prepare($ss)) { if ($result = $stmnt->execute()) { if ($row = $result->FetchArray(SQLITE3_ASSOC)) { $row['linkedTime'] = SecToString(intval($row['linkedTime'])); $row['module'] = strtoupper($mod); $row['modem'] = $cfg[$module]; $row['freq'] = $freq; $row['link'] = $row['to_callsign']." ".$row['to_mod']; $jsonArray[] = $row; } else { $jsonArray[] = array('linkedTime' => '', 'module' =>strtoupper($mod), 'modem' => $cfg[$module], 'freq' => $freq, 'link' => 'Unlinked', 'ip_address' => '', 'to_callsign' => '', 'to_mod' => ''); } $result->finalize(); } $stmnt->close(); } } } $db->close(); echo json_encode($jsonArray); } else { echo "Section disabled"; } ?>