-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdisplay_search.php
132 lines (118 loc) · 3.09 KB
/
display_search.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
<html>
<head>
<title>FBI</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="fav icon" href="images/FBIicon.ico" type="image/x-icon">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<style type="text/css">
body{
color: white;
}
.header{
font-size: 50px;
}
.navbar-inverse {
background: black;
color: white;
}
.navbar-inverse .navbar-brand, .navbar-inverse a{
color:white;
}
.navbar-inverse .navbar-nav>li>a {
color: white;
}
input.transparent-input{
background-color:transparent !important;
border:none !important;
}
table
{
border-style:solid;
border-width:2px;
border-color:black;
}
</style>
</head>
<body>
<?php
session_start();
if(!isset($_SESSION['user'])){
$_SESSION["msg"]="Your session has expired";
header("location:login.php");
}
?>
<div class="container"></div>
<div class="image"></div>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4"></div>
</div>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-nav-demo" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.php" class="navbar-brand"><span class="glyphicon glyphicon-picture"></span> FBI</a>
</div>
<div class="collapse navbar-collapse" id="bs-nav-demo">
<ul class="nav navbar-nav">
<li><a href="about.php">About</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="logout.php">Logout</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="header">
<div class="col-md-12">
<h1><b>Search Results</b></h1>
</div>
</div>
<div>
<?php
$con = mysqli_connect("127.0.0.1","root","mynameisrohit","fbi");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$qry = "SELECT * FROM `fbi-criminals`";
$result = $con->query($qry);
echo "<table border='1'>
<tr>
<th>ID</th>
<th>Name</th>
<th>Year</th>
<th>Area</th>
<th>Crime</th>
</tr>";
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row['criminalid'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['year'] . "</td>";
echo "<td>" . $row['area'] . "</td>";
echo "<td>" . $row['crime-comm'] . "</td>";
echo "</tr>";
}
} else {
echo "0 results";
}
echo "</table>";
mysqli_close($con);
?>
</div>
</div>
</div>
</body>
</html>