-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtracking.php
280 lines (239 loc) · 11.1 KB
/
tracking.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
<!doctype html>
<html lang="en">
<?php
session_start();
require 'phpfiles/init.php';
$full_path = pathinfo($_SERVER['PHP_SELF']);
$current_filename = $full_path['basename'];
$_SESSION["redirectionflag"] = $current_filename;
?>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="img/favicon.png" type="image/png">
<title>Fashiop</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="vendors/linericon/style.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="vendors/owl-carousel/owl.carousel.min.css">
<link rel="stylesheet" href="vendors/lightbox/simpleLightbox.css">
<link rel="stylesheet" href="vendors/nice-select/css/nice-select.css">
<link rel="stylesheet" href="vendors/animate-css/animate.css">
<link rel="stylesheet" href="vendors/jquery-ui/jquery-ui.css">
<!-- main css -->
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/responsive.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
</head>
<body>
<!--================Header Menu Area =================-->
<header class="header_area">
<div class="top_menu row m0">
<div class="container-fluid">
<div class="float-left">
<p>Call Us: 012 44 5698 7456 896</p>
</div>
<div class="float-right">
<ul class="right_side">
<?php
if(isset($_SESSION["email"])){
echo "
<li>
<a href=\"#\" style=\"text-transform: initial;\">
".$_SESSION["email"]."
</a>
</li>";
}else{
echo "<li>
<a href=\"login.php\">
Login/Register
</a>
</li>";
}
?>
<li>
<a href="contact.php">
Contact Us
</a>
</li>
<?php if(isset($_SESSION["email"])){ ?>
<li>
<a href="phpfiles/logout.php">
Logout
</a>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
<?php require 'header.php'; ?>
</header>
<!--================Header Menu Area =================-->
<!--================Home Banner Area =================-->
<br><br>
<!--================End Home Banner Area =================-->
<!--================Tracking Box Area =================-->
<section class="tracking_box_area p_120">
<div class="container">
<div class="billing_details">
<div class="row">
<div class="col-lg-7">
<p>To track your order please enter your Order ID in the box below and press the "Track" button. This was given
to you on your receipt and in the confirmation email you should have received.</p>
<form class="row tracking_form" method="get" action="tracking.php" >
<div class="col-md-6 form-group">
<input type="number" class="form-control" id="oid" name="oid" placeholder="Order ID" required>
</div>
<div class="col-md-6 form-group">
<button type="type" id="btn1" value="submit" class="btn submit_btn">Track Order</button>
</div>
</form>
</div>
<!--ADD HERE RESULTS -->
<?php
require 'phpfiles/init.php';
if(isset($_GET['oid'])){
$oid = $_GET['oid'];
if($oid <> null){
$sql4 = "SELECT * FROM order_placed WHERE oid = ".$oid.";";
$result4 = $conn->query($sql4);
?>
<!-- -->
<div class="col-lg-5">
<div class="order_box">
<h2>Your Order No: <?php echo $oid; ?></h2>
<ul class="list">
<li>
<a href="#">Product
<span> Total</span>
</a>
</li>
<?php
if ($result4->num_rows > 0) {
// output data of each row
$total = 0;
while($row2 = $result4->fetch_assoc()) {
$status = $row2["status"];
$total = $total + ($row2["cost"]*$row2["qty"]);
?>
<li>
<a href="#"><?php echo $row2["name"]; ?>
<span class="middle">x <?php echo $row2["qty"]; ?></span>
<span class="last">₹<?php echo ($row2["qty"]*$row2["cost"]); ?>.00</span>
</a>
</li>
<?php
}
}
?>
</ul>
<?php if ($result4->num_rows > 0) { ?>
<ul class="list list_2">
<li>
<a href="#">Subtotal
<span>₹<?php echo $total?>.00</span>
</a>
</li>
<li>
<a href="#">Shipping
<span>Flat rate: ₹50.00</span>
</a>
</li>
<li>
<a href="#">Total
<span>₹<?php echo ($total + 50); ?>.00</span>
</a>
</li>
<li>
<a href="#">Status:
<span><?php echo $status; ?></span>
</a>
</li>
</ul>
<?php }else{ ?>
<ul class="list list_3">
<li>
<a href="#">No such order found !
</a>
</li>
</ul>
<?php }?>
</div>
</div>
<?php }
}
?>
</div>
</div>
</div>
</section>
<!--================End Tracking Box Area =================-->
<section>
</section>
<!--================ start footer Area =================-->
<?php require 'footer.php'; ?>
<!--================ End footer Area =================-->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/popper.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/stellar.js"></script>
<script src="vendors/lightbox/simpleLightbox.min.js"></script>
<script src="vendors/nice-select/js/jquery.nice-select.min.js"></script>
<script src="vendors/isotope/imagesloaded.pkgd.min.js"></script>
<script src="vendors/isotope/isotope-min.js"></script>
<script src="vendors/owl-carousel/owl.carousel.min.js"></script>
<script src="js/jquery.ajaxchimp.min.js"></script>
<script src="js/mail-script.js"></script>
<script src="vendors/jquery-ui/jquery-ui.js"></script>
<script src="vendors/counter-up/jquery.waypoints.min.js"></script>
<script src="vendors/counter-up/jquery.counterup.js"></script>
<script src="js/theme.js"></script>
<script>
function isUserLoggedIn(){
var data = "<?php if(isset($_SESSION["id"]))echo true; else echo false; ?>";
//alert(data);
if(data==1){
//user is logged in, go ahead
location.href='cart.php';
//document.getElementById('my_form').submit();
}else{
//prompt user to login
alert("Please login to load your cart !");
location.href='login.php';
}
}
function isUserLoggedIn2(){
var data = "<?php if(isset($_SESSION["id"]))echo true; else echo false; ?>";
//alert(data);
if(data==1){
//user is logged in, go ahead
location.href='userdetails.php';
//document.getElementById('my_form').submit();
}else{
//prompt user to login
alert("Please login to load your cart !");
location.href='login.php';
}
}
function isUserLoggedInPast(){
var data = "<?php if(isset($_SESSION["id"]))echo true; else echo false; ?>";
//alert(data);
if(data==1){
//user is logged in, go ahead
location.href='pastorder.php';
//document.getElementById('my_form').submit();
}else{
//prompt user to login
alert("Please login to load your cart !");
location.href='login.php';
}
}
</script>
</body>
</html>