-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent_pickup.php
More file actions
63 lines (55 loc) · 2.06 KB
/
student_pickup.php
File metadata and controls
63 lines (55 loc) · 2.06 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'] != 2) {
header("Location: login.php");
exit();
}
include "connection.php";
$user_id = $_SESSION['user_id'];
// Fetch volunteer information if pickup is approved
$sql = "SELECT v.first_name, v.last_name, v.email, v.phone, v.car_manufacture, v.car_model, v.car_year
FROM apath_pickup p
JOIN apath_volunteer v ON p.v_id = v.v_id
WHERE p.s_id = ? AND p.approved = 1";
$stmt = mysqli_prepare($dbc, $sql);
mysqli_stmt_bind_param($stmt, "i", $user_id);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
$volunteer_info = mysqli_fetch_assoc($result);
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>APATH Pickup Information - STUDENT</title>
<link rel="stylesheet" href="apath.css">
</head>
<body>
<div class="container">
<h1>APATH</h1>
<?php
$current_page = basename($_SERVER['PHP_SELF']);
include "apath_nav.php";
?>
<br>
<?php if ($volunteer_info): ?>
<h2>Pickup Information</h2>
<p>Name: <?php echo htmlspecialchars($volunteer_info['first_name'] . ' ' . $volunteer_info['last_name']); ?></p>
<p>Email: <?php echo htmlspecialchars($volunteer_info['email']); ?></p>
<p>Phone: <?php echo htmlspecialchars($volunteer_info['phone']); ?></p>
<p>Car Manufacture: <?php echo htmlspecialchars($volunteer_info['car_manufacture']); ?></p>
<p>Car Model: <?php echo htmlspecialchars($volunteer_info['car_model']); ?></p>
<p>Car Year: <?php echo htmlspecialchars($volunteer_info['car_year']); ?></p>
<?php else: ?>
<h2>Pickup Information</h2>
<p>
We are working on finding a volunteer to pick you up from the airport; <br>
Information will be available later.
</p>
<?php endif; ?>
<p class="footer"><a href="#">Covid Information and Guidelines</a></p>
</div>
</body>
</html>