+5
-7
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Battles\Bank;
|
||||
use Battles\GameLogs;
|
||||
use Battles\Template;
|
||||
use Battles\Travel;
|
||||
use Battles\User;
|
||||
|
||||
require_once 'functions.php';
|
||||
@@ -13,7 +13,7 @@ const MEDIC = 'лекарь';
|
||||
$status = 'Внимание! Моментальная оплата без подтверждения!';
|
||||
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
|
||||
|
||||
function setProfession($name, $type, $needMoney, $needLevel)
|
||||
function setProfession($name, $type, $needMoney, $needLevel): string
|
||||
{
|
||||
global $user;
|
||||
$profId = 0;
|
||||
@@ -43,8 +43,7 @@ function setProfession($name, $type, $needMoney, $needLevel)
|
||||
$profId = 22;
|
||||
}
|
||||
if (!empty($profId)) {
|
||||
User::getInstance()->setMoney(User::getInstance()->getMoney() - $needMoney);
|
||||
Bank::setWalletMoney(User::getInstance()->getMoney(), User::getInstance()->getId());
|
||||
User::getInstance()->money()->spend($needMoney);
|
||||
db::c()->query('UPDATE `users` SET ?f = ?i WHERE `id` = ?i', 'prof' . $type, $profId, User::getInstance()->getId());
|
||||
$deloText = "{$user['login']} купил профессию «{$name}» в академии за {$needMoney} кр.";
|
||||
GameLogs::addUserLog($_SESSION['uid'], $deloText);
|
||||
@@ -67,8 +66,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::getInstance()->getId(), User::getInstance()->getId());
|
||||
header('Location: city.php');
|
||||
Travel::toRoom(2702, User::getInstance()->getRoom());
|
||||
}
|
||||
Template::header('Академия');
|
||||
?>
|
||||
@@ -80,7 +78,7 @@ Template::header('Академия');
|
||||
<div><?= $status ?></div>
|
||||
<div class="appblock appblock-main">
|
||||
<span class="legend">Информация</span>
|
||||
<span class="wrap">Кредиты<span class="num"><?= User::getInstance()->getMoney() ?></span></span>
|
||||
<span class="wrap">Кредиты<span class="num"><?= User::getInstance()->money()->get() ?></span></span>
|
||||
<span class="wrap">Уровень персонажа<span class="num"><?= User::getInstance()->getLevel() ?></span></span>
|
||||
</div>
|
||||
<div class="appblock">
|
||||
|
||||
Reference in New Issue
Block a user