-
Notifications
You must be signed in to change notification settings - Fork 0
/
transact_soul.php
180 lines (145 loc) · 7.69 KB
/
transact_soul.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?php
session_start();
if(!isset($_SESSION["user_email"]))
{
header('Location: index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="CSS/user_dashboard.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/css/all.min.css">
<link href='https://cdn.jsdelivr.net/npm/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<title>Document</title>
</head>
<body>
<?php
require_once('DBCONFIG/dbconfig.php');
if (class_exists('DATABASE_CONNECT'))
{
$obj_conn = new DATABASE_CONNECT;
$host = $obj_conn->connect[0];
$user = $obj_conn->connect[1];
$pass = $obj_conn->connect[2];
$db = $obj_conn->connect[3];
$conn = new mysqli($host,$user,$pass,$db);
if ($conn->connect_error)
{
die ("Cannot connect " .$conn->connect_error);
}
else
{
if (strpos($_SERVER['REQUEST_URI'], "?otp_true") !== false)
{
$email = $_SESSION["user_email"];
$length_code = 4;
$otp = substr(str_shuffle("123456789"),0, $length_code);
$sql = "update accounts set otp = '$otp', otptime = NOW() where user_email = '$email'";
$result = $conn->query($sql);
$sql2 = "select user_accounttype from accounts where user_email = '$email'";
$result2 = $conn->query($sql2);
$row2 = $result2->fetch_assoc();
if($row2['user_accounttype'] == 'block')
{
echo '<script type="text/javascript">alert("Your account is not activated. Try again later");
</script>';
echo ("<script>location.href='user_dashboard.php'</script>");
exit;
}
if ($result == true)
{
$msg = "Dear Customer, <br><br> $otp is the OTP for completing your Soul.pay transaction.
Never share this OTP with anyone including Bank officials.
<br><br>Thank you,<br>Soul.pay";
$headers = "";
$headers .= "From: Soul.pay <[email protected]> \r\n";
$headers .= "Reply-To:" . $email . "\r\n" ."X-Mailer: PHP/" . phpversion();
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$send = mail("$email","Soul.pay",$msg,$headers);
if(!$send)
{
echo '<script type="text/javascript">alert("OTP error. Please try again.");
</script>';
echo ("<script>location.href='user_dashboard.php'</script>");
}
else
{
echo '<script type="text/javascript">alert("Check your mail for OTP");
</script>';
echo ("<script>location.href='transact_soul.php?otp_one'</script>");
}
}
echo "Found";
}
}
$conn->close();
}
require_once ('dashboard.php');
?>
<div class="modal-container mod show" id="modal_container">
<div class="modal">
<button id="close" onclick="window.location.href = 'user_dashboard.php';" class="cross">
<svg data-testid="test-svg" width="14" height="100%" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard-Copy-43" transform="translate(-5.000000, -5.000000)"><g id="close"><path d="M5.57098982,5.65032324 C5.78968342,5.43162963 6.14425581,5.43162963 6.36294941,5.65032324 L6.36294941,5.65032324 L11.9059696,11.194303 L17.450383,5.65032324 C17.6447773,5.45592892 17.9465326,5.43432955 18.1647849,5.58552513 L18.2423426,5.65032324 C18.4610362,5.86901684 18.4610362,6.22358923 18.2423426,6.44228283 L18.2423426,6.44228283 L12.6979696,11.985303 L18.2423426,17.5297164 C18.4367369,17.7241107 18.4583363,18.025866 18.3071407,18.2441184 L18.2423426,18.321676 C18.023649,18.5403696 17.6690766,18.5403696 17.450383,18.321676 L17.450383,18.321676 L11.9059696,12.777303 L6.36294941,18.321676 C6.1685551,18.5160703 5.86679977,18.5376697 5.64854745,18.3864741 L5.57098982,18.321676 C5.35229621,18.1029824 5.35229621,17.74841 5.57098982,17.5297164 L5.57098982,17.5297164 L11.1149696,11.985303 L5.57098982,6.44228283 C5.3765955,6.24788852 5.35499614,5.94613319 5.50619171,5.72788087 Z" id="Combined-Shape"></path></g></g></svg>
</button>
<h2>SOUL GATEWAY</h2>
<form action="" method="post">
<div class="form">
<div class="card space icon-relative">
<label class="label">Recipient: <span style="color: red;">*</span></label>
<input type="text" class="input" name="lastname" placeholder="Name" pattern="[A-Za-z]{1,32}" title="Only Characters" required>
<i class="far fa-user"></i>
</div>
<div class="card space icon-relative">
<label class="label">Account Number: <span style="color: red;">*</span></label>
<input type="text" class="input" name="account_no" data-mask="000000000" placeholder="**********" required>
<i class="far fa-credit-card"></i>
</div>
<div class="card space icon-relative">
<label class="label">Amount: <span style="color: red;">*</span></label>
<input type="text" class="input" name="main_amount" data-mask="00000" placeholder="" required>
<i class="bx bx-sm bx-rupee far"></i>
</div>
<div class="card space icon-relative">
<label class="label">Remark:</label>
<input type="text" name="reason" class="input" required>
</div>
<div class="card-grp space">
<div class="card-item icon-relative">
<label class="label">OTP: <span style="color: red;">*</span></label>
<input type="text" class="input" name="otp" data-mask="0000" placeholder="####" required>
<i class="fas fa-lock"></i>
</div>
<div class="card-item1 space1">
<a href="otp_soul.php" class="resend" onclick="return clearForm(this.form);">Resend?</a>
</div>
<script>
function clearForm(form) {
var $f = $(form);
var $f = $f.find(':input').not(':button, :submit, :reset, :hidden');
$f.val('').attr('value','').removeAttr('checked').removeAttr('selected');
}
</script>
</div>
<div class="btn">
<button type="submit" name="transfer_soul_bank" style="background-color: transparent; outline: none; background-repeat: no-repeat ; border: none; overflow: hidden; color: #f8f8f8; font-size: 1rem; cursor: pointer; font-family: 'Quicksand', sans-serif;">
Transfer
</button>
</div>
</div>
</form>
</div>
</div>
<?php
require_once ('transact_soul_pay.php');
?>
<?php
require ('script.php');
?>
</body>
</html>