Файл: modules/shop/screens.php
Строк: 22
<?php
$title = 'Магазин | Скриншоты';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
$_GET['id'] = abs(intval($_GET['id']));
$query = $db->query("SELECT * FROM `shop_goods` WHERE `id`='".$_GET['id']."'");
if($query->num_rows==0){
error('Товара не существует.');
}
$good = $query->fetch_assoc();
?>
<div class="title">
<a href="/shop">Магазин</a>
|
<a href="/shop/good/<?=$good['id']?>"><?=output($good['name'])?></a>
|
Скриншоты
</div>
<?if($db->query("SELECT `id` FROM `shop_screens` WHERE `id_good`='".$_GET['id']."'")->num_rows==0){
?>
<div class="error">Скриншотов к данному товару нет.</div>
<?
}
$query = $db->query("SELECT * FROM `shop_screens` WHERE `id_good`='".$_GET['id']."'");
while ($screen = $query->fetch_assoc()) {
?>
<div class="section">
<a href="/files/shop/screens/<?=$screen['file']?>"><img src="/files/shop/screens/<?=$screen['file']?>" alt="Скриншот" width="100" height="100"></a>
<?if($user['id']==$good['id_us'] OR $user['level']>=1){?>
<a href="/shop/del_screen/<?=$screen['id']?>">[Уд.]</a>
<?}?>
</div>
<?
}
if($user['id']==$good['id_us'] OR $user['level']>=1){
?>
<div class="nvg"><a href="/shop/new_screen/<?=$good['id']?>">Добавить скриншот</a></div>
<?
}
?>
<?
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>