Item #4: centralize timezone, collapse the 16 pod branches to loops

- includes/db.php now defines PQS_TIMEZONE and sets it on include; the 9 files
  that hardcoded date_default_timezone_set('America/Chicago') drop the call
  (main pages already load db.php; display includes now require it).
- console.php: pod load and the 16 pod-checkbox lines collapsed into loops over
  a $pods array (fixed 16 kept - hardware max). Output unchanged.

Verified: timezone resolves to America/Chicago via the constant; console commit,
config update, and pod-checkbox rendering all correct; registration suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-01 14:30:57 -05:00
co-authored by Claude Opus 4.8
parent 0313606cf1
commit 689c6a4dd2
10 changed files with 26 additions and 44 deletions
+5
View File
@@ -15,6 +15,11 @@ const PQS_DB_USER = 'pqs';
const PQS_DB_PASS = 'pqs';
const PQS_DB_NAME = 'pqs';
// Single source of truth for the venue's timezone. Set on include so every
// page that pulls in db.php gets it without repeating the call.
const PQS_TIMEZONE = 'America/Chicago';
date_default_timezone_set(PQS_TIMEZONE);
/**
* Shared mysqli connection, opened once per request.
* mysqli is put into exception-reporting mode (the default since PHP 8.1) so
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
date_default_timezone_set('America/Chicago');
require_once __DIR__ . '/db.php';
$locked = 0;
$numplayers = 0;
$link = mysqli_connect('localhost', 'pqs', 'pqs') or die('Could not connect: ' . mysqli_error($link));
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
date_default_timezone_set('America/Chicago');
require_once __DIR__ . '/db.php';
$group = isset($_POST['group']) ? (int)$_POST['group'] : 0;
$link = mysqli_connect('localhost', 'pqs', 'pqs') or die('Could not connect: ' . mysqli_error($link));
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
date_default_timezone_set('America/Chicago');
require_once __DIR__ . '/db.php';
$link = mysqli_connect('localhost', 'pqs', 'pqs') or die('Could not connect: ' . mysqli_error($link));
mysqli_select_db($link, 'pqs') or die('Could not select database');
$query = "SELECT * FROM pqs_queue ORDER BY MissionID, ID";
+1 -1
View File
@@ -23,7 +23,7 @@ $(document).ready(function() {
});
</script>
<?php
date_default_timezone_set('America/Chicago');
require_once __DIR__ . '/db.php';
$numplayers = 0;
$link = mysqli_connect('localhost', 'pqs', 'pqs') or die('Could not connect: ' . mysqli_error($link));
mysqli_select_db($link, 'pqs') or die('Could not select database');
+1 -1
View File
@@ -1,5 +1,5 @@
<?Php
date_default_timezone_set('America/Chicago');
require_once __DIR__ . '/db.php';
$link = mysqli_connect('localhost', 'pqs', 'pqs') or die('Could not connect: ' . mysqli_error($link));
mysqli_select_db($link, 'pqs') or die('Could not select database');
$query = "SELECT * FROM pqs_gameconfig";