-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
141 lines (123 loc) · 5.23 KB
/
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
133
134
135
136
137
138
139
140
141
<?php
session_start();
$email = @$_SESSION['email'];
if(isset($email)){ header('location:user'); } else { }
?>
<!Doctype html>
<html>
<head>
<title>Your Restaurant</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="icon" href="img/logo.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" type="text/css" href="fonts/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="css/animate.css">
</head>
<body>
<div class="container">
<!-- Header -->
<div class="header animated fadeInDown">
<div class="a">
<span class=""><a href="about"><i class="fa fa-star"></i> <p class="rwd">About</p></a></span>
<span class="active"><a href="user"><i class="fa fa-image active"></i> <p class="rwd active">Gallery</p></a></span>
<span class=""><a href="contact"><i class="fa fa-phone"></i> <p class="rwd">Contact</p></a></span>
</div>
<div class="b">
<span><i class="fa fa-bell"></i></span>
</div>
<div class="c">
<span class="search"><i class="fa fa-search"></i> <p class="rwd"><input placeholder="Search" id='searchr'></p></span>
<span class="join" id="loginmodal">Login</span>
</div>
</div>
<div class="cover animated fadeIn">
</div>
<div class="category animated fadeIn">
<button id="All" class="active">Search Results</button>
</div>
<div class="prod-content animated slideInLeft" ng-app="myApp" ng-controller="customersCtrl">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/default.js"></script>
<script type="text/javascript" src="js/angular.js"></script>
<script type="text/javascript" src="js/a-model1.js"></script>
<script type="text/javascript" src="js/client.js"></script>
<script type="text/javascript" src="js/formajax.js"></script>
<?php
include "php/dbconn.php";
$q = $_GET['q'];
$sql ="SELECT * FROM products where name like '%$q%' or category like '%$q%' or price like '%$q%'";
$result = mysqli_query($conn,$sql);
$rows = mysqli_num_rows($result);
if($rows<=0){
echo "<div class='item' id='' style='width:100% !important; padding:1%;'>
<center>NO Results Found !</center>
</div>";
}
while($row = mysqli_fetch_array($result)){
$id = $row['id'];
$name = $row['name'];
$category = $row['category'];
$description = $row['description'];
$price = $row['price'];
$image = $row['image'];
$status = $row['status'];
echo "<div class='item' id='$category'>
<span class='a'>.
<span class='b'>P $price</span>
</span>
<img src='admin/img/uploads/$image'>
<!--<span class='overlay animated bounce'>
$description
<center>
<input type='number' name='qty' placeholder='Quantity' value='1' id='qty' focus><button id='addtocart' alt='$id'>Order</button>
</center>
</span>-->
<p>$name</p>
<!--<span>
<i class='fa fa-star'></i>
<i class='fa fa-star'></i>
<i class='fa fa-star-o'></i>
<i class='fa fa-star-o'></i>
<i class='fa fa-star-o'></i>
</span>-->
</div>";
}
?>
</div>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/default.js"></script>
<script type="text/javascript" src="js/angular.js"></script>
<script type="text/javascript" src="js/a-model1.js"></script>
<script type="text/javascript" src="js/client.js"></script>
<script type="text/javascript" src="js/formajax.js"></script>
</body>
</html>
<div class="login-modal animated bounceIn">
<div id="loader" class="loaderdiv"><img src="img/loader.gif" style="width:20%; margin-left:40%; margin-top:5%; margin-bottom:5%;"><center>Please Wait !<br></center></div>
<div class="login">
<i class="fa fa-remove" id="close"></i>
<form action="php/login.php" method="post" id="userlogin">
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="pass" placeholder="Password" required>
<button id="loginsubmit">Login</button>
</form>
<button class="sign" id="signupbtn2">SignUp</button>
</div>
<div class="signup">
<i class="fa fa-remove" id="close"></i>
<form action="php/signup.php" method="post" id="signupsubmit">
<input type="text" name="name" placeholder="Name" required>
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="pass" placeholder="Password" required>
<input type="password" name="pass2" placeholder="Confirm Password" required>
<textarea name="address" placeholder="Address" rows="5" required></textarea>
<input type="number" name="contact" placeholder="Contact" required>
<button>Signup</button>
</form>
<button class="log" id="loginbtn2">Login</button>
</div>
</div>
<div class="loader">
<img src="img/loader.gif">
</div>