forked from Noor-Alina/COMP4150-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
student_status.php
116 lines (105 loc) · 5.29 KB
/
student_status.php
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
<?php
session_start();
require_once 'database.php';
if (isset($_SESSION['advisor'])) {
header("Location: advisor.php");
exit();
} elseif (isset($_SESSION['student'])) {
header("Location: student.php");
exit();
} elseif (!isset($_SESSION['staff'])) {
header("Location: index.php");
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Staff Home Page</title>
<link rel="stylesheet" href="css/styles.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
</head>
<body class="d-flex flex-column align-content-stretch vh-100">
<?php
if (isset($_SESSION['error'])) {
echo "<div class='alert alert-danger' role='alert'>";
echo "{$_SESSION['error']}";
echo '</div>';
unset($_SESSION['error']); // clear the error in the $_SESSION array
}
?>
<!-- Header -->
<div class="container">
<header class="d-flex flex-wrap justify-content-center py-3 mb-4">
<!-- Logo -->
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
<i class="bi bi-circle-fill dark-blue-text" style="font-size: 3rem;"></i>
<span class="fs-1 fw-bold dark-blue-text" style="padding-left: 0.5rem;">UWindsor HMS</span>
</a>
<!-- Tabs -->
<ul class="nav nav-tabs my-auto ms-4 mb-3" >
<li class="nav-item" role="presentation">
<a class="nav-link" href="staff.php" role="tab" aria-selected="false">
Profile
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" href="rooms.php" aria-selected="false">
Rooms
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link active" href="student_status.php" aria-selected="true">
Students
</a>
</li>
</ul>
<!-- Logout Buttons -->
<div class="my-auto ms-4">
<a class="btn btn-lg text-light dark-blue-bg" role="button" aria-expanded="false" href="logout.php">
Logout
</a>
</div>
</header>
</div>
<!-- Body -->
<main class="container py-4">
<div class="row align-items-md-stretch">
<div class="col-md-5">
<img src="images/list.jpeg" class="img-fluid" alt="List image">
</div>
<!-- Student Profile -->
<div class="col-md-7 p-5 mb-4 bg-light rounded-3">
<h1 class="display-5 text-center fw-bold pb-2">Students</h1>
<div class="list-group list-group-flush pb-5 pt-3">
<?php
$result = $connection->query("SELECT * FROM Student");
while($row = $result->fetch_assoc()) {
echo '<span class="list-group-item list-group-item-light d-flex justify-content-between">';
echo '<span class="fs-4">'.$row["student_id"].'</span>';
echo '<span class="fs-4">'.$row["student_lname"].'</span>';
echo '<span class="fs-4">'.$row["student_fname"].'</span>';
echo '<span class="fs-4">'.$row["current_status"].'</span>';
if ($row["current_status"] == 'placed') {
$result_lease = $connection->query("SELECT lease_num FROM Leases WHERE student_id=".$row["student_id"]."");
$row_lease = $result_lease->fetch_assoc();
echo '<a class="btn btn-outline-secondary" href="staff_lease_view.php?lease_id='.$row_lease["lease_num"].'" role="button">View Lease</a>';
} else {
echo '<a class="btn btn-outline-secondary" href="rooms.php" role="button">Rooms</a>';
}
echo '</span>';
}
?>
</div>
</div>
</div>
</main>
<?php
include("templates/footer.php");
?>
</body>
</html>