-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.php
More file actions
170 lines (144 loc) · 5.99 KB
/
menu.php
File metadata and controls
170 lines (144 loc) · 5.99 KB
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
<?php include_once("header.php");
include('hms/include/config.php');
?>
<div class="jumbotron jumbotron-fluid">
<div class="container">
<center><h1>Menu</h1></center>
<center><p>Today's Special</p></center>
</div>
</div>
<div class="flex-container">
<a href="#row1"><button class="button2">BreakFast</button></a>
<a href="#row3"><button class="button2">Special Foods</button></a>
<a href="#row2"><button class="button2">Desert</button></a>
</div>
<!--<marquee direction="left">Hurry up!! Book Your Seat Now</marquee>
<marquee direction="right">Hurry up!! Book Your Seat Now</marquee>-->
<link rel="preconnect" href="https://fonts.googleapis.com">
</head>
<body>
<!-- Topic Cards -->
<div id="cards_landscape_wrap-2">
<div id="row1">
<div class="container">
<h2>BreakFast</h2>
<div class="row">
<?php
$procat='breakfast';
$sql=mysqli_query($con,"select * from product where procat='$procat'");
while($row=mysqli_fetch_array($sql))
{
?>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
<a href="">
<div class="card-flyer">
<div class="text-box">
<div class="image-box">
<img src="hms/images/<?php echo $row['proimg'];?>" alt="banana bread" />
</div>
<div class="text-container">
<h6><?php echo $row['proname'];?></h6>
<p> Rs. <?php echo $row['proprice'];?></p>
<br>
<form class="form-submit">
<input type="hidden" class="pname" value="<?php echo $row['proname'];?>">
<input type="hidden" class="pprice" value="<?php echo $row['proprice'];?>">
<input type="hidden" class="pimage" value="<?php echo $row['proimg'];?>">
<input type="hidden" class="pcode" value="<?php echo $row['id'];?>">
<button id="addItem" class="btn-success btn button">Add To Cart</button>
<div class="alert-message"></div>
</form>
</div>
</div>
</div>
</a>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<!-- Topic Cards2 -->
<div id="cards_landscape_wrap-2">
<div id="row2">
<div class="container">
<h2>Desert</h2>
<div class="row">
<?php
$procat='desert';
$sql=mysqli_query($con,"select * from product where procat='$procat'");
if (!empty($sql)) {
while($row=mysqli_fetch_array($sql))
{
?>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
<a href="">
<div class="card-flyer">
<div class="text-box">
<div class="image-box">
<img src="hms/images/<?php echo $row['proimg'];?>" alt="banana bread" />
</div>
<div class="text-container">
<h6><?php echo $row['proname'];?></h6>
<p> Rs. <?php echo $row['proprice'];?></p>
<br>
<form class="form-submit">
<input type="hidden" class="pname" value="<?php echo $row['proname'];?>">
<input type="hidden" class="pprice" value="<?php echo $row['proprice'];?>">
<input type="hidden" class="pimage" value="<?php echo $row['proimg'];?>">
<input type="hidden" class="pcode" value="<?php echo $row['id'];?>">
<button id="addItem" class="btn-success btn button">Add To Cart</button>
<div class="alert-message"></div>
</form>
</div>
</div>
</div>
</a>
</div>
<?php }}else{
echo "No Records.";
} ?>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$(document).on('click','#addItem',function(e){
e.preventDefault();
var form=$(this).closest(".form-submit");
var pcode=form.find('.pcode').val();
var pname=form.find('.pname').val();
var pimage=form.find('.pimage').val();
var pprice=form.find('.pprice').val();
//var $this = $(this);
var alertmsg=form.find('.alert-message');
$.ajax({
url:'action.php',
method:'post',
data:{pcode:pcode,pname:pname,pimage:pimage,pprice:pprice},
success:function(response){
console.log(response);
alertmsg.html(response);
// $this.closest('.alert-message').html(response)
//$(this).closest('.alert-message').html(response);
//alertmsg.html(response);
//window.scrollto(0,0);
load_cart_item_number();
}
});
});
load_cart_item_number();
function load_cart_item_number(){
$.ajax({
url:'action.php',
method:'get',
data:{cartItem:"cart_item"},
success:function(response){
$("#cart-item").html(response);
}
});
}
});
</script>
<?php include_once("footer.php"); ?>