Repository navigation
Expand file tree
/
Copy pathmSearchProcess.php
More file actions
57 lines (48 loc) · 1.9 KB
/
Copy pathmSearchProcess.php
File metadata and controls
57 lines (48 loc) · 1.9 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
<?php
// Assuming this is part of a larger file
// Correct the $_POST usage
$stNum = $_POST["stNum"];
$mid = $_POST["Mid"];
if ($stNum == null) {
echo ("Please Enter the Style Number");
} else {
?>
<div class=" col-12 table" id="mtable">
<div class="col-12 tableHead">
<div class="row">
<div class="col-3 th "> Style Number</div>
<div class="col-3 th "> Factory</div>
<div class="col-3 th "> Date</div>
<div class="col-3 th "> Status</div>
</div>
</div>
<?php
require "connection.php";
// Assuming Database::search returns a mysqli result set
$rs = Database::search("SELECT * FROM `style` WHERE `st_num` LIKE '%" . $stNum . "%' AND `merchant_mid`='".$mid."'");
// Check if there are rows
if ($rs->num_rows > 0) {
// Use a loop to fetch each row
while ($data = $rs->fetch_assoc()) {
$status_rs = Database::search("SELECT * FROM `status` WHERE `id` = '" . $data["status_id"] . "'");
$status_data = $status_rs->fetch_assoc();
// Output your HTML here for each row
?>
<div class="col-12 tableRow" onclick="loadStyle();">
<div class="row">
<div class="col-3 tr "> <?php echo ($data["st_num"]) ?></div>
<div class="col-3 tr "> <?php echo ($data["factory"]) ?></div>
<div class="col-3 tr "> <?php echo ($data["date_time"]) ?></div>
<div class="col-3 tr "> <?php echo ($status_data["status_name"]) ?></div>
</div>
</div>
<?php
}
} else {
// Handle the case where no results are found
echo "No results found.";
}
// Close the result set
$rs->close();
}
?>