-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathofficer_view.php
78 lines (55 loc) · 2.19 KB
/
officer_view.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
<?php
require 'header.php';
if(isset($_SESSION['userUidOfficer'])){
include_once 'includes/dbh.inc.php';
//require'header.php';
}else{
header("Location: ./failure.php");
exit();
}
$sql="SELECT O.Officer_id,O.First_name,O.Last_name,O.Title,O.Date_of_birth,OP.Officer_phone FROM
Officer as O INNER JOIN Officer_phone as OP ON O.Officer_id=OP.Officer_id;";
$result=mysqli_query($conn,$sql);
$resultCheck=mysqli_num_rows($result);
if($resultCheck > 0){?>
<style>.foot{padding-top:8gi5px;}</style>
<section class="text-gray-700 body-font relative">
<h1 class="text-3xl text-center">
Officers present
</h1>
<div class="container text-center px-5 my-5 mx-auto">
<div class="flex items-center justify-center bg-gray-50 pt-12 pb-56 px-3 sm:px-6 lg:px-8">
<table class="table-fixed">
<thead>
<tr>
<th class="w-1/8 px-7 py-2">Officer ID</th>
<th class="w-1/8 px-7 py-2">First Name</th>
<th class="w-1/8 px-7 py-2">Last Name</th>
<th class="w-1/8 px-7 py-2">Title</th>
<th class="w-1/8 px-7 py-2">Date Of Birth</th>
<th class="w-1/8 px-7 py-2">Mobile Number</th>
</tr>
</thead>
<tbody>
<?php
while($row=mysqli_fetch_assoc($result)){ ?>
<tr>
<td class="border px-4 py-2"><?php echo"OFF".$row['Officer_id']."<br>";?></td>
<td class="border px-4 py-2"><?php echo$row['First_name']."<br>";?></td>
<td class="border px-4 py-2"><?php echo$row['Last_name']."<br>";?></td>
<td class="border px-4 py-2"><?php echo$row['Title']."<br>";?></td>
<td class="border px-4 py-2"><?php echo$row['Date_of_birth']."<br>";?></td>
<td class="border px-4 py-2"><?php echo$row['Officer_phone']."<br>";?></td>
</tr>
<?php }?>
</tbody>
</table>
<?php }
?>
</div>
</div>
</section>
<footer class="foot">
<?php
require'footer.php';?>
</foooter>