Файл: page/shop/index.php
Строк: 75
<?php
$title = 'Магазин скриптов';
require_once($_SERVER["DOCUMENT_ROOT"]."/inc/head.php");
if ($sys['modules']['shop'] == 1) {
/* Скоро в магазине */
if ($count_release > 0) {
echo '<div class="title">Скоро в магазине</div>';
$data = $connect->prepare("select * from `shop` where `status` = '1' and `time` > :time order by `id` desc limit 3");
$data->bindValue(':time', time(), PDO::PARAM_INT);
$data->execute();
$sql = $data->fetchAll();
foreach ($sql as $row) {
echo linkShop($row);
}
}
/* Последние релизы */
if ($count_shop > 0) {
echo '<div class="title">Последние релизы</div>';
$data = $connect->prepare("select * from `shop` where `status` = '1' and `time` <= :time order by `id` desc limit 3");
$data->bindValue(':time', time(), PDO::PARAM_INT);
$data->execute();
$sql = $data->fetchAll();
foreach ($sql as $row) {
echo linkShop($row);
}
}
/* Последние обновления */
if ($last_update_shop > 0) {
echo '<div class="title">Последние обновления</div>';
$sql = $connect->query("select * from `shop` where `status` = '1' and `upd` != '0' order by `upd` desc limit 3")->fetchAll();
foreach ($sql as $row) {
echo linkShop($row);
}
}
echo '<div class="title">Категории</div>';
$stmt_count = $connect->prepare("select count(*) from `shop` where `kat` = ? and `status` = '1'");
if ($count_shop_kat == 0) {
echo '<div class="menu">Категорий нет!</div>';
} else {
echo '<div class="forlink"><a href="/shop/bestsellers" class="links"><img src="/img/like.png" alt="like">Хиты продаж<div class="chi">'.$count_shop_hits.'</div></a></div>
'.($sys['modules']['shop_free'] == 1 ? '<div class="forlink"><a href="/shop/free" class="links"><img src="/img/folder-special.png" alt="folder-special">Бесплатное<div class="chi">'.$count_shop_free.'</div></a></div>' : '');
$sql = $connect->query("select * from `kat` where `type` = '1' order by `id` asc")->fetchAll();
foreach ($sql as $row) {
$stmt_count->execute(array($row['id']));
$count = $stmt_count->fetchColumn();
echo '<div class="forlink"><a href="/shop/category/'.$row['id'].'" class="links"><img src="/img/folder.png" alt="folder">'.$row['name'].'<div class="chi">'.$count.'</div></a></div>';
}
}
echo '<div class="title">Меню</div>';
if (isset($active)) {
echo '<div class="forlink"><a href="/shop/my" class="links"><img src="/img/myshop.png" alt="myshop">Мои товары<div class="chi">'.$count_user_shop.'</div></a></div>
<div class="forlink"><a href="/shop/purchase" class="links"><img src="/img/purchase.png" alt="purchase">Мои покупки<div class="chi">'.$user_purch.'</div></a></div>
<div class="forlink"><a href="/shop/kassa" class="links"><img src="/img/kassa.png" alt="kassa">Мои продажи<div class="chi">'.$user_kassa.'</div></a></div>
<div class="forlink"><a href="/shop/basket" class="links"><img src="/img/bk.png" alt="bk">Корзина<div class="chi">'.$user_bk.'</div></a></div>';
} else {
echo '<div class="menu"><div class="information">Авторизуйтесь, чтобы была возможность купить товар.</div></div>';
}
echo '<div class="forlink"><a href="/shop/leaders" class="links"><img src="/img/crown.png" alt="crown">Лидеры продаж<div class="chi">'.$count_sellers.'</div></a></div>
<div class="forlink"><a href="/shop/search" class="links"><img src="/img/search.png" alt="search">Поиск</a></div>
<div class="forlink"><a href="/shop/rules" class="links"><img src="/img/rules.png" alt="rules">Правила магазина</a></div>';
} else {
header('Location: /');
}
require($_SERVER["DOCUMENT_ROOT"]."/inc/foot.php");
?>