-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathorderstatustest.php
143 lines (122 loc) · 2.89 KB
/
orderstatustest.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
<?php
include 'config.php';
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
?>
<style>
.cart-page {
margin: 20px auto;
margin-bottom: 90px;
}
body {
background: #f5f5f5;
}
table {
width: 100%;
border-collapse: collapse;
background: #f5f5f5;
}
.cart-info {
display: flex;
flex-wrap: wrap;
}
th {
text-align: left;
padding: 5px;
color: white;
background: #ff523b;
font-weight: bold;
font-size: 16px;
padding-left: 40px;
padding-right: 40px;
}
.center {
text-align: center;
font-size: 24px;
font-weight: bold;
}
td {
text-align: left;
padding: 5px;
font-weight: normal;
font-size: 12px;
padding-left: 40px;
padding-right: 40px;
}
.empty {
text-align: center;
font-size: 24px;
color: red;
margin-bottom: 40px;
}
</style>
<body>
<div class="center">
YOUR ORDERS
</div>
<!--cart items detail-->
<div class="small-container cart-page">
<table>
<tr>
<th>Placed on</th>
<th>Product</th>
<th>Total Price</th>
<th>Payment Method</th>
<th>payment status</th>
</tr>
<?php
$select_orders = mysqli_query($conn, "SELECT * FROM `orders`where user_id='$user_id'") or die('query failed');
if(mysqli_num_rows($select_orders) > 0){
while($fetch_orders = mysqli_fetch_assoc($select_orders)){
?>
<tr>
<td>
<div class="cart-info">
<?php echo $fetch_orders['placed_on']; ?>
</div>
</td>
<td>
<div class="cart-info">
<?php echo $fetch_orders['total_products']; ?>
</div>
</td>
<td>
<div class="cart-info">
NRS <?php echo $fetch_orders['total_price']; ?>/-
</div>
</td>
<td>
<div class="cart-info">
<?php echo $fetch_orders['method']; ?>
</div>
</td>
<td>
<div class="cart-info">
<?php echo $fetch_orders['payment_status']; ?>
</div>
</td>
</tr>
<?php
}
}else{
echo '<p class="empty">no orders placed yet!</p>';
}
?>
</table>
</div>
<!-----------js for toggle menu----------->
<script>
var menuitems = document.getElementById("menuitems");
menuitems.style.maxHeight = "0px";
function menutoggle() {
if (menuitems.style.maxHeight = "0px") {
menuitems.style.maxHeight = "200px";
} else {
menuitems.style.maxHeight = "0px";
}
}
</script>
</body>
</html>