Files
urfd/dashboard/json/views/links.php
T
Matt Fiscus bdadea3cd1 Fixed timezone issue
Found an issue where timezone could be incorrect in api if server admin changes server timezeone to localtime instead of UTC.
2023-11-28 17:32:08 -07:00

24 lines
719 B
PHP

<?php
/*** Add links to payload ***/
for ($i=0;$i<$Reflector->NodeCount();$i++) {
// craft payload array
$payload[$i] = array(
'callsign' => $Reflector->Nodes[$i]->GetCallSign() . ' ' . $Reflector->Nodes[$i]->GetSuffix(),
'ip' => $Reflector->Nodes[$i]->GetIP(),
'linkedmodule' => $Reflector->Nodes[$i]->GetLinkedModule(),
'protocol' => $Reflector->Nodes[$i]->GetProtocol(),
'connecttime' => gmdate('Y-m-d\TH:i:sp', $Reflector->Nodes[$i]->GetConnectTime()),
'lastheardtime' => gmdate('Y-m-d\TH:i:sp', $Reflector->Nodes[$i]->GetLastHeardTime())
);
}
// json encode payload array
$records = json_encode($payload);
echo $records;
?>