File Manager
Viewing File: inter_bank.php
<?php
session_start();
include_once ('../include/session.php');
require_once '../include/class.user.php';
if(!isset($_SESSION['acc_no'])){
header("Location: login.php");
exit();
}
$reg_user = new USER();
$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no=:acc_no");
$stmt->execute(array(":acc_no"=>$_SESSION['acc_no']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stat = $row['status'];
if($stat == 'DORMANT/INACTIVE'){
header('Location: summary.php?dormant');
exit();
}
$stat = $row['status'];
if($stat == 'NOT VERIFIED'){
header('Location: summary.php?notverified');
exit();
}
$stat = $row['status'];
if($stat == 'ON HOLD'){
header('Location: summary.php?hold');
exit();
}
$stat = $row['status'];
if($stat == 'BLOCK'){
header('Location: summary.php?block');
exit();
}
if(isset($_POST['transfer'])){
$email = $row['email'];
$amount = trim($_POST['amount']);
$amount = strip_tags($amount);
$amount = htmlspecialchars($amount);
$acc_no = trim($_POST['acc_no']);
$acc_no = strip_tags($acc_no);
$acc_no = htmlspecialchars($acc_no);
$acc_name = trim($_POST['acc_name']);
$acc_name = strip_tags($acc_name);
$acc_name = htmlspecialchars($acc_name);
$bank_name = trim($_POST['bank_name']);
$bank_name = strip_tags($bank_name);
$bank_name = htmlspecialchars($bank_name);
$swift = trim($_POST['swift']);
$swift = strip_tags($swift);
$swift = htmlspecialchars($swift);
$routing = trim($_POST['routing']);
$routing = strip_tags($routing);
$routing = htmlspecialchars($routing);
$type = trim($_POST['type']);
$type = strip_tags($type);
$type = htmlspecialchars($type);
$remarks = trim($_POST['remarks']);
$remarks = strip_tags($remarks);
$remarks = htmlspecialchars($remarks);
$cout = trim($_POST['cout']);
$cout = strip_tags($cout);
$cout = htmlspecialchars($cout);
$transtype = trim($_POST['transtype']);
$transtype = strip_tags($transtype);
$transtype = htmlspecialchars($transtype);
if($reg_user->temp($email,$amount,$acc_no,$acc_name,$bank_name,$swift,$routing,$type,$remarks,$cout,$transtype)){
if (isset($_SESSION['acc_no']))
$codeq = substr(number_format(time() * rand(), 0, '', ''), 0, 6);
$sql = "UPDATE account SET tmp_otp = '$codeq' WHERE acc_no ='$acc_no'";
if(mysqli_query($link, $sql))
$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no = '$acc_no'");
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$sender = "Hightower Wealth Management"; /* sender id */
$message = "Please enter this code to continue proceed
$code";
$message = "
<!DOCTYPE html>
<html lang='en' xmlns='http://www.w3.org/1999/xhtml' xmlns:v='urn:schemas-microsoft-com:vml' xmlns:o='urn:schemas-microsoft-com:office:office'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='x-apple-disable-message-reformatting'>
<title></title>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,600' rel='stylesheet' type='text/css'>
<!-- Web Font / @font-face : BEGIN -->
<!--[if mso]>
<style>
* {
font-family: 'Roboto', sans-serif !important;
}
</style>
<![endif]-->
<!--[if !mso]>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,600' rel='stylesheet' type='text/css'>
<![endif]-->
<!-- Web Font / @font-face : END -->
<!-- CSS Reset : BEGIN -->
<style>
/* What it does: Remove spaces around the email design added by some email clients. */
/* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
html,
body {
margin: 0 auto !important;
padding: 0 !important;
height: 100% !important;
width: 100% !important;
font-family: 'Roboto', sans-serif !important;
font-size: 14px;
margin-bottom: 10px;
line-height: 24px;
color:#8094ae;
font-weight: 400;
}
* {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
margin: 0;
padding: 0;
}
table,
td {
mso-table-lspace: 0pt !important;
mso-table-rspace: 0pt !important;
}
table {
border-spacing: 0 !important;
border-collapse: collapse !important;
table-layout: fixed !important;
margin: 0 auto !important;
}
table table table {
table-layout: auto;
}
a {
text-decoration: none;
}
img {
-ms-interpolation-mode:bicubic;
}
</style>
</head>
<body width='100%' style='margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f5f6fa;'>
<center style='width: 100%; background-color: #f5f6fa;'>
<table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#f5f6fa'>
<tr>
<td style='padding: 40px 0;'>
<table style='width:100%;max-width:620px;margin:0 auto;'>
<tbody>
<tr>
<td style='text-align: center; padding-bottom:25px'>
<a href='#'><img style='height: 40px' src='$site_url/dashboard/admin/logo/logo.png' alt='logo'></a>
<p style='font-size: 14px; color: #6576ff; padding-top: 12px;'>--***--</p>
</td>
</tr>
</tbody>
</table>
<table style='width:100%;max-width:620px;margin:0 auto;background-color:#ffffff;'>
<tbody>
<tr>
<td style='padding: 30px 30px 20px'>
<p style='margin-bottom: 10px;'>Hi $fname $lname,</p>
<p style='margin-bottom: 10px;'>Complete your transfer with this OTP code <h2>$codeq</h2> <br>
This code is valid for 20 minute.
</p>
<br>
<p style='margin-bottom: 15px;'>Hope you'll enjoy the experience, we're here if you have any questions, drop us a line at <a style='color: #6576ff; text-decoration:none;' href='mailto:$site_email'>$site_email</a> anytime. </p>
</td>
</tr>
</tbody>
</table>
<table style='width:100%;max-width:620px;margin:0 auto;'>
<tbody>
<tr>
<td style='text-align: center; padding:25px 20px 0;'>
<p style='font-size: 13px;'>Copyright © $site_title. All rights reserved.</p>
<ul style='margin: 10px -4px 0;padding: 0;'>
<li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-b.png' alt='brand'></a></li>
<li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-e.png' alt='brand'></a></li>
<li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-d.png' alt='brand'></a></li>
<li style='display: inline-block; list-style: none; padding: 4px;'><a style='display: inline-block; height: 30px; width:30px;border-radius: 50%; background-color: #ffffff' href='#'><img style='width: 30px' src='$site_url/images/brand-c.png' alt='brand'></a></li>
</ul>
<p style='padding-top: 15px; font-size: 12px;'>This email was sent to you as a registered user of <a style='color: #6576ff; text-decoration:none;' href='$site_url'>$site_title</a>. To update your emails preferences <a style='color: #6576ff; text-decoration:none;' href='$site_url/login.php'>click here</a>.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>
";
$acc_no = $_SESSION['acc_no'];
$queri = " UPDATE account SET tmp_otp = '$codeq' WHERE acc_no ='$acc_no'";
$resulti = mysqli_query($connection, $queri) or die(mysqli_error($connection));
$subject = "Confirm Transfer OTP";
$reg_user->send_mail($row['email'], $message, $subject);
$acc_no = $_SESSION['acc_no'];
$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no = '$acc_no'");
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$phone = preg_replace('/[^0-9]/', '', $row['phone']);
$mobile_msg = "Dear " . $row['fname'] . ", Please use the One Time Passcode (OTP): " . $codeq . " to complete your Transfer process";
$reg_user->otp($phone,$mobile_msg);
header("Location: inter_otp.php");
}
}
?>
<?php include 'mheader.php';
?>
<title>Inter Bank Transfer</title>
<!-- content @s -->
<div class="nk-content nk-content-fluid">
<div class="container-xl wide-lg">
<div class="nk-content-body">
<div class="components-preview wide-md mx-auto">
<div class="nk-block-head nk-block-head-lg wide-sm"><br><br><br>
<div class="nk-block-head-content">
<h2 class="nk-block-title fw-normal">Inter Bank Transfer</h2>
</div>
</div><!-- .nk-block-head -->
<div class="nk-block nk-block-lg">
<?php
if(isset($_GET['error']))
{
?>
<div class='alert alert-danger'>
<button class='close' data-dismiss='alert'>×</button>
<strong>Unable to Authenticate. Transfer Failed.</strong>
</div>
<?php
}
?>
<?php
if(isset($_GET['errorcot']))
{
?>
<div class='alert alert-danger'>
<button class='close' data-dismiss='alert'>×</button>
<strong>Invalid COT Code! Transfer Failed.</strong>
</div>
<?php
}
?>
<?php
if(isset($_GET['errortax']))
{
?>
<div class='alert alert-danger'>
<button class='close' data-dismiss='alert'>×</button>
<strong>Invalid Tax Code! Transfer Failed.</strong>
</div>
<?php
}
?>
<?php
if(isset($_GET['errorotp']))
{
?>
<div class='alert alert-danger'>
<button class='close' data-dismiss='alert'>×</button>
<strong>Invalid TRANSFER OTP Code! Transfer Failed.</strong>
</div>
<?php
}
?>
<?php
if(isset($_GET['insufficient']))
{
?>
<div class='alert alert-warning'>
<button class='close' data-dismiss='alert'>×</button>
<strong>Sorry, your balance is insufficient to make the transfer, please transfer a lower amount.</strong>
</div>
<?php
}
?>
<?php
if(isset($_GET['amounterror']))
{
?>
<div class='alert alert-warning'>
<button class='close' data-dismiss='alert'>×</button>
<strong>Sorry, the amount is too little, please transfer a higher amount.</strong>
</div>
<?php
}
?>
<div class="card card-preview">
<div class="card-inner">
<div class="preview-block">
<span class="preview-title-lg overline-title">Transfer Form</span>
<form autocomplete="off" method="post" >
<?php if(isset($error)){ echo $error;}?>
<?php if(isset($errorcot)){ echo $errorcot;}?>
<?php if(isset($errortax)){ echo $errortax;}?>
<?php if(isset($errorpin)){ echo $errorpin;}?>
<?php if(isset($insufficient)){ echo $insufficient;}?>
<?php if(isset($amounterror)){ echo $amounterror;}?>
<?php if(isset($errorotp)){ echo $errorotp;}?>
<div class="row gy-4">
<div class="col-sm-6">
<div class="form-group">
<label class="form-label" for="default-05">Amount (<?php echo $row['currency']; ?>)</label>
<div class="form-control-wrap">
<div class="form-text-hint">
<span class="overline-title"><?php echo $row['currency']; ?></span>
</div>
<input name="amount" type="number" required class="form-control" id="default-01" placeholder="Amount (<?php echo $row['currency']; ?>)">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="form-label" for="default-01">Beneficiary Account Name</label>
<div class="form-control-wrap">
<input placeholder="Beneficiary Name" name="acc_name" type="text" required class="form-control" >
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="form-label" for="default-01">Beneficiary Account Number</label>
<div class="form-control-wrap">
<input placeholder="Beneficiary Account Number" name="acc_no" type="number" required class="form-control" >
</div>
</div>
</div>
<!--<div class="col-sm-6">
<div class="form-group">
<label class="form-label" for="default-01"> Bank Name</label>
<div class="form-control-wrap">
<input placeholder="Bank Name" name="bank_name" type="text" required class="form-control" >
</div>
</div>
</div>
<!-- hidden -->
<input class="form-control" placeholder="Bank Name" name="bank_name" value="<?php echo $site_title; ?>" type="text" hidden>
<input type="hidden" class="form-control" name="uname" value="<?php echo $row['email']; ?> "/>
<input class="form-control" placeholder="Bank Address" name="swift" type="hidden" value="DOMESTIC" required>
<input class="form-control" placeholder="Swiftcode" name="routing" type="hidden" value="DOMESTIC" required>
<input class="form-control" placeholder="Swiftcode" name="cout" type="hidden" value="Domestic-Transfer" required>
<input class="form-control" placeholder="Swiftcode" name="transtype" type="hidden" value="InterBank" required>
<!-- hidden -->
<div class="col-sm-6">
<div class="form-group">
<label class="form-label" for="default-textarea">Funds Description</label>
<div class="form-control-wrap">
<textarea class="form-control no-resize" placeholder="Funds Description" name="remarks" type="text" required>Funds Description</textarea>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="form-label" for="default-textarea">Account Type</label>
<div class="form-control-wrap">
<select name="type" class="form-control" id="default-06">
<option value="Savings">Savings</option>
<option value="Current">Current</option>
<option value="Checking">Checking</option>
</select>
</div>
</div>
</div>
</div>
<hr class="preview-hr">
<button class="btn btn-primary" type="submit" name="transfer"> Transfer</button>
</div>
</div>
</div><!-- .card-preview -->
</div><!-- .nk-block -->
</div><!-- .components-preview -->
</div>
</div>
</div>
<!-- content @e -->
<?php include 'mfooter.php';
?>