<?php
$title = $l = "Админка стикеров";
$lBack ="/stickers";
require(CORE . 'head.php');
?>
    <div class="app-block">
        <div class="list" style="border-bottom: 0">
            <div class="sw-block_">
                <div class="sw-cont sw-4">
                    <div class="list tab">
                        <a class="tab_active" href="/stickers/?tab=admin">Админка</a>
                        <a href="/stickers/?tab=admin&amp;func=edit">Добавить</a>
                        <a href="/stickers/">Стикеры</a>
                    </div>
                </div>
            </div>
        </div>
        <?php
        $getData = (array)DB::$pdo->query("
                SELECT *, (SELECT CONCAT(IF(`info_first_name` = '', 'Имя', `info_first_name`), ' ', `info_last_name`) 
                  FROM `users` WHERE `id` = `stickers_cat`.`id_user` LIMIT 1) as author 
                FROM `stickers_cat` ORDER BY `id` DESC
            ")->fetchAll();
        if (count($getData) > 0) {
            foreach ($getData as $item) {
                ?>
                <a href="/stickers/?tab=admin&amp;func=show&amp;id=<?= $item['id'] ?>" class="stickers_item">
                    <div class="stickers_thumb">
                        <img src="<?= filesServerStickers . $item['cover'] ?>" class="th_img">
                    </div>
                    <div class="stickers_body">
                        <div class="stickers_name"><?= $item['title'] ?></div>
                        <div class="stickers_author"><?= $item['author'] ?></div>
                        <div class="stickers_price">
                            <span class="sp_str"><?= ((int)$item['price'] === 0 ? 'бесплатно' : $item['price'] . ' винетов') ?></span>
                        </div>
                    </div>
                </a>
                <?
            }
        } else {
            ?>
            <div id="show_msg_box" class="service_msg_box">
                <div class="service_msg service_msg_null">Магазин стикеров пуст.</div>
            </div>
            <?
        }
        ?>
    </div>
<?
