Файл: _modules/main/info/items/index.php
Строк: 31
<?php
# mark core v1.0
# author Drk in
# date 24.10.19
# core
require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );
# user
system::access(true);
# get
$id = isset( $_GET['id'] ) ? system::abs($_GET['id']): 0;
# check
if (cache_itm_cat::ch($id) == false)system::header('/main/info');
# cache
$act = cache_itm_cat::get($id);
# meta
$title = 'Энциклопедия - '.system::check($act['name']).' :: '.domain;
# head
require_once ( head );
$cn = DB :: $dbh -> querySingle("SELECT count(id) FROM itm WHERE cat = ?;", array($id));
if ($cn == 0)echo '<div class="dialog"><h1 class="pda">КПК</h1><p>› Cписок предметов пуст<br></p></div>';
$page = new page($cn);
$limit = $cn > $page -> elements ? $page -> limit : null;
$query = DB :: $dbh -> query("SELECT id FROM itm WHERE cat = ? ORDER BY id {$limit}", array($id));
while ($itm = $query -> fetch()):
$itm = cache_itm::get($itm['id']);
echo '
<div class="fights fights-about">
<a href="/info/items/'.$itm['id'].'">
<table width="100%">
<tbody><tr>
<td width="64px" valign="top"><img src="'.ico.'inv/'.$id.'/'.system::check($itm['img']).'" title="'.system::check($itm['name']).'"></td>
<td valign="top">
<div class="attack-text">
'.system::check($itm['name']).' [ID: '.$itm['id'].']<br>
<small>'.system::check($act['name']).'</small>
</div></td></tr></tbody></table></a></div>
';
endwhile;
$page -> get('?');
echo '
<div class="fights-link" style="margin: 2px 5px"><a href="/main/info">Вернуться назад</a></div>
<div class="line"></div>
';
# foot
require_once ( foot );
?>