-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchcaterer.php
105 lines (80 loc) · 3 KB
/
searchcaterer.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
<?php
session_start();
include "../../../connection_string.php";
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ZUMBA AIR</title>
<link rel="stylesheet" type="text/css" href="zumbacss.css">
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+KR|Pacifico" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<script>
$(document).ready(function() {
$('input.comsearchsubmit').typeahead({
name: 'comsearchsubmit',
remote: 'searchcaterer.php?query=%QUERY'
});
})
</script>
</head>
<body>
<div id="banner">
<div class="logoimg">
<img src="zumbaairlogo.png" height="140px" width="140px";>
</div>
<div class="logobrand">
<p>THE PRIDE OF AIR TRAVEL</p>
</div>
</div>
<div class="transition"><a href="logout.php"><input type="button" value="Logout"></a></div>
<?php
echo'<div id = "notes">' ;
echo "<ul style='list-style-type:none;'>";
echo'<li><form action="newmeal.php" method="GET">
<button class="button" type="submit" name="newmeal">New Request</button>
</form> </li> ' ;
echo'<li><form action="viewmeal.php" method="GET">
<button class="button" type="submit" name="Viewupdatemeal">View/Update Request</button>
</form> </li>' ;
echo'<li><form action="addcaterer.php" method="GET">
<button class="button" type="submit" name="addcaterer">Add new Caterer</button>
</form> </li>' ;
echo'<li><form action="searchcaterer.php" method="GET">
<button class="button" type="submit" name="updatecatererinfo">View / Update Caterer </button>
</form> </li>' ;
echo "</ul>";
echo "<br><br><br><br><br><br><br>";
echo "</div>";
?>
<?php
echo'<div id = "welcomepage">' ;
echo "<p class='welcomenote'>Welcome ".$_SESSION['username']."</p>";
echo'<br><br><form action="viewcatererinfo.php" method="GET">
<input type="text" name="comsearch"><br><br>
<button class="iconbutton" type="submit" name="comsearchsubmit"><i class="fas fa-search fa-3x" title="Search"></i></button>
' ;
echo "<br><br><br><br><br><br><br>";
echo "</div>";
?>
<?php
$comsearchsubmit = ($_REQUEST['comsearchsubmit']);
if (isset($comsearchsubmit)) {
include "../../../connection_string.php"; //contains MySQL login information
mysql_select_db("ZumbaAir", $con);
$query = $_REQUEST['comsearchsubmit'];
$sql = mysql_query ("SELECT comname FROM Zumbacaterers WHERE comname LIKE '%{$query}%' ");
$array = array();
while ($row = mysql_fetch_array($sql)) {
$array[] = array (
'label' => $row['comname'],
'value' => $row['comname'],
);
}
echo json_encode ($array);}
?>
<div id="footer">
</br>
<b>© Zumba Air| [email protected] | </b></div>
</body>
</html>