Файл: zamok/zamok.php
Строк: 97
<?
include_once '../core/system.php';
echo only_reg();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `zamok` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$zamok = mysql_fetch_assoc(mysql_query("SELECT * FROM `zamok` WHERE `id` = '".intval($_GET['id'])."'"));
}else{
$_SESSION['err'] = "Нет такого замка!";
header('Location: index.php');
exit();
}
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '".$zamok[id_user]."'"));
$header = $zamok[name];
include_once '../core/head.php';
echo "<div class='player center'><img src='/zamok/zamok.png'></div>";
echo "<div class='dot-line'></div>";
echo "<div class='player'>Владелец: ";
echo "<img src='/images/icon/user.png' alt=''/> <a href='/user/?id=$ank[id]'>$ank[nick]</a> <img src='/images/icon/level.png'> $ank[level]</div>";
echo "<div class='dot-line'></div>";
echo "<div class='player'>Параметры крепости: <img src='/images/icon/str.png' alt='str'/> $zamok[param] <img src='/images/icon/level.png'> $zamok[level]</div>";
echo "<div class='dot-line'></div>";
echo "<div class='player'>Стоят в защите:</br><img src='/images/icon/user.png'> Титаны: $zamok[titan1] </br><img src='/images/icon/user.png'> Циклопы: $zamok[titan2] </br><img src='/images/icon/user.png'> Колдуны: $zamok[titan3]</div>";
echo "<div class='dot-line'></div>";
echo "<div class='player center'>";
if($zamok[param] < 1){
if($user[id] != $ank[id])echo "<a class='btn' href='ok.php?id=$zamok[id]'><span class='end'><span class='label'>Завладеть</span></span></a>";
}else{
if($user[id] != $ank[id])echo "<a class='btn' href='ataka.php?id=$zamok[id]'><span class='end'><span class='label'>Атакoвать</span></span></a>";
}
if($user[id] == $ank[id]){echo "<a class='btn' href='level.php?id=$zamok[id]'><span class='end'><span class='label'><span class='grey'>Цена: <img src='/images/icon/gold.png'> 50</span> Повысить уровень <span class='grey'><img src='/images/icon/level.png'> +1</span></span></span></a>";
echo "<a class='btn' href='zashita.php?id=$zamok[id]'><span class='end'><span class='label'>Наим воинов</span></span></a>";
$s=$zamok[time]-time();
if($zamok[time]<time()){
echo "<a class='btn' href='/zamok/zamok.php?id=$zamok[id]&nalog'><span class='end'><span class='label'>Собрать налоги с владения <img src='/images/icon/gold.png'> 250 </span></span></a>";
}else{
echo "<br/><b> До следующего сбора :</b><br/> ".(int)($s/3600)." Часов
".($s/60%60)." Минут ".($s%60)." секунд </div>
";}
}
echo "</div>";
echo "<div class='mini-line'></div>";
echo "<div class='player menuList'>";
echo "<li><a href='/zamok/'><img src='/images/icon/tournament.png'>Замки</a></li>";
echo "</div>";
##CODE BY VK.COM/ELFI98 Цена 30руб...
if(isset($_GET[nalog])){
if($zamok[time]<time() && $user[id] == $ank[id]){
mysql_query("UPDATE `user` SET `gold`='".($user[gold]+250)."' WHERE `id`='$user[id]'");
mysql_query("UPDATE `zamok` SET `time`='".(time()+21149)."' WHERE `id`='$zamok[id]'");
$_SESSION['message']="Налоги собраны";
header("location:/zamok/zamok.php?id=$zamok[id]");
}}
include_once '../core/foot.php';
?>