-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrack.php
189 lines (123 loc) · 3.56 KB
/
track.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
<?php
session_start();
ini_set('display_errors',0);
$link = mysqli_connect("localhost","root","","ecom");
$TEMP=$_SESSION['CUSTOMER_ID'];
$i=count($_SESSION['CART']);
if(is_array($_COOKIE['item']))
{
foreach($_COOKIE['item'] as $name1 => $value1)
{
$value11=explode("__",$value1);
if(isset($_POST["sub"]))
{
$help=0;
$temp=(int)$value11[5];
while($help<$i)
{
if($_SESSION['CART'][$help]==$temp)
{
unset($_SESSION['CART'][$help]);
}
$help++;
}
$_SESSION['CART']=array_values($_SESSION['CART']);
setcookie("item[$name1]","",time()-1800);
?>
<script type="text/javascript">
window.location='index.php';
</script>
<?php
}
}
}
?>
<?php
if(isset($_POST["sub"]))
{
?>
<script type="text/javascript">
window.location='index.php';
</script>
<?php
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>E-commerce</title>
<link rel="stylesheet" href="cart1.css" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="stylesheet" href="bootstrap.min.css"/>
</head>
<body>
<form action="" method="POST">
<div class="container-alpha">
<div class="navbar-beta">
<div class="logo">
<img src="./images/Free_Sample_By_Wix.jfif" width="125px" />
</div>
<nav>
<ul>
<li>
<b><a href="logout.php" style="color: white;">Home</a></b>
</li>
<li>
<b><a href="Product.php" style="color: white;">Products</a></b>
</li>
<li>
<b><a href="cart.php" style="color: white;">Cart</a></b>
</li>
<li>
<b><input type="submit" name="sub" value="Logout"></b>
</li>
</ul>
</nav>
</div>
</form>
<div>
<table class="table table-dark">
<thead>
<tr>
<th scope="col">Customer Name</th>
<th scope="col">Bill Paid Status</th>
<th scope="col">Product/s Bought on</th>
<th scope="col">Delivery Date</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><?php echo $_SESSION['CUSTOMER_NAME']?></th>
<td>YES</td>
<?php
$res=mysqli_query($link,"SELECT * FROM orders WHERE CUSTOMER_ID=$TEMP");
while($row=mysqli_fetch_array($res))
{
?>
<td><?php echo $row['ORDER_DATE']?></td>
<td><?php echo $row['SHIPPING_DATE']?> </td>
</tr>
</tbody>
</table>
</div>
</div>
<?php
}
?>
<div class="footer-god">
<div class="row">
<div class="footer-god-col2">
<img src="./images/Free_Sample_By_Wix.jfif" width="30px" />
<p>
Hope our services have rendered useful. Continue shopping to avail better offers and discounts!!!
</p>
</div>
</div>
</div>
</body>
</html>