<?php
include_once ('./core/base.php');
falseauth();

$id=fl($_GET['id']);

$item = $base -> query('SELECT * FROM `users_items` WHERE `id` = "'.$id.'" LIMIT 1') -> fetch_assoc();

$header = ''.$item['name'].'';

include_once ('./core/head.php');

if($item != 0 AND $item['what'] != 'resource') {

echo '<div class="b"><div class="title">'.$item['name'].'</div>';

echo ''.item($item['id']).'';

echo '<div class="title">Характеристики</div>';

echo '<table class="table table-common" style="margin-top: 5px; border-collapse: collapse; text-align: left;">';
echo '<tr><td><img src="/images/icons/p_att.png"> Физ. Атака</td><td><center>'.$item['p_att'].'</center></td><td><img src="/images/icons/endurance.png"> Выносливость</td><td><center>'.$item['endurance'].'</center></td></tr>';
echo '<tr><td><img src="/images/icons/p_def.png"> Физ. Защита</td><td><center>'.$item['p_def'].'</center></td><td><img src="/images/icons/intellect.png"> Интеллект</td><td><center>'.$item['intellect'].'</center></td></tr>';
echo '<tr><td><img src="/images/icons/m_att.png"> Маг. Атака</td><td><center>'.$item['m_att'].'</center></td><td><img src="/images/icons/agility.png"> Ловкость</td><td><center>'.$item['agility'].'</center></td></tr>';
echo '<tr><td><img src="/images/icons/m_def.png"> Маг. Защита</td><td><center>'.$item['m_def'].'</center></td><td><img src="/images/icons/skill.png"> Мастерство</td><td><center>'.$item['skill'].'</center></td></tr>';
if($item['attack_type'] == 'p_att') $att_type = 'Физическая';
elseif($item['attack_type'] == 'm_att') $att_type = 'Магическая';
if($item['attack_type'] != 'none') echo '<tr><td colspan="2"><img src="/images/icons/sword.png"> Тип атаки</td><td colspan="2"><center><img src="/images/icons/'.$item['attack_type'].'.png">'.$att_type.'</center></td></tr>';
echo '<tr><td colspan="2"><img src="/images/icons/money_bag.png"> Стоимость</td><td colspan="2"><center>'.n_f($item['cost']).'</center></td></tr>';
echo '</table>';

/*
//Руны
if($item['rune']=='0'){
	$runeinfo = '<font color="#B1B1B1">отсутствует</font>';
	$runecolor = '<font color="#B1B1B1">';
	$runestat = 0;
}
if($item['rune']=='1'){
	$runeinfo = '<font color="#FFF">Обычная</font>';
	$runecolor = '<font color="#FFF">';
	$runestat = 75;
}

if($item['rune']=='2'){
	$runeinfo = '<font color="#30C030">Редкая</font>';
	$runecolor = '<font color="#30C030">';
	$runestat = 150;
}
if($item['rune']=='3'){
	$runeinfo = '<font color="#68A8F9">Эпическая</font>';
	$runecolor = '<font color="#68A8F9">';
	$runestat = 225;
}
if($item['rune']=='4'){
	$runeinfo = '<font color="#D8CD32">Легендарная</font>';
	$runecolor = '<font color="#D8CD32">';
	$runestat = 300;
}
if($item['rune']=='5'){
	$runeinfo = '<font color="#DD4FFF">Мифическая</font>';
	$runecolor = '<font color="#DD4FFF">';
	$runestat = 450;
}

if($item['rune_type'] == '') $runetype = 'параметрам';
if($item['rune_type'] == 'health') $runetype = 'здоровью';
if($item['rune_type'] == 'power') $runetype = 'атаке';
if($item['rune_type'] == 'defense') $runetype = 'защите';

echo '
<img src="/images/icons/rune/'.$item['rune'].'.png"> Руна: '.$runeinfo.'<br/>
'.$runecolor.'+'.$runestat.'</font> к '.$runetype.'<br/>';
if($item['user'] == $u['id']) echo '<a class="button_blue" href="/wizard/rune/">К Чародею</a><br/>';

*/

echo '<br/><a class="btn" href="javascript:history.go(-1)"><img src="/images/icons/back.png"> Назад</a>';

echo '</div>';

}else{
header('Location: /inventory/');
}


include_once ('./core/foot.php');
?>