-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_order.php
62 lines (59 loc) · 1.46 KB
/
view_order.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
<div class="container-fluid">
<table class="table table-bordered">
<thead>
<tr>
<th>Qty</th>
<th>Order</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php
$total = 0;
include 'db_connect.php';
$qry = $conn->query("SELECT * FROM order_list o inner join product_list p on o.product_id = p.id where order_id =".$_GET['id']);
while($row=$qry->fetch_assoc()):
$total += $row['qty'] * $row['price'];
?>
<tr>
<td><?php echo $row['qty'] ?></td>
<td><?php echo $row['name'] ?></td>
<td><?php echo number_format($row['qty'] * $row['price'],2) ?></td>
</tr>
<?php endwhile; ?>
</tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">TOTAL</th>
<th ><?php echo number_format($total,2) ?></th>
</tr>
</tfoot>
</table>
<div class="text-center">
<button class="btn btn-primary" id="confirm" type="button" onclick="confirm_order()">Confirm</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
<style>
#uni_modal .modal-footer{
display: none
}
</style>
<script>
function confirm_order(){
start_load()
$.ajax({
url:'ajax.php?action=confirm_order',
method:'POST',
data:{id:'<?php echo $_GET['id'] ?>'},
success:function(resp){
if(resp == 1){
alert_toast("Order confirmed.")
setTimeout(function(){
location.reload()
},1500)
}
}
})
}
</script>