<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
    die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
$this->setFrameMode(true);
?>
<? if ($arResult["ITEMS"]): ?>
    <section class="cards-block block">
        <div class="cards-block__content container">
            <div class="row">
                <div class="col-12">
                    <h2 class="cards-block__title block__title">Как проходит приём</h2>
                </div>
                <div class="col-12">
                    <div class="cards-block__swiper swiper" data-swiper-name="cards-swiper">
                        <div class="cards-block__items numbered-items swiper-wrapper">
                            <? $counter = 0; ?>
                            <? foreach ($arResult["ITEMS"] as $arItem): ?>
                                <?
                                $counter++;
                                $this->AddEditAction($arItem['ID'], $arItem['EDIT_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_EDIT"));
                                $this->AddDeleteAction($arItem['ID'], $arItem['DELETE_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BNL_ELEMENT_DELETE_CONFIRM')));
                                ?>
                                <div class="cards-block__item numbered-item swiper-slide"
                                    id="<?= $this->GetEditAreaId($arItem['ID']); ?>">
                                    <div class="cards-block__item-pic pic-wrapper">
                                        <?php
                                        switch ($counter) {
                                            case 1:
                                            case 4:
                                                $height = 540;
                                                break;

                                            default:
                                                $height = 350;
                                                break;
                                        }
                                        ?>
                                        <?
                                        if ($arItem['PREVIEW_PICTURE']['SRC']) {
                                            $file = CFile::ResizeImageGet($arItem['PREVIEW_PICTURE'], array('width' => 570, 'height' => 540), BX_RESIZE_IMAGE_PROPORTIONAL, true);
                                            $arResult["ITEMS"]['PREVIEW_PICTURE']['SRC'] = $file['src'];
                                            $arResult["ITEMS"]['PREVIEW_PICTURE']['SRC_WEBP'] = makeWebp($file['src']);
                                        }
                                        ?>
                                        <picture>
                                            <img src="<?= $arResult["ITEMS"]['PREVIEW_PICTURE']['SRC_WEBP']; ?>" alt="" loading="lazy">
                                        </picture>
                                    </div>
                                    <div class="cards-block__item-panel card-panel">
                                        <div class="card-panel">
                                            <div class="card-panel__text">
                                                <div class="card-panel__bg"></div>
                                                <h3 class="card-panel__title"><span class="card-panel__num num"></span>
                                                    <?= $arItem['NAME']; ?></h3>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <? if ($counter == 4)
                                    $counter = 0; ?>
                            <? endforeach; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
<? endif; ?>