-
Notifications
You must be signed in to change notification settings - Fork 0
/
foodlist.php
333 lines (277 loc) · 10.2 KB
/
foodlist.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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<?php
session_start();
if(!isset($_SESSION['login_user2'])){
header("location: customerlogin.php");
}
?>
<html>
<head>
<title> Explore | Food JD Home Cooks </title>
</head>
<link rel="stylesheet" type = "text/css" href ="css/foodlist.css">
<link rel="stylesheet" type = "text/css" href ="css/bootstrap.min.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<body>
<button onclick="topFunction()" id="myBtn" title="Go to top">
<span class="glyphicon glyphicon-chevron-up"></span>
</button>
<script type="text/javascript">
window.onscroll = function()
{
scrollFunction()
};
function scrollFunction(){
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
<nav class="navbar navbar-inverse navbar-fixed-top navigation-clean-search" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#myNavbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">JD Home Cooks</a>
</div>
<div class="collapse navbar-collapse " id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="index.php">Home</a></li>
<li><a href="aboutus.php">About</a></li>
<li><a href="contactus.php">Contact Us</a></li>
</ul>
<?php
if(isset($_SESSION['login_user1'])){
?>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Welcome <?php echo $_SESSION['login_user1']; ?> </a></li>
<li><a href="myrestaurant.php">MANAGER CONTROL PANEL</a></li>
<li><a href="logout_m.php"><span class="glyphicon glyphicon-log-out"></span> Log Out </a></li>
</ul>
<?php
}
else if (isset($_SESSION['login_user2'])) {
?>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Welcome <?php echo $_SESSION['login_user2']; ?> </a></li>
<li class="active" ><a href="foodlist.php"><span class="glyphicon glyphicon-cutlery"></span> Food Zone </a></li>
<li><a href="cart.php"><span class="glyphicon glyphicon-shopping-cart"></span> Cart (<?php
if(isset($_SESSION["cart"])){
$count = count($_SESSION["cart"]);
echo "$count";
}
else
echo "0";
?>) </a></li>
<li><a href="logout_u.php"><span class="glyphicon glyphicon-log-out"></span> Log Out </a></li>
</ul>
<?php
}
else {
?>
<ul class="nav navbar-nav navbar-right">
<li><a href="#" class="dropdown-toggle active" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-user"></span> Sign Up <span class="caret"></span> </a>
<ul class="dropdown-menu">
<li> <a href="customersignup.php"> User Sign-up</a></li>
<li> <a href="managersignup.php"> Manager Sign-up</a></li>
<li> <a href="#"> Admin Sign-up</a></li>
</ul>
</li>
<li><a href="#" class="dropdown-toggle active" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-log-in"></span> Login <span class="caret"></span></a>
<ul class="dropdown-menu">
<li> <a href="customerlogin.php"> User Login</a></li>
<li> <a href="managerlogin.php"> Manager Login</a></li>
<li> <a href="#"> Admin Login</a></li>
</ul>
</li>
</ul>
<?php
}
?>
</div>
</div>
</nav>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="images/home1.jpg" style="width:100%; height:64%;">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/home.jpg" style="width:100%;">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slide001.jpg" style="width:100%;">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slide003.jpg" style="width:100%;">
<div class="carousel-caption">
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="jumbotron">
<div class="container text-center">
<h1>Welcome To JD Home Cooks</h1>
<p> "Indulge in the delicious comfort of homemade goodness, </p>
<p>where every dish is crafted with love and care" </p>
</div>
</div>
<div class="container" style="width:95%;">
<!-- Display all Food from food table -->
<?php
require 'connection.php';
$conn = Connect();
$sql = "SELECT * FROM FOOD WHERE options = 'ENABLE' ORDER BY F_ID";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0)
{
$count=0;
while($row = mysqli_fetch_assoc($result)){
if ($count == 0)
echo "<div class='row'>";
?>
<div class="container" style="width:95%;">
<div class="row">
<?php
// Start the loop to display food items
while($row = mysqli_fetch_assoc($result)) {
?>
<div class="col-md-3 food-card">
<div class="mypanel">
<img src="<?php echo $row["images_path"]; ?>" class="img-responsive">
<h4 class="text-dark"><?php echo $row["name"]; ?></h4>
<h5 class="text-info"><?php echo $row["description"]; ?></h5>
<h5 class="text-danger">₹ <?php echo $row["price"]; ?>/-</h5>
<form method="post" action="cart.php?action=add&id=<?php echo $row["F_ID"]; ?>">
<input type="hidden" name="hidden_name" value="<?php echo $row["name"]; ?>">
<input type="hidden" name="hidden_price" value="<?php echo $row["price"]; ?>">
<input type="hidden" name="hidden_RID" value="<?php echo $row["R_ID"]; ?>">
<div class="input-group">
<input type="number" min="1" max="25" name="quantity" class="form-control" value="1">
<span class="input-group-btn">
<input type="submit" name="add" class="btn btn-success" value="Add to Cart">
</span>
</div>
</form>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
$count++;
if($count==4)
{
echo "</div>";
$count=0;
}
}
?>
</div>
</div>
<?php
}
else
{
?>
<div class="container">
<div class="jumbotron">
<center>
<label style="margin-left: 5px;color: red;"> <h1>Oops! No food is available.</h1> </label>
<p>Stay Hungry...! :P</p>
</center>
</div>
</div>
<?php
}
?>
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-md-3">
<h4>About Us</h4>
<ul><a href="">Who We Are</a></ul>
<ul><a href="">Blog</a></ul>
<ul><a href="">Inevstor</a></ul>
<ul><a href="">Relations</a></ul>
<ul><a href="">Careers</a></ul>
<ul><a href="">Team</a></ul>
</div>
<div class="col-md-3">
<h4>Contact Us</h4>
<ul>
<li>Email: [email protected]</li>
<li>Email: [email protected]</li>
<li>Phone: +123-456-7890</li>
<li>Phone: +123-456-8278</li>
</ul>
</div>
<div class="col-md-3">
<h4>Partnership</h4>
<ul>
<li><a href="#">Become a Partner</a></li>
<li><a href="#">Affiliate Program</a></li>
</ul>
</div>
<div class="col-md-3">
<h4>Terms & Policies</h4>
<ul>
<li><a href="#">Terms of Service</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Cookie Policy</a></li>
</ul>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<ul class="social-icons">
<h4>Social Links</h4>
<li><a href="#"><img src="images/insta.jpg" alt=""></i></a></li>
<li><a href="#"><img src="images/twitter.jpg" alt=""></i></a></li>
<li><a href="#"><img src="images/facebook.jpg" alt=""></i></a></li>
<!-- <li><a href="#"><img src="" alt=""></i></a></li> -->
</ul>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="text-center">© 2024 Your Website Name. All Rights Reserved.</p>
</div>
</div>
</div>
</footer>
</body>
</html>