File size: 1.25Kb
<?
require_once '../../core/system.php';
echo only_reg();
echo ban();
$header = 'Создание команды';
require_once H.'core/head.php';
mysql_query("DELETE FROM `hik_otk` WHERE `time`<='".$time."'");
mysql_query("UPDATE `user` set `mesto` = 'Поход', `battle` = '0' where `id` = '".$user['id']."'");
if($user['level'] < 37){
header('location: /');
$_SESSION['err'] = 'Доступно только с 37 уровня';
exit;
}
$avo = mysql_num_rows(mysql_query("SELECT id FROM `hik_otk` WHERE `usr`='".$user['id']."' and `hiking`='3'"));
if($avo > 0) {
$_SESSION['err'] = "Поход уже пройден!";
header('Location: /');
exit;
}
$req = mysql_query("SELECT * FROM `hiking` where (`lider`='".$user['id']."' || `usr1`='".$user['id']."' || `usr2`='".$user['id']."' || `usr3`='".$user['id']."')");
$avto = mysql_num_rows($req);
if($avto>0){
header('location: /');
$_SESSION['err'] = 'Ошибка';
exit;
}
if($user['plem']=='ogn')$imp=0;
if($user['plem']=='mol')$imp=1;
mysql_query("INSERT INTO `hiking` SET `name`='3', `kol`='1',`imp`='".$imp."', `lider`='".$user['id']."'");
mysql_query("UPDATE `user` set `team`='1' where `id` = '".$user['id']."'");
header('location: /hiking/lair-of-the-Werewolf/');
exit;
require_once H.'core/foot.php';
?>