-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathorders.php
70 lines (44 loc) · 1.31 KB
/
orders.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
<?php
if (isset($_SESSION['customer_email'])) {
$c_id = $_SESSION['customer_email'];
$query = "select * from customer where customer_email= '$c_id'";
$run_query = mysqli_query($con, $query);
$get_query = mysqli_fetch_array($run_query);
$custom_id = $get_query['customer_id'];
$get_items = "select * from orders where c_id = '$custom_id' ORDER BY date DESC";
$run_items = mysqli_query($db, $get_items);
echo "
<div class='cart-table' style='min-height: 150px;'>
<table>
<thead style='font-size: larger;'>
<tr>
<th>Order ID</th>
<th>Price</th>
<th> Quantity</th>
<th>Date</th>
</tr>
</thead>
<tbody>
";
while ($row_items = mysqli_fetch_array($run_items)) {
$o_id = $row_items['order_id'];
$o_qty = $row_items['order_qty'];
$o_price = $row_items['order_price'];
$o_date = $row_items['date'];
echo
"<tr style='border-bottom: 0.5px solid #ebebeb'>
<td class='first-row'>$o_id</td>
<td class='first-row'>
$o_price
</td>
<td class='first-row'>$o_qty</td>
<td class='first-row'>
$o_date
</td>
</tr>";
}
}
?>
</tbody>
</table>
</div>