-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuserorderdetail.php
66 lines (59 loc) · 1.4 KB
/
userorderdetail.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
<?php
include 'config.php';
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
?>
<style>
table {
display: flex;
justify-content: center;
width: 1600px;
text-align: left;
overflow: scroll;
border-collapse: collapse;
background-color: #f5f5f5;
}
th {
padding-right: 40px;
padding-left: 40px;
padding-bottom: 10px;
font-size: 16px;
}
td {
padding-left: 40px;
padding-bottom: 5px;
text-align: left;
font-size: 16px;
}
</style>
<body>
<table>
<tr>
<th>Placed on</th>
<th>Total Products</th>
<th>Total Price</th>
<th>Payment Method</th>
<th>Order 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><?php echo $fetch_orders['placed_on']; ?> </td>
<td><?php echo $fetch_orders['total_products']; ?></td>
<td>NRS <?php echo $fetch_orders['total_price']; ?>/- </td>
<td><?php echo $fetch_orders['method']; ?></td>
<td><?php echo $fetch_orders['payment_status']; ?></td>
</tr>
<?php
}
}else{
echo '<p class="empty">no orders placed yet!</p>';
}
?>
</table>
</body>