-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatements.php
More file actions
102 lines (95 loc) · 3.68 KB
/
statements.php
File metadata and controls
102 lines (95 loc) · 3.68 KB
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
<?php
session_start();
if(!isset($_SESSION['userId'])){ header('location:login.php');}
?>
<!DOCTYPE html>
<html>
<head>
<title>Banking</title>
<?php require 'assets/autoloader.php'; ?>
<?php require 'assets/db.php'; ?>
<?php require 'assets/function.php'; ?>
<?php
$error = "";
if (isset($_POST['userLogin']))
{
$error = "";
$user = $_POST['email'];
$pass = $_POST['password'];
$result = $con->query("select * from userAccounts where email='$user' AND password='$pass'");
if($result->num_rows>0)
{
session_start();
$data = $result->fetch_assoc();
$_SESSION['userId']=$data['id'];
$_SESSION['user'] = $data;
header('location:index.php');
}
else
{
$error = "<div class='alert alert-warning text-center rounded-0'>Username or password wrong try again!</div>";
}
}
?>
</head>
<body style="background:#000000;background-size: 100%">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">
<img src="images/logo1.jpg" width="30" height="30" class="d-inline-block align-top" alt="">
<!-- <i class="d-inline-block fa fa-building fa-fw"></i> --><?php echo bankname; ?>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item ">
<a class="nav-link " href="index.php">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item "> <a class="nav-link" href="accounts.php">Accounts</a></li>
<li class="nav-item active"> <a class="nav-link" href="statements.php">Account Statements</a></li>
<li class="nav-item "> <a class="nav-link" href="transfer.php">Funds Transfer</a></li>
<!-- <li class="nav-item "> <a class="nav-link" href="profile.php">Profile</a></li> -->
</ul>
<?php include 'sideButton.php'; ?>
</div>
</nav><br><br><br>
<div class="container">
<div class="card w-75 mx-auto">
<div class="card-header text-center">
Transaction made against you account
</div>
<div class="card-body">
<?php
$array = $con->query("select * from transaction where userId = '$userData[id]' order by date desc");
if ($array ->num_rows > 0)
{
while ($row = $array->fetch_assoc())
{
if ($row['action'] == 'withdraw')
{
echo "<div class='alert alert-secondary'>You withdraw Rs.$row[debit] from your account at $row[date]</div>";
}
if ($row['action'] == 'deposit')
{
echo "<div class='alert alert-success'>You deposit Rs.$row[credit] in your account at $row[date]</div>";
}
if ($row['action'] == 'deduction')
{
echo "<div class='alert alert-danger'>Deduction have been made for Rs.$row[debit] from your account at $row[date] in case of $row[other]</div>";
}
if ($row['action'] == 'transfer')
{
echo "<div class='alert alert-warning'>Transfer have been made for Rs.$row[debit] from your account at $row[date] in account no.$row[other]</div>";
}
}
}
?>
</div>
<div class="card-footer text-muted">
<?php echo bankname ?>
</div>
</div>
</div>
</body>
</html>