Skip to content

Commit 0f9687d

Browse files
Fix: "another column added in box table"
1 parent e5cfe9f commit 0f9687d

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

box.php

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,24 +532,28 @@
532532
<thead>
533533
<tr>
534534

535-
<th scope="col" style="width:8%;">#</th>
536-
<th scope="col" style="width: 24%;">Box name</th>
537-
<th scope="col" style="width: 24%;">Box ID</th>
538-
535+
<th scope="col" style="width:10%;">#</th>
536+
<th scope="col" style="width: 20%;">Box name</th>
537+
<th scope="col" style="width: 20%;">Box ID</th>
538+
<th scope="col" style="width: 20%;">Comp. Name</th>
539539
<!-- <th scope="col" style="width: 24%;">Company Name</th> -->
540-
<th scope="col" style="width: 24%;">Created at</th>
540+
<th scope="col" style="width: 20%;">Created at</th>
541541
<!-- <th scope="col" style="width: 30%;">Barcode</th> -->
542542
<th scope="col" style="width: 10%;">Action</th>
543543
</tr>
544544
</thead>
545545
<tbody style="table-layout: fixed;">
546-
547546
<?php
548547

549548
//counter variable
550549
$counter = 1;
551550

551+
552552
while ($row = $result->fetch_assoc()) {
553+
554+
555+
//dexlare variable for box_id
556+
553557
echo "<tr>";
554558
echo "<tr>";
555559
echo "<td>" . $counter++ . "</td>";
@@ -561,6 +565,19 @@
561565

562566
echo "<td>" . ($row["box_id"]) . "</td>";
563567

568+
//get specific company id
569+
$comp_item=$row['companiID_FK'];
570+
571+
//show company name of box
572+
$sql3 = "SELECT * FROM compani WHERE comp_id= '$comp_item'";
573+
$result3 = $conn->query($sql3);
574+
if($result->num_rows>0){
575+
$row3= $result3->fetch_assoc();
576+
$comp_name=$row3['comp_name'];
577+
}
578+
579+
580+
echo "<td>" . $comp_name. "</td>";
564581

565582

566583
echo "<td>" . ($row["created_at"]) . "</td>";

boxUpdate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@
630630
<!-- Start Header form -->
631631
<div class="headerimg text-center">
632632
<img src="image/update.png.png" alt="network-logo" width="50" height="50" />
633-
<h2>Update item</h2>
633+
<h2>Update box</h2>
634634
</div>
635635
<!-- End Header form -->
636636

emailTable.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
$tableHTML = "<table border='1' cellpadding='10' cellspacing='0'>
2121
<thead>
2222
<tr>
23-
<th>#</th>
2423
<th>Company Name</th>
2524
<th>Phone</th>
2625
<th>Email</th>
@@ -34,9 +33,8 @@
3433
<tbody>";
3534

3635
while ($row = mysqli_fetch_assoc($result)) {
37-
$counter = 1;
36+
3837
$tableHTML .= "<tr>
39-
<td>{$counter}</td>
4038
<td>{$row['comp_name']}</td>
4139
<td>{$row['phone']}</td>
4240
<td>{$row['email']}</td>
@@ -46,7 +44,7 @@
4644
<td>{$row['registration']}</td>
4745
<td>{$row['expiry']}</td>
4846
</tr>";
49-
$counter++; // Increment the counter for each row
47+
5048
}
5149

5250
$tableHTML .= "</tbody></table>";

0 commit comments

Comments
 (0)