Code cleanup and reformatting

This commit is contained in:
dg9vh 2017-05-16 08:05:52 +00:00
parent f6a36ad9ce
commit 47f1cee519
8 changed files with 207 additions and 214 deletions

View file

@ -194,31 +194,31 @@ if ($_GET['section'] == "sysinfo") {
<?php <?php
} }
$output = shell_exec('cat /proc/loadavg'); $output = shell_exec('cat /proc/loadavg');
$sysload = substr($output,0,strpos($output," "))*100; $sysload = substr($output,0,strpos($output," "))*100;
showLapTime("sysload"); showLapTime("sysload");
$stat1 = file('/proc/stat'); $stat1 = file('/proc/stat');
sleep(1); sleep(1);
$stat2 = file('/proc/stat'); $stat2 = file('/proc/stat');
$info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0])); $info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0]));
$info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0])); $info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0]));
$dif = array(); $dif = array();
$dif['user'] = $info2[0] - $info1[0]; $dif['user'] = $info2[0] - $info1[0];
$dif['nice'] = $info2[1] - $info1[1]; $dif['nice'] = $info2[1] - $info1[1];
$dif['sys'] = $info2[2] - $info1[2]; $dif['sys'] = $info2[2] - $info1[2];
$dif['idle'] = $info2[3] - $info1[3]; $dif['idle'] = $info2[3] - $info1[3];
$total = array_sum($dif); $total = array_sum($dif);
$cpu = array(); $cpu = array();
foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1); foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
$cpuusage = round($cpu['user'] + $cpu['sys'], 2); $cpuusage = round($cpu['user'] + $cpu['sys'], 2);
showLapTime("cpuusage"); showLapTime("cpuusage");
$output = shell_exec('grep -c processor /proc/cpuinfo'); $output = shell_exec('grep -c processor /proc/cpuinfo');
$cpucores = $output; $cpucores = $output;
$output = shell_exec('cat /proc/uptime'); $output = shell_exec('cat /proc/uptime');
$uptime = format_time(substr($output,0,strpos($output," "))); $uptime = format_time(substr($output,0,strpos($output," ")));
$idletime = format_time((substr($output,strpos($output," ")))/$cpucores); $idletime = format_time((substr($output,strpos($output," ")))/$cpucores);
showLapTime("idletime"); showLapTime("idletime");
if (defined("SHOWPOWERSTATE")) { if (defined("SHOWPOWERSTATE")) {

View file

@ -18,7 +18,6 @@
<tbody> <tbody>
<?php <?php
error_reporting(E_ERROR | E_WARNING | E_PARSE); error_reporting(E_ERROR | E_WARNING | E_PARSE);
//include "./functions.php";
try{ try{
$datas = array(); $datas = array();
if (!(exec('/bin/df -T | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{print $2}\'` \'{print substr($0,c);}\' | tail -n +2 | awk \'{print $1","$2","$3","$4","$5","$6","$7}\'', $df))) { if (!(exec('/bin/df -T | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{print $2}\'` \'{print substr($0,c);}\' | tail -n +2 | awk \'{print $1","$2","$3","$4","$5","$6","$7}\'', $df))) {

View file

@ -27,9 +27,9 @@ function getMMDVMHostFileVersion() {
} }
function getFirmwareVersion() { function getFirmwareVersion() {
$logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log"; $logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
$logLines = explode("\n", `egrep "MMDVM protocol version" $logPath`); $logLines = explode("\n", `egrep "MMDVM protocol version" $logPath`);
$firmware = "n/a"; $firmware = "n/a";
if (count($logLines) >= 2) { if (count($logLines) >= 2) {
$firmware = substr($logLines[count($logLines)-2], strpos($logLines[count($logLines)-2], "description")+13, strlen($logLines[count($logLines)-2])-strpos($logLines[count($logLines)-2], "description")+13); $firmware = substr($logLines[count($logLines)-2], strpos($logLines[count($logLines)-2], "description")+13, strlen($logLines[count($logLines)-2])-strpos($logLines[count($logLines)-2], "description")+13);
$firmware = preg_replace('/GitID #([0-9A-Fa-f]{7})/', 'GitID #<a href="http://www.github.com/g4klx/MMDVM/commit/$1" target=\"_blank\">$1</a>', $firmware); $firmware = preg_replace('/GitID #([0-9A-Fa-f]{7})/', 'GitID #<a href="http://www.github.com/g4klx/MMDVM/commit/$1" target=\"_blank\">$1</a>', $firmware);
@ -53,8 +53,8 @@ function setDMRNetwork($network) {
} }
function getDMRNetwork() { function getDMRNetwork() {
$filename = 'config/DMRNetwork.txt'; $filename = 'config/DMRNetwork.txt';
$network = ''; $network = '';
if (file_exists($filename)) { if (file_exists($filename)) {
$fp = fopen($filename, 'r'); $fp = fopen($filename, 'r');
$network = fread($fp, filesize($filename)); $network = fread($fp, filesize($filename));
@ -64,8 +64,8 @@ function getDMRNetwork() {
} }
function getDMRNetwork2() { function getDMRNetwork2() {
$filename = '../config/DMRNetwork.txt'; $filename = '../config/DMRNetwork.txt';
$network = ''; $network = '';
if (file_exists($filename)) { if (file_exists($filename)) {
$fp = fopen($filename, 'r'); $fp = fopen($filename, 'r');
$network = fread($fp, filesize($filename)); $network = fread($fp, filesize($filename));
@ -76,9 +76,9 @@ function getDMRNetwork2() {
} }
function getDMRMasterState() { function getDMRMasterState() {
$logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log"; $logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
$logLines = explode("\n", `egrep -h "(DMR, Logged into the master successfully)|(DMR, Closing DMR Network)" $logPath`); $logLines = explode("\n", `egrep -h "(DMR, Logged into the master successfully)|(DMR, Closing DMR Network)" $logPath`);
$state = -1; $state = -1;
foreach($logLines as $logLine) { foreach($logLines as $logLine) {
if (strpos($logLine, "successfully") > 0) { if (strpos($logLine, "successfully") > 0) {
$state = 1; $state = 1;
@ -132,7 +132,7 @@ function getCallsign($mmdvmconfigs) {
function getConfigItem($section, $key, $configs) { function getConfigItem($section, $key, $configs) {
// retrieves the corresponding config-entry within a [section] // retrieves the corresponding config-entry within a [section]
$sectionpos = array_search("[" . $section . "]", $configs) + 1; $sectionpos = array_search("[" . $section . "]", $configs) + 1;
$len = count($configs); $len = count($configs);
while(startsWith($configs[$sectionpos],$key."=") === false && $sectionpos <= ($len) ) { while(startsWith($configs[$sectionpos],$key."=") === false && $sectionpos <= ($len) ) {
if (startsWith($configs[$sectionpos],"[")) { if (startsWith($configs[$sectionpos],"[")) {
return null; return null;
@ -191,25 +191,22 @@ function showMode($mode, $mmdvmconfigs) {
function getMMDVMLog() { function getMMDVMLog() {
// Open Logfile and copy loglines into LogLines-Array() // Open Logfile and copy loglines into LogLines-Array()
$logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log"; $logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
//$logLines = explode("\n", `grep M: $logPath`); $logLines = explode("\n", `egrep -h "from|end|watchdog|lost" $logPath`);
$logLines = explode("\n", `egrep -h "from|end|watchdog|lost" $logPath`);
return $logLines; return $logLines;
} }
function getShortMMDVMLog() { function getShortMMDVMLog() {
// Open Logfile and copy loglines into LogLines-Array() // Open Logfile and copy loglines into LogLines-Array()
$logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log"; $logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
$logLines = explode("\n", `egrep -h "from|end|watchdog|lost|Alias|0000" $logPath | grep -v "data header" | tail -20`); $logLines = explode("\n", `egrep -h "from|end|watchdog|lost|Alias|0000" $logPath | grep -v "data header" | tail -20`);
return $logLines; return $logLines;
} }
function getYSFGatewayLog() { function getYSFGatewayLog() {
// Open Logfile and copy loglines into LogLines-Array() // Open Logfile and copy loglines into LogLines-Array()
$logPath = YSFGATEWAYLOGPATH."/".YSFGATEWAYLOGPREFIX."-".date("Y-m-d").".log"; $logPath = YSFGATEWAYLOGPATH."/".YSFGATEWAYLOGPREFIX."-".date("Y-m-d").".log";
//$logLines = explode("\n", `egrep -h "D:|M:" $logPath`); $logLines = explode("\n", `egrep -h "repeater|Starting|Disconnect|Connect|Automatic|Disconnecting|Reverting" $logPath`);
$logLines = explode("\n", `egrep -h "repeater|Starting|Disconnect|Connect|Automatic|Disconnecting|Reverting" $logPath`);
return $logLines; return $logLines;
} }
@ -225,32 +222,32 @@ function getYSFGatewayLog() {
// M: 2017-02-13 15:53:31.253 0000: 05 00 20 47 69 6F 76 61 DC *.. Giova.* // M: 2017-02-13 15:53:31.253 0000: 05 00 20 47 69 6F 76 61 DC *.. Giova.*
function getHeardList($logLines, $onlyLast) { function getHeardList($logLines, $onlyLast) {
$heardList = array(); $heardList = array();
$ts1duration = ""; $ts1duration = "";
$ts1loss = ""; $ts1loss = "";
$ts1ber = ""; $ts1ber = "";
$ts1rssi = ""; $ts1rssi = "";
$ts1alias = "---"; $ts1alias = "---";
$ts2duration = ""; $ts2duration = "";
$ts2loss = ""; $ts2loss = "";
$ts2ber = ""; $ts2ber = "";
$ts2rssi = ""; $ts2rssi = "";
$ts2alias = "---"; $ts2alias = "---";
$dstarduration = ""; $dstarduration = "";
$dstarloss = ""; $dstarloss = "";
$dstarber = ""; $dstarber = "";
$dstarrssi = ""; $dstarrssi = "";
$ysfduration = ""; $ysfduration = "";
$ysfloss = ""; $ysfloss = "";
$ysfber = ""; $ysfber = "";
$ysfrssi = ""; $ysfrssi = "";
$alias = ""; $alias = "";
foreach ($logLines as $logLine) { foreach ($logLines as $logLine) {
$duration = ""; $duration = "";
$loss = ""; $loss = "";
$ber = ""; $ber = "";
$rssi = ""; $rssi = "";
//removing invalid lines //removing invalid lines
if(strpos($logLine,"BS_Dwn_Act")) { if(strpos($logLine,"BS_Dwn_Act")) {
continue; continue;
@ -310,23 +307,23 @@ function getHeardList($logLines, $onlyLast) {
else $rssiVal = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); else $rssiVal = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString);
if (constant("RSSI") != "all") { if (constant("RSSI") != "all") {
if ($rssiVal > "-53") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +40dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; if ($rssiVal > "-53") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +40dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-63") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +30dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-63") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +30dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-73") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +20dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-73") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +20dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-83") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +10dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-83") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +10dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-93") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-93") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-99") $rssi = "<img src=\"images/3.png\" \> <div class=\"tooltip2\">S8 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-99") $rssi = "<img src=\"images/3.png\" \> <div class=\"tooltip2\">S8 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-105") $rssi = "<img src=\"images/3.png\" \> <div class=\"tooltip2\">S7 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-105") $rssi = "<img src=\"images/3.png\" \> <div class=\"tooltip2\">S7 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-111") $rssi = "<img src=\"images/2.png\" \> <div class=\"tooltip2\">S6 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-111") $rssi = "<img src=\"images/2.png\" \> <div class=\"tooltip2\">S6 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-117") $rssi = "<img src=\"images/2.png\" \> <div class=\"tooltip2\">S5 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-117") $rssi = "<img src=\"images/2.png\" \> <div class=\"tooltip2\">S5 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-123") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S4 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-123") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S4 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-129") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S3 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-129") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S3 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-135") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S2 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-135") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S2 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-141") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S1 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-141") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S1 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
} else { } else {
$rssi = $rssiVal; $rssi = $rssiVal;
} }
} }
$ber = substr($loss, 5); $ber = substr($loss, 5);
$loss = ""; $loss = "";
} else { } else {
$loss = strtok($loss, " "); $loss = strtok($loss, " ");
@ -342,18 +339,18 @@ function getHeardList($logLines, $onlyLast) {
else $rssiVal = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString); else $rssiVal = preg_replace('/-\d+\/-\d+\/(-\d+) dBm/', "\\1", $rssiString);
if (constant("RSSI") != "all") { if (constant("RSSI") != "all") {
if ($rssiVal > "-53") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +40dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; if ($rssiVal > "-53") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +40dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-63") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +30dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-63") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +30dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-73") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +20dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-73") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +20dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-83") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +10dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-83") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9<sup> +10dB</sup> ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-93") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-93") $rssi = "<img src=\"images/4.png\" \> <div class=\"tooltip2\">S9 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-99") $rssi = "<img src=\"images/3.png\" \> <div class=\"tooltip2\">S8 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-99") $rssi = "<img src=\"images/3.png\" \> <div class=\"tooltip2\">S8 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-105") $rssi = "<img src=\"images/3.png\" \> <div class=\"tooltip2\">S7 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-105") $rssi = "<img src=\"images/3.png\" \> <div class=\"tooltip2\">S7 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-111") $rssi = "<img src=\"images/2.png\" \> <div class=\"tooltip2\">S6 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-111") $rssi = "<img src=\"images/2.png\" \> <div class=\"tooltip2\">S6 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-117") $rssi = "<img src=\"images/2.png\" \> <div class=\"tooltip2\">S5 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-117") $rssi = "<img src=\"images/2.png\" \> <div class=\"tooltip2\">S5 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-123") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S4 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-123") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S4 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-129") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S3 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-129") $rssi = "<img src=\"images/1.png\" \> <div class=\"tooltip2\">S3 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-135") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S2 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-135") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S2 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
else if ($rssiVal > "-141") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S1 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>"; else if ($rssiVal > "-141") $rssi = "<img src=\"images/0.png\" \> <div class=\"tooltip2\">S1 ($rssiVal dBm)<span class=\"tooltip2text\">(min/max/avg)<br>$rssiString</span></div>";
} else { } else {
$rssi = $rssiVal; $rssi = $rssiVal;
} }
@ -372,34 +369,34 @@ function getHeardList($logLines, $onlyLast) {
} else { } else {
switch (substr($logLine, 27, strpos($logLine,",") - 27)) { switch (substr($logLine, 27, strpos($logLine,",") - 27)) {
case "D-Star": case "D-Star":
$dstarduration = $duration; $dstarduration = $duration;
$dstarloss = $loss; $dstarloss = $loss;
$dstarber = $ber; $dstarber = $ber;
$dstarrssi = $rssi; $dstarrssi = $rssi;
break; break;
case "DMR Slot 1": case "DMR Slot 1":
$ts1duration = $duration; $ts1duration = $duration;
$ts1loss = $loss; $ts1loss = $loss;
$ts1ber = $ber; $ts1ber = $ber;
$ts1rssi = $rssi; $ts1rssi = $rssi;
break; break;
case "DMR Slot 2": case "DMR Slot 2":
$ts2duration = $duration; $ts2duration = $duration;
$ts2loss = $loss; $ts2loss = $loss;
$ts2ber = $ber; $ts2ber = $ber;
$ts2rssi = $rssi; $ts2rssi = $rssi;
break; break;
case "YSF": case "YSF":
$ysfduration = $duration; $ysfduration = $duration;
$ysfloss = $loss; $ysfloss = $loss;
$ysfber = $ber; $ysfber = $ber;
$ysfrssi = $rssi; $ysfrssi = $rssi;
break; break;
case "P25": case "P25":
$p25duration = $duration; $p25duration = $duration;
$p25loss = $loss; $p25loss = $loss;
$p25ber = $ber; $p25ber = $ber;
$p25rssi = $rssi; $p25rssi = $rssi;
break; break;
} }
} }
@ -434,34 +431,34 @@ function getHeardList($logLines, $onlyLast) {
switch ($mode) { switch ($mode) {
case "D-Star": case "D-Star":
$duration = $dstarduration; $duration = $dstarduration;
$loss = $dstarloss; $loss = $dstarloss;
$ber = $dstarber; $ber = $dstarber;
$rssi = $dstarrssi; $rssi = $dstarrssi;
break; break;
case "DMR Slot 1": case "DMR Slot 1":
$duration = $ts1duration; $duration = $ts1duration;
$loss = $ts1loss; $loss = $ts1loss;
$ber = $ts1ber; $ber = $ts1ber;
$rssi = $ts1rssi; $rssi = $ts1rssi;
break; break;
case "DMR Slot 2": case "DMR Slot 2":
$duration = $ts2duration; $duration = $ts2duration;
$loss = $ts2loss; $loss = $ts2loss;
$ber = $ts2ber; $ber = $ts2ber;
$rssi = $ts2rssi; $rssi = $ts2rssi;
break; break;
case "YSF": case "YSF":
$duration = $ysfduration; $duration = $ysfduration;
$loss = $ysfloss; $loss = $ysfloss;
$ber = $ysfber; $ber = $ysfber;
$rssi = $ysfrssi; $rssi = $ysfrssi;
break; break;
case "P25": case "P25":
$duration = $p25duration; $duration = $p25duration;
$loss = $p25loss; $loss = $p25loss;
$ber = $p25ber; $ber = $p25ber;
$rssi = $p25rssi; $rssi = $p25rssi;
break; break;
} }
@ -475,12 +472,12 @@ function getHeardList($logLines, $onlyLast) {
array_push($heardList, array(convertTimezone($timestamp), $mode, $callsign, $id, $target, $source, $duration, $loss, $ber, $rssi, $alias)); array_push($heardList, array(convertTimezone($timestamp), $mode, $callsign, $id, $target, $source, $duration, $loss, $ber, $rssi, $alias));
$alias = ""; $alias = "";
} }
$duration = ""; $duration = "";
$loss =""; $loss = "";
$ber = ""; $ber = "";
$rssi = ""; $rssi = "";
$ts1alias = "---"; $ts1alias = "---";
$ts2alias = "---"; $ts2alias = "---";
if ($onlyLast && count($heardList )> 20) { if ($onlyLast && count($heardList )> 20) {
return $heardList; return $heardList;
} }
@ -491,10 +488,10 @@ function getHeardList($logLines, $onlyLast) {
function getLastHeard($logLines, $onlyLast) { function getLastHeard($logLines, $onlyLast) {
//returns last heard list from log //returns last heard list from log
$lastHeard = array(); $lastHeard = array();
$heardCalls = array(); $heardCalls = array();
$heardList = getHeardList($logLines, $onlyLast); $heardList = getHeardList($logLines, $onlyLast);
$counter = 0; $counter = 0;
foreach ($heardList as $listElem) { foreach ($heardList as $listElem) {
if ( ($listElem[1] == "D-Star") || ($listElem[1] == "YSF") || ($listElem[1] == "P25") || (startsWith($listElem[1], "DMR")) ) { if ( ($listElem[1] == "D-Star") || ($listElem[1] == "YSF") || ($listElem[1] == "P25") || (startsWith($listElem[1], "DMR")) ) {
if(!(array_search($listElem[2]."#".$listElem[1].$listElem[4], $heardCalls) > -1)) { if(!(array_search($listElem[2]."#".$listElem[1].$listElem[4], $heardCalls) > -1)) {
@ -503,7 +500,6 @@ function getLastHeard($logLines, $onlyLast) {
array_push($heardCalls, $listElem[2]."#".$listElem[1].$listElem[4]); array_push($heardCalls, $listElem[2]."#".$listElem[1].$listElem[4]);
if (defined("ENABLEXTDLOOKUP")) { if (defined("ENABLEXTDLOOKUP")) {
if ($listElem[2] !== "??????????") { if ($listElem[2] !== "??????????") {
//$listElem[3] = "Dummy"; //Should speed up this function - time-issue!
$listElem[3] = getName($call_canon); //Should speed up this function - time-issue! $listElem[3] = getName($call_canon); //Should speed up this function - time-issue!
} else { } else {
$listElem[3] = "---"; $listElem[3] = "---";
@ -532,18 +528,17 @@ function getActualMode($metaLastHeard, $mmdvmconfigs) {
if (count($metaLastHeard) == 0) if (count($metaLastHeard) == 0)
return _("idle"); return _("idle");
// returns mode of repeater actual working in // returns mode of repeater actual working in
$listElem = $metaLastHeard[0]; $listElem = $metaLastHeard[0];
$timestamp = new DateTime($listElem[0],new DateTimeZone(TIMEZONE)); $timestamp = new DateTime($listElem[0],new DateTimeZone(TIMEZONE));
$mode = $listElem[1];
$mode = $listElem[1];
if (startsWith($mode, "DMR")) { if (startsWith($mode, "DMR")) {
$mode = "DMR"; $mode = "DMR";
} }
if (defined("ENABLEXTDLOOKUP") && $listElem[7] == null || !defined("ENABLEXTDLOOKUP") && $listElem[6] == null) { if (defined("ENABLEXTDLOOKUP") && $listElem[7] == null || !defined("ENABLEXTDLOOKUP") && $listElem[6] == null) {
return "<span class=\"label label-danger\">".$mode."</span>"; return "<span class=\"label label-danger\">".$mode."</span>";
} else { } else {
$now = new DateTime('NOW',new DateTimeZone(TIMEZONE)); $now = new DateTime('NOW',new DateTimeZone(TIMEZONE));
$hangtime = getConfigItem("General", "ModeHang", $mmdvmconfigs); $hangtime = getConfigItem("General", "ModeHang", $mmdvmconfigs);
if ($hangtime != "") { if ($hangtime != "") {
$timestamp->add(new DateInterval('PT' . $hangtime . 'S')); $timestamp->add(new DateInterval('PT' . $hangtime . 'S'));
@ -572,44 +567,44 @@ function getDSTARLinks() {
$out = "<table>"; $out = "<table>";
if ($linkLog = fopen(LINKLOGPATH."/Links.log",'r')) { if ($linkLog = fopen(LINKLOGPATH."/Links.log",'r')) {
while ($linkLine = fgets($linkLog)) { while ($linkLine = fgets($linkLog)) {
$linkDate = "&nbsp;"; $linkDate = "&nbsp;";
$protocol = "&nbsp;"; $protocol = "&nbsp;";
$linkType = "&nbsp;"; $linkType = "&nbsp;";
$linkSource = "&nbsp;"; $linkSource = "&nbsp;";
$linkDest = "&nbsp;"; $linkDest = "&nbsp;";
$linkDir = "&nbsp;"; $linkDir = "&nbsp;";
// Reflector-Link, sample: // Reflector-Link, sample:
// 2011-09-22 02:15:06: DExtra link - Type: Repeater Rptr: DB0LJ B Refl: XRF023 A Dir: Outgoing // 2011-09-22 02:15:06: DExtra link - Type: Repeater Rptr: DB0LJ B Refl: XRF023 A Dir: Outgoing
// 2012-04-03 08:40:07: DPlus link - Type: Dongle Rptr: DB0ERK B Refl: REF006 D Dir: Outgoing // 2012-04-03 08:40:07: DPlus link - Type: Dongle Rptr: DB0ERK B Refl: REF006 D Dir: Outgoing
// 2012-04-03 08:40:07: DCS link - Type: Repeater Rptr: DB0ERK C Refl: DCS001 C Dir: Outgoing // 2012-04-03 08:40:07: DCS link - Type: Repeater Rptr: DB0ERK C Refl: DCS001 C Dir: Outgoing
if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*Rptr: (.{8}).*Refl: (.{8}).*Dir: (.{8})/',$linkLine,$linx) > 0){ if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*Rptr: (.{8}).*Refl: (.{8}).*Dir: (.{8})/',$linkLine,$linx) > 0){
$linkDate = $linx[1][0]; $linkDate = $linx[1][0];
$protocol = $linx[2][0]; $protocol = $linx[2][0];
$linkType = $linx[3][0]; $linkType = $linx[3][0];
$linkSource = $linx[4][0]; $linkSource = $linx[4][0];
$linkDest = $linx[5][0]; $linkDest = $linx[5][0];
$linkDir = $linx[6][0]; $linkDir = $linx[6][0];
} }
// CCS-Link, sample: // CCS-Link, sample:
// 2013-03-30 23:21:53: CCS link - Rptr: PE1AGO C Remote: PE1KZU Dir: Incoming // 2013-03-30 23:21:53: CCS link - Rptr: PE1AGO C Remote: PE1KZU Dir: Incoming
if(preg_match_all('/^(.{19}).*(CC[A-Za-z]*).*Rptr: (.{8}).*Remote: (.{8}).*Dir: (.{8})/',$linkLine,$linx) > 0){ if(preg_match_all('/^(.{19}).*(CC[A-Za-z]*).*Rptr: (.{8}).*Remote: (.{8}).*Dir: (.{8})/',$linkLine,$linx) > 0){
$linkDate = $linx[1][0]; $linkDate = $linx[1][0];
$protocol = $linx[2][0]; $protocol = $linx[2][0];
$linkType = $linx[2][0]; $linkType = $linx[2][0];
$linkSource = $linx[3][0]; $linkSource = $linx[3][0];
$linkDest = $linx[4][0]; $linkDest = $linx[4][0];
$linkDir = $linx[5][0]; $linkDir = $linx[5][0];
} }
// Dongle-Link, sample: // Dongle-Link, sample:
// 2011-09-24 07:26:59: DPlus link - Type: Dongle User: DC1PIA Dir: Incoming // 2011-09-24 07:26:59: DPlus link - Type: Dongle User: DC1PIA Dir: Incoming
// 2012-03-14 21:32:18: DPlus link - Type: Dongle User: DC1PIA Dir: Incoming // 2012-03-14 21:32:18: DPlus link - Type: Dongle User: DC1PIA Dir: Incoming
if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*User: (.{6,8}).*Dir: (.*)$/',$linkLine,$linx) > 0){ if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*User: (.{6,8}).*Dir: (.*)$/',$linkLine,$linx) > 0){
$linkDate = $linx[1][0]; $linkDate = $linx[1][0];
$protocol = $linx[2][0]; $protocol = $linx[2][0];
$linkType = $linx[3][0]; $linkType = $linx[3][0];
$linkSource = "&nbsp;"; $linkSource = "&nbsp;";
$linkDest = $linx[4][0]; $linkDest = $linx[4][0];
$linkDir = $linx[5][0]; $linkDir = $linx[5][0];
} }
$out .= "<tr><td>" . $linkSource . "</td><td>&nbsp;" . $protocol . "-link</td><td>&nbsp;to&nbsp;</td><td>" . $linkDest . "</td><td>&nbsp;" . $linkDir . "</td></tr>"; $out .= "<tr><td>" . $linkSource . "</td><td>&nbsp;" . $protocol . "-link</td><td>&nbsp;to&nbsp;</td><td>" . $linkDest . "</td><td>&nbsp;" . $linkDir . "</td></tr>";
} }
@ -652,8 +647,8 @@ function getActualLink($logLines, $mode) {
} }
} }
if (file_exists('/tmp/DMR1State.txt')) { if (file_exists('/tmp/DMR1State.txt')) {
$fp = fopen('/tmp/DMR1State.txt', 'r'); $fp = fopen('/tmp/DMR1State.txt', 'r');
$contents = fread($fp, filesize("/tmp/DMR1State.txt")); $contents = fread($fp, filesize("/tmp/DMR1State.txt"));
fclose($fp); fclose($fp);
if (count($contents)>0){ if (count($contents)>0){
return $contents; return $contents;
@ -682,8 +677,8 @@ function getActualLink($logLines, $mode) {
} }
} }
if (file_exists('/tmp/DMR2State.txt')) { if (file_exists('/tmp/DMR2State.txt')) {
$fp = fopen('/tmp/DMR2State.txt', 'r'); $fp = fopen('/tmp/DMR2State.txt', 'r');
$contents = fread($fp, filesize("/tmp/DMR2State.txt")); $contents = fread($fp, filesize("/tmp/DMR2State.txt"));
fclose($fp); fclose($fp);
if (count($contents)>0){ if (count($contents)>0){
return $contents; return $contents;
@ -731,8 +726,8 @@ function getActualLink($logLines, $mode) {
return -2; return -2;
} }
if (file_exists('/tmp/YSFState.txt')) { if (file_exists('/tmp/YSFState.txt')) {
$fp = fopen('/tmp/YSFState.txt', 'r'); $fp = fopen('/tmp/YSFState.txt', 'r');
$contents = fread($fp, filesize("/tmp/YSFState.txt")); $contents = fread($fp, filesize("/tmp/YSFState.txt"));
fclose($fp); fclose($fp);
if (count($contents)>0){ if (count($contents)>0){
return $contents; return $contents;
@ -761,8 +756,8 @@ function getActualReflector($logLines, $mode) {
} }
if (file_exists('/tmp/DMR2RefState.txt')) { if (file_exists('/tmp/DMR2RefState.txt')) {
$fp = fopen('/tmp/DMR2RefState.txt', 'r'); $fp = fopen('/tmp/DMR2RefState.txt', 'r');
$contents = fread($fp, filesize("/tmp/DMR2RefState.txt")); $contents = fread($fp, filesize("/tmp/DMR2RefState.txt"));
fclose($fp); fclose($fp);
if (count($contents)>0){ if (count($contents)>0){
return $contents; return $contents;
@ -902,9 +897,9 @@ function getGitVersion(){
} }
function getDMRReflectors() { function getDMRReflectors() {
$data = file_get_contents("http://ham-dmr.de/reflector.db"); $data = file_get_contents("http://ham-dmr.de/reflector.db");
$rows = explode("\n",$data); $rows = explode("\n",$data);
$refls = array(); $refls = array();
foreach($rows as $row) { foreach($rows as $row) {
$refls[] = str_getcsv($row,"@",''); $refls[] = str_getcsv($row,"@",'');
} }
@ -912,9 +907,9 @@ function getDMRReflectors() {
} }
function getDMRplusDMRMasterList() { function getDMRplusDMRMasterList() {
$data = file_get_contents("http://ham-dmr.de/dmr/dmrmaster2.php"); $data = file_get_contents("http://ham-dmr.de/dmr/dmrmaster2.php");
$rows = explode("\n",$data); $rows = explode("\n",$data);
$s = array(); $s = array();
foreach($rows as $row) { foreach($rows as $row) {
$s[] = str_getcsv($row,"@",''); $s[] = str_getcsv($row,"@",'');
} }

View file

@ -16,7 +16,6 @@ if (defined("ENABLEYSFGATEWAY")) {
$logLinesYSFGateway = getYSFGatewayLog(); $logLinesYSFGateway = getYSFGatewayLog();
showLapTime("getYSFGatewayLog"); showLapTime("getYSFGatewayLog");
$reverseLogLinesYSFGateway = $logLinesYSFGateway; $reverseLogLinesYSFGateway = $logLinesYSFGateway;
//array_multisort($reverseLogLinesYSFGateway,SORT_DESC);
rsort($reverseLogLinesYSFGateway); rsort($reverseLogLinesYSFGateway);
showLapTime("array_multisort"); showLapTime("array_multisort");
$activeYSFReflectors = getActiveYSFReflectors(); $activeYSFReflectors = getActiveYSFReflectors();

View file

@ -1,10 +1,10 @@
<?php <?php
function format_time($seconds) { function format_time($seconds) {
$secs = intval($seconds % 60); $secs = intval($seconds % 60);
$mins = intval($seconds / 60 % 60); $mins = intval($seconds / 60 % 60);
$hours = intval($seconds / 3600 % 24); $hours = intval($seconds / 3600 % 24);
$days = intval($seconds / 86400); $days = intval($seconds / 86400);
$uptimeString = ""; $uptimeString = "";
if ($days > 0) { if ($days > 0) {
$uptimeString .= $days; $uptimeString .= $days;
@ -84,20 +84,20 @@ function checkSetup() {
} }
function startStopwatch() { function startStopwatch() {
$time = microtime(); $time = microtime();
$time = explode(' ', $time); $time = explode(' ', $time);
$time = $time[1] + $time[0]; $time = $time[1] + $time[0];
$_SESSION['starttime'] = $time; $_SESSION['starttime'] = $time;
return $time; return $time;
} }
function getLapTime() { function getLapTime() {
$start = $_SESSION['starttime']; $start = $_SESSION['starttime'];
$time = microtime(); $time = microtime();
$time = explode(' ', $time); $time = explode(' ', $time);
$time = $time[1] + $time[0]; $time = $time[1] + $time[0];
$finish = $time; $finish = $time;
$lap_time = round(($finish - $start), 4); $lap_time = round(($finish - $start), 4);
return $lap_time; return $lap_time;
} }
@ -115,9 +115,9 @@ function convertTimezone($timestamp) {
function encode($hex) { function encode($hex) {
$validchars = " abcdefghijklmnopqrstuvwxyzäöüßABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ0123456789"; $validchars = " abcdefghijklmnopqrstuvwxyzäöüßABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ0123456789";
$str = ''; $str = '';
$chrval = hexdec($hex); $chrval = hexdec($hex);
$str = chr($chrval); $str = chr($chrval);
if (strpos($validchars, $str)>=0) if (strpos($validchars, $str)>=0)
return $str; return $str;
else else
@ -126,7 +126,7 @@ function encode($hex) {
function recursive_array_search($needle,$haystack) { function recursive_array_search($needle,$haystack) {
foreach($haystack as $key=>$value) { foreach($haystack as $key=>$value) {
$current_key=$key; $current_key = $key;
if($needle===$value OR (is_array($value) && recursive_array_search($needle,$value) !== false)) { if($needle===$value OR (is_array($value) && recursive_array_search($needle,$value) !== false)) {
return $current_key; return $current_key;
} }

View file

@ -65,8 +65,8 @@ include "version.php";
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?><br>Firmware: <?php echo getFirmwareVersion() ?> <h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?><br>Firmware: <?php echo getFirmwareVersion() ?>
<?php <?php
if (defined("JSONNETWORK")) { if (defined("JSONNETWORK")) {
$key = recursive_array_search(getDMRNetwork(),$networks); $key = recursive_array_search(getDMRNetwork(),$networks);
$network = $networks[$key]; $network = $networks[$key];
echo "<br>"; echo "<br>";
echo _("Configuration").": ".$network['label']; echo _("Configuration").": ".$network['label'];
@ -80,9 +80,9 @@ include "version.php";
<?php <?php
$logourl = ""; $logourl = "";
if (defined("JSONNETWORK")) { if (defined("JSONNETWORK")) {
$key = recursive_array_search(getDMRNetwork(),$networks); $key = recursive_array_search(getDMRNetwork(),$networks);
$network = $networks[$key]; $network = $networks[$key];
$logourl = $network['logo']; $logourl = $network['logo'];
} else { } else {
if (getDMRNetwork() == "BrandMeister") { if (getDMRNetwork() == "BrandMeister") {
if (constant('BRANDMEISTERLOGO') !== NULL) { if (constant('BRANDMEISTERLOGO') !== NULL) {

View file

@ -150,10 +150,10 @@ function get_tz_options($selectedzone, $label, $desc = '') {
$i = 0; $i = 0;
foreach($all AS $zone) { foreach($all AS $zone) {
$zone = explode('/',$zone); $zone = explode('/',$zone);
$zonen[$i]['continent'] = isset($zone[0]) ? $zone[0] : ''; $zonen[$i]['continent'] = isset($zone[0]) ? $zone[0] : '';
$zonen[$i]['city'] = isset($zone[1]) ? $zone[1] : ''; $zonen[$i]['city'] = isset($zone[1]) ? $zone[1] : '';
$zonen[$i]['subcity'] = isset($zone[2]) ? $zone[2] : ''; $zonen[$i]['subcity'] = isset($zone[2]) ? $zone[2] : '';
$i++; $i++;
} }

View file

@ -36,9 +36,9 @@ foreach ($lastHeard as $listElem) {
}else{ }else{
echo"<td nowrap>$listElem[6]</td>"; echo"<td nowrap>$listElem[6]</td>";
} }
$d1 = new DateTime($listElem[0], new DateTimeZone(TIMEZONE)); $d1 = new DateTime($listElem[0], new DateTimeZone(TIMEZONE));
$d2 = new DateTime('now', new DateTimeZone(TIMEZONE)); $d2 = new DateTime('now', new DateTimeZone(TIMEZONE));
$diff = $d2->getTimestamp() - $d1->getTimestamp(); $diff = $d2->getTimestamp() - $d1->getTimestamp();
echo"<td nowrap>$diff s</td>"; echo"<td nowrap>$diff s</td>";
} else { } else {
if (defined("TALKERALIAS")) if (defined("TALKERALIAS"))
@ -50,10 +50,10 @@ foreach ($lastHeard as $listElem) {
}else{ }else{
echo"<td nowrap>$listElem[5]</td>"; echo"<td nowrap>$listElem[5]</td>";
} }
$tz = new DateTimeZone(TIMEZONE); $tz = new DateTimeZone(TIMEZONE);
$d1 = new DateTime($listElem[0], $tz); $d1 = new DateTime($listElem[0], $tz);
$d2 = new DateTime('now', $tz); $d2 = new DateTime('now', $tz);
$diff = $d2->getTimestamp() - $d1->getTimestamp(); $diff = $d2->getTimestamp() - $d1->getTimestamp();
echo"<td nowrap>$diff s</td>"; echo"<td nowrap>$diff s</td>";
} }
echo "</tr>"; echo "</tr>";