Файл: public_html/modules/inventory/index.php
Строк: 60
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once ($root.'/core/base.php');
falseauth();
$header = "Инвентарь";
include_once ($root.'/core/head.php');
?>
<style>
.snar-ok {
display: block;
background-color: #343434;
font-size: 12px;
font-weight: 500;
color: #fff;
text-align: center;
text-decoration: none;
padding: 3px;
margin-bottom: 5px;
margin-left: -8px;
margin-right: -8px;
border: 1px solid #3CB371;
border-radius: 7px;
-moz-border-radius: 5px;
-webkit-border-radius: 4px;
-khtml-border-radius: 5px;
-o-border-radius: 5px;
}
.snar-no {
display: block;
background-color: #343434;
font-size: 12px;
font-weight: 500;
color: #fff;
margin-left: -8px;
margin-right: -8px;
margin-bottom: 5px;
text-align: center;
text-decoration: none;
padding: 3px;
border: 1px solid #A52A2A;
border-radius: 7px;
-moz-border-radius: 5px;
-webkit-border-radius: 4px;
-khtml-border-radius: 5px;
-o-border-radius: 5px;
}
</style>
<?
$count = $db -> query("SELECT * FROM `inventory` WHERE `user` = '".$u['id']."' ORDER BY `buytime` DESC") -> num_rows;
$k_page = k_page($count,10);
$page = page($k_page);
$start = 10*$page-10;
$sql = $db -> query("SELECT * FROM `inventory` WHERE `user` = '".$u['id']."' ORDER BY `buytime` DESC LIMIT $start, 10");
echo '<a class = "link"><font color="white"><center>Вещей: '.$count.'</center></a>
<div class = "b">
';
while($q = $sql->fetch_object())
{
$item = $db->query("SELECT * FROM `subject` WHERE `id` = '".$q->item."'")->fetch_object();
$myit = $db->query("SELECT * FROM `inventory` WHERE `item` = '".$q->item."' ORDER BY `user`")->fetch_object();
echo ' <a href="/inventory/'.$q->id.'">';
if($myit->weared == 0) echo ' <div class = "snar-no"> ';
else echo '<div class = "snar-ok"> ';
echo'<table width="100%">
<tr>
<td width="50px" valign="top">
<img width="48px" src="'.$item->images.'" title="1" alt="1" />
</td>
<td valign="top">
<div class="txt">';
echo '<big>'.$item->name.'</big>';
echo'<br>
'.$item->description.'
';
echo'</div>
</td>
</tr>
</table> ';
if($myit->weared == 0) echo ' </div> ';
else echo '</div> ';
echo'</a> ';
}
echo"</div>";
if($count >= 10) echo str('/inventory/?', $k_page, $page);
include_once ($root.'/core/foot.php');