forked from makdosx/online-banking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
640 lines (459 loc) · 20.5 KB
/
home.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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
<?php
/*
* Copyright (c) 2018 Barchampas Gerasimos <makindosx@gmail.com>
* 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();
if(!isset($_SESSION['login']))
{
header('Location: index.php');
}
$idletime=898;//after 60 seconds the user gets logged out
if (time()-$_SESSION['timestamp']>$idletime)
{
session_destroy();
session_unset();
}
else
{
$_SESSION['timestamp']=time();
}
?>
<!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 HTTP-EQUIV="REFRESH" content="900; url=/logout.php">
<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="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="assets/css/lib/vector-map/jqvmap.min.css" rel="stylesheet">
<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> -->
<!--for big logout icon on hover -->
<script>
function bigImg(x) {
x.style.height = "36px";
x.style.width = "36px";
}
function normalImg(x) {
x.style.height = "32px";
x.style.width = "32px";
}
</script>
<style>
.modal {
text-align: center;
padding: 0!important;
}
.modal:before {
content: '';
display: inline-block;
height: 80%;
vertical-align: middle;
margin-right: -4px; /* Adjusts for spacing */
}
.modal-dialog {
display: inline-block;
text-align: left;
vertical-align: middle;
}
.modal-content {
background-color: silver;
}
.modal-body {
background-color: white;
}
.modal-backdrop {
background-color: grey !important;
opacity:`1;
/*
background-image: url(images/bg2.jpg);
opacity:1 !important;
*/
}
</style>
</head>
<body>
<!-- Left Panel -->
<aside id="left-panel" class="left-panel">
<nav class="navbar navbar-expand-sm navbar-default">
<div class="navbar-header">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-menu" aria-controls="main-menu" aria-expanded="false" aria-label="Toggle navigation">
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand" href="home.php"> EasyBank </a>
<a class="navbar-brand active" href="home.php"><img src="images/logo5.png" alt="Logo"></a>
</div>
<div id="main-menu" class="main-menu collapse navbar-collapse">
<ul class="nav navbar-nav">
<h3 class="menu-title"> statements </h3><!-- /.menu-title -->
<li class="menu-item-has-children dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-handshake-o"></i> Transactions </a>
<ul class="sub-menu children dropdown-menu">
<li><i class="fa fa fa-money"></i><a href="transac_deposits.php"> Deposits </a></li>
<li><i class="fa fa fa fa-credit-card"></i><a href="transac_withdrawals.php"> Withdrawals </a></li>
</ul>
</li>
<li class="menu-item-has-children dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="menu-icon fa fa-credit-card-alt"></i> Transfers</a>
<ul class="sub-menu children dropdown-menu">
<li><i class="fa fa-credit-card-alt"></i><a href="transf_easy_bank.php?i_code_true"> Easy Bank </a></li>
<li><i class="fa fa-credit-card"></i><a href="transf_anyone_bank.php?i_code_true"> Anyone Bank </a></li>
</ul>
</li>
<h3 class="menu-title"> Settings </h3><!-- /.menu-title -->
<li>
<a href="account.php"> <i class="menu-icon fa fa-user"></i> Account </a>
</li>
<li>
<a href="notifications.php"> <i class="menu-icon ti-bell"></i> Notifications </a>
</li>
<li>
<a href="statics.php"> <i class="menu-icon fa fa-bar-chart"></i> Statics </a>
</li>
<h3 class="menu-title"> Extras </h3><!-- /.menu-title -->
<li class="menu-item-has-children dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="menu-icon fa fa-cogs"></i> Services </a>
<ul class="sub-menu children dropdown-menu">
<li><i class="menu-icon fa fa-info"></i><a href="informations.php"> Informations </a></li>
<li><i class="menu-icon fa fa-comments"></i><a href="support.php"> Support </a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
</aside><!-- /#left-panel -->
<!-- Left Panel -->
<!-- Right Panel -->
<div id="right-panel" class="right-panel">
<!-- Header-->
<header id="header" class="header">
<div class="header-menu">
<div class="col-sm-7">
<a id="menuToggle" class="menutoggle pull-left"><i class="fa fa fa-tasks"></i></a>
<div class="header-left">
<?php echo date("d.m.Y"); ?>
<div class="form-inline">
<form class="search-form">
<input class="form-control mr-sm-2" type="text" placeholder="Search ..." aria-label="Search">
<button class="search-close" type="submit"><i class="fa fa-close"></i></button>
</form>
</div>
<?php echo "Auto logout in "; ?> <span id="countdown"></span>
<!--for countdown to autologout -->
<script>
function countdown( elementName, minutes, seconds )
{
var element, endTime, hours, mins, msLeft, time;
function twoDigits( n )
{
return (n <= 9 ? "0" + n : n);
}
function updateTimer()
{
msLeft = endTime - (+new Date);
if ( msLeft < 1000 ) {
element.innerHTML = "countdown's over!";
} else {
time = new Date( msLeft );
hours = time.getUTCHours();
mins = time.getUTCMinutes();
element.innerHTML = (hours ? hours + ':' + twoDigits( mins ) : mins) + ':' + twoDigits( time.getUTCSeconds() );
setTimeout( updateTimer, time.getUTCMilliseconds() + 500 );
}
}
element = document.getElementById( elementName );
endTime = (+new Date) + 1000 * (60*minutes + seconds) + 500;
updateTimer();
}
countdown( "countdown", 15, 0 );
</script>
</div>
</div>
<div class="col-sm-5">
<div class="user-area dropdown float-right">
<!--
<a href="javascript:logout();">
<img onmouseover="bigImg(this)" onmouseout="normalImg(this)" class="user-avatar rounded-circle" src="images/menu/logout.png" title="Logout">
</a>
-->
<a href="#" data-toggle="modal" data-target="#logoutModal">
<img onmouseover="bigImg(this)" onmouseout="normalImg(this)" class="user-avatar rounded-circle" src="images/menu/logout.png" title="Logout">
</a>
<!-- Modal -->
<div class="modal" id="logoutModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4>Log Out <i class="fa fa-lock"></i></h4>
</div>
<div class="modal-body">
<p><i class="fa fa-question-circle"></i> Are you sure you want to Logout? <br /></p>
<div class="actionsBtns">
<form>
<button class="btn btn-default btn-lg" data-dismiss="modal"> Cancel
<i class="fa fa-close"></i>
</button>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<button type="submit" class="btn btn-default btn-primary btn-lg" data-dismiss="modal" onclick="window.location.href='logout.php'"/> Logout
<i class="fa fa-check"></i>
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<script>
function logout()
{
if (confirm("Do you want logout?"))
{
location.href='logout.php';
}
}
</script>
</div>
</div>
</div>
</header><!-- /header -->
<!-- Header-->
<?php
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 = $_SESSION['login'];
$sql_details_user = "select lastname, firstname, account_number, IBAN
from customers
where email = '$email'";
$result_details_user = $conn->query($sql_details_user);
$row_details_user = $result_details_user->fetch_assoc();
$lastname = ucfirst($row_details_user['lastname']);
$firstname = ucfirst($row_details_user['firstname']);
$acc_number = $row_details_user['account_number'];
$iban = $row_details_user['IBAN'];
echo "<div class='breadcrumbs'>
<div class='col-sm-12'>
<div class='page-header float-left'>
<div class='page-title'>
<h1> Welcome to Easy Bank <b> $lastname $firstname <b> </h1>
</div>
</div>
</div>";
$sql0 = "select total_balance from accounts where email = '".$_SESSION['login']."'";
$result0 = $conn->query($sql0);
while ($row0 = $result0->fetch_assoc())
{
echo "<div class='col-sm-12'>
<div class='page-header float-right'>
<div class='page-title'>
<ol class='breadcrumb text-right'>
<li> Account Number: $acc_number </li>
<li> IBAN: $iban </li>
<li class='active'> Your balance: {$row0['total_balance']} <i class='fa fa-euro'></i> </li>
</ol>
</div>
</div>
</div>
</div>";
} // end ehile of balance
echo '<div class="content mt-3">';
echo "<div class='col-sm-12'>
<div class='alert alert-success alert-dismissible fade show' role='alert'>
<span class='badge badge-pill badge-success'>
You have successfully joined $lastname $firstname
</span>
<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
</div>
</div>";
} // end of else connect
$conn->close();
} // end of if class connect exists
?>
<div align="center">
<p> <h3> Available credit and debit cards </h3> </p>
<div class="col-xl-3 col-lg-6">
<div class="card">
<div class="card-body">
<div class="stat-widget-one">
<div class="stat-icon dib"><i class="fa fa-cc-visa text-success border-success"></i></div>
<div class="stat-content dib">
<div class="stat-text"> Visa </div>
<div class="stat-digit"> <i class="fa fa-euro"></i> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card">
<div class="card-body">
<div class="stat-widget-one">
<div class="stat-icon dib"><i class="fa fa-cc-stripe text-primary border-primary"></i></div>
<div class="stat-content dib">
<div class="stat-text"> Stripe </div>
<div class="stat-digit"> <i class="fa fa-euro"></i> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card">
<div class="card-body">
<div class="stat-widget-one">
<div class="stat-icon dib"><i class="fa fa-cc-paypal text-warning border-warning"></i></div>
<div class="stat-content dib">
<div class="stat-text"> Paypal </div>
<div class="stat-digit"> <i class="fa fa-euro"></i> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card">
<div class="card-body">
<div class="stat-widget-one">
<div class="stat-icon dib"><i class="fa fa-cc-jcb text-info border-info"></i></div>
<div class="stat-content dib">
<div class="stat-text"> Jcb </div>
<div class="stat-digit"> <i class="fa fa-euro"></i> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card">
<div class="card-body">
<div class="stat-widget-one">
<div class="stat-icon dib"><i class="fa fa-cc-mastercard text-success border-success"></i></div>
<div class="stat-content dib">
<div class="stat-text"> Mastercard </div>
<div class="stat-digit"> <i class="fa fa-euro"></i> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card">
<div class="card-body">
<div class="stat-widget-one">
<div class="stat-icon dib"><i class="fa fa-cc-discover text-primary border-primary"></i></div>
<div class="stat-content dib">
<div class="stat-text"> Discover </div>
<div class="stat-digit"> <i class="fa fa-euro"></i> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card">
<div class="card-body">
<div class="stat-widget-one">
<div class="stat-icon dib"><i class="fa fa-cc-amex text-warning border-warning"></i></div>
<div class="stat-content dib">
<div class="stat-text"> American Express </div>
<div class="stat-digit"> <i class="fa fa-euro"></i> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card">
<div class="card-body">
<div class="stat-widget-one">
<div class="stat-icon dib"><i class="fa fa-cc-diners-club text-info border-info"></i></div>
<div class="stat-content dib">
<div class="stat-text"> Diners Club </div>
<div class="stat-digit"> <i class="fa fa-euro"></i> </div>
</div>
</div>
</div>
</div>
</div>
<div>
</div> <!-- .content -->
</div><!-- /#right-panel -->
<!-- Right Panel -->
<script src="assets/js/vendor/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/lib/chart-js/Chart.bundle.js"></script>
<script src="assets/js/dashboard.js"></script>
<script src="assets/js/widgets.js"></script>
<script src="assets/js/lib/vector-map/jquery.vmap.js"></script>
<script src="assets/js/lib/vector-map/jquery.vmap.min.js"></script>
<script src="assets/js/lib/vector-map/jquery.vmap.sampledata.js"></script>
<script src="assets/js/lib/vector-map/country/jquery.vmap.world.js"></script>
<script>
( function ( $ ) {
"use strict";
jQuery( '#vmap' ).vectorMap( {
map: 'world_en',
backgroundColor: null,
color: '#ffffff',
hoverOpacity: 0.7,
selectedColor: '#1de9b6',
enableZoom: true,
showTooltip: true,
values: sample_data,
scaleColors: [ '#1de9b6', '#03a9f5' ],
normalizeFunction: 'polynomial'
} );
} )( jQuery );
</script>
</body>
</html>