-
Notifications
You must be signed in to change notification settings - Fork 0
/
your_orders.php
408 lines (332 loc) · 13.2 KB
/
your_orders.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
<!DOCTYPE html>
<html lang="en">
<?php
include("connection/connect.php");
error_reporting(0);
session_start();
if(empty($_SESSION['user_id'])) //if usser is not login redirected baack to login page
{
header('location:login.php');
}
else
{
?>
<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>Oder</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">
<style type="text/css" rel="stylesheet">
.indent-small {
margin-left: 5px;
}
.form-group.internal {
margin-bottom: 0;
}
.dialog-panel {
margin: 10px;
}
.datepicker-dropdown {
z-index: 200 !important;
}
.panel-body {
background: #e5e5e5;
/* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #e5e5e5 0%, #ffffff 100%);
/* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #e5e5e5), color-stop(100%, #ffffff));
/* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #e5e5e5 0%, #ffffff 100%);
/* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #e5e5e5 0%, #ffffff 100%);
/* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #e5e5e5 0%, #ffffff 100%);
/* IE10+ */
background: radial-gradient(ellipse at center, #e5e5e5 0%, #ffffff 100%);
/* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e5e5e5', endColorstr='#ffffff', GradientType=1);
/* IE6-9 fallback on horizontal gradient */
font: 600 15px "Open Sans", Arial, sans-serif;
}
label.control-label {
font-weight: 600;
color: #777;
}
table {
width: 750px;
border-collapse: collapse;
margin: auto;
}
/* Zebra striping */
tr:nth-of-type(odd) {
background: #eee;
}
th {
background: #ff3300;
color: white;
font-weight: bold;
}
td, th {
padding: 10px;
border: 1px solid #ccc;
text-align: left;
font-size: 14px;
}
/*
Max width before this PARTICULAR table gets nasty
This query will take effect for any screen smaller than 760px
and also iPads specifically.
*/
@media
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px) {
table {
width: 100%;
}
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
tr { border: 1px solid #ccc; }
td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 50%;
}
td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
/* Label the data */
content: attr(data-column);
color: #000;
font-weight: bold;
}
}
</style>
</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"><i><b>Home</i></b><span class="sr-only">(current)</span></a> </li>
<li class="nav-item"> <a class="nav-link active" href="restaurants.php"> <i><b>Restaurants</i></b><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"><i><b>login</i></b></a> </li>
<li class="nav-item"><a href="registration.php" class="nav-link active"><i><b>signup</i></b></a> </li>';
}
else
{
echo '<li class="nav-item"><a href="your_orders.php" class="nav-link active"><i><b>Your Orders</i></b></a> </li>';
echo '<li class="nav-item"><a href="logout.php" class="nav-link active"><i><b>Logout</i></b></a> </li>';
}
?>
</ul>
</div>
</div>
</nav>
<!-- /.navbar -->
</header>
<div class="page-wrapper">
<!-- top Links -->
<!-- end:Top links -->
<!-- start: Inner page hero -->
<div class="inner-page-hero bg-image" data-image-src="images/img/res.jpeg">
<div class="container"> </div>
<!-- end:Container -->
</div>
<div class="result-show">
<div class="container">
<div class="row">
</div>
</div>
</div>
<!-- //results show -->
<section class="restaurants-page">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-3">
<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">
Fried Shrimps
</a> </li>
<li> <a href="#" class="tag">
Potato Puff Pastry
</a> </li>
<li> <a href="#" class="tag">
Coffee
</a> </li>
<li> <a href="#" class="tag">
Lemon
</a> </li>
<li> <a href="#" class="tag">
Cheese Pakora </a> </li>
</ul>
</div>
</div>
<!-- end:Widget -->
</div>
<div class="col-xs-12 col-sm-7 col-md-7 ">
<div class="bg-gray restaurant-entry">
<div class="row">
<table >
<thead>
<tr>
<th>Item</th>
<th>Quantity</th>
<th>price</th>
<th>status</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
// displaying current session user login orders
$query_res= mysqli_query($db,"select * from users_orders where u_id='".$_SESSION['user_id']."'");
if(!mysqli_num_rows($query_res) > 0 )
{
echo '<td colspan="6"><center>You have No orders Placed yet. </center></td>';
}
else
{
while($row=mysqli_fetch_array($query_res))
{
?>
<tr>
<td data-column="Item"> <?php echo $row['title']; ?></td>
<td data-column="Quantity"> <?php echo $row['quantity']; ?></td>
<td data-column="price">LKR <?php echo $row['price']; ?></td>
<td data-column="status">
<?php
$status=$row['status'];
if($status=="" or $status=="NULL")
{
?>
<button type="button" class="btn btn-info" style="font-weight:bold;">Dispatch</button>
<?php
}
if($status=="in process")
{ ?>
<button type="button" class="btn btn-warning"><span class="fa fa-cog fa-spin" aria-hidden="true" ></span>On a Way!</button>
<?php
}
if($status=="closed")
{
?>
<button type="button" class="btn btn-success" ><span class="fa fa-check-circle" aria-hidden="true">Delivered</button>
<?php
}
?>
<?php
if($status=="rejected")
{
?>
<button type="button" class="btn btn-danger"> <i class="fa fa-close"></i>cancelled</button>
<?php
}
?>
</td>
<td data-column="Date"> <?php echo $row['date']; ?></td>
<td data-column="Action"> <a href="delete_orders.php?order_del=<?php echo $row['o_id'];?>" onclick="return confirm('Are you sure you want to cancel your order?');" class="btn btn-danger btn-flat btn-addon btn-xs m-b-10"><i class="fa fa-trash-o" style="font-size:16px"></i></a>
</td>
</tr>
<?php }} ?>
</tbody>
</table>
</div>
<!--end:row -->
</div>
</div>
</div>
</div>
</div>
</section>
<!-- start: FOOTER -->
<footer class="footer">
<div class="container">
<!-- bottom footer statrs -->
<div class="bottom-footer">
<div class="row">
<div class="col-xs-12 col-sm-3 payment-options color-gray">
<h5><i>Payment Options</i></h5>
<ul>
<li>
<a href="#"> <img src="images/pay-online.jpg" alt="Paypal"> </a>
</li>
</ul>
</div>
<div class="col-xs-12 col-sm-4 address color-gray">
</div>
<div class="col-xs-12 col-sm-5 additional-info color-gray">
<h5><i><u>About Us</u></i></h5>
<i><h5>Address :- </h5>
<p>Madampe Road<br>Kanadulla,<br>Kuliyapitiya</p>
<h5>Phone :- <a href="tel: 037 222 4594">037 222 4594</a></h5>
<h5>Email :- <a href="foodpicky@gmail.com">foodpicky@gmail.com</a></h5>
<h5>Fax :- 0001535758 </h5></i>
</div>
</div>
</div>
<!-- bottom footer ends -->
</div>
</footer>
<!-- end:Footer -->
<!-- end:Footer -->
</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>
<?php
}
?>