<?
include_once '../core/system.php';
echo only_reg();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id`  = '".intval($_GET['id'])."'"));
}else{
$_SESSION['err'] = "Игрок не найден";
header('Location: /');
exit();
}
$header = 'Замки '.$ank[nick];
include_once '../core/head.php';
$k_post = mysql_result(mysql_query("SELECT COUNT(*)  FROM `zamok` WHERE `id_user` = '$ank[id]'"),0);
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `zamok` WHERE `id_user` = '$ank[id]' ORDER BY `param` DESC LIMIT $start, $set[p_str]");
echo "<div class='player'>";
if($k_post == 0)echo "<span class='grey'>Нет замков</span>";
while($post = mysql_fetch_assoc($q)) {
echo "<img src='/images/icon/sumstat.png'> <a href='/zamok/zamok.php?id=$post[id]'>$post[name]</a>, $post[health]</a><br>";
}
echo "</div>";
echo "<div class='dot-line'></div>";
if ($k_page>1)str("zamok.php?id=$ank[id]&",$k_page,$page); // Вывод страниц
echo "<div class='mini-line'></div>";
echo "<div class='player menuList'>";
echo "<li><a href='/zamok/'><img src='/images/icon/arrow.png'>Вернуться к замкам</a></li>";
echo "</div>";
include_once '../core/foot.php';
?>