code inspect

This commit is contained in:
Igor Barkov (iwork)
2019-09-16 17:01:59 +03:00
parent e93f8ebca1
commit 77e8b7de2a
8 changed files with 31 additions and 73 deletions
+10 -3
View File
@@ -28,7 +28,10 @@ function setProfession($name, $type, $needMoney, $needLevel)
if ($name == 'наёмник') $profId = 21;
if ($name == 'лекарь') $profId = 22;
if (!empty($profId)) {
db::c()->query('UPDATE `users` SET ?f = ?i, `money` = `money` - ?i WHERE `id` = ?i', 'prof' . $type, $profId, $needMoney, $_SESSION['uid']);
try {
db::c()->query('UPDATE `users` SET ?f = ?i, `money` = `money` - ?i WHERE `id` = ?i', 'prof' . $type, $profId, $needMoney, $_SESSION['uid']);
} catch (\Krugozor\Database\Mysql\Exception $e) {
}
$deloText = "{$user['login']} купил профессию «{$name}» в академии за {$needMoney} кр.";
addToDelo($deloText);
$user['prof'.$type] = true;
@@ -42,16 +45,20 @@ if ($get == 'mercenary') $status = setProfession('наёмник', 2, 700, 5);
if ($get == 'medic') $status = setProfession('лекарь', 2, 700, 5);
if ($get == 'exit') {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $_SESSION['uid'], $_SESSION['uid']);
try {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $_SESSION['uid'], $_SESSION['uid']);
} catch (\Krugozor\Database\Mysql\Exception $e) {
}
header('Location: city.php');
}
?>
<!DOCTYPE html>
<html>
<html lang="ru">
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet">
<link href="css/secondary.css" rel="stylesheet"/>
<title></title>
</head>
<body>
<div style="float: right;">