File size: 1.24Kb
<?
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'] < 24){
header('location: /');
$_SESSION['err'] = 'Доступно только с 24 уровня';
exit;
}
$avo = mysql_num_rows(mysql_query("SELECT id FROM `hik_otk` WHERE `usr`='".$user['id']."' and `hiking`='2'"));
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`='2', `kol`='1',`imp`='".$imp."', `lider`='".$user['id']."'");
mysql_query("UPDATE `user` set `team`='1' where `id` = '".$user['id']."'");
header('location: /hiking/land-of-death/');
exit;
require_once H.'core/foot.php';
?>