-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhistory.php
More file actions
58 lines (50 loc) · 1.67 KB
/
history.php
File metadata and controls
58 lines (50 loc) · 1.67 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
<!DOCTYPE html>
<html lang="en">
<head>
<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>History</title>
</head>
<body background="bkgimg.jpg" class="bg">
<!-- Connection to database -->
<?php
include 'dbconnect.php';
$sql = "SELECT * FROM transaction_history";
$result = $conn->query($sql);
?>
<!-- Navbar -->
<?php include 'navbar.php' ?>
<!-- Table of customers -->
<div class="container py-3">
<table class="table table-dark table-striped table-hover">
<thead>
<tr>
<th>Transaction Id</th>
<th>From</th>
<th>To</th>
<th>Amount</th>
<th>Time</th>
</tr>
</thead>
<tbody>
<?php
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) { ?>
<tr>
<td><?php echo $row["id"]; ?></td>
<td><?php echo $row["from_acc"] . " : " . $row["from_name"]; ?></td>
<td><?php echo $row["to_acc"] . " : " . $row["to_name"]; ?></td>
<td><?php echo "$" . $row["amount"]; ?></td>
<td><?php echo $row["time_of_transaction"]; ?></td>
</tr>
<?php }
} else {
echo "No transactions yet.";
}
?>
</tbody>
</table>
</div>
</body>
</html>