database fixes

This commit is contained in:
lopar 2018-03-23 23:09:30 +02:00
parent 6af2144cdc
commit 35d0653bee

View File

@ -139,6 +139,9 @@ if (isset($eff['id']) && $_GET['got']) {
$_GET['got'] = 0;
}
function gone_rooms($room)
{
global $user;
$array = [
1 => [], 2 => [], 3 => [], 4 => [],
5 => ['min_level' => 1, 'max_level' => 3], 6 => ['min_level' => 1, 'max_level' => 3],
@ -151,10 +154,6 @@ $array = [
36 => ['align' => 2],
54 => ['align' => 6], 55 => ['align' => 6], 56 => ['align' => 2]
];
function gone_rooms($room)
{
global $array, $user;
$error = 0;
$param = $array[$room];
if ($room == 57) {
@ -192,14 +191,13 @@ function gone_rooms($room)
}
}
if ($error == 0 OR $user['admin'] == 1) {
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '$room', `online`.`room` = '$room' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'");
db::c()->query('UPDATE `users`, `online` SET `users`.`room` = ?i, `online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $user['id']);
header('Location: main.php');
}
}
if (isset($_GET['got']) && $_GET['got']) {
gone_rooms($_GET['room']);
}
if (isset($_GET['got'])) gone_rooms($_GET['room']);
if ($_REQUEST['transreport']) {
?>