492 lines
25 KiB
PHP
492 lines
25 KiB
PHP
<?php
|
||
ob_start("ob_gzhandler");
|
||
session_start();
|
||
if ($_SESSION['uid'] == null) header("Location: index.php");
|
||
include "config.php";
|
||
include "functions.php";
|
||
if ($user['room'] != 29) header("Location: main.php");
|
||
if ($user['battle'] != 0) {
|
||
header('location: fbattle.php');
|
||
die();
|
||
}
|
||
|
||
$cost_login = 25;
|
||
|
||
######## ОБЩИЕ ЗАПРОСЫ В БАЗУ ###
|
||
|
||
#################################
|
||
|
||
function inschet($userid)
|
||
{
|
||
$banks = db::c()->query('SELECT `id` FROM `bank` WHERE `owner` = ?i', $userid);
|
||
echo "<select style='width:150px' name=id>";
|
||
while ($rah = $banks->fetch_assoc()) {
|
||
echo "<option>" . $rah['id'] . "</option>";
|
||
}
|
||
echo "</select>";
|
||
}
|
||
|
||
?>
|
||
|
||
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<link href="css/main.css" rel="stylesheet"/>
|
||
<title>Банк</title>
|
||
<script>
|
||
function leave() {
|
||
top.frames['main'].location = 'city.php?strah=1&tmp=' + Math.random()
|
||
}
|
||
</script>
|
||
<script src="/js/jquery-1.7.2.min.js"></script>
|
||
<style>
|
||
legend {
|
||
padding: 0.2em 0.5em;
|
||
color: #666;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.appblock {
|
||
background: silver;
|
||
border-radius: 2px;
|
||
float: left;
|
||
height: 200px;
|
||
margin: 10px;
|
||
max-width: 250px;
|
||
opacity: 0.75;
|
||
padding: 5px;
|
||
}
|
||
|
||
div.appblock form {
|
||
margin: 0;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<h1>Банк</h1>
|
||
|
||
<?php
|
||
|
||
if ($_GET['exit']) {
|
||
$_SESSION['bankid'] = null;
|
||
}
|
||
|
||
if ($_POST['userlogin']) {
|
||
$_SESSION['bankid'] = $user['id'];
|
||
}
|
||
|
||
//if ($_POST['enter'] && $_POST['pass']) {
|
||
//// $data = mysql_query("SELECT * FROM `bank` WHERE `owner` = '" . $user['id'] . "' AND `id` = '" . (int)$_POST['id'] . "' AND `pass` = '" . md5($_POST['pass']) . "' LIMIT 1");
|
||
// $data = db::c()->query('SELECT 1 FROM `bank` WHERE `owner` = ?i', $user['id']);
|
||
//// $data = mysql_fetch_array($data);
|
||
// if ($data) {
|
||
// $_SESSION['bankid'] = $_POST['id'];
|
||
// err('Удачный вход.');
|
||
// } else {
|
||
// err('Ошибка входа.');
|
||
// }
|
||
//}
|
||
|
||
if (!$_SESSION['bankid']) {
|
||
?>
|
||
<a href=# onclick=leave()> ← выйти из банка</a>
|
||
<form method="post"><input type="submit" name="userlogin" value="Войти в личный счёт"></form>
|
||
<?
|
||
} else {
|
||
if ($_GET['fail']) {
|
||
err('Ошибка пополнения баланса.');
|
||
die();
|
||
}
|
||
if ($_GET['suk']) {
|
||
err('Баланс удачно пополнен.');
|
||
die();
|
||
}
|
||
|
||
if ($_POST['in'] && $_POST['ik']) {
|
||
$_POST['ik'] = round($_POST['ik'], 2);
|
||
if (is_numeric($_POST['ik']) && ($_POST['ik'] > 0) && ($_POST['ik'] <= $user['money'])) {
|
||
$user['money'] -= $_POST['ik'];
|
||
if (mysql_query("UPDATE `users` SET `money`=`money`-'" . $_POST['ik'] . "' WHERE `id`=" . $user['id'] . " LIMIT 1;")) {
|
||
$mywarn = "Деньги удачно положены на счет";
|
||
mysql_query("UPDATE `bank` SET `cr`=`cr`+'" . $_POST['ik'] . "' WHERE `id`=" . $_SESSION['bankid'] . " LIMIT 1;");
|
||
mysql_query("INSERT INTO `delo`(`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','Персонаж " . $user['login'] . " положил на свой счет №" . $_SESSION['bankid'] . " " . $_POST['ik'] . " кр. ',1,'" . time() . "');");
|
||
} else {
|
||
$mywarn = "Произошла ошибка!";
|
||
}
|
||
} else {
|
||
$mywarn = "У вас недостаточно денег для выполнения операции";
|
||
}
|
||
$_POST['in'] = 0;
|
||
}
|
||
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`=" . $_SESSION['bankid'] . ";"));
|
||
if ($_POST['out'] && $_POST['ok']) {
|
||
$_POST['ok'] = round($_POST['ok'], 2);
|
||
if (is_numeric($_POST['ok']) && ($_POST['ok'] > 0) && ($_POST['ok'] <= $bank['cr'])) {
|
||
$user['money'] += $_POST['ok'];
|
||
if (mysql_query("UPDATE `users` SET `money`=`money`+'" . $_POST['ok'] . "' WHERE `id`='" . $user['id'] . "' LIMIT 1;")) {
|
||
$mywarn = "Деньги удачно сняты со счета";
|
||
mysql_query("UPDATE `bank` SET `cr`=`cr`-'" . $_POST['ok'] . "' WHERE `id`='" . $_SESSION['bankid'] . "' LIMIT 1;");
|
||
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['bankid'] . "';"));
|
||
mysql_query("INSERT INTO `delo` (`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','Персонаж " . $user['login'] . " снял со своего счета №" . $_SESSION['bankid'] . " " . $_POST['ok'] . " кр.',1,'" . time() . "');");
|
||
} else {
|
||
$mywarn = "Произошла ошибка!";
|
||
}
|
||
} else {
|
||
$mywarn = "У вас недостаточно денег на счету для выполнения операции";
|
||
}
|
||
$_POST['out'] = 0;
|
||
}
|
||
|
||
if ($_POST['change'] && $_POST['ok']) {
|
||
$_POST['ok'] = round($_POST['ok'], 2);
|
||
if (is_numeric($_POST['ok']) && ($_POST['ok'] > 0) && ($_POST['ok'] <= $bank['ekr'])) {
|
||
$bank['cr'] += $_POST['ok'] * 100;
|
||
$bank['ekr'] -= $_POST['ok'];
|
||
$add_money = $_POST['ok'] * 100;
|
||
if (mysql_query("UPDATE `bank` SET `cr`=`cr`+'$add_money' WHERE `id`='" . $bank['id'] . "' LIMIT 1;")) {
|
||
$mywarn = "Обмен произведен успешно";
|
||
mysql_query("UPDATE `bank` SET `ekr`=`ekr`-'" . $_POST['ok'] . "' WHERE `id`='" . $_SESSION['bankid'] . "' LIMIT 1;");
|
||
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['bankid'] . "';"));
|
||
mysql_query("INSERT INTO `delo` (`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','Персонаж " . $user['login'] . " обменял " . $_POST['ok'] . " екр. на " . $add_money . " кр. на счету №" . $_SESSION['bankid'] . " в банке. ',1,'" . time() . "');");
|
||
} else {
|
||
$mywarn = "Произошла ошибка!";
|
||
}
|
||
} else {
|
||
$mywarn = "У вас недостаточно денег на валютном счету для выполнения операции";
|
||
}
|
||
$_POST['change'] = 0;
|
||
}
|
||
|
||
if ($_GET['dropm']) {
|
||
if (2 <= $bank['ekr']) {
|
||
undressall($user['id']);
|
||
if (mysql_query("UPDATE `users` SET `master`=noj+mec+topor+dubina+mfire+mwater+mair+mearth+mlight+mgray+mdark+master,noj=0,mec=0,topor=0,dubina=0,mfire=0,mwater=0,mair=0,mearth=0,mlight=0,mgray=0,mdark=0 WHERE `id`='" . $user['id'] . "' LIMIT 1;")) {
|
||
mysql_query("UPDATE `bank` SET `ekr`=`ekr`-'2' WHERE `id`='" . $_SESSION['bankid'] . "' LIMIT 1;");
|
||
mysql_query("INSERT INTO `delo` (`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','" . $user['login'] . " перераспределил умения, заплатив 2 екр. со счета №" . $_SESSION['bankid'] . " в банке. ',1,'" . time() . "');");
|
||
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['bankid'] . "';"));
|
||
$mywarn = "Все прошло удачно. Вы можете перераспределить умения.";
|
||
} else {
|
||
$mywarn = "Произошла ошибка!";
|
||
}
|
||
} else {
|
||
$mywarn = "У вас недостаточно денег на валютном счету для выполнения операции";
|
||
}
|
||
$_GET['dropm'] = 0;
|
||
}
|
||
|
||
if ($_GET['dropst']) {
|
||
$travma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner`='" . $user['id'] . "' AND (`type`=11 OR `type`=12 OR `type`=13 OR `type`=14) ORDER BY `type` DESC LIMIT 1;"));
|
||
if ($travma['type']) {
|
||
$mywarn = "Невозможно сбрасывать статы находясь в травме!";
|
||
} else {
|
||
undressall($user['id']);
|
||
$user1 = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='" . $user['id'] . "' LIMIT 1;"));
|
||
$svstats = $user1['sila'] + $user1['lovk'] + $user1['inta'] + $user1['vinos'] + $user1['intel'] + $user1['mudra'] - 12 - $user1['level'];
|
||
if ($svstats <= $bank['ekr']) {
|
||
$exps = ["20" => [15],
|
||
"45" => [16],
|
||
"75" => [17],
|
||
"110" => [18],
|
||
"160" => [21],
|
||
"215" => [22],
|
||
"280" => [23],
|
||
"350" => [24],
|
||
"410" => [25],
|
||
"530" => [28],
|
||
"670" => [29],
|
||
"830" => [30],
|
||
"950" => [31],
|
||
"1100" => [32],
|
||
"1300" => [33],
|
||
"1450" => [36],
|
||
"1650" => [37],
|
||
"1850" => [38],
|
||
"2050" => [39],
|
||
"2200" => [40],
|
||
"2500" => [41],
|
||
"2900" => [46],
|
||
"3350" => [47],
|
||
"3800" => [48],
|
||
"4200" => [49],
|
||
"4600" => [50],
|
||
"5000" => [51],
|
||
"6000" => [54],
|
||
"7000" => [55],
|
||
"8000" => [56],
|
||
"9000" => [57],
|
||
"10000" => [58],
|
||
"11000" => [59],
|
||
"12000" => [60],
|
||
"12500" => [61],
|
||
"14000" => [64],
|
||
"15500" => [65],
|
||
"17000" => [66],
|
||
"19000" => [67],
|
||
"21000" => [68],
|
||
"23000" => [69],
|
||
"26000" => [70],
|
||
"30000" => [71],
|
||
"60000" => [76],
|
||
"75000" => [77],
|
||
"150000" => [78],
|
||
"175000" => [79],
|
||
"200000" => [80],
|
||
"225000" => [81],
|
||
"250000" => [82],
|
||
"260000" => [83],
|
||
"280000" => [84],
|
||
"300000" => [85],
|
||
"1500000" => [86],
|
||
"1750000" => [87],
|
||
"2000000" => [88],
|
||
"2175000" => [89],
|
||
"2300000" => [90],
|
||
"2400000" => [91],
|
||
"2500000" => [92],
|
||
"2600000" => [93],
|
||
"2800000" => [94],
|
||
"3000000" => [95],
|
||
"6000000" => [96],
|
||
"6500000" => [97],
|
||
"7500000" => [98],
|
||
"8500000" => [99],
|
||
"9000000" => [100],
|
||
"9250000" => [101],
|
||
"9500000" => [102],
|
||
"9750000" => [103],
|
||
"9900000" => [104],
|
||
"10000000" => [105],
|
||
"13000000" => [106],
|
||
"14000000" => [107],
|
||
"15000000" => [108],
|
||
"16000000" => [109],
|
||
"17000000" => [110],
|
||
"17500000" => [111],
|
||
"18000000" => [112],
|
||
"19000000" => [113],
|
||
"19500000" => [114]];
|
||
echo "<pre>";
|
||
$ss = mysql_query("SELECT `id`,`nextup`,`level` FROM `users` WHERE `level` > 0 AND `level` < 8 AND id='" . $user['id'] . "';");
|
||
$errdo = 0;
|
||
while ($ssd = mysql_fetch_array($ss)) {
|
||
undressall($ssd['id']);
|
||
if (!mysql_query("UPDATE `users` SET `sila`='3',`lovk`='3',`inta`='3',`vinos`='" . (3 + $ssd['level']) . "',`intel`='0',`fkrit`='0',`fakrit`='0',`fuvorot`='0',`fauvorot`='0',`stats`='" . ($exps[$ssd['nextup']][0] - 12) . "' WHERE `id`='" . $ssd['id'] . "';")) $errdo = 1;
|
||
}
|
||
if ($errdo == 0) {
|
||
mysql_query("UPDATE `bank` SET `ekr`=`ekr`-'" . $svstats . "' WHERE `id`='" . $_SESSION['bankid'] . "' LIMIT 1;");
|
||
mysql_query("INSERT INTO `delo` (`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','" . $user['login'] . " перераспределил статы, заплатив " . $svstats . " екр. со счета №" . $_SESSION['bankid'] . " в банке. ',1,'" . time() . "');");
|
||
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['bankid'] . "';"));
|
||
$mywarn = "Все прошло удачно. Вы можете перераспределить статы.";
|
||
} else {
|
||
$mywarn = "Произошла ошибка! Обратитесь к палладинам.";
|
||
}
|
||
|
||
$vinos = $user1['level'] + 3;
|
||
$hp = $vinos * 6;
|
||
if (mysql_query("UPDATE `users` SET `stats`='" . $svstats . "',lovk=3,sila=3,inta=3,vinos='" . $vinos . "',hp='" . $hp . "',maxhp='" . $hp . "',intel=0,mudra=0 WHERE `id`='" . $user['id'] . "' LIMIT 1;")) {
|
||
mysql_query("UPDATE `bank` SET `ekr`=`ekr`-'" . $svstats . "' WHERE `id`='" . $_SESSION['bankid'] . "' LIMIT 1;");
|
||
mysql_query("INSERT INTO `delo` (`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','" . $user['login'] . " перераспределил статы, заплатив " . $svstats . " екр. со счета №" . $_SESSION['bankid'] . " в банке. ',1,'" . time() . "');");
|
||
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['bankid'] . "';"));
|
||
|
||
$mywarn = "Все прошло удачно. Вы можете перераспределить статы.";
|
||
|
||
} else {
|
||
$mywarn = "Произошла ошибка!";
|
||
}
|
||
} else {
|
||
$mywarn = "У вас недостаточно денег на валютном счету для выполнения операции";
|
||
}
|
||
}
|
||
$_GET['dropst'] = 0;
|
||
}
|
||
|
||
if ($_POST['wu'] && $_POST['sum'] && $_POST['number']) {
|
||
$bank2 = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_POST['number'] . "';"));
|
||
$to = mysql_fetch_array(mysql_query("SELECT login FROM `users` WHERE `id`='" . $bank2['owner'] . "';"));
|
||
if ($bank2[0]) {
|
||
$_POST['sum'] = round($_POST['sum'], 2);
|
||
if (is_numeric($_POST['sum']) && ($_POST['sum'] > 0)) {
|
||
$nalog = round($_POST['sum'] * 0.03);
|
||
if ($nalog < 1) {
|
||
$nalog = 1;
|
||
}
|
||
$new_sum = $_POST['sum'] + $nalog;
|
||
if ($new_sum <= $bank['cr']) {
|
||
if (mysql_query("UPDATE `bank` SET `cr`=`cr`-'" . $new_sum . "' WHERE `id`='" . $_SESSION['bankid'] . "' LIMIT 1;")) {
|
||
mysql_query("UPDATE `bank` SET `cr`=`cr`+'" . $_POST['sum'] . "' WHERE `id`='" . $_POST['number'] . "' LIMIT 1;");
|
||
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['bankid'] . "';"));
|
||
mysql_query("INSERT INTO `delo` (`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','Персонаж " . $user['login'] . " перевел со своего банковского счета №" . $_SESSION['bankid'] . " на счет №" . $_POST['number'] . " к персонажу " . $to['login'] . " " . $_POST['sum'] . " кр. Дополнительно снято " . $nalog . " кр. за услуги банка ',1,'" . time() . "');");
|
||
mysql_query("INSERT INTO `delo` (`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $bank2['owner'] . "','Персонаж " . $user['login'] . " перевел со своего банковского счета №" . $_SESSION['bankid'] . " на счет №" . $_POST['number'] . " к персонажу " . $to['login'] . " " . $_POST['sum'] . " кр. Дополнительно снято " . $nalog . " кр. за услуги банка ',1,'" . time() . "');");
|
||
$sum = $_POST['sum'];
|
||
$schet = $_POST['number'];
|
||
$mywarn = "$sum кр. успешно переведены на счет № $schet";
|
||
} else {
|
||
$mywarn = "Произошла ошибка!";
|
||
}
|
||
} else {
|
||
$mywarn = "У вас недостаточно денег на счету для выполнения операции";
|
||
}
|
||
} else {
|
||
$mywarn = "У вас недостаточно денег на счету для выполнения операции";
|
||
}
|
||
} else {
|
||
$mywarn = "Данные о счете получателя не найдены.";
|
||
}
|
||
$_POST['wu'] = 0;
|
||
}
|
||
|
||
### Чеки
|
||
/**
|
||
*
|
||
*/
|
||
function bank_show()
|
||
{
|
||
global $user;
|
||
$pl = db::c()->query('SELECT `id`,`name`,`bcost` FROM `inventory` WHERE `owner` = ?i AND `bcost` > 0 ORDER BY `bcost` ASC', $user['id']);
|
||
if ($pl->getNumRows() > 0) {
|
||
echo '<select name=\'coste\'>';
|
||
while ($sp = $pl->fetch_assoc()) {
|
||
echo '<option value=\'' . $sp['id'] . '\'>' . $sp['name'] . '</option>';
|
||
}
|
||
echo '</select> <input class="ctContent" type="submit" value="Обменять" name="saled" />';
|
||
} else {
|
||
echo '<b>Нет чеков для обмена</b>';
|
||
}
|
||
}
|
||
|
||
if ($_POST['sales'] && $_POST['count_ekr'] && (!empty($user['admin']))) {
|
||
if (isset($bank['id'])) {
|
||
$cnt = round($_POST['count_ekr'], 2);
|
||
if ($cnt < 1) {
|
||
err('Минимальная сумма: 1 екр');
|
||
} elseif ($bank['ekr'] < $cnt) {
|
||
err('Недостаточно средств ...');
|
||
} else {
|
||
$name = 'Банковский чек на ' . $cnt . ' еврокредитов';
|
||
db::c()->query('INSERT INTO `inventory` SET `name` = "?s", `bcost` = ?i, `owner` = ?i, `prototype` = ?i', $name, $cnt, $user['id'], 1123);
|
||
// $bank['ekr'] -= $cnt;
|
||
// mysql_query('UPDATE `bank` SET `ekr` = "' . $bank['ekr'] . '" WHERE `id` = "' . $bank['id'] . '" LIMIT 1');
|
||
db::c()->query('UPDATE `bank` SET `ekr` = `ekr` - ?i WHERE `id` = ?i', $cnt, $bank['id']);
|
||
err('Чек на сумму : ' . $cnt . ' екр., появится у Вас в инвентаре ...');
|
||
}
|
||
} else {
|
||
err('Банковский счёт, не найден ...');
|
||
}
|
||
}
|
||
|
||
if ($_POST['saled'] && $_POST['coste'] && (!empty($user['admin']))) {
|
||
$item = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `bcost` FROM `inventory` WHERE `owner` = "' . $user['id'] . '" AND `id` = "' . mysql_real_escape_string($_POST['coste']) . '" LIMIT 1'));
|
||
if (isset($item['id'])) {
|
||
if ($item['bcost'] > 0) {
|
||
mysql_query('DELETE FROM `inventory` WHERE `owner` = "' . $user['id'] . '" AND `id` = "' . $item['id'] . '" LIMIT 1');
|
||
$bank['ekr'] += $item['bcost'];
|
||
mysql_query('UPDATE `bank` SET `ekr` = "' . $bank['ekr'] . '" WHERE `id` = "' . $bank['id'] . '" LIMIT 1');
|
||
err($item['name'] . ', успешно обналичен ...');
|
||
} else {
|
||
err('Это не чек ...');
|
||
}
|
||
} else {
|
||
err('Чек, не найден ...');
|
||
}
|
||
}
|
||
###
|
||
if ($_POST['changeback'] && $_POST['ok'] && (!empty($user['admin']))) {
|
||
$_POST['ok'] = round($_POST['ok'], 2);
|
||
if (is_numeric($_POST['ok']) && ($_POST['ok'] > 0) && ($_POST['ok'] <= $bank['cr'])) {
|
||
$bank['cr'] -= $_POST['ok'];
|
||
$bank['ekr'] += $_POST['ok'] / 500;
|
||
$add_ekr = $_POST['ok'] / 500;
|
||
if (mysql_query("UPDATE `bank` SET `cr`=`cr`-'" . $_POST['ok'] . "' WHERE `id`='" . $bank['id'] . "' LIMIT 1;")) {
|
||
$mywarn = "Обмен произведен успешно";
|
||
mysql_query("UPDATE `bank` SET `ekr`=`ekr`+'$add_ekr' WHERE `id`='" . $_SESSION['bankid'] . "' LIMIT 1;");
|
||
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['bankid'] . "';"));
|
||
mysql_query("INSERT INTO `delo` (`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','Персонаж " . $user['login'] . " обменял " . $_POST['ok'] . " кр. на " . $add_ekr . " екр. на счету №" . $_SESSION['bankid'] . " в банке. ',1,'" . time() . "');");
|
||
} else {
|
||
$mywarn = "Произошла ошибка!";
|
||
}
|
||
} else {
|
||
$mywarn = "У вас недостаточно денег для выполнения операции";
|
||
}
|
||
$_POST['changeback'] = 0;
|
||
}
|
||
|
||
err($mywarn);
|
||
?>
|
||
<a href="?exit=1"> ← выйти из счёта</a>
|
||
<h1>Cчет № <b><?= $_SESSION['bankid'] ?></h1>
|
||
|
||
<div class="appblock">
|
||
<legend>Денежные средства</legend>
|
||
Кредитов на руках: <b><?= $user['money'] ?></b> кр.<br>
|
||
Кредитов на счету: <b><?= $bank['cr'] ?></b> кр.<br>
|
||
Еврокредитов на счету: <b><?= $bank['ekr'] ?></b> екр.<br>
|
||
<table width=100%>
|
||
<tr>
|
||
<td width="75"><input type=text size=10 name=ik placeholder="Сумма"></td>
|
||
<td><input type=submit name=in value="Положить кредиты на счёт"></td>
|
||
</tr>
|
||
<tr>
|
||
<td><input type=text size=10 name=ok placeholder="Сумма"></td>
|
||
<td><input type=submit name=out value="Снять кредиты со счёта"></td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="appblock">
|
||
<legend>Перевод кредитов</legend>
|
||
<form method="POST">
|
||
<table width=100%>
|
||
<tr>
|
||
<td width="75"><input type=text size=10 name=sum placeholder="Сумма"></td>
|
||
</tr>
|
||
<tr>
|
||
<td><input type=text size=10 name=number placeholder="Cчёт получателя"></td>
|
||
</tr>
|
||
</table>
|
||
<input type=submit name=wu value="Перевести кредиты">
|
||
</form>
|
||
Комиссия составит 3% от переводимой суммы, но не менее 1 кр.
|
||
</div>
|
||
|
||
<? if (!empty($user['admin'])): ?>
|
||
<div class="appblock" style="background:#FFAAAA;">
|
||
<legend>Обменять екр. на кр.</legend>
|
||
Курс обмена: 1 екр. = 100 кр.<br>
|
||
<form method="POST">
|
||
Сумма екр. для обмена
|
||
<input type=text name=ok placeholder="Сумма">
|
||
<input type=submit name=change value="обменять">
|
||
</form>
|
||
</div>
|
||
<div class="appblock" style="background:#FFAAAA;">
|
||
<legend>Обменять кр. на екр.</legend>
|
||
Курс обмена: 500 кр. = 1 екр.<br>
|
||
<form method="POST">
|
||
Сумма кр. для обмена
|
||
<input type=text name=ok placeholder="Сумма">
|
||
<input type=submit name=changeback value="обменять">
|
||
</form>
|
||
</div>
|
||
<div class="appblock">
|
||
<legend>Выписать чек</legend>
|
||
Услуга "чек на предъявителя". Вы выписываете екровый чек, который затем сможет обналичить любой
|
||
персонаж.<br>
|
||
<form method="POST">
|
||
Сумма (екр): <input type="text" size="4" name="count_ekr"/> <input type="submit" value="Выписать"
|
||
name="sales"/>
|
||
</form>
|
||
</div>
|
||
<div class="appblock">
|
||
<legend>Обналичить чек</legend>
|
||
В нашем банке мы принимаем к погашению екровые чеки на предъявителя.
|
||
<form method="POST">
|
||
<?php bank_show(); ?>
|
||
</form>
|
||
</div>
|
||
<?php endif;
|
||
} # Очень важная и гордая кавычка!
|
||
?>
|
||
|
||
</body>
|
||
</html>
|