Файл: totem.php
Строк: 84
<?
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');
$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;
}
$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 `okr_usr` 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;
}
$mobs7=mysql_query("SELECT * FROM `terr_usr` WHERE `usr`='".$udata['id']."'");
$rows7=mysql_num_rows($mobs7);
if($rows7!=0)
{
header('location: terr_b.php');exit;
}
$mobs9=mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$udata['id']."'");
$rows9=mysql_num_rows($mobs9);
if($rows9!=0)
{
header('location: b_oh.php');exit;
}
if($udata['clan']==0)
{
header('location: game.php');exit;
}
$gi=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$udata['clan']."'"));
$magaz=mysql_fetch_array(mysql_query("SELECT * FROM `clan_bild` WHERE `clan`='".$gi['id']."' and `img`='7'"));
$mobs91=mysql_query("SELECT * FROM `clan_totem_usr` WHERE `usr`='".$udata['id']."'");
$rows91=mysql_num_rows($mobs91);
if($rows91!=0)
{
header('location: b_totem.php');exit;
}
if(isset($_GET['start']))
{
if($magaz['lvl']>0)
{
mysql_query("INSERT INTO `clan_totem_usr` SET
`id`='',
`usr`='".$udata['id']."',
`tip`='str',
`hp`='".$udata['hp']."',
`arm`='".$udata['arm']."',
`kom`='".$gi['id']."',
`sila`='".$udata['sila']."'
");
$tr=mysql_query("SELECT * FROM `pit` WHERE `usr`='".$udata['id']."' and `status`='1'");
$num=mysql_num_rows($tr);
if($num!=0)
{
$t=mysql_fetch_array($tr);
mysql_query("INSERT INTO `clan_totem_usr` SET
`id`='',
`usr`='".$udata['id']."',
`tip`='pit',
`pit`='".$t['id']."',
`hp`='".$t['hp']."',
`arm`='".$t['arm']."',
`sila`='".$t['sila']."',
`kom`='".$gi['id']."'
");
}
}
header('location: ?');exit;
}
include($path.'files/head.php');
include($path.'files/zag.php');
echo '<div class="v3 bts brs bls b p v12">Навигация</div><div class="v4 bts brs bls bbs p t3">
<img src=img/main/i26.png class="menu"> <a href=game.php>главная</a>
</div>';
echo '<div class="v8"><div class="v3 bts brs bls b p v12">Битва за Тотем</div><div class="v2 bts brs bls bbs p t3">';
echo '<center><img src=img/clan/bild/7.png></center>';
echo '<center><i><font color=#ffff00>Завоюйте древний тотем и вы начнете получате бонус от него.</font></i></center>';
echo '<img src=img/main/e28.png> Тотем: ';
$totem=mysql_fetch_array(mysql_query("SELECT * FROM `clan_totem` WHERE `id`='1'"));
if($totem['clan']!=0)
{
$clan=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$totem['clan']."'"));
echo '<a href=clans.php&id='.$clan['id'].'>'.$clan['name'].'</a>';
}
else
{
echo '<font color=#ff0000>свободен</font>';
}
echo '<br>';
echo '<img src=img/main/e30.png> <a href=?start>В бой</a>';
echo '</div></div>';
echo '<div class="v8"><div class="v3 bts brs bls b p v12">Рейтинг Гильдий</div><div class="v2 bts brs bls bbs p t3">';
$dat=date('H');
if($dat>='20' and $dat<='21')
{
$users=mysql_query("SELECT * FROM `clan` WHERE `slava`>'0' ORDER BY `slava` DESC LIMIT 10");
while($us=mysql_fetch_array($users))
{
echo '<img src=img/main/e28.png> <a href=clans.php?id='.$us['id'].'>'.$us['name'].'</a> [<img src=img/main/p9.png>'.$us['slava'].'] <br>';
}
}
else
{
echo '<img src=img/main/e30.png> <font color=#ff0000>Рейтинг открывается для показа в период с 20:00 до 21:00</font>';
}
echo '</div></div>';
include('files/down.php');
?>