-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsection_view.php
76 lines (51 loc) · 2.19 KB
/
section_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
<?php
require 'header.php';
if(isset($_SESSION['userUidOfficer']) ||isset($_SESSION['userUidJailor'])){
include_once 'includes/dbh.inc.php';
}else{
header("Location: ./failure.php");
exit();
}
$sql="SELECT S.Section_id ,S.Section_name,S.Jailor_id ,J.First_name, J.Last_name,JP.Jailor_phone FROM Section AS S INNER JOIN Jailor AS J ON J.Jailor_id=S.Jailor_id INNER JOIN Jailor_phone AS JP ON J.Jailor_id=JP.Jailor_id";
$result=mysqli_query($conn,$sql);
$resultCheck=mysqli_num_rows($result);
if($resultCheck > 0){?>
<section class="text-gray-700 body-font relative">
<h1 class="text-3xl text-center">
Sections present in the prison
</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-4 sm:px-6 lg:px-8">
<table class="table-fixed">
<thead>
<tr>
<th class="w-1/7 px-8 py-2">Section ID</th>
<th class="w-1/7 px-8 py-2">Section Name</th>
<th class="w-1/7 px-8 py-2">Jailor ID</th>
<th class="w-1/7 px-8 py-2">First_name</th>
<th class="w-1/7 px-8 py-2">Last_name</th>
<th class="w-1/7 px-8 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"SEC".$row['Section_id']."<br>";?></td>
<td class="border px-4 py-2"><?php echo$row['Section_name']."<br>";?></td>
<td class="border px-4 py-2"><?php echo"JAI".$row['Jailor_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['Jailor_phone']."<br>";?></td>
</tr>
<?php }?>
</tbody>
</table>
<?php }
?>
</div>
</div>
</section>
<?php
require'footer.php';
?>