You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
688 B

<?php
use Battles\Bank;
require_once "functions.php";
$_POST['action'] ??= null;
$bank = new Bank();
// Зачисление кредитов на счёт.
if ($_POST['action'] === 'depositMoney' && !empty($_POST['summa'])) {
$bank->depositMoney($_POST['summa']);
}
// Снятие кредитов со счёта.
if ($_POST['action'] === 'withdrawMoney' && !empty($_POST['summa'])) {
$bank->withdrawMoney($_POST['summa']);
}
// Перевод кредитов на другой счёт.
if ($_POST['action'] === 'sendMoney' && !empty($_POST['summa']) && !empty($_POST['to-id'])) {
$bank->sendMoney($_POST['to-id'], $_POST['summa']);
}
require_once 'views/bank.php';