-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearchInvoiceProcess.php
More file actions
101 lines (76 loc) · 4.41 KB
/
searchInvoiceProcess.php
File metadata and controls
101 lines (76 loc) · 4.41 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
include "connection.php";
if(isset($_GET["id"])){
$invoice_id = $_GET["id"];
$invoice_rs = Database::search("SELECT * FROM `invoice` WHERE `invoice_id` = '".$invoice_id."' ");
$invoice_num = $invoice_rs->num_rows;
if($invoice_num == 1){
$invoice_data = $invoice_rs->fetch_assoc();
$users_rs = Database::search("SELECT * FROM `users` WHERE `email` = '".$invoice_data["users_email"]."' ");
$users_data = $users_rs->fetch_assoc();
$product_rs = Database::search("SELECT * FROM `product` WHERE `id` = '".$invoice_data["product_id"]."' ");
$product_data = $product_rs->fetch_assoc();
?>
<tr>
<td><?php echo $invoice_data["invoice_id"]; ?></td>
<td>
<div class="client">
<h6><?php echo $product_data["title"]; ?></h6>
</div>
</td>
<td>
<div class="client-info">
<h4><?php echo $users_data["fname"]." ".$users_data["lname"]; ?></h4>
</div>
</td>
<td>
<div class="client-info">
<h4><?php echo $invoice_data["total"]; ?></h4>
</div>
</td>
<td>
<div class="client-info">
<h4><?php echo $invoice_data["invoice_qty"]; ?></h4>
</div>
</td>
<td>
<div class="client-inf">
<?php
if($invoice_data["status"] == 0){
//confirm order
?>
<button class="btn btn-success fw-bold"> Confirm Order</button>
<?php
}else if($invoice_data["status"] == 1){
//packing
?>
<button class="btn btn-warning fw-bold">Packing</button>
<?php
}else if($invoice_data["status"] == 2){
//dispatch
?>
<button class="btn btn-danger fw-bold">Dispatched</button>
<?php
}else if($invoice_data["status"] == 3){
//shipping
?>
<button class="btn btn-dark fw-bold">Shipping</button>
<?php
}else if($invoice_data["status"] == 4){
//delivered
?>
<button class="btn btn-primary fw-bold disabled">Delivered</button>
<?php
}
?>
</div>
</td>
</tr>
<?php
}else{
echo("Invalid Invoice ID");
}
}else{
echo("Please add a Invoice id");
}
?>