php separate

This commit is contained in:
2025-12-09 13:14:27 +00:00
parent 94dfd20e84
commit 062a1d1f97
28 changed files with 4702 additions and 0 deletions

20
php/warntrack.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
require_once __DIR__ . '/common.php';
$dbconn = getDBConnection();
//no gets, curent point outage info
if(empty(array_diff_key($_GET, array('service' => '')))) {
$result = pg_query($dbconn,
"SELECT json_build_object('type', 'FeatureCollection','features', json_agg(json_build_object('type','Feature', 'geometry', ST_AsGeoJSON(nwspoly)::json,'properties',json_build_object('issue',issue,'endtime',endtime,'warntype',warntype,'etin',etin,'followups',followups,'followup',followup,'canexp',canexp,'warnexpired',warnexpired,'vtectext',vtectext,'office',office))order by issue desc)) FROM warntracker WHERE office = 'KRLX' and svstype = 'NEW' and EXTRACT(EPOCH FROM (current_timestamp - endtime ))/60 < 2400") or die('Query failed: ' . pg_last_error());
$resultArray = pg_fetch_all($result);
echo($resultArray[0]['json_build_object']);
}
pg_free_result($result);
// Close database connection when needed
if (isset($dbconn)) {
pg_close($dbconn);
}
?>