<?
include("lib.php");
check_access();
$sql='update users set room="0"';
$chat_reload=false;
if($User['room']!=0) {
$sql.=', last_request_time=0';
$chat_reload=true;
}
mysql_query($sql.' where id='.$User['id']);
$t=$_POST['t'];
if (($t!='ok')and($t!='no')){
if($User['labirint_hol']>0) {
$html='<html><body><script
language="JavaScript">document.location.href="labirint.php?hol='.$User['labirint_hol'].'"</script></body></html>'
;
die($html);
}
}
if ($t=='ok'){
mysql_query('update users set labirint_hol=0 where id='.$User['id']);
}
if ($t=='no'){
if($User['money'] < 5) {
$html='<html><body><script language="JavaScript">alert("У вас не достаточно лодов");
top.main_frame.window.location="labirint.php?hol='.$User['labirint_hol'].'"</script></body></html>';
die($html);
}
if($User['money'] > 5){
$money_exit=$User['money']-5;
mysql_query('update users set labirint_hol=0,money='.$money_exit.' where id='.$User['id']);
}
}
?>