-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathdishes.php
580 lines (530 loc) · 30.7 KB
/
dishes.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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
<!DOCTYPE html>
<html lang="en">
<?php
include("connection/connect.php"); // connection to db
error_reporting(0);
session_start();
include_once 'product-action.php'; //including controller
?>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="#">
<title>Starter Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/animsition.min.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet"> </head>
<body>
<!--header starts-->
<header id="header" class="header-scroll top-header headrom">
<!-- .navbar -->
<nav class="navbar navbar-dark">
<div class="container">
<button class="navbar-toggler hidden-lg-up" type="button" data-toggle="collapse" data-target="#mainNavbarCollapse">☰</button>
<a class="navbar-brand" href="index.html"> <img class="img-rounded" src="images/food-picky-logo.png" alt=""> </a>
<div class="collapse navbar-toggleable-md float-lg-right" id="mainNavbarCollapse">
<ul class="nav navbar-nav">
<li class="nav-item"> <a class="nav-link active" href="index.php">Home <span class="sr-only">(current)</span></a> </li>
<li class="nav-item"> <a class="nav-link active" href="restaurants.php">Restaurants <span class="sr-only"></span></a> </li>
<?php
if(empty($_SESSION["user_id"]))
{
echo '<li class="nav-item"><a href="login.php" class="nav-link active">login</a> </li>
<li class="nav-item"><a href="registration.php" class="nav-link active">signup</a> </li>';
}
else
{
echo '<li class="nav-item"><a href="your_orders.php" class="nav-link active">your orders</a> </li>';
echo '<li class="nav-item"><a href="logout.php" class="nav-link active">logout</a> </li>';
}
?>
</ul>
</div>
</div>
</nav>
<!-- /.navbar -->
</header>
<div class="page-wrapper">
<!-- top Links -->
<div class="top-links">
<div class="container">
<ul class="row links">
<li class="col-xs-12 col-sm-4 link-item"><span>1</span><a href="restaurants.php">Choose Restaurant</a></li>
<li class="col-xs-12 col-sm-4 link-item active"><span>2</span><a href="dishes.php?res_id=<?php echo $_GET['res_id']; ?>">Pick Your favorite food</a></li>
<li class="col-xs-12 col-sm-4 link-item"><span>3</span><a href="#">Order and Pay online</a></li>
</ul>
</div>
</div>
<!-- end:Top links -->
<!-- start: Inner page hero -->
<?php $ress= mysqli_query($db,"select * from restaurant where rs_id='$_GET[res_id]'");
$rows=mysqli_fetch_array($ress);
?>
<section class="inner-page-hero bg-image" data-image-src="images/img/dish.jpeg">
<div class="profile">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 profile-img">
<div class="image-wrap">
<figure><?php echo '<img src="admin/Res_img/'.$rows['image'].'" alt="Restaurant logo">'; ?></figure>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 profile-desc">
<div class="pull-left right-text white-txt">
<h6><a href="#"><?php echo $rows['title']; ?></a></h6>
<p><?php echo $rows['address']; ?></p>
<ul class="nav nav-inline">
<li class="nav-item"> <a class="nav-link active" href="#"><i class="fa fa-check"></i> Min $ 10,00</a> </li>
<li class="nav-item"> <a class="nav-link" href="#"><i class="fa fa-motorcycle"></i> 30 min</a> </li>
<li class="nav-item ratings">
<a class="nav-link" href="#"> <span>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-o"></i>
</span> </a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- end:Inner page hero -->
<div class="breadcrumb">
<div class="container">
</div>
</div>
<div class="container m-t-30">
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-3">
<div class="widget widget-cart">
<div class="widget-heading">
<h3 class="widget-title text-dark">
Your Shopping Cart
</h3>
<div class="clearfix"></div>
</div>
<div class="order-row bg-white">
<div class="widget-body">
<?php
$item_total = 0;
foreach ($_SESSION["cart_item"] as $item) // fetch items define current into session ID
{
?>
<div class="title-row">
<?php echo $item["title"]; ?><a href="dishes.php?res_id=<?php echo $_GET['res_id']; ?>&action=remove&id=<?php echo $item["d_id"]; ?>" >
<i class="fa fa-trash pull-right"></i></a>
</div>
<div class="form-group row no-gutter">
<div class="col-xs-8">
<input type="text" class="form-control b-r-0" value=<?php echo "$".$item["price"]; ?> readonly id="exampleSelect1">
</div>
<div class="col-xs-4">
<input class="form-control" type="text" readonly value='<?php echo $item["quantity"]; ?>' id="example-number-input"> </div>
</div>
<?php
$item_total += ($item["price"]*$item["quantity"]); // calculating current price into cart
}
?>
</div>
</div>
<!-- end:Order row -->
<div class="widget-body">
<div class="price-wrap text-xs-center">
<p>TOTAL</p>
<h3 class="value"><strong><?php echo "$".$item_total; ?></strong></h3>
<p>Free Shipping</p>
<a href="checkout.php?res_id=<?php echo $_GET['res_id'];?>&action=check" class="btn theme-btn btn-lg">Checkout</a>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-6">
<!-- end:Widget menu -->
<div class="menu-widget" id="2">
<div class="widget-heading">
<h3 class="widget-title text-dark">
POPULAR ORDERS Delicious hot food! <a class="btn btn-link pull-right" data-toggle="collapse" href="#popular2" aria-expanded="true">
<i class="fa fa-angle-right pull-right"></i>
<i class="fa fa-angle-down pull-right"></i>
</a>
</h3>
<div class="clearfix"></div>
</div>
<div class="collapse in" id="popular2">
<?php // display values and item of food/dishes
$stmt = $db->prepare("select * from dishes where rs_id='$_GET[res_id]'");
$stmt->execute();
$products = $stmt->get_result();
if (!empty($products))
{
foreach($products as $product)
{
?>
<div class="food-item">
<div class="row">
<div class="col-xs-12 col-sm-12 col-lg-8">
<form method="post" action='dishes.php?res_id=<?php echo $_GET['res_id'];?>&action=add&id=<?php echo $product['d_id']; ?>'>
<div class="rest-logo pull-left">
<a class="restaurant-logo pull-left" href="#"><?php echo '<img src="admin/Res_img/dishes/'.$product['img'].'" alt="Food logo">'; ?></a>
</div>
<!-- end:Logo -->
<div class="rest-descr">
<h6><a href="#"><?php echo $product['title']; ?></a></h6>
<p> <?php echo $product['slogan']; ?></p>
</div>
<!-- end:Description -->
</div>
<!-- end:col -->
<div class="col-xs-12 col-sm-12 col-lg-4 pull-right item-cart-info">
<span class="price pull-left" >$<?php echo $product['price']; ?></span>
<input class="b-r-0" type="text" name="quantity" style="margin-left:30px;" value="1" size="2" />
<input type="submit" class="btn theme-btn" style="margin-left:40px;" value="Add to cart" />
</div>
</form>
</div>
<!-- end:row -->
</div>
<!-- end:Food item -->
<?php
}
}
?>
</div>
<!-- end:Collapse -->
</div>
<!-- end:Widget menu -->
</div>
<!-- end:Bar -->
<div class="col-xs-12 col-md-12 col-lg-3">
<div class="sidebar-wrap">
<div class="widget clearfix">
<!-- /widget heading -->
<div class="widget-heading">
<h3 class="widget-title text-dark">
Popular tags
</h3>
<div class="clearfix"></div>
</div>
<div class="widget-body">
<ul class="tags">
<li> <a href="#" class="tag">
Coupons
</a> </li>
<li> <a href="#" class="tag">
Discounts
</a> </li>
<li> <a href="#" class="tag">
Deals
</a> </li>
<li> <a href="#" class="tag">
Amazon
</a> </li>
<li> <a href="#" class="tag">
Ebay
</a> </li>
<li> <a href="#" class="tag">
Fashion
</a> </li>
<li> <a href="#" class="tag">
Shoes
</a> </li>
<li> <a href="#" class="tag">
Kids
</a> </li>
<li> <a href="#" class="tag">
Travel
</a> </li>
<li> <a href="#" class="tag">
Hosting
</a> </li>
</ul>
</div>
</div>
</div>
</div>
<!-- end:Right Sidebar -->
</div>
<!-- end:row -->
</div>
<!-- end:Container -->
<section class="app-section">
<div class="app-wrap">
<div class="container">
<div class="row text-img-block text-xs-left">
<div class="container">
<div class="col-xs-12 col-sm-6 hidden-xs-down right-image text-center">
<figure> <img src="images/app.png" alt="Right Image"> </figure>
</div>
<div class="col-xs-12 col-sm-6 left-text">
<h3>The Best Food Delivery App</h3>
<p>Now you can make food happen pretty much wherever you are thanks to the free easy-to-use Food Delivery & Takeout App.</p>
<div class="social-btns">
<a href="#" class="app-btn apple-button clearfix">
<div class="pull-left"><i class="fa fa-apple"></i> </div>
<div class="pull-right"> <span class="text">Available on the</span> <span class="text-2">App Store</span> </div>
</a>
<a href="#" class="app-btn android-button clearfix">
<div class="pull-left"><i class="fa fa-android"></i> </div>
<div class="pull-right"> <span class="text">Available on the</span> <span class="text-2">Play store</span> </div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- start: FOOTER -->
<footer class="footer">
<div class="container">
<!-- top footer statrs -->
<div class="row top-footer">
<div class="col-xs-12 col-sm-3 footer-logo-block color-gray">
<a href="#"> <img src="images/food-picky-logo.png" alt="Footer logo"> </a> <span>Order Delivery & Take-Out </span> </div>
<div class="col-xs-12 col-sm-2 about color-gray">
<h5>About Us</h5>
<ul>
<li><a href="#">About us</a> </li>
<li><a href="#">History</a> </li>
<li><a href="#">Our Team</a> </li>
<li><a href="#">We are hiring</a> </li>
</ul>
</div>
<div class="col-xs-12 col-sm-2 how-it-works-links color-gray">
<h5>How it Works</h5>
<ul>
<li><a href="#">Enter your location</a> </li>
<li><a href="#">Choose restaurant</a> </li>
<li><a href="#">Choose meal</a> </li>
<li><a href="#">Pay via credit card</a> </li>
<li><a href="#">Wait for delivery</a> </li>
</ul>
</div>
<div class="col-xs-12 col-sm-2 pages color-gray">
<h5>Pages</h5>
<ul>
<li><a href="#">Search results page</a> </li>
<li><a href="#">User Sing Up Page</a> </li>
<li><a href="#">Pricing page</a> </li>
<li><a href="#">Make order</a> </li>
<li><a href="#">Add to cart</a> </li>
</ul>
</div>
<div class="col-xs-12 col-sm-3 popular-locations color-gray">
<h5>Popular locations</h5>
<ul>
<li><a href="#">Sarajevo</a> </li>
<li><a href="#">Split</a> </li>
<li><a href="#">Tuzla</a> </li>
<li><a href="#">Sibenik</a> </li>
<li><a href="#">Zagreb</a> </li>
<li><a href="#">Brcko</a> </li>
<li><a href="#">Beograd</a> </li>
<li><a href="#">New York</a> </li>
<li><a href="#">Gradacac</a> </li>
<li><a href="#">Los Angeles</a> </li>
</ul>
</div>
</div>
<!-- top footer ends -->
<!-- bottom footer statrs -->
<div class="row bottom-footer">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-3 payment-options color-gray">
<h5>Payment Options</h5>
<ul>
<li>
<a href="#"> <img src="images/paypal.png" alt="Paypal"> </a>
</li>
<li>
<a href="#"> <img src="images/mastercard.png" alt="Mastercard"> </a>
</li>
<li>
<a href="#"> <img src="images/maestro.png" alt="Maestro"> </a>
</li>
<li>
<a href="#"> <img src="images/stripe.png" alt="Stripe"> </a>
</li>
<li>
<a href="#"> <img src="images/bitcoin.png" alt="Bitcoin"> </a>
</li>
</ul>
</div>
<div class="col-xs-12 col-sm-4 address color-gray">
<h5>Address</h5>
<p>Concept design of oline food order and deliveye,planned as restaurant directory</p>
<h5>Phone: <a href="tel:+080000012222">080 000012 222</a></h5> </div>
<div class="col-xs-12 col-sm-5 additional-info color-gray">
<h5>Addition informations</h5>
<p>Join the thousands of other restaurants who benefit from having their menus on TakeOff</p>
</div>
</div>
</div>
</div>
<!-- bottom footer ends -->
</div>
</footer>
<!-- end:Footer -->
</div>
<!-- end:page wrapper -->
</div>
<!--/end:Site wrapper -->
<!-- Modal -->
<div class="modal fade" id="order-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button>
<div class="modal-body cart-addon">
<div class="food-item white">
<div class="row">
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="item-img pull-left">
<a class="restaurant-logo pull-left" href="#"><img src="http://placehold.it/70x70" alt="Food logo"></a>
</div>
<!-- end:Logo -->
<div class="rest-descr">
<h6><a href="#">Sandwich de Alegranza Grande Menü (28 - 30 cm.)</a></h6> </div>
<!-- end:Description -->
</div>
<!-- end:col -->
<div class="col-xs-6 col-sm-2 col-lg-2 text-xs-center"> <span class="price pull-left">$ 2.99</span></div>
<div class="col-xs-6 col-sm-4 col-lg-4">
<div class="row no-gutter">
<div class="col-xs-7">
<select class="form-control b-r-0" id="exampleSelect2">
<option>Size SM</option>
<option>Size LG</option>
<option>Size XL</option>
</select>
</div>
<div class="col-xs-5">
<input class="form-control" type="number" value="0" id="quant-input-2"> </div>
</div>
</div>
</div>
<!-- end:row -->
</div>
<!-- end:Food item -->
<div class="food-item">
<div class="row">
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="item-img pull-left">
<a class="restaurant-logo pull-left" href="#"><img src="http://placehold.it/70x70" alt="Food logo"></a>
</div>
<!-- end:Logo -->
<div class="rest-descr">
<h6><a href="#">Sandwich de Alegranza Grande Menü (28 - 30 cm.)</a></h6> </div>
<!-- end:Description -->
</div>
<!-- end:col -->
<div class="col-xs-6 col-sm-2 col-lg-2 text-xs-center"> <span class="price pull-left">$ 2.49</span></div>
<div class="col-xs-6 col-sm-4 col-lg-4">
<div class="row no-gutter">
<div class="col-xs-7">
<select class="form-control b-r-0" id="exampleSelect3">
<option>Size SM</option>
<option>Size LG</option>
<option>Size XL</option>
</select>
</div>
<div class="col-xs-5">
<input class="form-control" type="number" value="0" id="quant-input-3"> </div>
</div>
</div>
</div>
<!-- end:row -->
</div>
<!-- end:Food item -->
<div class="food-item">
<div class="row">
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="item-img pull-left">
<a class="restaurant-logo pull-left" href="#"><img src="http://placehold.it/70x70" alt="Food logo"></a>
</div>
<!-- end:Logo -->
<div class="rest-descr">
<h6><a href="#">Sandwich de Alegranza Grande Menü (28 - 30 cm.)</a></h6> </div>
<!-- end:Description -->
</div>
<!-- end:col -->
<div class="col-xs-6 col-sm-2 col-lg-2 text-xs-center"> <span class="price pull-left">$ 1.99</span></div>
<div class="col-xs-6 col-sm-4 col-lg-4">
<div class="row no-gutter">
<div class="col-xs-7">
<select class="form-control b-r-0" id="exampleSelect5">
<option>Size SM</option>
<option>Size LG</option>
<option>Size XL</option>
</select>
</div>
<div class="col-xs-5">
<input class="form-control" type="number" value="0" id="quant-input-4"> </div>
</div>
</div>
</div>
<!-- end:row -->
</div>
<!-- end:Food item -->
<div class="food-item">
<div class="row">
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="item-img pull-left">
<a class="restaurant-logo pull-left" href="#"><img src="http://placehold.it/70x70" alt="Food logo"></a>
</div>
<!-- end:Logo -->
<div class="rest-descr">
<h6><a href="#">Sandwich de Alegranza Grande Menü (28 - 30 cm.)</a></h6> </div>
<!-- end:Description -->
</div>
<!-- end:col -->
<div class="col-xs-6 col-sm-2 col-lg-2 text-xs-center"> <span class="price pull-left">$ 3.15</span></div>
<div class="col-xs-6 col-sm-4 col-lg-4">
<div class="row no-gutter">
<div class="col-xs-7">
<select class="form-control b-r-0" id="exampleSelect6">
<option>Size SM</option>
<option>Size LG</option>
<option>Size XL</option>
</select>
</div>
<div class="col-xs-5">
<input class="form-control" type="number" value="0" id="quant-input-5"> </div>
</div>
</div>
</div>
<!-- end:row -->
</div>
<!-- end:Food item -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn theme-btn">Add to cart</button>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="js/jquery.min.js"></script>
<script src="js/tether.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/animsition.min.js"></script>
<script src="js/bootstrap-slider.min.js"></script>
<script src="js/jquery.isotope.min.js"></script>
<script src="js/headroom.js"></script>
<script src="js/foodpicky.min.js"></script>
</body>
</html>