-
Notifications
You must be signed in to change notification settings - Fork 41
/
index.php
354 lines (240 loc) · 11.7 KB
/
index.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<?php
/*
* Copyright (c) 2018 Barchampas Gerasimos <[email protected]>
* online-banking a online banking system for local businesses.
*
* online-banking is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* online-banking is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
session_start();
?>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> Easybank </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="favicon.png" type="image/png">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="assets/css/normalize.css">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/themify-icons.css">
<link rel="stylesheet" href="assets/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/css/cs-skin-elastic.css">
<!-- <link rel="stylesheet" href="assets/css/bootstrap-select.less"> -->
<link rel="stylesheet" href="assets/scss/style.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/html5shiv/3.7.3/html5shiv.min.js"></script> -->
<style>
body
{
background-image: url("images/bg1.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
background-color: ;
}
.alert
{
max-width: 550px;
margin: auto;
}
</style>
</head>
<body>
<div class="sufee-login d-flex align-content-center flex-wrap">
<div class="container">
<div class="login-content">
<div class="login-logo">
<img src="images/logo4.png" height="130" width="27%">
<img src="images/bg5.png" height="130" width="33%">
<img src="images/logo5.png" height="130" width="27%">
</div>
<div class="login-form" style="background-color:white;
border-style:solid; border-width:0.5em;
border-radius: 2em;">
<form action="" method="post" >
<h3 align="center">
<font color="black"> <b> <i>
$ $ EASYBANK € €
</i> </b> </font>
</h3> <hr>
<div class="form-group">
<label>Email address</label>
<div class="input-group">
<span class="input-group-addon col-sm-1"">
<i class="glyphicon glyphicon-user" style="font-size:20px; vertical-align: middle;"></i>
</span>
<input type="email" name="email" class="form-control" style="font-size:17px; font-weight:bold;"
placeholder="Email" required>
</div>
</div>
<div class="form-group">
<label>Password</label>
<div class="input-group">
<span class="input-group-addon col-sm-1">
<i class="glyphicon glyphicon-lock" style="font-size:20px; vertical-align: middle;"></i>
</span>
<input type="password" name="password" class="form-control" style="font-size:17px; font-weight:bold; color:red;"
placeholder="Password" required>
</span>
</div>
</div>
<div class="form-group">
<label>Pin</label>
<div class="input-group">
<span class="input-group-addon col-sm-1">
<i class="glyphicon glyphicon-info-sign" style="font-size:20px; vertical-align: middle;"></i>
</span>
<input type="password" name="pin" class="form-control" style="font-size:17px; font-weight:bold; color:red;"
placeholder="Pin" required>
</div>
</div>
<div class="checkbox" align="center">
<!--
<label>
<input type="checkbox"> Remember Me
</label>
-->
</div>
<br>
<div class="wrapper">
<span class="group-btn">
<button type="submit" name="submit_login" class="btn btn-success btn-flat m-b-30 m-t-30"> Sign in <i class="fa fa-sign-in"></i></button>
</span>
</div>
<br><br>
<div class="register-link m-t-15 text-center">
<p>Don't have account ? <a href="page-register.php"> Sign Up Here</a></p>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="assets/js/vendor/jquery-2.1.4.min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>
<?php
error_reporting(E_ALL | E_WARNING | E_NOTICE);
ini_set('display_errors', TRUE);
if (isset($_POST['submit_login']))
{
require_once('__SRC__/secure_data.php');
if (class_exists('SECURE_INPUT_DATA_AVAILABLE'))
{
$obj_secure_data = new SECURE_INPUT_DATA;
$email = $obj_secure_data->SECURE_DATA_ENTER($_POST['email']);
$password = $obj_secure_data->SECURE_DATA_ENTER($_POST['password']);
$pin = $obj_secure_data->SECURE_DATA_ENTER($_POST['pin']);
require_once('__SRC__/connect.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
{
$email = $conn->real_escape_string($email);
$password = $conn->real_escape_string($password);
$pin = $conn->real_escape_string($pin);
$password = md5($password);
$sql = "select email,password,pin,account_type from customers where email='$email'";
$result = $conn->query($sql);
$count = $result->num_rows;
if($count == 1)
{
while ($row = $result->fetch_assoc())
{
if ($row['account_type'] != 'active')
{
echo"
<div class='alert alert-danger' role='alert'>
<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
<strong> Your account is not activated </strong>.
</div>";
}
else if ($row['account_type'] == 'active')
{
if ($row['email'] != $email)
{
echo"
<div class='alert alert-danger' role='alert'>
<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
<strong> Your Login </strong> Email is invalid.
</div>";
}
if ($row['password'] != $password)
{
echo"
<div class='alert alert-danger' role='alert'>
<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
<strong> Your Login </strong> Password is invalid.
</div>";
}
if ($row['pin'] != $pin)
{
echo"
<div class='alert alert-danger' role='alert'>
<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
<strong> Your Login </strong> Pin is invalid.
</div>";
}
if ($row['email'] == $email && $row['password'] == $password && $row['pin'] == $pin)
{
$_SESSION['login'] = $email;
$_SESSION['timestamp']=time();
echo ("<script>location.href='home.php'</script>");
}
} // end of else if activate
} // end of while
} // end of count
else
{
} // end of else error login messages
}// end else class connect
$conn->close();
} // end if class connect exists
} // end if class secure_data
else
{
// exit;
} // end else class secure_data
} // end of isset submit_login
?>