View file sdark.mobi/hunting/go.php

File size: 1Kb
<?
include_once '../core/system.php';
echo only_reg();
echo ban();
echo blok();
$header = 'Охота';
include_once '../core/head.php';
$req = mysql_query("SELECT * from `hunting` where `usr` = '$user[id]' and `time`>'$tm'");
$avto= mysql_num_rows($req);
if($avto>0){header("Location: /hunting/");$_SESSION['err'] = 'Вы уже на охоте!';exit();}

$req = mysql_query("SELECT * from `hunting` where `usr` = '$user[id]' and `status`='1'");
$avto= mysql_num_rows($req);
if($avto>0){header("Location: /hunting/");$_SESSION['err'] = 'Заберите награду!';exit();}

$kol = mysql_result(mysql_query("SELECT * from `hunting` where `usr` = '$user[id]'"),0);
if($kol==0){mysql_query("INSERT INTO `hunting` SET `usr` = '$user[id]', `time`=('$tm'+'21600')");}else{
mysql_query("UPDATE `hunting` SET `time`=('$tm'+'21600'), `status`='' WHERE `usr` = '$user[id]'");}
header("Location: /hunting/");
$_SESSION['message'] = 'Охота началась!';
exit();

echo"</div>";
include_once '../core/foot.php';
?>