= 1.0)
return sprintf("%0.2f days", $days);
$hrs = intdiv($secs, 3600);
$sec %= 3600;
$min = intdiv($sec, 3600);
$sec %= 60;
if ($hrs > 9)
return sprintf("%d hr %2d min %2d sec", $hrs, $min, $sec);
if ($hrs)
return sprintf("%2d min $2 sec", $min, $sec);
if ($min > 9)
return sprintf("%d min %2d sec", $min, $sec);
if ($sec > 9)
return sprintf("%d sec", $sec);
return sprintf("%2d sec", $sec);
}
function LastHeardPage()
{
echo 'Last Heard:
', "\n";
$rstr = 'MyCall Sfx URCall Module Gateway Time
';
echo str_replace(' ', ' ', $rstr), "\n";
echo '
', "\n";
$dbname = GetCFGValue('dashboard_sql_filename');
$db = new SQLite3($dbname, SQLITE3_OPEN_READONLY);
$ss = 'SELECT mycall,sfx,urcall,module,gateway,strftime("%s","now")-lastime FROM LHEARD ORDER BY strftime("%s","now")-lastime LIMIT '.GetCFGValue('dashboard_lastheard_count', $cfg, $defaults);
if ($stmnt = $db->prepare()) {
if ($result = $stmnt->execute()) {
while ($row = $result->FetchArray(SQLITE3_NUM)) {
$rstr = $row[0].'/'.$row[1].' '.$row[2].' '.$row[3].' '.$row[4].' '.SecToStrstring($row[4]).'
';
echo str_replace(' ', ' ', $rstr), "\n";
}
$result->finalize();
}
$stmnt->close();
}
$db->Close();
echo '
', "\n";
}
$cfg = array();
$defaults = array();
ParseKVFile($cfgdir.'/qn.cfg', $cfg);
ParseKVFile($cfgdir.'/defaults', $defaults);
?>
QnetGateway Dashboard
2) {
echo 'Processes:
', "\n";
echo str_replace(' ', ' ', 'USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
'), "\n";
$lines = explode("\n", `ps -aux | grep -e qngateway -e qnlink -e qndtmf -e qndvap -e qnitap -e qnrelay -e qndvrptr -e qnmodem -e MMDVMHost | grep -v grep`);
foreach ($lines as $line) {
echo str_replace(' ', ' ', $line), "
\n";
}
echo '', "\n";
}
if ('true' == GetCFGValue('dashboard', $cfg, $defaults))
LastHeardPage();
?>
IP Addresses:
Modules:
| Module | Modem | Frequency | Repeater | Repeater IP |
',strtoupper($mod),' | ',$cfg[$module],' | ',$freq,' | ',$linkstatus,' | ',$stat[3],' | ',"\n";
}
}
?>
Send URCall:
0 && strlen($fmodule)>0) {
$command = 'qnremote '.strtolower($fmodule).' '.strtolower($cfg['ircddb_login']).' '.$furcall;
echo $command, "
\n";
$unused = `$command`;
}
?>