more changes to example.php

pull/14/head
Tom Early 6 years ago
parent 2c3abb5482
commit 56e2d167a1

@ -107,12 +107,12 @@
echo '</code><br>', "\n"; echo '</code><br>', "\n";
$dbname = GetCFGValue('dashboard_sql_filename'); $dbname = GetCFGValue('dashboard_sql_filename');
$db = new SQLite3($dbname, SQLITE3_OPEN_READONLY); $db = new SQLite3($dbname, SQLITE3_OPEN_READONLY);
$ss = 'SELECT mycall,sfx,urcall,module,gateway,strftime("%s","now")-lasttime FROM LHEARD ORDER BY 6 LIMIT '.GetCFGValue('dashboard_lastheard_count'); $ss = 'SELECT mycall,sfx,urcall,module,gateway,strftime("%s","now")-lasttime FROM LHEARD ORDER BY 6 LIMIT '.GetCFGValue('dashboard_lastheard_count').' ';
if ($stmnt = $db->prepare($ss)) { if ($stmnt = $db->prepare($ss)) {
if ($result = $stmnt->execute()) { if ($result = $stmnt->execute()) {
while ($row = $result->FetchArray(SQLITE3_NUM)) { while ($row = $result->FetchArray(SQLITE3_NUM)) {
$cs = str_pad(trim($row[0]).'/'.trim($row[1]), 13); $cs = str_pad(trim($row[0]).'/'.trim($row[1]), 13);
$rstr = $cs.' '.$row[2].' '.$row[3].' '.$row[4].' '.SecToStrstring($row[4]).'<br>'; $rstr = $cs.' '.$row[2].' '.$row[3].' '.$row[4].' '.SecToString(intval($row[5])).'<br>';
echo str_replace(' ', '&nbsp;', $rstr), "\n"; echo str_replace(' ', '&nbsp;', $rstr), "\n";
} }
$result->finalize(); $result->finalize();

Loading…
Cancel
Save

Powered by TurnKey Linux.