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

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

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

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

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

if($res != 0 AND $res['what'] != 'clothing') {

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

echo ''.just_shop_res($res['id']).'';

echo '<div class="title">Информация</div>';

if($res['what'] == 'resource'){
	echo '<table class="table table-common" style="margin-top: 5px; border-collapse: collapse; text-align: left;">';
	echo '<tr><td><img src="/images/icons/moneybag.png"> Стоимость</td><td><center>'.$res['cost'].'</center></td></tr>';
	echo '</table>';
}elseif($res['what'] == 'potion'){
	echo '<table class="table table-common" style="margin-top: 5px; border-collapse: collapse; text-align: left;">';
	if($res['potion'] == 'hp') echo '<tr><td><img src="/images/icons/hp_regen.png"> Восстановление здоровья</td><td><center>'.$res['hp_regen'].'</center></td></tr>';
	if($res['potion'] == 'mp') echo '<tr><td><img src="/images/icons/mp_regen.png"> Восстановление маны</td><td><center>'.$res['mp_regen'].'</center></td></tr>';
	echo '<tr><td><img src="/images/icons/money_bag.png"> Стоимость</td><td><center>'.$res['cost'].'</center></td></tr>';
	echo '</table>';
}

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

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


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