-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcivilian_criminals.php
257 lines (222 loc) · 9.22 KB
/
civilian_criminals.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php include('server.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Criminal Database</title>
<link rel="stylesheet" href="Css/style.css">
<link rel="icon" href="images/Fingerprint.jpg" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Serif&display=swap" rel="stylesheet" />
</head>
<body style="background-color: #181818">
<!-- /* from here */ -->
<div>
<div>
<nav id="navigation_bar" class="navbar navbar-expand-lg navbar-light">
<a style="border-bottom: #181818" class="navbar-brand" href="#">Criminal Records</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="http://localhost/DBMS%20Mini%20project/homepage.php">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="http://localhost/DBMS%20Mini%20project/database_civilian.php">Database</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">Criminals</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" action="http://localhost/DBMS%20Mini%20project/civilian_criminals.php" method="POST">
<input class="form-control mr-sm-2" name="search-criminal_field"type="search" placeholder="Search" aria-label="Search" />
<button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="search-criminal_button">
Search
</button>
</form>
</div>
</nav>
</div>
</div>
<?php
$criminaldataquery = "SELECT * FROM `criminal's` WHERE 1";
$criminals = mysqli_query($connection, $criminaldataquery);
?>
<div style="padding:50px;margin-top:200px;margin-bottom:200px;">
<table id="editable_table"class="table table-bordered">
<thead class="thead-dark" style="background-color: black; color: white;">
<tr>
<th scope="col">Criminal ID</th>
<th scope="col">Name</th>
<th scope="col">Crime ID</th>
<th scope="col">Age</th>
<th scope="col">Height</th>
<th scope="col">Weight</th>
<th scope="col">Crimes Description</th>
<th scope="col">Address</th>
<th scope="col">Status</th>
</tr>
</thead>
<?php
if(isset($_POST['search-criminal_button'])){
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$criminalrecord = $_POST['search-criminal_field'];
if (empty($criminalrecord)) {
$msg="Can't be empty field";
echo "<script type='text/javascript'>alert('$msg');</script>";
}
$criminal_result = mysqli_query($connection, "SELECT * FROM `criminal's` WHERE `Criminal ID` LIKE '%$criminalrecord%' OR `Name` LIKE '%$criminalrecord%' OR `Crime ID` LIKE '%$criminalrecord%' OR `Age` LIKE '%$criminalrecord%' OR `Height` LIKE '%$criminalrecord%' OR `Weight` LIKE '%$criminalrecord%' OR `Crimes Description` LIKE '%$criminalrecord%' OR `Address` LIKE '%$criminalrecord%' OR `Status` LIKE '%$criminalrecord%'");
$queryresult=mysqli_num_rows($criminal_result);
if($queryresult == 0 ){
?>
<tbody style="background-color: white; color: black;">
<tr>
<td><?php echo " No Results Found" ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
<?php
}
else{
if($queryresult == 1){
?>
<p style="color: white;">We found <?php echo $queryresult?> result !!!!</p>
<?php
}
else{
?>
<p style="color: white;">We found <?php echo $queryresult?> results !!!!</p>
<?php
}
while ($rows0=mysqli_fetch_assoc($criminal_result)){
?>
<tbody style="background-color: white; color: black;">
<tr>
<td><?php echo $rows0['Criminal ID']; ?></td>
<td><?php echo $rows0['Name']; ?></td>
<td><?php echo $rows0['Crime ID']; ?></td>
<td><?php echo $rows0['Age']; ?></td>
<td><?php echo $rows0['Height']; ?></td>
<td><?php echo $rows0['Weight']; ?></td>
<td><?php echo $rows0['Crimes Description']; ?></td>
<td><?php echo $rows0['Address']; ?></td>
<td><?php echo $rows0['Status']; ?></td>
</tr>
</tbody>
<?php
}
}
}
}
else{
while ($rows = mysqli_fetch_assoc($criminals)) {
?>
<tbody style="background-color: white; color: black;">
<tr>
<td><?php echo $rows['Criminal ID']; ?></td>
<td><?php echo $rows['Name']; ?></td>
<td><?php echo $rows['Crime ID']; ?></td>
<td><?php echo $rows['Age']; ?></td>
<td><?php echo $rows['Height']; ?></td>
<td><?php echo $rows['Weight']; ?></td>
<td><?php echo $rows['Crimes Description']; ?></td>
<td><?php echo $rows['Address']; ?></td>
<td><?php echo $rows['Status']; ?></td>
</tr>
</tbody>
<?php
}
}
?>
</table>
</div>
<!-- end of table containing of police officers -->
<footer class="site-footer">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-6">
<h6>About</h6>
<p class="text-justify">
Crime Database <i>DO NOT COMMIT ANY CRIMES</i> Although there are
many different kinds of crimes, criminal acts can generally be
divided into four primary categories: personal crimes, property
crimes, inchoate crimes, statutory crimes, and financial crimes.
</p>
</div>
<div class="col-xs-6 col-md-3">
<h6>Categories</h6>
<ul class="footer-links">
<li>
<a href="https://en.wikipedia.org/wiki/Category:Crimes">Assault and battery</a>
</li>
<li>
<a href="https://en.wikipedia.org/wiki/Category:Crimes">Arson</a>
</li>
<li>
<a href="https://en.wikipedia.org/wiki/Category:Crimes">Child Abuse</a>
</li>
<li>
<a href="https://en.wikipedia.org/wiki/Category:Crimes">Domestic Abuse</a>
</li>
<li>
<a href="https://en.wikipedia.org/wiki/Category:Crimes">Kidnapping</a>
</li>
<li>
<a href="https://en.wikipedia.org/wiki/Category:Crimes">Rape and Statutory Rape</a>
</li>
</ul>
</div>
<div class="col-xs-6 col-md-3">
<h6>Quick Links</h6>
<ul class="footer-links">
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Contribute</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Sitemap</a></li>
</ul>
</div>
</div>
<hr />
</div>
<div class="container">
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<p class="copyright-text">
Copyright © 2020 All Rights Reserved by
<a href="#">Deepak Vellanki</a>.
</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<ul class="social-icons">
<li>
<a class="facebook" href="#"><i class="fa fa-facebook"></i></a>
</li>
<li>
<a class="twitter" href="#"><i class="fa fa-twitter"></i></a>
</li>
<li>
<a class="dribbble" href="#"><i class="fa fa-dribbble"></i></a>
</li>
<li>
<a class="linkedin" href="#"><i class="fa fa-linkedin"></i></a>
</li>
</ul>
</div>
</div>
</div>
</footer>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</body>
</html>