-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfood-detail.php
161 lines (139 loc) · 6.11 KB
/
food-detail.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
<?php
session_start();
error_reporting(0);
include_once('includes/dbconnection.php');
if(isset($_POST['addcart']))
{
$foodid=$_POST['foodid'];
$foodqty=$_POST['foodqty'];
$userid= $_SESSION['fosuid'];
$query=mysqli_query($con,"insert into tblorders(UserId,FoodId,FoodQty) values('$userid','$foodid','$foodqty') ");
if($query)
{
echo "<script>alert('Food has been added in to the cart');</script>";
} else {
echo "<script>alert('Something went wrong.');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>Food Ordering System | Food Details</title>
<link rel="stylesheet" href="assets/css/icons.min.css">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/red-color.css">
<link rel="stylesheet" href="assets/css/yellow-color.css">
<link rel="stylesheet" href="assets/css/responsive.css">
</head>
<body itemscope>
<?php include_once('includes/header.php');?>
<?php
//Getting Food details
$cid=$_GET['fid'];
$ret=mysqli_query($con,"select * from tblfood where ID='$cid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {
?>
<section>
<div class="block">
<div class="fixed-bg" style="background-image: url(assets/images/topbg.jpg);"></div>
<div class="page-title-wrapper text-center">
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="page-title-inner">
<h1 itemprop="headline"><?php echo $row['ItemName'];?> Details</h1>
</div>
</div>
</div>
</div>
</section>
<div class="bread-crumbs-wrapper">
<div class="container">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php" title="" itemprop="url">Home</a></li>
<li class="breadcrumb-item active">Food Details</li>
</ol>
</div>
</div>
<section>
<div class="block gray-bg bottom-padd210 top-padd30">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="sec-box">
<div class="sec-wrapper">
<form method="post">
<div class="col-md-8 col-sm-12 col-lg-8">
<div class="restaurant-detail-wrapper">
<div class="restaurant-detail-info">
<div class="restaurant-detail-thumb">
<ul class="restaurant-detail-img-carousel">
<li><img class="brd-rd3" src="admin/itemimages/<?php echo $row['Image'];?>" alt="<?php echo $row['ItemName'];?>" itemprop="image"></li>
</ul>
</div>
<div class="restaurant-detail-title">
<h1 itemprop="headline"><?php echo $row['ItemName'];?></h1>
<div class="info-meta">
<span><?php echo $row['CategoryName'];?></span>
</div>
<span class="price">Rs.<?php echo $row['ItemPrice'];?></span>
<div class="qty-wrap">
<input type="hidden" name="foodid" value="<?php echo $row['ID'];?>">
<input class="qty" name="foodqty" type="text" value="1">
</div>
<p itemprop="description"><?php echo $row['ItemDes'];?></p>
<?php if($_SESSION['fosuid']==""){?>
<a class="log-popup-btn" href="#" title="Login" class="btn pull-right red-bg brd-rd3">Order Now</a>
<?php } else {?>
<button type="submit" name="addcart" class="btn pull-right red-bg brd-rd3">Order Now</button>
<?php } ?>
</div>
</div>
</div>
</div>
</form>
<?php } ?>
<div class="col-md-3 col-sm-12 col-lg-3" style="margin-left:2%">
<div class="sidebar right">
<div class="widget style2 quick_filters wow fadeIn" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s; animation-name: fadeIn;">
<h4 class="widget-title2 sudo-bg-red" itemprop="headline">Food Categories</h4>
<div class="widget-data">
<ul>
<?php
$query=mysqli_query($con,"select * from tblcategory");
while($row=mysqli_fetch_array($query))
{
?>
<li><span class="radio-box"><label for="filt1-1"><a href="categorywise-menu.php?catid=<?php echo $row['CategoryName'];?>"><?php echo $row['CategoryName'];?></a></label></span></li>
<?php } ?>
</ul>
</div>
</div>
</div><!--Sidebar -->
</div>
</div>
</div>
</div>
</div>
</div><!-- Section Box -->
</div>
</section>
<!-- red section -->
<?php include_once('includes/footer.php');
include_once('includes/signin.php');
include_once('includes/signup.php');
?>
</main><!-- Main Wrapper -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script src="assets/js/google-map-int2.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>