Файл: public_html/modules/user_item_info.php
Строк: 68
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once ($root.'/core/base.php');
falseauth();
$header = "Информация о предмете";
include_once ($root.'/core/head.php');
$itemId = fl($_GET['item']);
$uId = fl($_GET['user']);
$userInfo = $db->query("SELECT * FROM `users` WHERE `id` = '".$uId."'");
if($userInfo->num_rows == 0) redirect('/', 'Игрок не найден!');
$userInfo = $userInfo->fetch_object();
$itemInventory = $db->query("SELECT * FROM `inventory` WHERE `id` = '".$itemId."'");
if($itemInventory->num_rows == 0) redirect('/user/'.$uId, 'Предмет не найден!');
$itemInventory = $itemInventory->fetch_object();
if($itemInventory->weared == 0) redirect('/user/'.$uId, 'Предмет не надет!');
if($itemInventory->user != $uId) redirect('/user/'.$uId);
$subject = $db->query("SELECT * FROM `subject` WHERE `id` = '".$itemInventory->item."'")->fetch_object();
$slotName = $subject->clothing_type.'_slot_level';
$stonesInfo = $db->query("SELECT * FROM `stones_item` WHERE `item` = '".$itemId."'");
$stonesBoost = 0;
$stones = '';
$stones_buff = [null,25,50,100];
if($stonesInfo->num_rows > 0)
{
while($sI = $stonesInfo->fetch_object())
{
$stones .= '<img src="/images/stones/'.$sI->type.'.png"> ';
$stonesBoost += $stones_buff[$sI->type];
}
}
$health = $subject->health+getSlotBoost($uId, $itemInventory->type)+$stonesBoost;
$power = $subject->power+getSlotBoost($uId, $itemInventory->type)+$stonesBoost;
$block = $subject->block+getSlotBoost($uId, $itemInventory->type)+$stonesBoost;
echo '
<div class="b">
<table width="100%">
<tr>
<td width="55px" valign="top">
<img src="'.$subject->images.'">
</td>
<td valign="top">
<big> <font color = "white"> '.$subject->name.'<br> '.$subject->level.'ур.</font></big>
<div class="txt">
<img src="/images/health.png" width="25px"> '.$health.'
<img src="/images/str.png" width="25px"> '.$power.'
<img src="/images/def.png" width="25px"> '.$block.'</br>
Уровень слота: '.$userInfo->$slotName.'<br>
'.(($stonesBoost > 0) ? 'Самоцветы: '.$stones : 'Самоцветы не установлены').'
</div>
</td>
</tr>
</table></div>
';
echo"<div class = 'b-mini'><a href = '/user/".$uId."/' class = 'clicker _gold'>";
if($u['id'] == $uId){ echo" Мой игрок";}else{echo"Назад к игроку";}
echo"</a></div>";
include_once ($root.'/core/foot.php');