-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransaction.php
More file actions
127 lines (116 loc) · 4.32 KB
/
transaction.php
File metadata and controls
127 lines (116 loc) · 4.32 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Transaction</title>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
<link rel="shortcut icon" href="img/logo.png" type="image/x-icon">
<style>
<?php include 'style.css'; ?>
</style>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" rel="stylesheet">
</head>
<body style="background-color: #77adff;">
<?php include 'config.php'; ?>
<div id="lock"><br>
<p style="color:black; margin-top: 25px;" class="lock">
<p>We recommend users to use the site on laptop/desktop.</p>
</div>
<nav class="navbar bg-dark navbar-expand-lg navbar-dark sticky-top">
<a class="navbar-brand title" href="index.php">GOLDEN <span class="s1">HORIZON</span> BANK</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 ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="customers.php">Transfer Money</a>
</li>
<li class="nav-item">
<a class="nav-link" href="transaction.php">Transaction History</a>
</li>
</ul>
</div>
</nav>
<div class="main2">
<div class="lds-spinner">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<section class="c3">
<h1 class="text-center">Transaction History</h1>
</section>
<?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 align-middle mb-0">
<thead>
<tr>
<th>Sender</th>
<th>Reciever</th>
<th>Amount</th>
<th>Status</th>
</tr>
</thead>
<?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 '<span class="badge badge-success rounded-pill d-inline">Success</span>';
} else {
echo '<span class="badge badge-danger rounded-pill d-inline">Failed</span>';
} ?>
<?php echo '</td>
</tr>';
}
}
}
echo "</tbody>";
?>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
<script>
const loader = document.querySelector(".main2");
const main = document.querySelector(".super");
function hide() {
loader.style.display = "none";
}
function show() {
main.classList.toggle('done');
}
window.addEventListener("load", () => {
setTimeout(hide, 1500);
setTimeout(show, 1500);
})
</script>
</body>
</html>