-
Notifications
You must be signed in to change notification settings - Fork 0
/
cart.php
243 lines (228 loc) · 8.89 KB
/
cart.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
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$databasename="database name";
$conn = mysqli_connect('localhost', 'root', '','final');
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());}
$query = "SELECT * FROM cart";
$result = $conn->query($query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="mystyle.css">
<link rel="shortcut icon" href="images/favicon.png" type="image/png">
<title>Your Account</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
<!--owl slider stylesheet -->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" />
<!-- nice select -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-nice-select/1.1.0/css/nice-select.min.css" integrity="sha512-CruCP+TD3yXzlvvijET8wV5WxxEh5H8P4cmz0RFbKK6FlZ2sYl3AEsKlLPHbniXKSrDdFewhbmBK5skbdsASbQ==" crossorigin="anonymous" />
<!-- font awesome style -->
<link href="css/font-awesome.min.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet" />
<!-- responsive style -->
<link href="css/responsive.css" rel="stylesheet" />
<style>
.checkout-btn {
margin-top: 50px;
text-align: center;
}
</style>
</head>
<body>
<header class="header_section">
<div class="container">
<nav class="navbar navbar-expand-lg custom_nav-container ">
<a class="navbar-brand" href="index.php">
<span>
HungryHub
</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class=""> </span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mx-auto ">
<li class="nav-item">
<a class="nav-link" href="index.php">Home </a>
</li>
<li class="nav-item active">
<a class="nav-link" href="menu.php">Menu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="book.php">Book Table</a>
</li>
</ul>
<div class="user_option">
<a href="customer.php" class="user_link">
<i class="fa fa-user" aria-hidden="true"></i>
</a>
<a class="cart_link" href="cart.php">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 456.029 456.029" style="enable-background:new 0 0 456.029 456.029;" xml:space="preserve">
<g>
<g>
<path d="M345.6,338.862c-29.184,0-53.248,23.552-53.248,53.248c0,29.184,23.552,53.248,53.248,53.248
c29.184,0,53.248-23.552,53.248-53.248C398.336,362.926,374.784,338.862,345.6,338.862z" />
</g>
</g>
<g>
<g>
<path d="M439.296,84.91c-1.024,0-2.56-0.512-4.096-0.512H112.64l-5.12-34.304C104.448,27.566,84.992,10.67,61.952,10.67H20.48
C9.216,10.67,0,19.886,0,31.15c0,11.264,9.216,20.48,20.48,20.48h41.472c2.56,0,4.608,2.048,5.12,4.608l31.744,216.064
c4.096,27.136,27.648,47.616,55.296,47.616h212.992c26.624,0,49.664-18.944,55.296-45.056l33.28-166.4
C457.728,97.71,450.56,86.958,439.296,84.91z" />
</g>
</g>
<g>
<g>
<path d="M215.04,389.55c-1.024-28.16-24.576-50.688-52.736-50.688c-29.696,1.536-52.224,26.112-51.2,55.296
c1.024,28.16,24.064,50.688,52.224,50.688h1.024C193.536,443.31,216.576,418.734,215.04,389.55z" />
</g>
</g>
</svg>
</a>
<form class="form-inline">
<button class="btn my-2 my-sm-0 nav_search-btn" type="submit">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</form>
<a href="menu.php" class="order_online">
Order Online
</a>
</div>
</div>
</nav>
</div>
</header>
<div class="table-container">
<div class="tblr">
<div class="tblc"><b>Item</b></div>
<div class="tblc"><b>Description</b></div>
<div class="tblc"><b>Price</b></div>
</div>
<?php
while ($row = mysqli_fetch_assoc($result)) {
?>
<div class="tblr">
<div class="tblc"><?php echo $row['Item'];?></div>
<div class="tblc"><?php echo $row['Descrip'];?></div>
<div class="tblc">$<?php echo $row['Price'];?></div>
</div>
<?php
}
?>
<div class="tblr">
<div class="tblc" colspan="2"></div>
<div class="tblc"></div>
<?php
$query = "SELECT SUM(Price) FROM cart";
$result100 = $conn->query($query);
while ($row = mysqli_fetch_assoc($result100)) {
?>
<div class="tblc">$
<?php
echo $row['SUM(Price)'];
?>
</div>
<?php
}
?>
</div>
<form method="post" action="delete.php">
<div class="checkout-btn">
<button type="submit" class="btn btn-warning" name="checkout">Checkout</button>
</div>
</form>
</div>
<!-- footer section -->
<footer class="footer_section">
<div class="container">
<div class="row">
<div class="col-md-4 footer-col">
<div class="footer_contact">
<h4>
Contact Us
</h4>
<div class="contact_link_box">
<a href="about.php">
<i class="fa fa-map-marker" aria-hidden="true"></i>
<span>
Location
</span>
</a>
<a href="">
<i class="fa fa-phone" aria-hidden="true"></i>
<span>
Call +92 1234567890
</span>
</a>
<a href="">
<i class="fa fa-envelope" aria-hidden="true"></i>
<span>
</span>
</a>
</div>
</div>
</div>
<div class="col-md-4 footer-col">
<div class="footer_detail">
<a href="index.php" class="footer-logo">
HungryHub
</a>
<p>
Follow us on
</p>
<div class="footer_social">
<a href="https://www.facebook.com/">
<i class="fa fa-facebook" aria-hidden="true"></i>
</a>
<a href="https://twitter.com/?lang=en">
<i class="fa fa-twitter" aria-hidden="true"></i>
</a>
<a href="https://www.linkedin.com/">
<i class="fa fa-linkedin" aria-hidden="true"></i>
</a>
<a href="https://www.instagram.com/">
<i class="fa fa-instagram" aria-hidden="true"></i>
</a>
<a href="https://www.pinterest.com/">
<i class="fa fa-pinterest" aria-hidden="true"></i>
</a>
</div>
</div>
</div>
<div class="col-md-4 footer-col">
<h4>
Opening Hours
</h4>
<p>
Everyday
</p>
<p>
10.00 Am -10.00 Pm
</p>
</div>
</div>
<div class="footer-info">
<p>
© <span id="displayYear"></span> All Rights Reserved By
<a href="about.php">HungryHub</a><br><br>
© <span id="displayYear"></span> Distributed By
<a href="https://cms.bahria.edu.pk/Logins/Student/Login.aspx" target="_blank">Ahmed, Ashad, Shahbaz</a>
</p>
</div>
</div>
</footer>
<!-- footer section -->
</body>
</html>