-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdelistatus.php
78 lines (75 loc) · 2.82 KB
/
delistatus.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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Product Delivery</title>
<link rel="stylesheet" type="text/css" href="vendor/css/food.css">
</head>
<body>
<?php require_once('menu.php'); ?>
<link rel="stylesheet" type="text/css" href="vendor/css/dataTables.bootstrap.min.css">
<script src="vendor/js/jquery.dataTables.min.js"></script>
<script src="vendor/js/dataTables.bootstrap.min.js"></script>
<div class="container" style="padding-bottom: 30px">
<div class="table-responsive">
<table class="table table-hover" id="deliveryTable">
<thead>
<tr>
<th>Product</th>
<th>Order date</th>
<th>Customer name</th>
<th>Product name</th>
<th>Quantity</th>
<th>Address</th>
<th>Delivery status</th>
</tr>
</thead>
<tbody>
<?php
$cu_id = $_SESSION["cu_id"];
$query = "SELECT p.image,order_id, orderDate, c.name as cu_name, p.name as p_name, quantity, address, isDelivered
FROM orders o join customer c on c.cu_id = o.cu_id
join product p on p.product_id = o.product_id
where c.cu_id = $cu_id";
$result = mysqli_query($connect, $query);
if (mysqli_num_rows($result) > 0):
?>
<input type="hidden" value="<?= $row['order_id'] ?>">
<?php
while ($row = mysqli_fetch_array($result)):
if ($row['isDelivered'] == 1)
$isDelivered = true;
else
$isDelivered = false;
?>
<tr>
<td><img src="<?= $row['image']; ?>" class="img-responsive"
style="height: 80px;"></td>
<td><?= $row['orderDate'] ?></td>
<td><?= $row['cu_name'] ?></td>
<td><?= $row['p_name'] ?></td>
<td><?= $row['quantity'] ?></td>
<td><?= $row['address'] ?></td>
<td>
<?php
if ($isDelivered)
echo '<b><p style="color:green;">Delivered</p></b>';
else
echo '<b><p style="color:red;">In progress</p></b>';
?>
</td>
</tr>
<?php endwhile; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<?php require_once('footer.php') ?>
</body>
</html>
<script>
$(document).ready(function () {
$('#deliveryTable').DataTable();
});
</script>