Файл: terr_b.php
Строк: 81
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Подготовка к битве';
include($path.'files/core.php');
if($udata['err']>time())
{
mysql_query("INSERT INTO `user_log` SET
`usr`='".$udata['id']."',
`text`='Штраф смерти в территориях 30 минут. Приходите позже.'
");
header('location: game.php');exit;
}
$mobs=mysql_query("SELECT * FROM `craft` WHERE `usr`='".$udata['id']."'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
header('location: work.php');exit;
}
$mobs1=mysql_query("SELECT * FROM `arena_usr` WHERE `usr`='".$udata['id']."'");
$rows1=mysql_num_rows($mobs1);
if($rows1!=0)
{
header('location: arena.php');exit;
}
$mobs2=mysql_query("SELECT * FROM `avan_usr` WHERE `usr`='".$udata['id']."'");
$rows2=mysql_num_rows($mobs2);
if($rows2!=0)
{
header('location: avan.php');exit;
}
$mobs3=mysql_query("SELECT * FROM `battle` WHERE `usr`='".$udata['id']."'");
$rows3=mysql_num_rows($mobs3);
if($rows3!=0)
{
header('location: battle.php');exit;
}
$mobs4=mysql_query("SELECT * FROM `ohota` WHERE `usr`='".$udata['id']."'");
$rows4=mysql_num_rows($mobs4);
if($rows4!=0)
{
header('location: b_oh.php');exit;
}
$mobs5=mysql_query("SELECT * FROM `okrest` WHERE `usr`='".$udata['id']."'");
$rows5=mysql_num_rows($mobs5);
if($rows5!=0)
{
header('location: b_okr.php');exit;
}
$mobs6=mysql_query("SELECT * FROM `str_usr` WHERE `usr`='".$udata['id']."'");
$rows6=mysql_num_rows($mobs6);
if($rows6!=0)
{
header('location: b_str.php');exit;
}
$arr_usr=mysql_num_rows(mysql_query("SELECT * FROM `terr_usr` WHERE `usr`='".$udata['id']."'"));
if($arr_usr==0)
{
header('location: terr.php');exit;
}
$arr_u=mysql_fetch_array(mysql_query("SELECT * FROM `terr_usr` WHERE `usr`='".$udata['id']."'"));
$as=mysql_query("SELECT * FROM `sectors` WHERE `id`='".$arr_u['arr']."'");
$se=mysql_fetch_array($as);
if($se['att_time']>time())
{
if(isset($_GET['leave']))
{
if($arr_u['lider']==1)
{
header('location: ?');exit;
}
else
{
mysql_query("DELETE FROM `terr_usr` WHERE `usr`='".$udata['id']."'");
header('location: terr.php');exit;
}
}
include($path.'files/head.php');
include($path.'files/zag.php');
echo '<table width=100%>
<tr>
<td width=35%>
<a href=game.php><div style="background: #882222; border-radius: 7px 0 0 7px" class="m p bts bbs brs bls" align=center>Главная</div></a>
</td><td>';
echo '<a href=?><div class="line bts brs bls bbs p m" style="border-radius: 0 7px 7px 0">
<font color=#ffffff>Подготовка
</font>
</div></a></td></tr></table>';
echo '<div class="bat bts brs bls bbs p">';
echo '<center><img src=img/clan/bild/7.png></center>
<div class="v4 p" align=center><font color=#ff9900>Лишь путем сражений вы поймете чья гильдия сильнейшая.</font></div>
<img src=img/main/e55.png> <a href=clan.php?chat>Чат гильдии</a><br>
<img src=img/main/p21.png> <font color=#ff0000>до битвы:</font> <font color=#1faee9>';
$se['att_time']=$se['att_time']-time();
if($se['att_time']<60){
echo $se['att_time']." с.</font>";
}elseif($se['att_time']>60 and $se['att_time']<3600){
$se['att_time']=round($se['att_time']/60);
echo $se['att_time']." м.</font>";
}else{
$se['att_time']=round($se['att_time']/3600);
echo $se['att_time']." ч.</font>";
}
echo '<br>';
echo '<b><font color=#ff9900>Участники:</font></b><br>
';
$aq=mysql_query("SELECT * FROM `terr_usr` WHERE `arr`='".$se['id']."' and `kom`='".$arr_u['kom']."' and `usr`!='0' and `tip`!='pit'");
while($arrs=mysql_fetch_array($aq))
{
$usrz=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$arrs['usr']."'"));
echo '<img src=img/main/c'.$usrz['klass'].'.png> <img src=img/main/r'.$usrz['rasa'].'.png>
<a href=info.php?id='.$usrz['id'].'>'.$usrz['usr'].'</a> <img src=img/main/p10.png>'.$usrz['lvl'].' ';
}
if($arr_u['lider']==1)
{
echo '<div align=center><font color=#ff0000>Вы лидер штурма и не можете покинуть бой!</font></div>';
}
else
{
echo '<br><img src=img/main/e55.png> <a href=?leave>Покинуть</a>';
}
echo '</div>';
}
else
{
header('location: b_terr.php');exit;
}
echo'</div>';
include('files/down.php');
?>