Зачем-то инкапсуляция...
This commit is contained in:
+6
-6
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user