Файл: public_html/modules/shop/list.php
Строк: 30
<?php
/*
*
Переделал
*
*/
include_once $_SERVER['DOCUMENT_ROOT'] . '/core/base.php';
if(!$u) exit(header('location: /'));
$type = fl($_GET['type']);
if(!in_array($type, ['head', 'body', 'weapon', 'boots'])) header("Location: /shop");
$types = ['head' => 'Шлемы', 'body' => 'Броня' ,'boots' => 'Обувь', 'weapon' => 'Оружие'];
$header = "Магазин снаряжения::".$types[$type];
include_once $_SERVER['DOCUMENT_ROOT'] . '/core/head.php';
$count = $db -> query("SELECT * FROM `subject` WHERE `clothing_type` = '".$type."' AND `level` <= '".$u['level']."' ORDER BY `level` ASC, `clothing_mark` ASC") -> num_rows;
$k_page = k_page($count,5);
$page = page($k_page);
$start = 5 * $page - 5;
$sql = $db -> query("SELECT * FROM `subject` WHERE `clothing_type` = '".$type."' AND `level` <= '".$u['level']."' ORDER BY `level` ASC, `clothing_mark` ASC LIMIT $start, 5");
while($q = $sql->fetch_object())
{
?>
<a href="/shop/<?=$type;?>/<?=$q->translate;?>">
<div class="b">
<table width="100%">
<tbody><tr>
<td width="50px" valign="top">
<img width="48px" src="<?=$q->images;?>" title="Сторона" alt="Сторона">
</td>
<td valign="top">
<div class="txt"><big><?=$q->name;?></big><br>
<?=$q->description;?>
</div>
</td>
</tr>
</tbody></table>
</div> </a>
<?
}
?>
</center></div></div></div>
<?
if($count >= 5) str('/shop/'.$type.'/?', $k_page, $page);
?>
<div class = 'line'></div><center><a href = '/shop' class = 'link'>Назад</a></center>
<?
include_once $_SERVER['DOCUMENT_ROOT'] . '/core/foot.php';
?>