-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_payments.php
More file actions
47 lines (42 loc) · 1.15 KB
/
Copy pathadmin_payments.php
File metadata and controls
47 lines (42 loc) · 1.15 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
<?php
session_start();
require "config.php";
if (!isset($_SESSION["user"]) || $_SESSION["user"]["role"] !== "admin") {
die("Access denied");
}
$stmt = $pdo->query("
SELECT payments.*, users.full_name
FROM payments
JOIN users ON users.id = payments.student_id
ORDER BY payments.created_at DESC
");
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<h2>Payment Verification</h2>
<table border="1" cellpadding="6">
<tr>
<th>Student</th>
<th>Reference</th>
<th>Amount</th>
<th>Method</th>
<th>Status</th>
<th>Action</th>
</tr>
<?php foreach ($rows as $p): ?>
<tr>
<td><?= $p["full_name"] ?></td>
<td><?= $p["reference"] ?></td>
<td><?= $p["amount"] ?></td>
<td><?= $p["payment_method"] ?></td>
<td><?= strtoupper($p["status"]) ?></td>
<td>
<?php if ($p["status"] === "pending"): ?>
<a href="verify_payment.php?id=<?= $p["id"] ?>&action=paid">Mark Paid</a> |
<a href="verify_payment.php?id=<?= $p["id"] ?>&action=failed">Mark Failed</a>
<?php else: ?>
-
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</table>