Вход Регистрация
Файл: defense/index.php
Строк: 75
<?
require_once'../core/system.php';
echo 
only_reg();
echo 
ban();
echo 
blok();
$header='Оборона';
require_once
'../core/head.php';
mysql_query("UPDATE `user` set `mesto` = 'Оборона', `battle` = '0' where `id` = '".$user['id']."'");

if(
$user['level'] < 10){
header('location: /'); 
$_SESSION['err'] = 'Доступно только с 10 уровня';
}

echo
"<img src='/images/defense.jpg' width='100%'><hr>";
$bat mysql_result(mysql_query("SELECT COUNT(id) FROM `def_bat` WHERE `status`=''"),0);
if(
$setgame['fight']==0  or $setgame['def_bat']<$tm){
$recharge=$setgame['def_time']-$_SERVER['REQUEST_TIME'];
} else {
$recharge=$setgame['def_bat']-$_SERVER['REQUEST_TIME'];
}
$hours floor($recharge 3600);
if(
$hours && $hours 10)
{
$h='0'.$hours.'';}
if(
$hours >= 10){$h=''.$hours.'';}
if(
$hours == 0){$h='00';}

$minutes floor($recharge 60) % 60;
if(
$minutes && $minutes 10)
{
$m='0'.$minutes.'';}
if(
$minutes >= 10){$m=''.$minutes.'';}
if(
$minutes == 0){$m='00';}

$seconds $recharge $minutes*60 $hours*3600;
if(
$seconds && $seconds 10)
{
$s='0'.$seconds.'';}
if(
$seconds >= 10){$s=''.$seconds.'';}
if(
$seconds == 0){$s='00';}
if(
$h==0){$de ''.$m.':'.$s.'';}
if(
$h>0){$de ''.$h.':'.$m.':'.$s.'';}
echo
'<div class="foot center">Приближается армия злобных скелетов... Нужно объединить силы, чтобы победить темную нечисть!</div><hr>
<div class="d-grey grey center">Бойцов в отряде: <font color="CDCDCD">'
.$bat.'</font></br><div class="empty2"></div>';

if(
$setgame['fight']==or $setgame['def_bat']<$tm){
    echo
'До начала боя:';
} else {
    echo
'До конца боя:';
}
    
echo
' <font color="CDCDCD">'.$de.'</font><div class="empty"></div></div><hr><div class="head">';
$req mysql_query("SELECT `id` FROM `def_bat` where `usr` = '".$user['id']."' and `status`=''");
$avttto mysql_num_rows($req);
if(
$avttto==and $setgame['fight']==0){
    echo
'<a class="mini-fight" href="introduction">Вступить в отряд</a></div>';
    }
    
if(
$avttto>and $setgame['fight']==1){
    echo
'<a class="mini-fight" href="fight">В бой</a></div>';
}

if((
$avttto==and $setgame['fight']==1) or ($avttto>and $setgame['fight']==0)){
    echo
'<a class="mini-fight" href="?">Обновить</a></div>';
    }
    
if(
$setgame['fight']==1){echo"<hr><div class='head'><div class='inpc-ar center'>Топ игроков</br></div></div>";
$sur mysql_query("SELECT `id`,`wins`,`usr`,`exp` FROM `def_bat` WHERE `status`='' and `fight`='1' ORDER BY `wins`  DESC LIMIT 0, 5");
$at mysql_num_rows($sur);
if(
$at>0){
while(
$sn mysql_fetch_array($sur)) {
$qst mysql_query("SELECT * FROM `user` WHERE `id` = '".$sn['usr']."'");
$ust mysql_fetch_array($qst);
echo
"<hr><div class='but-list-light'>";
if(
$ust['prava']=="5"){$status="<font color='ffc22b'>[A]</font>";$color="#F7990D";}
if(
$ust['prava']=="4"){$status="<font color='ffc22b'>[a]</font>";$color="EBC621";}
if(
$ust['prava']=="3"){$status="<font color='ffc22b'>[M]</font>";}
if(
$ust['prava']=="2"){$status="<font color='ffc22b'>[m]</font>";}
echo
'<a href="/user/'.$ust['id'].'/">';
echo 
online($ust['id']);
echo 
'<font color="'.$ust['font'].'"> '.$ust['nick'].'</font>';
if(
$ust['prava']>"1"){echo' '.$status.'';}echo', <img src="/images/icon/level.png">'.$ust['level'].'  <span class="float-right"> <img src="/images/icon/wins.png" width="16" height="16"> '.$sn['wins'].', <img src="/images/icon/exp.png" width="16" height="16"> '.$sn['exp'].'</span></a></div>';
}
echo
'</div>';
} else {
echo
'<hr><div class="foot">Пусто</div>';
}
}

?>
<hr><div class="player"><div class="empty"></div><div class="center grey">Убив некоторых монстров, можно получить очень много золота.</div><div class="empty"></div></div>
<?
require_once'../core/foot.php';
?>
Онлайн: 3
Реклама