This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
status.php
89 lines (67 loc) · 3.02 KB
/
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
<?php
session_start();
if(!isset($_SESSION['loggedin'])){
header('Location: login.php');
exit();
}
if ($_SESSION['username'] != 'administrator'){
header('Location: index.php?adminonly=1');
}
include ('serverconnect.php');
?>
<!DOCTYPE html>
<html>
<?php
include('header.php')
?>
<body class="form-v8 loggedin" id="fade">
<div id="loader">
<div class="loader"><div></div><div></div><div></div><div></div></div>
</div>
<?php include('navbar.php'); ?>
<h2>All Requests</h2>
<div class="limiter">
<div class="container-table100">
<div class="wrap-table100">
<div class="table100">
<table>
<thead>
<tr class="table100-head">
<th class="column1" style="border-bottom: 1px solid black">ID</th>
<th class="column2" style="border-bottom: 1px solid black">User</th>
<th class="column3" style="border-bottom: 1px solid black">Equipment</th>
<th class="column4" style="border-bottom: 1px solid black">purpose</th>
<th class="column5" style="border-bottom: 1px solid black">Date Requested</th>
<th class="column6" style="border-bottom: 1px solid black">State</th>
<th class="column6" style="border-bottom: 1px solid black">Action</th>
</tr>
</thead>
<tbody>
<?php $results = mysqli_query($db, "SELECT * FROM allrequests"); ?>
<?php while ($row = mysqli_fetch_array($results)) { ?>
<tr>
<td style="text-align:left"><?php echo $row['Equipment']; ?></td>
<td style="text-align:left"><?php echo $row['User'] ?></td>
<td style="text-align:left"><?php echo $row['Equipment'] ?></td>
<td style="text-align:left"><?php echo $row['purpose'] ?>
<td style="text-align:left"><?php echo $row['DateRequested'] ?></td>
<td>
<?php
if ($row['Active'] == 1) {
echo '<dt style="color:green; text-align: left";">Passed</dt>';
} elseif ($row['Active'] == 0){
echo '<dt style="color:red; text-align: left";">Pending/Rejected</dt>';
} else echo "Error";
?>
</td>
<td><?php echo $row['Action'] ?></td>
</tr>
<?php }; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</body>