locations-bugs #17
25
bank.php
25
bank.php
@ -16,19 +16,11 @@ if ($user->battle != 0) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
const BANK_SESSION_NAME = "bankid";
|
||||
const SUCCESS = "Успешная операция!";
|
||||
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
|
||||
if ($get == 'exit') {
|
||||
$_SESSION[BANK_SESSION_NAME] = null;
|
||||
}
|
||||
|
||||
$bank = new Bank($user->id);
|
||||
$status = '';
|
||||
|
||||
if (isset($_POST['userlogin'])) {
|
||||
$_SESSION[BANK_SESSION_NAME] = $bank->user_id;
|
||||
}
|
||||
if ($_SESSION[BANK_SESSION_NAME]) {
|
||||
$toid = (int)$_POST['to_id'] ?? 0;
|
||||
$summa = (int)$_POST['summa'] ?? 0;
|
||||
$submit = $_POST['action'] ?? '';
|
||||
@ -48,23 +40,17 @@ if ($_SESSION[BANK_SESSION_NAME]) {
|
||||
$status = SUCCESS;
|
||||
}
|
||||
unset($submit, $summa, $toid);
|
||||
}
|
||||
|
||||
Template::header('Банк');
|
||||
?>
|
||||
<link href="css/secondary.css" rel="stylesheet"/>
|
||||
<script src="js/main.js"></script>
|
||||
<h1>Банк</h1>
|
||||
<?php if (!$_SESSION[BANK_SESSION_NAME]): ?>
|
||||
<a href=# onclick=hrefToFrame('city.php?strah')> ← выйти из банка</a>
|
||||
<form method="post"><input type="submit" name="userlogin" value="Управление счётом"></form>
|
||||
<?php else: ?>
|
||||
<p><a href="?exit"> ← выйти из счёта</a></p>
|
||||
<?php Template::buildingTop(Rooms::$roomNames[29], 'strah') ?>
|
||||
<div><?= $status ?></div>
|
||||
<div class="appblock appblock-main">
|
||||
<span class="legend">Cчет №<?= $bank->user_id ?></span>
|
||||
<span class="wrap">На счету: <span class="num"><?= $bank->money ?></span></span>
|
||||
<span class="wrap">На счету: <span class="num"><?= $bank->getMoney() ?></span></span>
|
||||
<hr>
|
||||
<span class="wrap">На руках: <span class="num"><?= $user['money'] ?></span></span>
|
||||
<span class="wrap">На руках: <span class="num"><?= $user->money ?></span></span>
|
||||
</div>
|
||||
<div class="appblock">
|
||||
<span class="legend">Работа со счётом</span>
|
||||
@ -89,4 +75,3 @@ Template::header('Банк');
|
||||
</form>
|
||||
<span class="wrap">Комиссия: <?= Config::$bank_commission * 100 ?>% от переводимой суммы, но не менее 1 кр.</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
Loading…
Reference in New Issue
Block a user