database fixes

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

View File

@ -139,22 +139,21 @@ if (isset($eff['id']) && $_GET['got']) {
$_GET['got'] = 0;
}
$array = [
1 => [], 2 => [], 3 => [], 4 => [],
5 => ['min_level' => 1, 'max_level' => 3], 6 => ['min_level' => 1, 'max_level' => 3],
7 => ['min_level' => 1, 'max_level' => 3], 8 => ['min_level' => 4, 'max_level' => 21],
9 => ['min_level' => 4, 'max_level' => 6], 10 => ['min_level' => 7, 'max_level' => 9],
11 => ['min_level' => 10, 'max_level' => 12], 12 => ['min_level' => 13, 'max_level' => 15],
13 => ['min_level' => 16, 'max_level' => 19], 14 => ['min_level' => 19, 'max_level' => 21],
15 => ['paladin' => 1], 16 => ['paladin' => 1],
17 => ['align' => 3], 18 => ['align' => 3], 19 => ['sex' => 2],
36 => ['align' => 2],
54 => ['align' => 6], 55 => ['align' => 6], 56 => ['align' => 2]
];
function gone_rooms($room)
{
global $array, $user;
global $user;
$array = [
1 => [], 2 => [], 3 => [], 4 => [],
5 => ['min_level' => 1, 'max_level' => 3], 6 => ['min_level' => 1, 'max_level' => 3],
7 => ['min_level' => 1, 'max_level' => 3], 8 => ['min_level' => 4, 'max_level' => 21],
9 => ['min_level' => 4, 'max_level' => 6], 10 => ['min_level' => 7, 'max_level' => 9],
11 => ['min_level' => 10, 'max_level' => 12], 12 => ['min_level' => 13, 'max_level' => 15],
13 => ['min_level' => 16, 'max_level' => 19], 14 => ['min_level' => 19, 'max_level' => 21],
15 => ['paladin' => 1], 16 => ['paladin' => 1],
17 => ['align' => 3], 18 => ['align' => 3], 19 => ['sex' => 2],
36 => ['align' => 2],
54 => ['align' => 6], 55 => ['align' => 6], 56 => ['align' => 2]
];
$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']) {
?>