- 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>
32 lines
1.3 KiB
PHP
32 lines
1.3 KiB
PHP
<?Php
|
|
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";
|
|
$result = mysqli_query($link, $query) or die('Query failed: ' . mysqli_error($link));
|
|
$line = mysqli_fetch_array($result);
|
|
$tpg = ($line[2] * 60) + $line[6];
|
|
|
|
|
|
$query = "SELECT max(unix_timestamp(ctime)) FROM pqs_pastmissions";
|
|
$result = mysqli_query($link, $query) or die('Query failed: ' . mysqli_error($link));
|
|
$line = mysqli_fetch_array($result);
|
|
$endlastgame = $line[0] + $tpg;
|
|
|
|
$tramaining = $endlastgame - time();
|
|
echo "<table width='98%' align='center'>";
|
|
echo "<tr><td class='queuedisplayhead'><font size='6'>Oficial Pod Bay Time:</font></td></tr>";
|
|
echo "<tr><td class='queuedisplayhead'><font size='7'>";
|
|
echo date("h:i", time());
|
|
echo "</font></td></tr>";
|
|
|
|
//echo "<tr><td class='queuedisplayhead'> </td></tr>";
|
|
echo "<tr><td class='queuedisplayhead'></td></tr>";
|
|
echo "<tr><td class='queuedisplayhead'>Current Mission ETR: </td></tr>";
|
|
if($tramaining > 0){
|
|
echo "<tr><td class='queuedisplayhead'><font size='7'>"; echo date("i:s", $tramaining); echo"</font></td></tr>";
|
|
}else{
|
|
echo "<tr><td class='queuedisplayhead'><font size='7'>Awaiting Next Launch</font></td></tr>";
|
|
}
|
|
?>
|