-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_pickup_needs.php
More file actions
63 lines (55 loc) · 1.96 KB
/
check_pickup_needs.php
File metadata and controls
63 lines (55 loc) · 1.96 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
<?php
session_start();
if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] != 1) {
echo "User not authenticated or not a volunteer.";
var_dump($_SESSION);
exit(); // Prevent further code execution
}
include "connection.php";
// Fetch students without a confirmed pickup
$sql = "SELECT s.s_id, s.first_name, s.last_name, s.email, s.phone
FROM apath_student s
LEFT JOIN apath_pickup p ON s.s_id = p.s_id
WHERE p.s_id IS NULL OR p.approved = 0";
$result = mysqli_query($dbc, $sql);
mysqli_close($dbc);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Check Pickup Needs - Volunteer</title>
<link rel="stylesheet" href="apath.css">
</head>
<body>
<div class="container">
<h1>APATH</h1>
<?php
$current_page = basename($_SERVER['PHP_SELF']);
include "v_nav.php";
?>
<h2>Check Pickup Needs</h2>
<?php if (mysqli_num_rows($result) > 0): ?>
<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Action</th>
</tr>
<?php while ($row = mysqli_fetch_assoc($result)): ?>
<tr>
<td><?php echo htmlspecialchars($row['first_name'] . ' ' . $row['last_name']); ?></td>
<td><?php echo htmlspecialchars($row['email']); ?></td>
<td><?php echo htmlspecialchars($row['phone']); ?></td>
<td><a href="confirm_pickup.php?s_id=<?php echo $row['s_id']; ?>">Confirm Pickup</a></td>
</tr>
<?php endwhile; ?>
</table>
<?php else: ?>
<p>No students need pickup at the moment.</p>
<?php endif; ?>
</div>
</body>
</html>