Зачем-то инкапсуляция...

This commit is contained in:
Igor Barkov (iwork)
2021-02-01 18:42:52 +02:00
parent 8d0bce6299
commit 7dd6368b84
23 changed files with 867 additions and 236 deletions
+6 -6
View File
@@ -45,9 +45,9 @@ function setProfession($name, $type, $needMoney, $needLevel)
$profId = 22;
}
if (!empty($profId)) {
$user->money -= $needMoney;
Bank::setWalletMoney($user->money, $user->id);
db::c()->query('UPDATE `users` SET ?f = ?i WHERE `id` = ?i', 'prof' . $type, $profId, $user->id);
$user->setMoney($user->getMoney() - $needMoney);
Bank::setWalletMoney($user->getMoney(), $user->getId());
db::c()->query('UPDATE `users` SET ?f = ?i WHERE `id` = ?i', 'prof' . $type, $profId, $user->getId());
$deloText = "{$user['login']} купил профессию «{$name}» в академии за {$needMoney} кр.";
GameLogs::addUserLog($_SESSION['uid'], $deloText);
$user['prof' . $type] = true;
@@ -69,7 +69,7 @@ if ($get == 'medic') {
}
if ($get == 'exit') {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $user->id, $user->id);
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $user->getId(), $user->getId());
header('Location: city.php');
}
Template::header('Академия');
@@ -82,8 +82,8 @@ Template::header('Академия');
<div><?= $status ?></div>
<div class="appblock appblock-main">
<span class="legend">Информация</span>
<span class="wrap">Кредиты<span class="num"><?= $user->money ?></span></span>
<span class="wrap">Уровень персонажа<span class="num"><?= $user->level ?></span></span>
<span class="wrap">Кредиты<span class="num"><?= $user->getMoney() ?></span></span>
<span class="wrap">Уровень персонажа<span class="num"><?= $user->getLevel() ?></span></span>
</div>
<div class="appblock">
<span class="legend">Наёмник</span>