<?
include_once '../core/system.php';
echo only_reg();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `bashni` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$bashnay = mysql_fetch_assoc(mysql_query("SELECT * FROM `bashni` WHERE `id`  = '".intval($_GET['id'])."'"));
}else{
$_SESSION['err'] = "Нет такой башни!";
header('Location: index.php');
exit();
}
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id`  = '".$bashnay[id_user]."'"));
$header = $bashnay[name];
include_once '../core/head.php';
echo "<div class='player'>Владелец: ";
echo online($ank[id]);
echo " <a href='/user/?id=$ank[id]'>$ank[nick]</a></div>";
echo "<div class='dot-line'></div>";
echo "<div class='player'>Параметры башни:</br><img src='/images/icon/str.png' alt='str'/> $bashnay[sila] <img src='/images/icon/vit.png' alt='vit'/> $bashnay[max_health]($bashnay[health]) <img src='/images/icon/agi.png' alt='agi'/> $bashnay[lovk] <img src='/images/icon/def.png' alt='def'/> $bashnay[zashit]</div>";
echo "<div class='dot-line'></div>";
echo "<div class='player center'>";
if($bashnay[health] < 1){
if($user[id] != $ank[id])echo "<a class='btn' href='ok.php?id=$bashnay[id]'><span class='end'><span class='label'>Завладеть</span></span></a>";
}else{
if($user[id] != $ank[id])echo "<a class='btn' href='ataka.php?id=$bashnay[id]'><span class='end'><span class='label'>Атакoвать</span></span></a>";
}
if($user[id] == $ank[id])echo "<a class='btn' href='remont.php?id=$bashnay[id]'><span class='end'><span class='label'>Ремонт <img src='/images/icon/gold.png'> 100</span></span></a>";
echo "</div>";
echo "<div class='mini-line'></div>";
echo "<div class='player menuList'>";
echo "<li><a href='/bashni/'><img src='/images/icon/tournament.png'>Башни</a></li>";
echo "</div>";
include_once '../core/foot.php';
?>