fix: address code review - prepared stmt, first-radio auto-select, remove unused var, clarify comment
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/4a9c8aab-3782-44a8-a5e4-01b50a813cc0 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
b3d677035b
commit
7f6fe9a39a
3 changed files with 24 additions and 15 deletions
|
|
@ -201,12 +201,15 @@ if ($row['price_monthly'] == 0.0) {
|
|||
ORDER BY r.remote_server_name";
|
||||
$mappedResult = $db->query($mappedQuery);
|
||||
if ($mappedResult) {
|
||||
$firstServer = true;
|
||||
while ($rs = $mappedResult->fetch_assoc()) {
|
||||
$rsID = (int)$rs['remote_server_id'];
|
||||
$rsNAME = htmlspecialchars((string)$rs['remote_server_name'], ENT_QUOTES, 'UTF-8');
|
||||
$rsID = (int)$rs['remote_server_id'];
|
||||
$rsNAME = htmlspecialchars((string)$rs['remote_server_name'], ENT_QUOTES, 'UTF-8');
|
||||
$checked = $firstServer ? ' checked' : '';
|
||||
$available_server = true;
|
||||
$firstServer = false;
|
||||
echo "<div>\n"
|
||||
. " <input type='radio' name='ip_id' id='rs_{$rsID}' value='{$rsID}' required>\n"
|
||||
. " <input type='radio' name='ip_id' id='rs_{$rsID}' value='{$rsID}' required{$checked}>\n"
|
||||
. " <label for='rs_{$rsID}'>{$rsNAME}</label>\n"
|
||||
. "</div>\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue