fix: billing admin service list UI and customer server list display
- adminserverlist.php: fix th color (dark bg #2c3e50 + light text #f0f0f0) and add position:sticky to thead so header rows stay visible while scrolling - adminserverlist.php: remove Out of Stock column from UI (thead, tbody), save handler (no longer reads/writes out_of_stock), and sync logic (soft-disable no longer sets out_of_stock = 1; new rows no longer insert it) - adminserverlist.php: normalize price inputs to step=0.01 / 2 decimal places - serverlist.php: fix foreach on mysqli_result cast bug that silently prevented all services from rendering; now uses fetch_assoc() loop - serverlist.php: add IS NOT NULL guard alongside the != '' check Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/3474562e-25f4-4d89-a030-f227e11b609b Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
d5557a0145
commit
a484974c06
2 changed files with 34 additions and 34 deletions
|
|
@ -39,16 +39,25 @@ if (isset($_POST['save']) && !empty($_POST['description'])) {
|
|||
|
||||
// Fetch services
|
||||
$service_id = isset($_REQUEST['service_id']) ? intval($_REQUEST['service_id']) : 0;
|
||||
$where_service_id = $service_id !== 0 ? "WHERE enabled = 1 AND service_id = $service_id AND remote_server_id != ''" : "WHERE enabled = 1 AND remote_server_id != ''";
|
||||
$where_service_id = $service_id !== 0
|
||||
? "WHERE enabled = 1 AND service_id = $service_id AND remote_server_id != '' AND remote_server_id IS NOT NULL"
|
||||
: "WHERE enabled = 1 AND remote_server_id != '' AND remote_server_id IS NOT NULL";
|
||||
$qry_services = "SELECT * FROM {$table_prefix}billing_services $where_service_id ORDER BY service_name";
|
||||
$services = $db->query($qry_services);
|
||||
$result_services = $db->query($qry_services);
|
||||
|
||||
if (!$services) {
|
||||
if (!$result_services) {
|
||||
echo "<meta http-equiv='refresh' content='1'>";
|
||||
billing_maybe_close_db($db);
|
||||
return;
|
||||
}
|
||||
|
||||
// Fetch all service rows into an array so the template foreach works correctly
|
||||
$serviceRows = [];
|
||||
while ($row = $result_services->fetch_assoc()) {
|
||||
$serviceRows[] = $row;
|
||||
}
|
||||
$result_services->free();
|
||||
|
||||
// Include top bar and menu
|
||||
include(__DIR__ . '/includes/top.php');
|
||||
include(__DIR__ . '/includes/menu.php');
|
||||
|
|
@ -56,7 +65,7 @@ include(__DIR__ . '/includes/menu.php');
|
|||
|
||||
<!-- Services container: clearfix to contain floated service cards so footer clears correctly -->
|
||||
<div class="clearfix container-wide">
|
||||
<?php foreach ((array)$services as $row): ?>
|
||||
<?php foreach ($serviceRows as $row): ?>
|
||||
<?php if (!isset($_REQUEST['service_id'])): ?>
|
||||
<!-- Service listing (all) -->
|
||||
<div class="float-left p-30-20">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue