File Manager
Viewing File: imfcode.php
<?php
session_start();
require_once '../include/dbconfig.php';
include_once ('../include/session.php');
require_once '../include/class.user.php';
if (!isset($_SESSION['acc_no'])) {
header("Location: login.php");
exit();
}
$url != 'http://secure..com/tax_auth.php';
if ($_SERVER['HTTP_REFERER'] == $url) {
header('Location: wire.php'); //redirect to some other page
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);
$query = "SELECT * FROM account WHERE acc_no='$acc_no'";
$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
$count = mysqli_num_rows($result);
include 'admin/dbconnect.php';
if(isset($_POST['code'])){
$tax = $row['tax'];
$sub = $_POST['tax'];
if($sub !== $tax){
header("Location: wire.php?errorimf");
}
else {
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($connection, $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 Wire 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);
$reg_user->send_mail($row['email'], $message, $subject);
$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: smsotp_auth.php");
}
}
?>
<?php include 'mheader.php';
?>
<title>IMF Auth</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">IMF Code</h2>
</div>
</div><!-- .nk-block-head -->
<div class="nk-block nk-block-lg">
<div class="card card-preview">
<div class="card-inner">
<div class="preview-block">
<span class="preview-title-lg overline-title">IMF Code Required</span>
<form autocomplete="off" method="post" >
<p>
IMF is required. Kindly insert your IMF Code<br /> to facilitate the transfer of your funds.
</p>
<div class="row gy-4">
<div class="col-sm-6">
<div class="form-group">
<label class="form-label" for="default-01">IMF Code</label>
<div class="form-control-wrap">
<input placeholder="IMF Code" name="tax" type="text" required class="form-control" >
</div>
</div>
</div>
<!-- hidden --
<input type="hidden" name="email" value="<?php echo $row['email']; ?>">
<input type="hidden" name="amount" value="<?php echo $rows['amount']; ?>">
<input type="hidden" name="acc_no" value="<?php echo $rows['acc_no']; ?>">
<input type="hidden" name="acc_name" value="<?php echo $rows['acc_name']; ?>">
<input type="hidden" name="bank_name" value="<?php echo $rows['bank_name']; ?>">
<input type="hidden" name="swift" value="<?php echo $rows['swift']; ?>">
<input type="hidden" name="cout" value="<?php echo $rows['cout']; ?>">
<input type="hidden" name="transtype" value="<?php echo $rows['transtype']; ?>">
<input type="hidden" name="routing" value="<?php echo $rows['routing']; ?>">
<input type="hidden" name="type" value="<?php echo $rows['type']; ?>">
<input type="hidden" name="remarks" value="<?php echo $rows['remarks']; ?>">
<!-- hidden -->
</div>
<hr class="preview-hr">
<button class="btn btn-primary" type="submit" name="code"> Confirm</button>
<br>
<p>This page will expire in 1 minute <h5 style="color: red;">0</h5></p>
</div>
</div>
</div><!-- .card-preview -->
</div><!-- .nk-block -->
<script>
let counter = document.querySelector('h5');
let count = 1;
setInterval(()=>{
counter.innerText = count;
count++
if(count > 60) location.replace('dashboard/wire.php?timer')
},1000)
</script>
</div><!-- .components-preview -->
</div>
</div>
</div>
<!-- content @e -->
<?php include 'mfooter.php';
?>