mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'");
Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'".$u_res['nagrada']."',`doblest`=`doblest`+'".$u_res['nagrada']."' where `login`='".$user['login']."'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';");
echo"<script>location='vxod_lab.php'</script>";
}else{
echo"<font color=red>Вы еще не собрали все ресурсы</font><br>";
$bot=mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->getRoom()."' LIMIT 1"));
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';");
echo"<script>location='vxod_lab.php'</script>";
}
if($_GET['get']){
$data=mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($_GET['get'])."' AND `id_user`='".$user['id']."';"));
$d=mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';"));
if($user['sila']*4>$d[0]){
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case2:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user['hp']=$user['maxhp'];
break;
case6:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case5:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case7:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case4:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case3:
$d=mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4>$d[0]){
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case9:
$d=mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4>$d[0]){
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case8:
$d=mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4>$d[0]){
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
}
}
unset($data);
}
if($_GET['drop']){
$data=mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($_GET['drop'])."' AND `id_user`='".$user['id']."';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
$data=mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal1'])."' AND `id_user`='".$user['id']."';"));
$sum=mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';");
mysql_query("UPDATE `users` SET `money` = `money`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
err('Вы обналичили у Архивариуса чек на <b>'.round($sum[0],2).'</b> кр!<br>');
}
unset($data);
}
if($_GET['nal2']){
$data=mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal2'])."' AND `id_user`='".$user['id']."';"));
$sum=mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';");
mysql_query("UPDATE `users` SET `doblest` = `doblest`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
err('Вы обналичили у Архивариуса чек на <b>'.round($sum[0],2).'</b> доблести!<br>');
}
unset($data);
}
if($_GET['nal3']){
$data=mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal3'])."' AND `id_user`='".$user['id']."';"));
$sum=mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';");
mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
err('Вы обналичили у Архивариуса чек на <b>'.round($sum[0],2).'</b> екр!<br>');
}
unset($data);
}
if($_GET['nal4']){
$data=mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal4'])."' AND `id_user`='".$user['id']."';"));
$sum=mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';");
mysql_query("UPDATE `users` SET `exp` = `exp`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
err('Вы обналичили у Архивариуса чек на <b>'.round($sum[0],2).'</b> опыта!<br>');
}
unset($data);
}
if($_GET['go']){
if(time()-$_SESSION['time']<=3){
echo"<font color=red>Не так быстро</font>";
}else
switch($_GET['go']){
case"p1":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p1'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$roow=mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '".mysql_real_escape_string($user->getRoom())."' AND `id_user`='".$user['id']."';"));
echo" <a href=\"#\" onclick=\"javascript:if (confirm('Желаете выбраться из квестового лабиринта? Теряете все, что здесь нашли.')){ location.href='lab.php?eexit=1';}\">Выйти?</a>";