-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy_order_details.php
56 lines (51 loc) · 1.51 KB
/
my_order_details.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
<?php
require('header.php');
if(!isset($_SESSION['USER_LOGIN'])){
?>
<script>
window.location.href='index.php';
</script>
<?php
}
$order_id=get_safe_value($con,$_GET['id']);
?>
<div class="header-cart">
<h1>MY ORDER DETAILS</h1>
</div>
<table class="my-order-table">
<thead>
<tr>
<th scope="col">Product Name</th>
<th scope="col">Product Image</th>
<th scope="col">Qty</th>
<th scope="col">Price</th>
<th scope="col">Total Price</th>
</tr>
</thead>
<tbody>
<?php
$uid=$_SESSION['USER_ID'];
$res=mysqli_query($con,"select distinct(order_detail.id) ,order_detail.*,product.name,product.image from order_detail,product ,ordertb where order_detail.order_id='$order_id' and ordertb.user_id='$uid' and order_detail.product_id=product.id");
$total_price=0;
while($row=mysqli_fetch_assoc($res)){
$total_price=$total_price+($row['qty']*$row['price']);
echo $row['qty'];
?>
<tr>
<td data-label="Product Name"><?php echo $row['name']?></td>
<td data-label="Product Image"><img src="<?php echo PRODUCT_IMAGE_SITE_PATH.$row['image']?>"></td>
<td data-label="Qty"><?php echo $row['qty']?></td>
<td data-label="Price"><?php echo $row['price']?></td>
<td data-label="Total Price"><?php echo $row['qty']*$row['price']?></td>
</tr>
<?php } ?>
<tr>
<td colspan="3"></td>
<td >Total Price</td>
<td ><?php echo $total_price?></td>
</tr>
</tbody>
</table>
<?php
require('footer.php');
?>