-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_order_status.php
233 lines (206 loc) · 10.6 KB
/
view_order_status.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
<?php
include '../config.php';
$admin = new Admin();
if (!isset($_SESSION['c_id'])) {
header('Location:index.php');
}
$cid = $_SESSION['c_id'];
$oid = $_GET['o_id'];
$stmt = $admin->ret("SELECT * FROM `customer` where `c_id`='$cid'");
$row = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<!doctype html>
<html lang="zxx">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Drug Rial</title>
<link rel="icon" href="img/favicon.png">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- animate CSS -->
<link rel="stylesheet" href="css/animate.css">
<!-- owl carousel CSS -->
<link rel="stylesheet" href="css/owl.carousel.min.css">
<!-- font awesome CSS -->
<link rel="stylesheet" href="css/all.css">
<!-- flaticon CSS -->
<link rel="stylesheet" href="css/flaticon.css">
<link rel="stylesheet" href="css/themify-icons.css">
<!-- font awesome CSS -->
<link rel="stylesheet" href="css/magnific-popup.css">
<!-- swiper CSS -->
<link rel="stylesheet" href="css/slick.css">
<!-- style CSS -->
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<link rel="stylesheet" href="css/order.css">
</head>
<body>
<!--::header part start::-->
<header class="main_menu home_menu">
<div class="container">
<div class="row align-items-center justify-content-center">
<div class="col-lg-12">
<?php include 'includes/navbar.php'; ?>
</div>
</div>
</div>
</header>
<!-- Header part end-->
<!-- banner part start-->
<div class="container">
<?php
$stmt1=$admin->ret("SELECT * FROM `order` WHERE `c_id`='$cid' and `o_id`='$oid' GROUP BY order.c_id");
while($row1=$stmt1->fetch(PDO::FETCH_ASSOC)){
$cid=$row1['c_id'];
$odate = $row1['o_date'];
$o_stutus = $row1['o_status'];
$date = date_create($odate);
date_add($date, date_interval_create_from_date_string('3 days'));
$estdate = date_format($date, 'Y-m-d');
$bstmt = $admin -> ret("SELECT `p_type` FROM `payment` WHERE `o_id` = '$oid'");
$brow = $bstmt -> fetch(PDO::FETCH_ASSOC);
$pmethod = $brow['p_type'];
?>
<article class="card">
<header class="card-header d-flex">
My Orders / Tracking
<div style="margin-left: 800px;">
<?php if($row1['o_status']=='canceled') {?> <button class="btn btn-danger">Your Order Has Been Canceled</button>
<?php } ?>
</div>
</header>
<div class="card-body">
<article class="card">
<div class="card-body row">
<div class="col"> <strong> Ordered Date:</strong> <br><?php echo $odate?> </div>
<div class="col"> <strong>Estimated Delivery time:</strong> <br><?php echo $estdate?></div>
<div class="col"> <strong>Status:</strong> <br> <?php echo $row1['o_status']?> </div>
<div class="col"> <strong>Payment</strong> <br> <?php echo $pmethod?> </div>
</div>
</article>
<?php if($row1['o_status']=='accepted'){?>
<div class="track">
<div class="step active"> <span class="icon"> <i class="fa fa-check"></i> </span> <span class="text">Order confirmed</span> </div>
<div class="step "> <span class="icon"> <i class="fa fa-user"></i> </span> <span class="text"> Picked by courier</span> </div>
<div class="step"> <span class="icon"> <i class="fa fa-truck"></i> </span> <span class="text"> On the way </span> </div>
<div class="step"> <span class="icon"> <i class="fa fa-box"></i> </span> <span class="text">Delivered</span> </div>
</div>
<?php }elseif($row1['o_status']=='Picked by courier'){ ?>
<div class="track">
<div class="step active"> <span class="icon"> <i class="fa fa-check"></i> </span> <span class="text">Order confirmed</span> </div>
<div class="step active"> <span class="icon"> <i class="fa fa-user"></i> </span> <span class="text"> Picked by courier</span> </div>
<div class="step"> <span class="icon"> <i class="fa fa-truck"></i> </span> <span class="text"> On the way </span> </div>
<div class="step"> <span class="icon"> <i class="fa fa-box"></i> </span> <span class="text">Delivered</span> </div>
</div>
<?php }elseif($row1['o_status']=='On the way'){ ?>
<div class="track">
<div class="step active"> <span class="icon"> <i class="fa fa-check"></i> </span> <span class="text">Order confirmed</span> </div>
<div class="step active"> <span class="icon"> <i class="fa fa-user"></i> </span> <span class="text"> Picked by courier</span> </div>
<div class="step active"> <span class="icon"> <i class="fa fa-truck"></i> </span> <span class="text"> On the way </span> </div>
<div class="step"> <span class="icon"> <i class="fa fa-box"></i> </span> <span class="text">Delivered</span> </div>
</div>
<?php }elseif($row1['o_status']=='Delivered'){ ?>
<div class="track">
<div class="step active"> <span class="icon"> <i class="fa fa-check"></i> </span> <span class="text">Order confirmed</span> </div>
<div class="step active"> <span class="icon"> <i class="fa fa-user"></i> </span> <span class="text"> Picked by courier</span> </div>
<div class="step active"> <span class="icon"> <i class="fa fa-truck"></i> </span> <span class="text"> On the way </span> </div>
<div class="step active"> <span class="icon"> <i class="fa fa-box"></i> </span> <span class="text">Delivered</span> </div>
</div>
<?php } ?>
<hr>
<ul class="row">
<?php
$total=0;
$g_total=0;
$stmt=$admin->ret("SELECT * FROM `order` INNER JOIN `medicine` ON medicine.m_id=order.m_id WHERE `c_id`='$cid' AND `o_id`='$oid'");
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
$price=$row['m_mrp'];
$qty=$row['o_qty'];
$total=$price*$qty;
$g_total=$g_total+$total;
?>
<li class="col-md-4 ">
<figure class="itemside mb-3">
<div class="aside"><img src="../employee/controller/<?php echo $row['m_image']?>" class="img-sm border"></div>
<figcaption class="info align-self-center">
<p class="title"><?php echo $row['m_title']?><br> Quantity: <?php echo $row['o_qty']?> <br>Price: ₹<?php echo $row['m_mrp']?></p> <h6 class="">Total: ₹<?php echo $total?></h6>
</figcaption>
</figure>
</li>
<?php } ?>
</ul>
<hr>
<div class="row">
<div>
<a href="orders.php" class="btn btn-warning" data-abc="true"> <i class="fa fa-chevron-left"></i> Back</a>
</div>
<div style="margin-left:750px">
<h4>Total: ₹ <?php echo $g_total?>.00</h4>
</div>
</div>
</div>
</article>
<?php } ?>
</div>
<!-- Button trigger modal -->
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">New message</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="controller/feedback.php" method="POST">
<div class="form-group">
<label for="message-text" class="col-form-label">Message:</label>
<textarea class="form-control" id="message-text" name="msg"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" name="feed">Send message</button>
</div>
</form>
</div>
</div>
</div>
<!-- banner part start-->
<!--::footer_part start::-->
<?php include 'includes/footer.php' ?>
<!--::footer_part end::-->
<!-- jquery plugins here-->
<script src="js/jquery-1.12.1.min.js"></script>
<!-- popper js -->
<script src="js/popper.min.js"></script>
<!-- bootstrap js -->
<script src="js/bootstrap.min.js"></script>
<!-- magnific popup js -->
<script src="js/jquery.magnific-popup.js"></script>
<!-- carousel js -->
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.nice-select.min.js"></script>
<!-- slick js -->
<script src="js/slick.min.js"></script>
<script src="js/jquery.counterup.min.js"></script>
<script src="js/waypoints.min.js"></script>
<script src="js/contact.js"></script>
<script src="js/jquery.ajaxchimp.min.js"></script>
<script src="js/jquery.form.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/mail-script.js"></script>
<!-- custom js -->
<script src="js/custom.js"></script>
</body>
</html>