Файл: _modules/inv/objects/index.php
Строк: 99
<?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);
# meta
$title = 'Предметы :: '.domain;
# get
$cat = isset( $_GET['cat'] ) ? system::abs($_GET['cat']): 0;
# head
require_once ( head );
# size
$size = cache_size::get($user['id'],$user['lvl_inv']);
echo '
'.system::dis().'
<div style="margin: 2px 5px;">
<div class="grid fights-link">
<div class="six columns ln">
<a href="/inv">Экипировка</a>
</div>
<div class="six columns">
<a href="/inv/objects">Предметы</a>
</div>
</div>
</div>
<div class="dialog"><h1 class="pda">
Cклад: '.$size['size'].'/'.$size['max'].' кг
<div style="background-color: #1c201e;text-align: left;color: #fff;border: 1px solid #333333;">
<span style="width: '.(round(($size['size']*100)/$size['max'],2) > 100? 100:round(($size['size']*100)/$size['max'],2)).'%;display: block;background: #e3972a;height: 3px;">
</span></div>
</h1></div>
<br><div class="callout">Что имеется на складе:</div>
<br>
<div style="margin: 2px 5px;">
<div class="grid fights-link">
<div class="six columns ln">
<a href="/inv/objects">Все</a>
</div>
<div class="six columns ">
<a href="/inv/objects?&cat=10">Противогазы</a>
</div>
<div class="six columns ln">
<a href="/inv/objects?&cat=4">Ножи</a>
</div>
<div class="six columns ">
<a href="/inv/objects?&cat=1">Броня</a>
</div>
<div class="six columns ln">
<a href="/inv/objects?&cat=3">Пистолеты</a>
</div>
<div class="six columns ">
<a href="/inv/objects?&cat=2">Автоматы</a>
</div>
<div class="six columns ln">
<a href="/inv/objects?&cat=5">Аптечки</a>
</div>
<div class="six columns ">
<a href="/inv/objects?&cat=6">Артефакты</a>
</div>
<div class="six columns ln">
<a href="/inv/objects?&cat=7">Части мутантов</a>
</div>
<div class="six columns ">
<a href="/inv/objects?&cat=8">Еда</a>
</div>
<div class="six columns ln">
<a href="/inv/objects?&cat=9">Патроны</a>
</div>
<div class="six columns ">
<a href="/inv/objects?&cat=11">Прочие</a>
</div>
</div></div>
';
if ($cat > 0) $thing = "user = ".$user['id']." AND cat = {$cat}";
if ($cat == 0) $thing = "user = ".$user['id']."";
$cn = DB :: $dbh -> querySingle("SELECT count(id) FROM inv WHERE {$thing}");
if ($cn == 0)echo '<div class="dialog"><h1 class="pda">КПК</h1><p>› В слоте нет доступного предмета<br></p></div>';
$query = DB :: $dbh -> query("SELECT id FROM inv WHERE {$thing} ORDER BY id ");
while ($inv = $query -> fetch()):
$inv = cache_inv::check($inv['id']);
$itm = cache_itm::get($inv['thing']);
$itm_cat = cache_itm_cat::get($inv['cat']);
echo'
<div class="fights fights-about">
<table width="100%">
<tbody><tr>
<td width="58px" valign="top"><img width="58px" src ="'.ico.'inv/'.$itm['cat'].'/'.$itm['img'].'">
</td>
<td valign="top">
<div class="attack-text">
<h1 class="human"><img src="'.ico.'ammo.png" width="12px">
<a style="color: #ffa200;" href="/info/items/'.$itm['id'].'">'.system::check($itm['name']).'</a>
<span class="small" style="color: #888;">'.system::check($itm_cat['name']).'</span></h1><hr>
'.($inv['cat'] == 8 || $inv['cat'] == 5 ? '
<div class="quest-btn" style="margin: 5px 0">
<a href="/inv/objects/equip/'.$inv['id'].'">— Использовать </a></div>':null).'
<div class="quest-btn" style="margin: 5px 0">
<a href="/inv/objects/drop/'.$inv['id'].'">— Выбросить </a></div>
</div>
</td>
</tr>
</tbody></table>
<div style="background-color: #1c201e;text-align: left;color: #fff;border: 1px solid #333333;">
<span style="width: '.$inv['cc'].'%;display: block;background: #39ef39;height: 3px;">
</span></div>
</div>
';
endwhile;
echo '<div class="line"></div>';
# foot
require_once ( foot );
?>