-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfoods.php
86 lines (75 loc) · 3.44 KB
/
foods.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
<?php include('partials-front/navbar.php');?>
<!--food search section starts here-->
<section class="food-search text-center">
<h2>Order your favorite cusine</h2>
<div class="container">
<form action="<?php echo SETURL;?>food-search.php" method='POST'>
<input type="search" name="search" placeholder="Search for food..">
<button type="submit" name='submit' class="btn btn-primary">Search</button>
</form>
</div>
</section>
<!--food search section ends here-->
<!--food menu section starts here-->
<section class="food-menu">
<div class="container">
<h2 class="text-center">Menu</h2>
<?php
// display foods that are active
$sql = "SELECT * FROM tbl_food WHERE active ='Yes'";
// execute the query
$res = mysqli_query($conn, $sql);
// count rows
$count = mysqli_num_rows($res);
if ($count>0)
{
while($row = mysqli_fetch_assoc($res))
{
$id = $row['id'];
$title = $row['title'];
$price = $row['price'];
$image_name = $row['image_name'];
$description = $row['description'];
?>
<div class="food-menu-box">
<div class="food-menu-img">
<?php
// chechk whether the image is available or not
if ($image_name =="")
{
// image not available
echo '<div class="error">Image name not available. Stay Tuned!</div>';
}
else
{
// image not available
?>
<img src="<?php echo SETURL;?>images/food/<?php echo $image_name; ?>" class="img-responsive img-curve">
<?php
}
?>
</div>
<div class="food-menu-desc">
<h4><?php echo $title?></h4>
<p class="food-price">Rs. <?php echo $price?></p>
<p class="food-details">
<?php echo $description; ?>
</p>
<br>
<a href="<?php echo SETURL;?>order.php?food_id=<?php echo $id;?>" class="btn btn-primary">Order Now</a>
</div>
<div class="clearfix"></div>
</div>
<?php
}
}
else
{
echo '<div class="error">Food Not available. Stay Tuned!</div>';
}
?>
<div class="clearfix"></div>
</div>
</section>
<!--food menu section ends here-->
<?php include('partials-front/footer.php');?>