-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearchInvoiceProcess.php
More file actions
91 lines (73 loc) · 3 KB
/
searchInvoiceProcess.php
File metadata and controls
91 lines (73 loc) · 3 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
<?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();
?>
<div class="row">
<div class="col-1 bg-secondary text-end">
<label class="form-label fs-5 fw-bold text-white mt-1 mb-1">
<?php echo $invoice_data["invoice_id"]; ?>
</label>
</div>
<?php
$product_rs = Database::search("SELECT * FROM `product` WHERE `id`='" . $invoice_data["product_id"] . "'");
$product_data = $product_rs->fetch_assoc();
?>
<div class="col-3 bg-body text-end">
<label class="form-label fs-5 fw-bold text-black mt-1 mb-1">
<?php echo $product_data["title"]; ?>
</label>
</div>
<?php
$user_rs = Database::search("SELECT * FROM `user` WHERE `email`='" . $invoice_data["user_email"] . "'");
$user_data = $user_rs->fetch_assoc();
?>
<div class="col-3 bg-secondary text-end">
<label class="form-label fs-5 fw-bold text-white mt-1 mb-1">
<?php echo $user_data["fname"] . " " . $user_data["lname"]; ?>
</label>
</div>
<div class="col-2 bg-body text-end">
<label class="form-label fs-5 fw-bold text-black mt-1 mb-1">
Rs. <?php echo $invoice_data["total"]; ?> .00
</label>
</div>
<div class="col-1 bg-secondary text-end">
<label class="form-label fs-5 fw-bold text-white mt-1 mb-1"><?php echo $invoice_data["qty"]; ?></label>
</div>
<div class="col-2 bg-white d-grid">
<?php
if ($invoice_data["status"] == 0) {
?>
<button class="btn btn-success fw-bold mt-1 mb-1">Confirm Order</button>
<?php
} else if ($invoice_data["status"] == 1) {
?>
<button class="btn btn-warning fw-bold mt-1 mb-1">Packing</button>
<?php
} else if ($invoice_data["status"] == 2) {
?>
<button class="btn btn-info fw-bold mt-1 mb-1">Dispatch</button>
<?php
} else if ($invoice_data["status"] == 3) {
?>
<button class="btn btn-primary fw-bold mt-1 mb-1">Shipping</button>
<?php
} else if ($invoice_data["status"] == 4) {
?>
<button class="btn btn-danger fw-bold mt-1 mb-1">Delivered</button>
<?php
}
?>
</div>
</div>
<?php
} else {
echo ("Invalid Invoice ID.");
}
}
?>