//error_reporting(E_ALL);
//ini_set("display_errors", 1);
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
include "functions.php";
if (!($user['room'] >= 37 AND $user['room'] <= 41 )) { header("Location: main.php"); die(); }
$zam = mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'gotzamok' LIMIT 1;"));
if ($zam['value'] == $user['klan']) {
// если мой клан
if($_GET['goto']=='arsenal') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '38',`online`.`room` = '38' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
header('location: gotzamok.php');
$user['room']=38;
}
if($_GET['goto']=='home') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '37',`online`.`room` = '37' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
header('location: gotzamok.php');
$user['room']=37;
}
if($_GET['goto']=='dvor') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '39',`online`.`room` = '39' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
header('location: gotzamok.php');
$user['room']=39;
}
if($_GET['goto']=='master') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '40',`online`.`room` = '40' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
header('location: gotzamok.php');
$user['room']=40;
}
if($_GET['goto']=='rest') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '41',`online`.`room` = '41' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
header('location: gotzamok.php');
$user['room']=41;
}
}
?>
Приветствую в родной обители, собрат ".$user['login']."!";
?>
}
?>