Файл: user/backpack.php
Строк: 50
<?
require_once('../core/index.php');
require_once('../core/func.php');
avt();
$title='Коллекция';
require_once('../design/head.php');
$count=$db->query("SELECT id FROM `backpack` WHERE `id_user`='".$user['id']."' AND `status`='0'")->rowCount();
if($count==0){echo '<div class="h1">У вас ничего нет</div>';}
require '../core/pagination.php';
$pagination = new Pagination;
$pagination->sett($count, 10, true);
$res = $db->query("SELECT * FROM `backpack` WHERE `id_user`='".$user['id']."' AND `status`='0' ORDER BY `id` DESC " . $pagination->limit());
foreach($res as $post){
$thing = $db->query("SELECT * FROM `thing` WHERE `id`='".$post['id_thing']."'")->fetch();
$strange = $thing['str']*$post['lvl'];
if ($thing['lvl'] == 1){$rcol = '#B0C3D9';}
if ($thing['lvl'] == 2){$rcol = '#5E98D9';}
if ($thing['lvl'] == 3){$rcol = '#4B69FF';}
if ($thing['lvl'] == 4){$rcol = '#8847FF';}
if ($thing['lvl'] == 5){$rcol = '#D32CE6';}
echo '<div class="h1"><table width="100%" cellspacing="0"><tr><td class="h2" align="center" width="25%"><img style="border-radius: 5px; border: 2px solid '.$rcol.';" src=/design/ico/maneken/'.$thing['id'].'.png></td>';
echo '<td class="h1" width="75%" style="font-size: 12px;">'.$thing['name'].' '.$post['lvl'].' ур.<br/>Сила '.$strange.'<br/>Карт '.$post['count'].'
<br/><a href=/user/thing?id='.$post['id'].'&wear>В колоду</a> | <a href=/user/lvl?id='.$post['id'].'&up>Повысить</a>
</td></tr></table></div>';
}
echo "<div class='pg'>";
echo $pagination->get();
echo "</div>";
require_once('../design/foot.php');
?>