<? 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);

//echo '<pre>';
//print_r($component);
//echo '</pre>'
?>
<div class="my_bulletins">
    <? foreach ($arResult["ITEMS"] as $arItem) {?>
        <div class="my_bulletins_item">
            <div class="my_bulletins_item_pict">
                <img src="<?= $arItem["PREVIEW_PICTURE"]["SRC"] ?>" width="200"/>
                <? if ($arItem['DOP_INFO']['ACTIVE'] === 'Y') { ?>
                    <span class="pict_label checked">
                       Активно
                    </span>
                <? } else { ?>
                    <span class="pict_label not_checked">
                       Не активно
                    </span>
                <? } ?>
            </div>
            <div class="my_bulletins_item_text">
                <? if ($arItem['DOP_INFO']['ACTIVE'] === 'Y') { ?>
                    <a href="<?= $arItem["DETAIL_PAGE_URL"] ?>">
                        <? echo $arItem["NAME"] ?>
                    </a>
                <? } else { ?>
                    <a href="/personal/add_bulletin/?EDIT_ELEMENT=<?= $arItem['ID'] ?>">
                        <? echo $arItem["NAME"] ?>
                    </a>
                <? } ?>
                <strong>
                    <?= $arItem['PRICE']['PRICE'] ?>
                </strong>
            </div>
            <div class="my_bulletins_item_info">
                <ul>
                    <li><span>Осталось:</span> <span>19 дней</span></li>
                    <li><span>Просмотров:</span> <span><?echo $arItem['SHOW_COUNTER'] ?? '0'?></span></li>
                </ul>
                <a href="/personal/add_bulletin/?EDIT_ELEMENT=<?= $arItem['ID'] ?>">
                    Отредактировать
                </a>
            </div>
        </div>
    <? } ?>
</div>
<? if ($arParams["DISPLAY_BOTTOM_PAGER"]): ?>
    <br/><?= $arResult["NAV_STRING"] ?>
<? endif; ?>

