-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtransactions.php
149 lines (124 loc) · 5.62 KB
/
transactions.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" sizes="180x180" href="statics/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="statics/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="statics/favicon-16x16.png">
<link rel="manifest" href="statics/site.webmanifest">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css"
integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<title>Contact us - Sparks Bank</title>
</head>
<body style="background-color:#212529;">
<?php include 'spin.php'; ?>
<style>
.nav-link:hover {
text-decoration: underline;
}
</style>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed fixed-top"
style="font-family:candara; font-size:18px; box-shadow: 0px 0px 10px 0px black;">
<div class="container-fluid">
<a href="index.php"><img src="statics\logo.png" alt=""
style="height: 80px; margin-left:25px; margin-top:10px;"></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<b>
<ul class="navbar-nav ">
<li class="nav-item nav-links" style="margin-left:15px;">
<a class="nav-link text-nowrap" aria-current="page" href="index.php">Home</a>
</li>
<li class="nav-item" style="margin-left:15px; ">
<a class="nav-link text-nowrap" href="send_money.php">Send Money</a>
</li>
<li class="nav-item" style="margin-left:15px;">
<a class="nav-link text-nowrap" href="all_cust.php">View All Customers</a>
</li>
<li class="nav-item" style="margin-left:15px;">
<a class="nav-link text-nowrap active" href="transactions.php">Transactions</a>
</li>
<li class="nav-item" style="margin-left:15px;">
<a class="nav-link text-nowrap" href="contact_us.php">Contact Us</a>
</li>
<li class="nav-item" style="margin-left:15px; margin-right:75px;">
<a class="nav-link text-nowrap" href="about_us.php">About Us</a>
</li>
</ul>
</b>
</div>
</nav>
<style>
th,
td {
text-align: center;
}
</style>
<center>
<div class="container" style="margin-top: 10%; padding:10px 80px 10px 80px; ">
<div
style="width:80%; background-color:rgba(0,0,0,.5); padding:5px 5px 5px 5px; border-radius:30px; box-shadow: 2px 2px 10px gray;">
<h1 style=" color:white;">All Customers</h1>
</div>
<?php
$conn = mysqli_connect($servername, $username, $password, $database);
if(!$conn){
die("Connection not established: ".mysqli_connect_error());
}else{
$sql = "SELECT * FROM `transactions`";
$result = mysqli_query($conn, $sql);
?>
<table class="table table-dark" style="margin-top: 30px;">
<thead>
<tr>
<th scope="col">Sender</th>
<th scope="col">Reciever</th>
<th scope="col">Amount</th>
<th scope="col">Status</th>
</tr>
</thead>
<style>
.mybtn {
box-shadow: 2px 2px 10px black;
border-radius: 30px;
font-weight: bold;
background-color: lightgreen;
color: green;
}
.mybtn:active {
background-color: green;
color: lightgreen;
}
</style>
<?php
echo "<tbody>";
while($row = mysqli_fetch_assoc($result)){
if(!(empty($row['sender']) && empty($row['receiver']) && empty($row['amount'])))
{echo '
<tr>
<td>'.$row['sender'].'</td>
<td>'.$row['receiver'].'</td>
<td>'.$row['amount'].'</td>
<td>'; ?> <?php if($row['status'] == "succeed"){echo '<b><p style="color:green;">Succeed</p></b>';}else{echo '<b><p style="color:red;">Failed</p></b>';} ?>
<?php echo '</td>
</tr>';}
}
}
echo "</tbody>";
?>
</div>
</center>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous">
</script>
</body>
</html>