-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_search_location.php
50 lines (43 loc) · 1.46 KB
/
index_search_location.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
<?php
include 'config_db.php';
$userid= $_GET['uid'];
$searchq = $_GET['searchq'];
$searchq = preg_replace("#[^0-9a-z]#i","",$searchq);
$query = mysql_query("SELECT * FROM hotel WHERE city LIKE '%$searchq%'") or die("Could not search!");
$count = mysql_num_rows($query);
if($count === 0) {
echo "There was no search results!";
}else{
echo '<table class="table" style="font-size:20px;">';
echo '<tr>';
echo '<td style="width:300px; font-size:30px;">Hotel Name</td>';
echo '<td style="width:300px; font-size:30px;">City</td>';
echo '<td></td>';
echo '</tr>';
while($row = mysql_fetch_array($query)){
$hname = $row['hotelName'];
$hid = $row['hotelID'];
$hcity = $row['city'];
echo "<tr>";
echo "<td>"; echo $hname; echo "</td>";
echo "<td>"; echo $hcity; echo "</td>";
echo "<td>";
echo '<a href="hotel_index.php?hid=';
echo $hid;
echo '&uid=';
echo $userid;
echo '" style="font-size:15px; background-color:rgb(165,222,228);">MORE>></a>';
echo "</td>";
echo "</tr>";
}
echo '</table>';
}
?>
<html>
<head>
<script src="javascripts/jquery-2.1.0.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/style.css" media="screen" type="text/css" />
<link rel="stylesheet" href="css/bootstrap/css/bootstrap.css" media="screen" type="text/css" />
</head>
</html>