-
Notifications
You must be signed in to change notification settings - Fork 0
/
order_history.php
91 lines (81 loc) · 3.52 KB
/
order_history.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
<?php
include ("header.php");
if(!isset($_SESSION['FOOD_USER_ID'])){
redirect(FRONT_SITE_PATH.'shop');
}
$uid=$_SESSION['FOOD_USER_ID'];
if(isset($_GET['cancel_id'])){
$cancel_id=get_safe_value($_GET['cancel_id']);
$cancel_at=date('Y-m-d h:i:s');
mysqli_query($con,"update order_master set order_status='5',cancel_by='user',cancel_at='$cancel_at' where id='$cancel_id' and order_status='1' and user_id='$uid'");
}
$sql="select order_master.*,order_status.order_status as order_status_str from order_master,order_status where order_master.order_status=order_status.id and order_master.user_id='$uid' order by order_master.id desc";
$res=mysqli_query($con,$sql);
?>
<div class="cart-main-area pt-95 pb-100">
<div class="container">
<h3 class="page-title">Order History</h3>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-12">
<form method="post">
<div class="table-content table-responsive">
<table>
<thead>
<tr>
<th>Order No</th>
<th>Price</th>
<th>.. </th>
<th>Table no</th>
<th>Seat no</th>
<th>Order Status</th>
<th>Payment Status</th>
</tr>
</thead>
<tbody>
<?php if(mysqli_num_rows($res)>0){
$i=1;
while($row=mysqli_fetch_assoc($res)){
?>
<tr>
<td>
<div class="div_order_id"><a href="<?php echo FRONT_SITE_PATH.'order_detail?id='.$row['id']?>"><?php echo $row['id']?></div></a>
<br/>
<a href="<?php echo FRONT_SITE_PATH?>download_invoice?id=<?php echo $row['id']?>"><img src='<?php echo FRONT_SITE_PATH?>assets/img/icon-img/pdf.png' width="20px" title="Download Invoice"/></a>
</td>
<td style="font-size:14px;">
<?php echo $row['total_price']?></td>
<td>
<?php
if($row['coupon_code']!=''){
?>
Coupon Code:- <?php echo $row['coupon_code']?><br/>
Final Price:- <?php echo $row['final_price']?>
<?php } ?>
</td>
<td><?php echo $row['address']?></td>
<td><?php echo $row['zipcode']?></td>
<td>
<?php
echo $row['order_status_str'];
if($row['order_status']==1){
echo "<br/>";
echo "<div style='margin-top:10px;'><a href='?cancel_id=".$row['id']."' class='cancel_btn'>Cancel</a></div>";
}
?>
</td>
<td>
<div class="payment_status payment_status_<?php echo $row['payment_status']?>"><?php echo ucfirst($row['payment_status'])?></div>
</td>
</tr>
<?php }} ?>
</tbody>
</table>
</div>
</form>
</div>
</div>
</div>
</div>
<?php
include("footer.php");
?>