-
Notifications
You must be signed in to change notification settings - Fork 2
/
crime_view.php
79 lines (52 loc) · 2.04 KB
/
crime_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
79
<?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 * FROM Crime as F INNER JOIN Commits as A ON A.IPC=F.IPC INNER JOIN Prisoner as P on P.Prisoner_id = A.Prisoner_id ;";
$result=mysqli_query($conn,$sql);
$resultCheck=mysqli_num_rows($result);
if($resultCheck > 0){?>
<style>.foot{padding-top:55px;}</style>
<section class="text-gray-700 body-font relative">
<h1 class="text-3xl text-center">
Prisoner Crime Details
</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/5 px-5 py-2">IPC</th>
<th class="w-1/5 px-5 py-2">Description</th>
<th class="w-1/5 px-5 py-2">Prisoner ID</th>
<th class="w-1/5 px-5 py-2">First Name</th>
<th class="w-1/5 px-5 py-2">Last Name</th>
</tr>
</thead>
<tbody>
<?php
while($row=mysqli_fetch_assoc($result)){ ?>
<tr>
<td class="border px-4 py-2"><?php echo$row['IPC']."<br>";?></td>
<td class="border px-4 py-2"><?php echo$row['Description']."<br>";?></td>
<td class="border px-4 py-2"><?php echo"PRI".$row['Prisoner_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>
</tr>
<?php }?>
</tbody>
</table>
<?php }
?>
</div>
</div>
</section>
<footer class="foot">
<?php
require'footer.php';?>
</foooter>