File size: 718B
<?
include_once '../core/system.php';
echo only_reg();
echo ban();
echo blok();
$header = 'Запись';
include_once '../core/head.php';
$req = mysql_query("SELECT * from `def_bat` where `usr` = '$user[id]' and `status`=''");
$avto= mysql_num_rows($req);
if($avto>0){
header("Location: /defense/");
$_SESSION['err'] = 'Вы уже записаны!';
exit();
}
if($setgame['fight']==1 and $setgame['def_bat']>$tm){
header("Location: /defense/");
$_SESSION['err'] = 'Заявки не принимаются!';
exit();
}
$tt=$setgame['def_time']+3600;
mysql_query("INSERT INTO `def_bat` SET `usr` = '$user[id]', `time`='$tt'");
header("Location: /defense/");
exit();
echo"</div>";
include_once '../core/foot.php';
?>