if (!$userTools->login($emailId, $password)){ echo("Login Failed"); return; } if (!isset($_SESSION["emailId"])) { header ("Location: banklogin.php"); } // Check the balance of the current user $balance = AccountUtils::checkBalance($emailId); //Check if IBAN already exists and if yes, then return the balance $balanceOfTheTargetUser = AccountUtils::checkBalanceIBAN($iban); $data = array( "senderIban" => AccountUtils::getIBANFromEmail($emailId), "receiverIban" => $iban, "bic" => $bic, "amount" => $amount, "description" => "'$description'", "userId" => "'$emailId'", "date" => "'".date('Y-m-d H:i:s')."'", "closingBalance" => $balance, "isActive" => $isActive, "type" => "'DEBIT'" ); // Check if the user has a transaction that is not yet approved