Merge pull request #75 from phl0/refactor

Refactor code with regard to whitespace and line endings
This commit is contained in:
Kim - DG9VH 2017-01-10 15:27:57 +01:00 committed by GitHub
commit 010d885f7b
24 changed files with 2264 additions and 2264 deletions

392
ajax.php
View file

@ -8,232 +8,232 @@ include "include/functions.php";
$mmdvmconfigs = getMMDVMConfig();
if (!defined("MMDVMLOGPREFIX"))
define("MMDVMLOGPREFIX", getConfigItem("Log", "FileRoot", $mmdvmconfigs));
define("MMDVMLOGPREFIX", getConfigItem("Log", "FileRoot", $mmdvmconfigs));
if (!defined("TIMEZONE"))
define("TIMEZONE", "UTC");
define("TIMEZONE", "UTC");
$logLinesMMDVM = getMMDVMLog();
$reverseLogLinesMMDVM = $logLinesMMDVM;
array_multisort($reverseLogLinesMMDVM,SORT_DESC);
if ($_GET['section'] == "mode") {
$mode = getActualMode(getLastHeard($reverseLogLinesMMDVM, TRUE), $mmdvmconfigs);
echo $mode;
$mode = getActualMode(getLastHeard($reverseLogLinesMMDVM, TRUE), $mmdvmconfigs);
echo $mode;
}
if ($_GET['section'] == "lastHeard") {
$lastHeard = getLastHeard($reverseLogLinesMMDVM, FALSE);
echo '{"data": '.json_encode($lastHeard)."}";
$lastHeard = getLastHeard($reverseLogLinesMMDVM, FALSE);
echo '{"data": '.json_encode($lastHeard)."}";
}
if ($_GET['section'] == "localTx") {
$localTXList = getHeardList($reverseLogLinesMMDVM, FALSE);
$lastHeard = Array();
for ($i = 0; $i < count($localTXList); $i++) {
$listElem = $localTXList[$i];
if (defined("ENABLEXTDLOOKUP")) {
if ($listElem[6] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) {
$listElem[3] = getName($listElem[2]);
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
$listElem[2] = "<a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a>";
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</a>";
}
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</a>";
}
}
array_push($lastHeard, $listElem);
}
} else {
if ($listElem[5] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) {
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
$listElem[2] = "<a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a>";
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</a>";
}
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</a>";
}
}
array_push($lastHeard, $listElem);
}
}
}
echo '{"data": '.json_encode($lastHeard)."}";
$localTXList = getHeardList($reverseLogLinesMMDVM, FALSE);
$lastHeard = Array();
for ($i = 0; $i < count($localTXList); $i++) {
$listElem = $localTXList[$i];
if (defined("ENABLEXTDLOOKUP")) {
if ($listElem[6] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) {
$listElem[3] = getName($listElem[2]);
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
$listElem[2] = "<a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a>";
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</a>";
}
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</a>";
}
}
array_push($lastHeard, $listElem);
}
} else {
if ($listElem[5] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) {
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
$listElem[2] = "<a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a>";
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</a>";
}
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</a>";
}
}
array_push($lastHeard, $listElem);
}
}
}
echo '{"data": '.json_encode($lastHeard)."}";
}
if ($_GET['section'] == "sysinfo") {
$cputemp = NULL;
$cpufreq = NULL;
if (file_exists ("/sys/class/thermal/thermal_zone0/temp")) {
exec("cat /sys/class/thermal/thermal_zone0/temp", $cputemp);
$cputemp = $cputemp[0] / 1000;
}
showLapTime("cputemp");
if (file_exists ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")) {
exec("cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", $cpufreq);
$cpufreq = $cpufreq[0] / 1000;
}
showLapTime("cpufreq");
$cputemp = NULL;
$cpufreq = NULL;
if (file_exists ("/sys/class/thermal/thermal_zone0/temp")) {
exec("cat /sys/class/thermal/thermal_zone0/temp", $cputemp);
$cputemp = $cputemp[0] / 1000;
}
showLapTime("cputemp");
if (file_exists ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")) {
exec("cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", $cpufreq);
$cpufreq = $cpufreq[0] / 1000;
}
showLapTime("cpufreq");
if (defined("TEMPERATUREALERT") && $cputemp > TEMPERATUREHIGHLEVEL && $cputemp !== NULL) {
if (defined("TEMPERATUREALERT") && $cputemp > TEMPERATUREHIGHLEVEL && $cputemp !== NULL) {
?>
<script>
function deleteLayer(id) {
if (document.getElementById && document.getElementById(id)) {
var theNode = document.getElementById(id);
theNode.parentNode.removeChild(theNode);
}
else if (document.all && document.all[id]) {
document.all[id].innerHTML='';
document.all[id].outerHTML='';
}
// OBSOLETE CODE FOR NETSCAPE 4
else if (document.layers && document.layers[id]) {
document.layers[id].visibility='hide';
delete document.layers[id];
}
}
<script>
function deleteLayer(id) {
if (document.getElementById && document.getElementById(id)) {
var theNode = document.getElementById(id);
theNode.parentNode.removeChild(theNode);
}
else if (document.all && document.all[id]) {
document.all[id].innerHTML='';
document.all[id].outerHTML='';
}
// OBSOLETE CODE FOR NETSCAPE 4
else if (document.layers && document.layers[id]) {
document.layers[id].visibility='hide';
delete document.layers[id];
}
}
function makeLayer(id,L,T,W,H,bgColor,visible,zIndex) {
if (document.getElementById) {
if (document.getElementById(id)) {
alert ('Layer with this ID already exists!');
return;
}
var ST = 'position:absolute; text-align:center;padding-top:20px;'
+'; left:'+L+'px'
+'; top:'+T+'px'
+'; width:'+W+'px'
+'; height:'+H+'px'
+'; clip:rect(0,'+W+','+H+',0)'
+'; visibility:'
+(null==visible || 1==visible ? 'visible':'hidden')
+(null==zIndex ? '' : '; z-index:'+zIndex)
+(null==bgColor ? '' : '; background-color:'+bgColor);
function makeLayer(id,L,T,W,H,bgColor,visible,zIndex) {
if (document.getElementById) {
if (document.getElementById(id)) {
alert ('Layer with this ID already exists!');
return;
}
var ST = 'position:absolute; text-align:center;padding-top:20px;'
+'; left:'+L+'px'
+'; top:'+T+'px'
+'; width:'+W+'px'
+'; height:'+H+'px'
+'; clip:rect(0,'+W+','+H+',0)'
+'; visibility:'
+(null==visible || 1==visible ? 'visible':'hidden')
+(null==zIndex ? '' : '; z-index:'+zIndex)
+(null==bgColor ? '' : '; background-color:'+bgColor);
var LR = '<DIV id='+id+' style="'+ST+'">CPU-Temperature is very high!<br><input type="button" value="Close" onclick="deleteLayer(\'LYR1\')"></DIV>';
var LR = '<DIV id='+id+' style="'+ST+'">CPU-Temperature is very high!<br><input type="button" value="Close" onclick="deleteLayer(\'LYR1\')"></DIV>';
if (document.body) {
if (document.body.insertAdjacentHTML)
document.body.insertAdjacentHTML("BeforeEnd",LR);
else if (document.createElement && document.body.appendChild) {
var newNode = document.createElement('div');
newNode.setAttribute('id',id);
newNode.setAttribute('style',ST);
document.body.appendChild(newNode);
}
}
}
}
var audio = new Audio('sounds/alert.mp3');
audio.play();
var x = window.innerWidth/2-100;
var y = window.innerHeight/2-50;
if (document.body) {
if (document.body.insertAdjacentHTML)
document.body.insertAdjacentHTML("BeforeEnd",LR);
else if (document.createElement && document.body.appendChild) {
var newNode = document.createElement('div');
newNode.setAttribute('id',id);
newNode.setAttribute('style',ST);
document.body.appendChild(newNode);
}
}
}
}
var audio = new Audio('sounds/alert.mp3');
audio.play();
var x = window.innerWidth/2-100;
var y = window.innerHeight/2-50;
makeLayer('LYR1',x,y,200,100,'red',1,1);
</script>
makeLayer('LYR1',x,y,200,100,'red',1,1);
</script>
<?php
}
}
$output = shell_exec('cat /proc/loadavg');
$sysload = substr($output,0,strpos($output," "))*100;
showLapTime("sysload");
$stat1 = file('/proc/stat');
sleep(1);
$stat2 = file('/proc/stat');
$info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0]));
$info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0]));
$dif = array();
$dif['user'] = $info2[0] - $info1[0];
$dif['nice'] = $info2[1] - $info1[1];
$dif['sys'] = $info2[2] - $info1[2];
$dif['idle'] = $info2[3] - $info1[3];
$total = array_sum($dif);
$cpu = array();
foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
$cpuusage = round($cpu['user'] + $cpu['sys'], 2);
showLapTime("cpuusage");
$output = shell_exec('cat /proc/loadavg');
$sysload = substr($output,0,strpos($output," "))*100;
showLapTime("sysload");
$stat1 = file('/proc/stat');
sleep(1);
$stat2 = file('/proc/stat');
$info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0]));
$info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0]));
$dif = array();
$dif['user'] = $info2[0] - $info1[0];
$dif['nice'] = $info2[1] - $info1[1];
$dif['sys'] = $info2[2] - $info1[2];
$dif['idle'] = $info2[3] - $info1[3];
$total = array_sum($dif);
$cpu = array();
foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
$cpuusage = round($cpu['user'] + $cpu['sys'], 2);
showLapTime("cpuusage");
$output = shell_exec('grep -c processor /proc/cpuinfo');
$cpucores = $output;
$output = shell_exec('grep -c processor /proc/cpuinfo');
$cpucores = $output;
$output = shell_exec('cat /proc/uptime');
$uptime = format_time(substr($output,0,strpos($output," ")));
$idletime = format_time((substr($output,strpos($output," ")))/$cpucores);
showLapTime("idletime");
$output = shell_exec('cat /proc/uptime');
$uptime = format_time(substr($output,0,strpos($output," ")));
$idletime = format_time((substr($output,strpos($output," ")))/$cpucores);
showLapTime("idletime");
if (defined("SHOWPOWERSTATE")) {
$pinStatus = trim(shell_exec("gpio -g read ".POWERONLINEPIN)); // Pin 18
}
//returns 0 = low; 1 = high
if (defined("SHOWPOWERSTATE")) {
$pinStatus = trim(shell_exec("gpio -g read ".POWERONLINEPIN)); // Pin 18
}
//returns 0 = low; 1 = high
?>
<tbody>
<tr>
<?php
if (defined("SHOWPOWERSTATE")) {
?>
<th>Power</th>
<?php
}
if ($cputemp !== NULL) {
?>
<th>CPU-Temperature</th>
<?php
}
if ($cpufreq !== NULL) {
?>
<th>CPU-Frequency</th>
<?php
}
?>
<th>System-Load</th>
<th>CPU-Usage</th>
<th>Uptime</th>
<th>Idle</th>
</tr>
<tr class="gatewayinfo">
<?php
if (defined("SHOWPOWERSTATE")) {
?>
<td><?php if ($pinStatus == POWERONLINESTATE ) {echo "online";} else {echo "on battery";} ?></td>
<?php
}
if ($cputemp !== NULL) {
?>
<td><?php echo $cputemp; ?> &deg;C</td>
<?php
}
if ($cpufreq !== NULL) {
?>
<td><?php echo $cpufreq; ?> MHz</td>
<?php
}
?>
<td><?php echo $sysload; ?> %</td>
<td>
<tr>
<?php
if (defined("SHOWPOWERSTATE")) {
?>
<th>Power</th>
<?php
}
if ($cputemp !== NULL) {
?>
<th>CPU-Temperature</th>
<?php
}
if ($cpufreq !== NULL) {
?>
<th>CPU-Frequency</th>
<?php
}
?>
<th>System-Load</th>
<th>CPU-Usage</th>
<th>Uptime</th>
<th>Idle</th>
</tr>
<tr class="gatewayinfo">
<?php
if (defined("SHOWPOWERSTATE")) {
?>
<td><?php if ($pinStatus == POWERONLINESTATE ) {echo "online";} else {echo "on battery";} ?></td>
<?php
}
if ($cputemp !== NULL) {
?>
<td><?php echo $cputemp; ?> &deg;C</td>
<?php
}
if ($cpufreq !== NULL) {
?>
<td><?php echo $cpufreq; ?> MHz</td>
<?php
}
?>
<td><?php echo $sysload; ?> %</td>
<td>
<?php
if (defined("SHOWPROGRESSBARS")) {
if (defined("SHOWPROGRESSBARS")) {
?>
<div class="progress"><div class="progress-bar <?php
if ($cpuusage < 30)
echo "progress-bar-success";
if ($cpuusage >= 30 and $cpuusage < 60)
echo "progress-bar-warning";
if ($cpuusage >= 60)
echo "progress-bar-danger";
<div class="progress"><div class="progress-bar <?php
if ($cpuusage < 30)
echo "progress-bar-success";
if ($cpuusage >= 30 and $cpuusage < 60)
echo "progress-bar-warning";
if ($cpuusage >= 60)
echo "progress-bar-danger";
?>" role="progressbar" aria-valuenow="<?php echo $cpuusage; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $cpuusage; ?>%;"><?php echo $cpuusage; ?>%</div></div>
<?php
} else {
echo $cpuusage." %";
}
} else {
echo $cpuusage." %";
}
?>
</td>
<td><?php echo $uptime; ?></td>
<td><?php echo $idletime; ?></td>
</tr>
</tbody>
</td>
<td><?php echo $uptime; ?></td>
<td><?php echo $idletime; ?></td>
</tr>
</tbody>
<?php
}
?>

View file

@ -1,37 +1,37 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<!-- Das neueste kompilierte und minimierte CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optionales Theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Das neueste kompilierte und minimierte JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<title>MMDVM-Dashboard by DG9VH - Credits</title>
</head>
<body>
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH</small> Credits</h1>
</div>
<div class="container">
<p>I think, after all the time this dashboard is developed mainly by myself, it is time to say "Thank you" to all those, wo delivered some ideas or code into this project.</p>
<p>This are explicit named following persons:</p>
<ul>
<li>df2et</li>
<li>dg1tal</li>
<li>ayasystems</li>
<li>on3yh</li>
<li>g0wfv</li>
<li>dg0cco</li>
<li>sa7bnt</li>
<li>and some others...</li>
</ul>
<p>Those, who felt forgotten, feel free to comit a change into github of this file.</p>
<p>Many thanks to you all!</p>
<p>Best 73, Kim, DG9VH</p>
</div>
</body>
</html>
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<!-- Das neueste kompilierte und minimierte CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optionales Theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Das neueste kompilierte und minimierte JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<title>MMDVM-Dashboard by DG9VH - Credits</title>
</head>
<body>
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH</small> Credits</h1>
</div>
<div class="container">
<p>I think, after all the time this dashboard is developed mainly by myself, it is time to say "Thank you" to all those, wo delivered some ideas or code into this project.</p>
<p>This are explicit named following persons:</p>
<ul>
<li>df2et</li>
<li>dg1tal</li>
<li>ayasystems</li>
<li>on3yh</li>
<li>g0wfv</li>
<li>dg0cco</li>
<li>sa7bnt</li>
<li>and some others...</li>
</ul>
<p>Those, who felt forgotten, feel free to comit a change into github of this file.</p>
<p>Many thanks to you all!</p>
<p>Best 73, Kim, DG9VH</p>
</div>
</body>
</html>

View file

@ -1,60 +1,60 @@
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Disk Use</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="diskuse" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th class="w10p filesystem">File System</th>
<th class="w20p">Mount Point</th>
<th>Use</th>
<th class="w15p">Free</th>
<th class="w15p">Used</th>
<th class="w15p">Total</th>
</tr>
</thead>
<tbody>
<div class="panel-heading">Disk Use</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="diskuse" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th class="w10p filesystem">File System</th>
<th class="w20p">Mount Point</th>
<th>Use</th>
<th class="w15p">Free</th>
<th class="w15p">Used</th>
<th class="w15p">Total</th>
</tr>
</thead>
<tbody>
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//include "./functions.php";
try{
$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))) {
$datas[] = array(
'total' => 'N.A',
'used' => 'N.A',
'free' => 'N.A',
'percent_used' => 0,
'mount' => 'N.A',
'filesystem' => 'N.A',
);
} else {
$mounted_points = array();
$key = 0;
foreach ($df as $mounted) {
list($filesystem, $type, $total, $used, $free, $percent, $mount) = explode(',', $mounted);
if ((strpos($type, 'tmpfs') !== false) && (strpos($mount, '/mnt/ramdisk') === false))
continue;
?>
<tr>
<td><?php echo $filesystem ?></td>
<td><?php echo $mount ?></td>
<td><div class="progress"><div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo trim($percent, '%') ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo trim($percent, '%') ?>%;"><?php echo trim($percent, '%') ?>%</div></div></td>
<td><?php echo getSize($free * 1024) ?></td>
<td><?php echo getSize($used * 1024) ?></td>
<td><?php echo getSize($total * 1024) ?></td>
</tr>
<?php
$key++;
}
}
$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))) {
$datas[] = array(
'total' => 'N.A',
'used' => 'N.A',
'free' => 'N.A',
'percent_used' => 0,
'mount' => 'N.A',
'filesystem' => 'N.A',
);
} else {
$mounted_points = array();
$key = 0;
foreach ($df as $mounted) {
list($filesystem, $type, $total, $used, $free, $percent, $mount) = explode(',', $mounted);
if ((strpos($type, 'tmpfs') !== false) && (strpos($mount, '/mnt/ramdisk') === false))
continue;
?>
<tr>
<td><?php echo $filesystem ?></td>
<td><?php echo $mount ?></td>
<td><div class="progress"><div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo trim($percent, '%') ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo trim($percent, '%') ?>%;"><?php echo trim($percent, '%') ?>%</div></div></td>
<td><?php echo getSize($free * 1024) ?></td>
<td><?php echo getSize($used * 1024) ?></td>
<td><?php echo getSize($total * 1024) ?></td>
</tr>
<?php
$key++;
}
}
} catch (Exception $e) {
return false;
return false;
}
?>
</tbody>
</table>
</div>
</tbody>
</table>
</div>
</div>

File diff suppressed because it is too large Load diff

View file

@ -2,9 +2,9 @@
//Some basic inits
$mmdvmconfigs = getMMDVMConfig();
if (!defined("MMDVMLOGPREFIX"))
define("MMDVMLOGPREFIX", getConfigItem("Log", "FileRoot", $mmdvmconfigs));
define("MMDVMLOGPREFIX", getConfigItem("Log", "FileRoot", $mmdvmconfigs));
if (!defined("TIMEZONE"))
define("TIMEZONE", "UTC");
define("TIMEZONE", "UTC");
$logLinesMMDVM = getMMDVMLog();
showLapTime("getMMDVMLog");
//getNames(" ");
@ -19,12 +19,12 @@ showLapTime("getLastHeard");
//$_SESSION['lastHeard'] = $lastHeard;
if (defined("ENABLEYSFGATEWAY")) {
$logLinesYSFGateway = getYSFGatewayLog();
showLapTime("getYSFGatewayLog");
$reverseLogLinesYSFGateway = $logLinesYSFGateway;
array_multisort($reverseLogLinesYSFGateway,SORT_DESC);
showLapTime("array_multisort");
$activeYSFReflectors = getActiveYSFReflectors();
showLapTime("getActiveYSFReflectors");
$logLinesYSFGateway = getYSFGatewayLog();
showLapTime("getYSFGatewayLog");
$reverseLogLinesYSFGateway = $logLinesYSFGateway;
array_multisort($reverseLogLinesYSFGateway,SORT_DESC);
showLapTime("array_multisort");
$activeYSFReflectors = getActiveYSFReflectors();
showLapTime("getActiveYSFReflectors");
}
?>

View file

@ -1,74 +1,74 @@
<?php
$totalLH = count($lastHeard);
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Last Heard List of today's <?php echo $totalLH; ?> callsigns.</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="lastHeard" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (UTC)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>Dur (s)</th>
<th>Loss</th>
<th>BER</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; ($i < $totalLH); $i++) {
$listElem = $lastHeard[$i];
echo"<tr>";
echo"<td nowrap>$listElem[0]</td>";
echo"<td nowrap>$listElem[1]</td>";
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";
}
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</td>";
}
}
if (defined("ENABLEXTDLOOKUP")) {
echo "<td nowrap>".getName($listElem[2])."</td>";
}
echo"<td nowrap>$listElem[3]</td>";
echo"<td nowrap>$listElem[4]</td>";
if ($listElem[5] == "RF"){
echo "<td nowrap><span class=\"label label-success\">RF</span></td>";
}else{
echo"<td nowrap>$listElem[5]</td>";
}
if ($listElem[6] == null) {
echo'<td nowrap>transmitting</td><td></td><td></td>';
} else if ($listElem[6] == "SMS") {
echo'<td nowrap>sending or receiving SMS</td><td></td><td></td>';
} else {
echo"<td nowrap>$listElem[6]</td>";
echo"<td nowrap>$listElem[7]</td>";
echo"<td nowrap>$listElem[8]</td>";
}
echo"</tr>\n";
}
?>
</tbody>
</table>
</div>
</div>
<?php
$totalLH = count($lastHeard);
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Last Heard List of today's <?php echo $totalLH; ?> callsigns.</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="lastHeard" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (UTC)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>Dur (s)</th>
<th>Loss</th>
<th>BER</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; ($i < $totalLH); $i++) {
$listElem = $lastHeard[$i];
echo"<tr>";
echo"<td nowrap>$listElem[0]</td>";
echo"<td nowrap>$listElem[1]</td>";
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";
}
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</td>";
}
}
if (defined("ENABLEXTDLOOKUP")) {
echo "<td nowrap>".getName($listElem[2])."</td>";
}
echo"<td nowrap>$listElem[3]</td>";
echo"<td nowrap>$listElem[4]</td>";
if ($listElem[5] == "RF"){
echo "<td nowrap><span class=\"label label-success\">RF</span></td>";
}else{
echo"<td nowrap>$listElem[5]</td>";
}
if ($listElem[6] == null) {
echo'<td nowrap>transmitting</td><td></td><td></td>';
} else if ($listElem[6] == "SMS") {
echo'<td nowrap>sending or receiving SMS</td><td></td><td></td>';
} else {
echo"<td nowrap>$listElem[6]</td>";
echo"<td nowrap>$listElem[7]</td>";
echo"<td nowrap>$listElem[8]</td>";
}
echo"</tr>\n";
}
?>
</tbody>
</table>
</div>
</div>

View file

@ -1,59 +1,59 @@
<?php
$totalLH = count($lastHeard);
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Last Heard List of today's <?php echo $totalLH; ?> callsigns.</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="lastHeard" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (<?php echo TIMEZONE;?>)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>Dur (s)</th>
<th>Loss</th>
<th>BER</th>
</tr>
</thead>
</table>
</div>
</div>
<script>
$(document).ready(function(){
var lastHeardT = $('#lastHeard').dataTable( {
"aaSorting": [[0,'desc']],
<?php $request = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . "{$_SERVER['HTTP_HOST']}/{$_SERVER['REQUEST_URI']}";
if (strpos($request,"index.php")> 0) {
$request = substr($request,0,strpos($request,"index.php"));
}
if (strpos($request,"?stoprefresh")> 0) {
$request = substr($request,0,strpos($request,"?stoprefresh"));
}
?>
"ajax": '<?php echo $request?>/ajax.php?section=lastHeard',
"deferRender": true
} );
<?php
if (!isset($_GET['stoprefresh'])) {
?>
setInterval( function () {
lastHeardT.api().ajax.reload( );
}, <?php echo REFRESHAFTER * 1000 ?> );
<?php
}
?>
});
</script>
<?php
$totalLH = count($lastHeard);
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Last Heard List of today's <?php echo $totalLH; ?> callsigns.</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="lastHeard" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (<?php echo TIMEZONE;?>)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>Dur (s)</th>
<th>Loss</th>
<th>BER</th>
</tr>
</thead>
</table>
</div>
</div>
<script>
$(document).ready(function(){
var lastHeardT = $('#lastHeard').dataTable( {
"aaSorting": [[0,'desc']],
<?php $request = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . "{$_SERVER['HTTP_HOST']}/{$_SERVER['REQUEST_URI']}";
if (strpos($request,"index.php")> 0) {
$request = substr($request,0,strpos($request,"index.php"));
}
if (strpos($request,"?stoprefresh")> 0) {
$request = substr($request,0,strpos($request,"?stoprefresh"));
}
?>
"ajax": '<?php echo $request?>/ajax.php?section=lastHeard',
"deferRender": true
} );
<?php
if (!isset($_GET['stoprefresh'])) {
?>
setInterval( function () {
lastHeardT.api().ajax.reload( );
}, <?php echo REFRESHAFTER * 1000 ?> );
<?php
}
?>
});
</script>

View file

@ -1,77 +1,77 @@
<?php
$localTXList = getHeardList($reverseLogLinesMMDVM, FALSE);
//array_multisort($localTXList,SORT_DESC);
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Today's local transmissions</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="localTx" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (UTC)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>Dur (s)</th>
<th>Loss</th>
<th>BER</th>
<th>RSSI</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i < count($localTXList); $i++) {
$listElem = $localTXList[$i];
if ($listElem[6] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) {
echo"<tr>";
echo"<td nowrap>$listElem[0]</td>";
echo"<td nowrap>$listElem[1]</td>";
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";
}
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</td>";
}
}
if (defined("ENABLEXTDLOOKUP")) {
echo "<td class=\"nowrap\">$listElem[3]</td>";
}
echo"<td nowrap>$listElem[4]</td>";
echo"<td nowrap>$listElem[5]</td>";
echo"<td nowrap>$listElem[6]</td>";
if ($listElem[6] == null) {
echo'<td nowrap>in TX</td><td></td><td></td>';
} else if ($listElem[7] == "SMS") {
echo'<td nowrap>sending or receiving SMS</td><td></td><td></td>';
} else {
echo"<td nowrap>$listElem[7]</td>";
echo"<td nowrap>$listElem[8]</td>";
echo"<td nowrap>$listElem[9]</td>";
}
echo"</tr>\n";
}
}
?>
</tbody>
</table>
</div>
</div>
<?php
$localTXList = getHeardList($reverseLogLinesMMDVM, FALSE);
//array_multisort($localTXList,SORT_DESC);
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Today's local transmissions</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="localTx" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (UTC)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>Dur (s)</th>
<th>Loss</th>
<th>BER</th>
<th>RSSI</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i < count($localTXList); $i++) {
$listElem = $localTXList[$i];
if ($listElem[6] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) {
echo"<tr>";
echo"<td nowrap>$listElem[0]</td>";
echo"<td nowrap>$listElem[1]</td>";
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";
}
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</td>";
}
}
if (defined("ENABLEXTDLOOKUP")) {
echo "<td class=\"nowrap\">$listElem[3]</td>";
}
echo"<td nowrap>$listElem[4]</td>";
echo"<td nowrap>$listElem[5]</td>";
echo"<td nowrap>$listElem[6]</td>";
if ($listElem[6] == null) {
echo'<td nowrap>in TX</td><td></td><td></td>';
} else if ($listElem[7] == "SMS") {
echo'<td nowrap>sending or receiving SMS</td><td></td><td></td>';
} else {
echo"<td nowrap>$listElem[7]</td>";
echo"<td nowrap>$listElem[8]</td>";
echo"<td nowrap>$listElem[9]</td>";
}
echo"</tr>\n";
}
}
?>
</tbody>
</table>
</div>
</div>

View file

@ -1,61 +1,61 @@
<?php
$totalLH = count($lastHeard);
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Today's local transmissions</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="localTx" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (<?php echo TIMEZONE;?>)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>Dur (s)</th>
<th>Loss</th>
<th>BER</th>
<th>RSSI</th>
</tr>
</thead>
</table>
</div>
</div>
<script>
$(document).ready(function(){
var localTxT = $('#localTx').dataTable( {
"aaSorting": [[0,'desc']],
<?php $request = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . "{$_SERVER['HTTP_HOST']}/{$_SERVER['REQUEST_URI']}";
if (strpos($request,"index.php")> 0) {
$request = substr($request,0,strpos($request,"index.php"));
}
if (strpos($request,"?stoprefresh")> 0) {
$request = substr($request,0,strpos($request,"?stoprefresh"));
}
?>
"ajax": '<?php echo $request?>/ajax.php?section=localTx',
"deferRender": true
} );
<?php
if (!isset($_GET['stoprefresh'])) {
?>
setInterval( function () {
localTxT.api().ajax.reload( );
}, <?php echo REFRESHAFTER * 1000 ?> );
<?php
}
?>
});
</script>
<?php
$totalLH = count($lastHeard);
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Today's local transmissions</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="localTx" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (<?php echo TIMEZONE;?>)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>Dur (s)</th>
<th>Loss</th>
<th>BER</th>
<th>RSSI</th>
</tr>
</thead>
</table>
</div>
</div>
<script>
$(document).ready(function(){
var localTxT = $('#localTx').dataTable( {
"aaSorting": [[0,'desc']],
<?php $request = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . "{$_SERVER['HTTP_HOST']}/{$_SERVER['REQUEST_URI']}";
if (strpos($request,"index.php")> 0) {
$request = substr($request,0,strpos($request,"index.php"));
}
if (strpos($request,"?stoprefresh")> 0) {
$request = substr($request,0,strpos($request,"?stoprefresh"));
}
?>
"ajax": '<?php echo $request?>/ajax.php?section=localTx',
"deferRender": true
} );
<?php
if (!isset($_GET['stoprefresh'])) {
?>
setInterval( function () {
localTxT.api().ajax.reload( );
}, <?php echo REFRESHAFTER * 1000 ?> );
<?php
}
?>
});
</script>

View file

@ -1,19 +1,19 @@
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Enabled Modes</div>
<!-- Tabelle -->
<div class="table-responsive">
<table class="table">
<tr>
<?php showMode("DMR", $mmdvmconfigs);?>
<?php showMode("DMR Network", $mmdvmconfigs);?>
<?php showMode("D-Star", $mmdvmconfigs);?>
<?php showMode("D-Star Network", $mmdvmconfigs);?>
<?php showMode("System Fusion", $mmdvmconfigs);?>
<?php showMode("System Fusion Network", $mmdvmconfigs);?>
<?php showMode("P25", $mmdvmconfigs);?>
<?php showMode("P25 Network", $mmdvmconfigs);?>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Enabled Modes</div>
<!-- Tabelle -->
<div class="table-responsive">
<table class="table">
<tr>
<?php showMode("DMR", $mmdvmconfigs);?>
<?php showMode("DMR Network", $mmdvmconfigs);?>
<?php showMode("D-Star", $mmdvmconfigs);?>
<?php showMode("D-Star Network", $mmdvmconfigs);?>
<?php showMode("System Fusion", $mmdvmconfigs);?>
<?php showMode("System Fusion Network", $mmdvmconfigs);?>
<?php showMode("P25", $mmdvmconfigs);?>
<?php showMode("P25 Network", $mmdvmconfigs);?>
</tr>
</table>
</div>
</div>

View file

@ -1,98 +1,98 @@
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Repeater Info</div>
<!-- Tabelle -->
<div class="table-responsive">
<table class="table">
<tr>
<th>Current Mode</th>
<th>D-Star linked to</th>
<th>YSF linked to</th>
<th>DMR TS1 last linked to</th>
<th>DMR TS2 last linked to</th>
</tr>
<?php
echo"<tr>";
echo"<td id=\"mode\">".getActualMode($lastHeard, $mmdvmconfigs)."</td>";
echo"<td>".getActualLink($reverseLogLinesMMDVM, "D-Star")."</td>";
echo"<td>".getYSFReflectorById(getActualLink($reverseLogLinesYSFGateway, "YSF"), $activeYSFReflectors)."</td>";
echo"<td>".getActualLink($reverseLogLinesMMDVM, "DMR Slot 1")."</td>";
echo"<td>".getActualLink($reverseLogLinesMMDVM, "DMR Slot 2")."/". getActualReflector($reverseLogLinesMMDVM, "DMR Slot 2") ."</td>";
echo"</tr>\n";
?>
<tr>
<td colspan="5">
<table class="table">
<tr>
<th>Location</th>
<th>TX-Freq.</th>
<th>RX-Freq.</th>
<?php
if (getEnabled("System Fusion Network", $mmdvmconfigs) == 1) {
?>
<th>YSFGateway</th>
<?php
}
if (getEnabled("DMR", $mmdvmconfigs) == 1) {
?>
<th>DMR CC</th>
<?php
if (getEnabled("DMR Network", $mmdvmconfigs) == 1) {
?>
<th>DMR-Master</th>
<th>TS1</th>
<th>TS2</th>
<?php
}
}
?>
</tr>
<?php
echo"<tr>";
echo"<td>".getConfigItem("Info", "Location", $mmdvmconfigs)."</td>";
echo"<td>".getMHZ(getConfigItem("Info", "TXFrequency", $mmdvmconfigs))."</td>";
echo"<td>".getMHZ(getConfigItem("Info", "RXFrequency", $mmdvmconfigs))."</td>";
if (getEnabled("System Fusion Network", $mmdvmconfigs) == 1) {
echo"<td>".getConfigItem("System Fusion Network", "GwyAddress", $mmdvmconfigs)."</td>";
}
if (getEnabled("DMR", $mmdvmconfigs) == 1) {
echo"<td>".getConfigItem("DMR", "ColorCode", $mmdvmconfigs)."</td>";
if (getEnabled("DMR Network", $mmdvmconfigs) == 1) {
echo"<td>";
if (getDMRMasterState()) {
echo "<span class=\"label label-success\" title=\"Master connected\">";
} else {
echo "<span class=\"label label-danger\" title=\"Master not connected\">";
}
echo getConfigItem("DMR Network", "Address", $mmdvmconfigs);
if (strlen(getDMRNetwork()) > 0 ) {
echo " (".getDMRNetwork().")";
}
?>
</span>
</td>
<td><span class="label <?php
if (getConfigItem("DMR Network", "Slot1", $mmdvmconfigs) == 1) {
echo 'label-success">enabled';
} else {
echo 'label-default">disabled';
}
?></span></td>
<td><span class="label <?php
if (getConfigItem("DMR Network", "Slot2", $mmdvmconfigs) == 1) {
echo 'label-success">enabled';
} else {
echo 'label-default">disabled';
}
?></span></td>
<?php
}
}
?>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Repeater Info</div>
<!-- Tabelle -->
<div class="table-responsive">
<table class="table">
<tr>
<th>Current Mode</th>
<th>D-Star linked to</th>
<th>YSF linked to</th>
<th>DMR TS1 last linked to</th>
<th>DMR TS2 last linked to</th>
</tr>
<?php
echo"<tr>";
echo"<td id=\"mode\">".getActualMode($lastHeard, $mmdvmconfigs)."</td>";
echo"<td>".getActualLink($reverseLogLinesMMDVM, "D-Star")."</td>";
echo"<td>".getYSFReflectorById(getActualLink($reverseLogLinesYSFGateway, "YSF"), $activeYSFReflectors)."</td>";
echo"<td>".getActualLink($reverseLogLinesMMDVM, "DMR Slot 1")."</td>";
echo"<td>".getActualLink($reverseLogLinesMMDVM, "DMR Slot 2")."/". getActualReflector($reverseLogLinesMMDVM, "DMR Slot 2") ."</td>";
echo"</tr>\n";
?>
<tr>
<td colspan="5">
<table class="table">
<tr>
<th>Location</th>
<th>TX-Freq.</th>
<th>RX-Freq.</th>
<?php
if (getEnabled("System Fusion Network", $mmdvmconfigs) == 1) {
?>
<th>YSFGateway</th>
<?php
}
if (getEnabled("DMR", $mmdvmconfigs) == 1) {
?>
<th>DMR CC</th>
<?php
if (getEnabled("DMR Network", $mmdvmconfigs) == 1) {
?>
<th>DMR-Master</th>
<th>TS1</th>
<th>TS2</th>
<?php
}
}
?>
</tr>
<?php
echo"<tr>";
echo"<td>".getConfigItem("Info", "Location", $mmdvmconfigs)."</td>";
echo"<td>".getMHZ(getConfigItem("Info", "TXFrequency", $mmdvmconfigs))."</td>";
echo"<td>".getMHZ(getConfigItem("Info", "RXFrequency", $mmdvmconfigs))."</td>";
if (getEnabled("System Fusion Network", $mmdvmconfigs) == 1) {
echo"<td>".getConfigItem("System Fusion Network", "GwyAddress", $mmdvmconfigs)."</td>";
}
if (getEnabled("DMR", $mmdvmconfigs) == 1) {
echo"<td>".getConfigItem("DMR", "ColorCode", $mmdvmconfigs)."</td>";
if (getEnabled("DMR Network", $mmdvmconfigs) == 1) {
echo"<td>";
if (getDMRMasterState()) {
echo "<span class=\"label label-success\" title=\"Master connected\">";
} else {
echo "<span class=\"label label-danger\" title=\"Master not connected\">";
}
echo getConfigItem("DMR Network", "Address", $mmdvmconfigs);
if (strlen(getDMRNetwork()) > 0 ) {
echo " (".getDMRNetwork().")";
}
?>
</span>
</td>
<td><span class="label <?php
if (getConfigItem("DMR Network", "Slot1", $mmdvmconfigs) == 1) {
echo 'label-success">enabled';
} else {
echo 'label-default">disabled';
}
?></span></td>
<td><span class="label <?php
if (getConfigItem("DMR Network", "Slot2", $mmdvmconfigs) == 1) {
echo 'label-success">enabled';
} else {
echo 'label-default">disabled';
}
?></span></td>
<?php
}
}
?>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>

View file

@ -1,180 +1,180 @@
<?php
$cputemp = NULL;
$cpufreq = NULL;
if (file_exists ("/sys/class/thermal/thermal_zone0/temp")) {
exec("cat /sys/class/thermal/thermal_zone0/temp", $cputemp);
$cputemp = $cputemp[0] / 1000;
}
showLapTime("cputemp");
if (file_exists ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")) {
exec("cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", $cpufreq);
$cpufreq = $cpufreq[0] / 1000;
}
showLapTime("cpufreq");
$cputemp = NULL;
$cpufreq = NULL;
if (file_exists ("/sys/class/thermal/thermal_zone0/temp")) {
exec("cat /sys/class/thermal/thermal_zone0/temp", $cputemp);
$cputemp = $cputemp[0] / 1000;
}
showLapTime("cputemp");
if (file_exists ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")) {
exec("cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", $cpufreq);
$cpufreq = $cpufreq[0] / 1000;
}
showLapTime("cpufreq");
if (defined("TEMPERATUREALERT") && $cputemp > TEMPERATUREHIGHLEVEL && $cputemp !== NULL) {
if (defined("TEMPERATUREALERT") && $cputemp > TEMPERATUREHIGHLEVEL && $cputemp !== NULL) {
?>
<script>
function deleteLayer(id) {
if (document.getElementById && document.getElementById(id)) {
var theNode = document.getElementById(id);
theNode.parentNode.removeChild(theNode);
}
else if (document.all && document.all[id]) {
document.all[id].innerHTML='';
document.all[id].outerHTML='';
}
// OBSOLETE CODE FOR NETSCAPE 4
else if (document.layers && document.layers[id]) {
document.layers[id].visibility='hide';
delete document.layers[id];
}
}
<script>
function deleteLayer(id) {
if (document.getElementById && document.getElementById(id)) {
var theNode = document.getElementById(id);
theNode.parentNode.removeChild(theNode);
}
else if (document.all && document.all[id]) {
document.all[id].innerHTML='';
document.all[id].outerHTML='';
}
// OBSOLETE CODE FOR NETSCAPE 4
else if (document.layers && document.layers[id]) {
document.layers[id].visibility='hide';
delete document.layers[id];
}
}
function makeLayer(id,L,T,W,H,bgColor,visible,zIndex) {
if (document.getElementById) {
if (document.getElementById(id)) {
alert ('Layer with this ID already exists!');
return;
}
var ST = 'position:absolute; text-align:center;padding-top:20px;'
+'; left:'+L+'px'
+'; top:'+T+'px'
+'; width:'+W+'px'
+'; height:'+H+'px'
+'; clip:rect(0,'+W+','+H+',0)'
+'; visibility:'
+(null==visible || 1==visible ? 'visible':'hidden')
+(null==zIndex ? '' : '; z-index:'+zIndex)
+(null==bgColor ? '' : '; background-color:'+bgColor);
function makeLayer(id,L,T,W,H,bgColor,visible,zIndex) {
if (document.getElementById) {
if (document.getElementById(id)) {
alert ('Layer with this ID already exists!');
return;
}
var ST = 'position:absolute; text-align:center;padding-top:20px;'
+'; left:'+L+'px'
+'; top:'+T+'px'
+'; width:'+W+'px'
+'; height:'+H+'px'
+'; clip:rect(0,'+W+','+H+',0)'
+'; visibility:'
+(null==visible || 1==visible ? 'visible':'hidden')
+(null==zIndex ? '' : '; z-index:'+zIndex)
+(null==bgColor ? '' : '; background-color:'+bgColor);
var LR = '<DIV id='+id+' style="'+ST+'">CPU-Temperature is very high!<br><input type="button" value="Close" onclick="deleteLayer(\'LYR1\')"></DIV>';
var LR = '<DIV id='+id+' style="'+ST+'">CPU-Temperature is very high!<br><input type="button" value="Close" onclick="deleteLayer(\'LYR1\')"></DIV>';
if (document.body) {
if (document.body.insertAdjacentHTML)
document.body.insertAdjacentHTML("BeforeEnd",LR);
else if (document.createElement && document.body.appendChild) {
var newNode = document.createElement('div');
newNode.setAttribute('id',id);
newNode.setAttribute('style',ST);
document.body.appendChild(newNode);
}
}
}
}
var audio = new Audio('sounds/alert.mp3');
audio.play();
var x = window.innerWidth/2-100;
var y = window.innerHeight/2-50;
if (document.body) {
if (document.body.insertAdjacentHTML)
document.body.insertAdjacentHTML("BeforeEnd",LR);
else if (document.createElement && document.body.appendChild) {
var newNode = document.createElement('div');
newNode.setAttribute('id',id);
newNode.setAttribute('style',ST);
document.body.appendChild(newNode);
}
}
}
}
var audio = new Audio('sounds/alert.mp3');
audio.play();
var x = window.innerWidth/2-100;
var y = window.innerHeight/2-50;
makeLayer('LYR1',x,y,200,100,'red',1,1);
</script>
makeLayer('LYR1',x,y,200,100,'red',1,1);
</script>
<?php
}
}
$output = shell_exec('cat /proc/loadavg');
$sysload = substr($output,0,strpos($output," "))*100;
showLapTime("sysload");
$stat1 = file('/proc/stat');
sleep(1);
$stat2 = file('/proc/stat');
$info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0]));
$info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0]));
$dif = array();
$dif['user'] = $info2[0] - $info1[0];
$dif['nice'] = $info2[1] - $info1[1];
$dif['sys'] = $info2[2] - $info1[2];
$dif['idle'] = $info2[3] - $info1[3];
$total = array_sum($dif);
$cpu = array();
foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
$cpuusage = round($cpu['user'] + $cpu['sys'], 2);
showLapTime("cpuusage");
$output = shell_exec('cat /proc/loadavg');
$sysload = substr($output,0,strpos($output," "))*100;
showLapTime("sysload");
$stat1 = file('/proc/stat');
sleep(1);
$stat2 = file('/proc/stat');
$info1 = explode(" ", preg_replace("!cpu +!", "", $stat1[0]));
$info2 = explode(" ", preg_replace("!cpu +!", "", $stat2[0]));
$dif = array();
$dif['user'] = $info2[0] - $info1[0];
$dif['nice'] = $info2[1] - $info1[1];
$dif['sys'] = $info2[2] - $info1[2];
$dif['idle'] = $info2[3] - $info1[3];
$total = array_sum($dif);
$cpu = array();
foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
$cpuusage = round($cpu['user'] + $cpu['sys'], 2);
showLapTime("cpuusage");
$output = shell_exec('grep -c processor /proc/cpuinfo');
$cpucores = $output;
$output = shell_exec('grep -c processor /proc/cpuinfo');
$cpucores = $output;
$output = shell_exec('cat /proc/uptime');
$uptime = format_time(substr($output,0,strpos($output," ")));
$idletime = format_time((substr($output,strpos($output," ")))/$cpucores);
showLapTime("idletime");
$output = shell_exec('cat /proc/uptime');
$uptime = format_time(substr($output,0,strpos($output," ")));
$idletime = format_time((substr($output,strpos($output," ")))/$cpucores);
showLapTime("idletime");
if (defined("SHOWPOWERSTATE")) {
$pinStatus = trim(shell_exec("gpio -g read ".POWERONLINEPIN)); // Pin 18
}
//returns 0 = low; 1 = high
if (defined("SHOWPOWERSTATE")) {
$pinStatus = trim(shell_exec("gpio -g read ".POWERONLINEPIN)); // Pin 18
}
//returns 0 = low; 1 = high
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">System Info</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="sysinfo" class="table table-condensed">
<tbody>
<tr>
<?php
if (defined("SHOWPOWERSTATE")) {
?>
<th>Power</th>
<?php
}
if ($cputemp !== NULL) {
?>
<th>CPU-Temperature</th>
<?php
}
if ($cpufreq !== NULL) {
?>
<th>CPU-Frequency</th>
<?php
}
?>
<th>System-Load</th>
<th>CPU-Usage</th>
<th>Uptime</th>
<th>Idle</th>
</tr>
<tr class="gatewayinfo">
<?php
if (defined("SHOWPOWERSTATE")) {
?>
<td><?php if ($pinStatus == POWERONLINESTATE ) {echo "online";} else {echo "on battery";} ?></td>
<?php
}
if ($cputemp !== NULL) {
?>
<td><?php echo $cputemp; ?> &deg;C</td>
<?php
}
if ($cpufreq !== NULL) {
?>
<td><?php echo $cpufreq; ?> MHz</td>
<?php
}
?>
<td><?php echo $sysload; ?> %</td>
<td>
<div class="table-responsive">
<table id="sysinfo" class="table table-condensed">
<tbody>
<tr>
<?php
if (defined("SHOWPOWERSTATE")) {
?>
<th>Power</th>
<?php
}
if ($cputemp !== NULL) {
?>
<th>CPU-Temperature</th>
<?php
}
if ($cpufreq !== NULL) {
?>
<th>CPU-Frequency</th>
<?php
}
?>
<th>System-Load</th>
<th>CPU-Usage</th>
<th>Uptime</th>
<th>Idle</th>
</tr>
<tr class="gatewayinfo">
<?php
if (defined("SHOWPOWERSTATE")) {
?>
<td><?php if ($pinStatus == POWERONLINESTATE ) {echo "online";} else {echo "on battery";} ?></td>
<?php
}
if ($cputemp !== NULL) {
?>
<td><?php echo $cputemp; ?> &deg;C</td>
<?php
}
if ($cpufreq !== NULL) {
?>
<td><?php echo $cpufreq; ?> MHz</td>
<?php
}
?>
<td><?php echo $sysload; ?> %</td>
<td>
<?php
if (defined("SHOWPROGRESSBARS")) {
if (defined("SHOWPROGRESSBARS")) {
?>
<div class="progress"><div class="progress-bar <?php
if ($cpuusage < 30)
echo "progress-bar-success";
if ($cpuusage >= 30 and $cpuusage < 60)
echo "progress-bar-warning";
if ($cpuusage >= 60)
echo "progress-bar-danger";
<div class="progress"><div class="progress-bar <?php
if ($cpuusage < 30)
echo "progress-bar-success";
if ($cpuusage >= 30 and $cpuusage < 60)
echo "progress-bar-warning";
if ($cpuusage >= 60)
echo "progress-bar-danger";
?>" role="progressbar" aria-valuenow="<?php echo $cpuusage; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $cpuusage; ?>%;"><?php echo $cpuusage; ?>%</div></div>
<?php
} else {
echo $cpuusage." %";
}
} else {
echo $cpuusage." %";
}
?>
</td>
<td><?php echo $uptime; ?></td>
<td><?php echo $idletime; ?></td>
</tr>
</tbody>
</table>
</div>
</td>
<td><?php echo $uptime; ?></td>
<td><?php echo $idletime; ?></td>
</tr>
</tbody>
</table>
</div>
</div>

View file

@ -1,29 +1,29 @@
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">System Info</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="sysinfo" class="table table-condensed">
</table>
</div>
</div>
<script>
function loadXMLDocSysinfo() {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("sysinfo").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax.php?section=sysinfo",true);
xmlhttp.send();
var timeout = window.setTimeout("loadXMLDocSysinfo()", 20000);
}
loadXMLDocSysinfo();
</script>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">System Info</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="sysinfo" class="table table-condensed">
</table>
</div>
</div>
<script>
function loadXMLDocSysinfo() {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("sysinfo").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax.php?section=sysinfo",true);
xmlhttp.send();
var timeout = window.setTimeout("loadXMLDocSysinfo()", 20000);
}
loadXMLDocSysinfo();
</script>

View file

@ -1,115 +1,115 @@
<?php
function format_time($seconds) {
$secs = intval($seconds % 60);
$mins = intval($seconds / 60 % 60);
$hours = intval($seconds / 3600 % 24);
$days = intval($seconds / 86400);
$uptimeString = "";
$secs = intval($seconds % 60);
$mins = intval($seconds / 60 % 60);
$hours = intval($seconds / 3600 % 24);
$days = intval($seconds / 86400);
$uptimeString = "";
if ($days > 0) {
$uptimeString .= $days;
$uptimeString .= (($days == 1) ? "&nbsp;day" : "&nbsp;days");
}
if ($hours > 0) {
$uptimeString .= (($days > 0) ? ", " : "") . $hours;
$uptimeString .= (($hours == 1) ? "&nbsp;hr" : "&nbsp;hrs");
}
if ($mins > 0) {
$uptimeString .= (($days > 0 || $hours > 0) ? ", " : "") . $mins;
$uptimeString .= (($mins == 1) ? "&nbsp;min" : "&nbsp;mins");
}
if ($secs > 0) {
$uptimeString .= (($days > 0 || $hours > 0 || $mins > 0) ? ", " : "") . $secs;
$uptimeString .= (($secs == 1) ? "&nbsp;s" : "&nbsp;s");
}
return $uptimeString;
if ($days > 0) {
$uptimeString .= $days;
$uptimeString .= (($days == 1) ? "&nbsp;day" : "&nbsp;days");
}
if ($hours > 0) {
$uptimeString .= (($days > 0) ? ", " : "") . $hours;
$uptimeString .= (($hours == 1) ? "&nbsp;hr" : "&nbsp;hrs");
}
if ($mins > 0) {
$uptimeString .= (($days > 0 || $hours > 0) ? ", " : "") . $mins;
$uptimeString .= (($mins == 1) ? "&nbsp;min" : "&nbsp;mins");
}
if ($secs > 0) {
$uptimeString .= (($days > 0 || $hours > 0 || $mins > 0) ? ", " : "") . $secs;
$uptimeString .= (($secs == 1) ? "&nbsp;s" : "&nbsp;s");
}
return $uptimeString;
}
function startsWith($haystack, $needle) {
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false;
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false;
}
function getMHZ($freq) {
return substr($freq,0,3) . "." . substr($freq,3,6) . " MHz";
return substr($freq,0,3) . "." . substr($freq,3,6) . " MHz";
}
function isProcessRunning($processname) {
exec("pgrep " . $processname, $pids);
if(empty($pids)) {
// process not running!
return false;
} else {
// process running!
return true;
}
exec("pgrep " . $processname, $pids);
if(empty($pids)) {
// process not running!
return false;
} else {
// process running!
return true;
}
}
function createConfigLines() {
$out ="";
foreach($_GET as $key=>$val) {
if($key != "cmd") {
$out .= "define(\"$key\", \"$val\");"."\n";
}
}
return $out;
$out ="";
foreach($_GET as $key=>$val) {
if($key != "cmd") {
$out .= "define(\"$key\", \"$val\");"."\n";
}
}
return $out;
}
function getSize($filesize, $precision = 2) {
$units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y');
foreach ($units as $idUnit => $unit) {
if ($filesize > 1024)
$filesize /= 1024;
else
break;
}
return round($filesize, $precision).' '.$units[$idUnit].'B';
$units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y');
foreach ($units as $idUnit => $unit) {
if ($filesize > 1024)
$filesize /= 1024;
else
break;
}
return round($filesize, $precision).' '.$units[$idUnit].'B';
}
function checkSetup() {
$el = error_reporting();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (defined(DISTRIBUTION)) {
$el = error_reporting();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (defined(DISTRIBUTION)) {
?>
<div class="alert alert-danger" role="alert">You are using an old config.php. Please configure your Dashboard by calling <a href="setup.php">setup.php</a>!</div>
<?php
} else {
if (file_exists ("setup.php")) {
?>
<div class="alert alert-danger" role="alert">You forgot to remove setup.php in root-directory of your dashboard or you forgot to configure it! Please delete the file or configure your Dashboard by calling <a href="setup.php">setup.php</a>!</div>
<?php
}
}
error_reporting($el);
} else {
if (file_exists ("setup.php")) {
?>
<div class="alert alert-danger" role="alert">You forgot to remove setup.php in root-directory of your dashboard or you forgot to configure it! Please delete the file or configure your Dashboard by calling <a href="setup.php">setup.php</a>!</div>
<?php
}
}
error_reporting($el);
}
function startStopwatch() {
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$_SESSION['starttime'] = $time;
return $time;
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$_SESSION['starttime'] = $time;
return $time;
}
function getLapTime() {
$start = $_SESSION['starttime'];
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$lap_time = round(($finish - $start), 4);
return $lap_time;
$start = $_SESSION['starttime'];
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$lap_time = round(($finish - $start), 4);
return $lap_time;
}
function showLapTime($func) {
if( defined("DEBUG") ) {
?><script>console.log('<?php echo $func . ": ". getLapTime(); ?> sec.');</script><?php
}
if( defined("DEBUG") ) {
?><script>console.log('<?php echo $func . ": ". getLapTime(); ?> sec.');</script><?php
}
}
function convertTimezone($timestamp) {
$date = new DateTime($timestamp);
$date->setTimezone(new DateTimeZone(TIMEZONE));
return $date->format('Y-m-d H:i:s');
$date = new DateTime($timestamp);
$date->setTimezone(new DateTimeZone(TIMEZONE));
return $date->format('Y-m-d H:i:s');
}
?>

View file

@ -1,71 +1,71 @@
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Currently TXing</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="currtx" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (<?php echo TIMEZONE;?>)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>TX-Time</th>
</tr>
</thead>
<tbody id="txline">
</tbody>
</table>
</div>
</div>
<script>
function doXMLHTTPRequest(scriptname, elem) {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById(elem).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET",scriptname,true);
xmlhttp.send();
}
function refreshMode() {
doXMLHTTPRequest("ajax.php?section=mode","mode");
}
var transmitting = false;
function loadXMLDoc() {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("txline").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","txinfo.php",true);
xmlhttp.send();
var timeout = window.setTimeout("loadXMLDoc()", 1000);
refreshMode();
}
loadXMLDoc();
</script>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Currently TXing</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="currtx" class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th>Time (<?php echo TIMEZONE;?>)</th>
<th>Mode</th>
<th>Callsign</th>
<?php
if (defined("ENABLEXTDLOOKUP")) {
?>
<th>Name</th>
<?php
}
?>
<th>DSTAR-ID</th>
<th>Target</th>
<th>Source</th>
<th>TX-Time</th>
</tr>
</thead>
<tbody id="txline">
</tbody>
</table>
</div>
</div>
<script>
function doXMLHTTPRequest(scriptname, elem) {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById(elem).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET",scriptname,true);
xmlhttp.send();
}
function refreshMode() {
doXMLHTTPRequest("ajax.php?section=mode","mode");
}
var transmitting = false;
function loadXMLDoc() {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("txline").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","txinfo.php",true);
xmlhttp.send();
var timeout = window.setTimeout("loadXMLDoc()", 1000);
refreshMode();
}
loadXMLDoc();
</script>

View file

@ -1,66 +1,66 @@
<?php
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">YSFGateway-Infos</div>
<!-- Tabelle -->
<table class="table">
<tr>
<td><span class="label <?php
if (isProcessRunning("YSFGateway")) {
echo "label-success";
?>">YSFGateway Process is running</span></td><?php
} else {
echo "label-danger\" title=\"YSFGateway is down!";
?>">YSFGateway Process is down!</span></td><?php
}
?>
</tr>
</table>
</div>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">YSFReflectors reported active</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="ysfGateways" class="table table-condensed table-striped table-hover">
<?php
if (count($activeYSFReflectors) > 0) {
?>
<thead>
<tr>
<th>No.</th>
<th>Name</th>
<th>Description</th>
<th>ID</th>
<th>Connections</th>
</tr>
</thead>
<tbody>
<?php
$counter = 1;
foreach ($activeYSFReflectors as $reflector) {
echo "<tr>";
echo "<td>$counter</td>";
for ($i = 0; $i < 4; $i++) {
echo"<td>$reflector[$i]</td>";
}
echo "</tr>\n";
$counter++;
}
}
?>
<tbody>
</table>
</div>
</div>
<script>
$(document).ready(function(){
var ysfGatewaysT = $('#ysfGateways').dataTable( {
"aaSorting": [[0,'asc']]
} );
});
</script>
<?php
?>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">YSFGateway-Infos</div>
<!-- Tabelle -->
<table class="table">
<tr>
<td><span class="label <?php
if (isProcessRunning("YSFGateway")) {
echo "label-success";
?>">YSFGateway Process is running</span></td><?php
} else {
echo "label-danger\" title=\"YSFGateway is down!";
?>">YSFGateway Process is down!</span></td><?php
}
?>
</tr>
</table>
</div>
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">YSFReflectors reported active</div>
<!-- Tabelle -->
<div class="table-responsive">
<table id="ysfGateways" class="table table-condensed table-striped table-hover">
<?php
if (count($activeYSFReflectors) > 0) {
?>
<thead>
<tr>
<th>No.</th>
<th>Name</th>
<th>Description</th>
<th>ID</th>
<th>Connections</th>
</tr>
</thead>
<tbody>
<?php
$counter = 1;
foreach ($activeYSFReflectors as $reflector) {
echo "<tr>";
echo "<td>$counter</td>";
for ($i = 0; $i < 4; $i++) {
echo"<td>$reflector[$i]</td>";
}
echo "</tr>\n";
$counter++;
}
}
?>
<tbody>
</table>
</div>
</div>
<script>
$(document).ready(function(){
var ysfGatewaysT = $('#ysfGateways').dataTable( {
"aaSorting": [[0,'asc']]
} );
});
</script>

298
index.php
View file

@ -1,149 +1,149 @@
<?php
//session_start();
/*
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;*/
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// do not touch this includes!!! Never ever!!!
include "config/config.php";
include "include/tools.php";
startStopwatch();
showLapTime("Start of page");
include "include/functions.php";
include "include/init.php";
include "version.php";
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=0.6,maximum-scale=1, user-scalable=yes">
<!-- CSS for tooltip display -->
<link rel="stylesheet" href="css/tooltip.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<!-- Das neueste kompilierte und minimierte CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
<!-- Optionales Theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css">
<!-- Das neueste kompilierte und minimierte JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/latest/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
<script type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<style>
.nowrap {
white-space:nowrap
}
</style>
<title><?php echo getCallsign($mmdvmconfigs) ?> - MMDVM-Dashboard by DG9VH</title>
</head>
<body>
<div class="page-header" style="position:relative;">
<h1><small>MMDVM-Dashboard by DG9VH for <?php
if (getConfigItem("General", "Duplex", $mmdvmconfigs) == "1") {
echo "Repeater";
} else {
echo "Hotspot";
}
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?><br>Firmware: <?php echo getFirmwareVersion() ?>
<?php
if (strlen(getDMRNetwork()) > 0 ) {
echo "<br>DMR-Network: ".getDMRNetwork();
}
?></h4>
<?php
$logourl = "";
if (getDMRNetwork() == "BrandMeister") {
if (constant('BRANDMEISTERLOGO') !== NULL) {
$logourl = BRANDMEISTERLOGO;
}
}
if (getDMRNetwork() == "DMRplus") {
if (constant('DMRPLUSLOGO') !== NULL) {
$logourl = DMRPLUSLOGO;
}
}
if ($logourl == "") {
$logourl = LOGO;
}
if ($logourl !== "") {
?>
<div id="Logo" style="position:absolute;top:-43px;right:10px;"><img src="<?php echo $logourl ?>" width="250px" style="width:250px; border-radius:10px;box-shadow:2px 2px 2px #808080; padding:1px;background:#FFFFFF;border:1px solid #808080;" border="0" hspace="10" vspace="10" align="absmiddle"></div>
<?php
}
?>
</div>
<?php
if (defined("ENABLEMANAGEMENT")) {
?>
<button onclick="window.location.href='./scripts/log.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>&nbsp;View Log</button>
<button onclick="window.location.href='./scripts/rebootmmdvm.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>&nbsp;Reboot MMDVMHost</button>
<button onclick="window.location.href='./scripts/reboot.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-repeat" aria-hidden="true"></span>&nbsp;Reboot System</button>
<button onclick="window.location.href='./scripts/halt.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-off" aria-hidden="true"></span>&nbsp;ShutDown System</button>
<?php
}
if (defined("ENABLENETWORKSWITCHING")) {
?>
<button onclick="window.location.href='./scripts/switchnetwork.php?network=DMRPLUS'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp;DMRplus</button>
<button onclick="window.location.href='./scripts/switchnetwork.php?network=BRANDMEISTER'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-fire" aria-hidden="true"></span>&nbsp;BrandMeister</button>
<?php
}
checkSetup();
// Here you can feel free to disable info-sections by commenting out with // before include
include "include/txinfo.php";
showLapTime("txinfo");
include "include/sysinfo_ajax.php";
showLapTime("sysinfo");
include "include/disk.php";
showLapTime("disk");
include "include/repeaterinfo.php";
showLapTime("repeaterinfo");
include "include/modes.php";
showLapTime("modes");
include "include/lh_ajax.php";
showLapTime("lh_ajax");
include "include/localtx_ajax.php";
showLapTime("localtx_ajax");
if (defined("ENABLEYSFGATEWAY")) {
include "include/ysfgatewayinfo.php";
showLapTime("ysfgatewayinfo");
}
?>
<div class="panel panel-info">
<?php
//$datum = date("Y-m-d");
//$uhrzeit = date("H:i:s");
$lastReload = new DateTime();
$lastReload->setTimezone(new DateTimeZone(TIMEZONE));
echo "MMDVMHost-Dashboard V ".VERSION." | Last Reload ".$lastReload->format('Y-m-d, H:i:s')." (".TIMEZONE.")";
/*$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);*/
echo '<!--Page generated in '.getLapTime().' seconds.-->';
?> |
<?php
if (!isset($_GET['stoprefresh'])) {
echo '<a href="?stoprefresh">stop refreshing</a>';
} else {
echo '<a href=".">start refreshing</a>';
}
?>
| get your own at: <a href="https://github.com/dg9vh/MMDVMHost-Dashboard">https://github.com/dg9vh/MMDVMHost-Dashboard</a> | <a href="credits.php">Credits</a>
</div>
<noscript>
For full functionality of this site it is necessary to enable JavaScript.
Here are the <a href="http://www.enable-javascript.com/" target="_blank">
instructions how to enable JavaScript in your web browser</a>.
</noscript>
</body>
</html>
<?php
showLapTime("End of Page");
?>
<?php
//session_start();
/*
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;*/
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// do not touch this includes!!! Never ever!!!
include "config/config.php";
include "include/tools.php";
startStopwatch();
showLapTime("Start of page");
include "include/functions.php";
include "include/init.php";
include "version.php";
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=0.6,maximum-scale=1, user-scalable=yes">
<!-- CSS for tooltip display -->
<link rel="stylesheet" href="css/tooltip.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<!-- Das neueste kompilierte und minimierte CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
<!-- Optionales Theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css">
<!-- Das neueste kompilierte und minimierte JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/latest/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
<script type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<style>
.nowrap {
white-space:nowrap
}
</style>
<title><?php echo getCallsign($mmdvmconfigs) ?> - MMDVM-Dashboard by DG9VH</title>
</head>
<body>
<div class="page-header" style="position:relative;">
<h1><small>MMDVM-Dashboard by DG9VH for <?php
if (getConfigItem("General", "Duplex", $mmdvmconfigs) == "1") {
echo "Repeater";
} else {
echo "Hotspot";
}
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?><br>Firmware: <?php echo getFirmwareVersion() ?>
<?php
if (strlen(getDMRNetwork()) > 0 ) {
echo "<br>DMR-Network: ".getDMRNetwork();
}
?></h4>
<?php
$logourl = "";
if (getDMRNetwork() == "BrandMeister") {
if (constant('BRANDMEISTERLOGO') !== NULL) {
$logourl = BRANDMEISTERLOGO;
}
}
if (getDMRNetwork() == "DMRplus") {
if (constant('DMRPLUSLOGO') !== NULL) {
$logourl = DMRPLUSLOGO;
}
}
if ($logourl == "") {
$logourl = LOGO;
}
if ($logourl !== "") {
?>
<div id="Logo" style="position:absolute;top:-43px;right:10px;"><img src="<?php echo $logourl ?>" width="250px" style="width:250px; border-radius:10px;box-shadow:2px 2px 2px #808080; padding:1px;background:#FFFFFF;border:1px solid #808080;" border="0" hspace="10" vspace="10" align="absmiddle"></div>
<?php
}
?>
</div>
<?php
if (defined("ENABLEMANAGEMENT")) {
?>
<button onclick="window.location.href='./scripts/log.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>&nbsp;View Log</button>
<button onclick="window.location.href='./scripts/rebootmmdvm.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>&nbsp;Reboot MMDVMHost</button>
<button onclick="window.location.href='./scripts/reboot.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-repeat" aria-hidden="true"></span>&nbsp;Reboot System</button>
<button onclick="window.location.href='./scripts/halt.php'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-off" aria-hidden="true"></span>&nbsp;ShutDown System</button>
<?php
}
if (defined("ENABLENETWORKSWITCHING")) {
?>
<button onclick="window.location.href='./scripts/switchnetwork.php?network=DMRPLUS'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp;DMRplus</button>
<button onclick="window.location.href='./scripts/switchnetwork.php?network=BRANDMEISTER'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-fire" aria-hidden="true"></span>&nbsp;BrandMeister</button>
<?php
}
checkSetup();
// Here you can feel free to disable info-sections by commenting out with // before include
include "include/txinfo.php";
showLapTime("txinfo");
include "include/sysinfo_ajax.php";
showLapTime("sysinfo");
include "include/disk.php";
showLapTime("disk");
include "include/repeaterinfo.php";
showLapTime("repeaterinfo");
include "include/modes.php";
showLapTime("modes");
include "include/lh_ajax.php";
showLapTime("lh_ajax");
include "include/localtx_ajax.php";
showLapTime("localtx_ajax");
if (defined("ENABLEYSFGATEWAY")) {
include "include/ysfgatewayinfo.php";
showLapTime("ysfgatewayinfo");
}
?>
<div class="panel panel-info">
<?php
//$datum = date("Y-m-d");
//$uhrzeit = date("H:i:s");
$lastReload = new DateTime();
$lastReload->setTimezone(new DateTimeZone(TIMEZONE));
echo "MMDVMHost-Dashboard V ".VERSION." | Last Reload ".$lastReload->format('Y-m-d, H:i:s')." (".TIMEZONE.")";
/*$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);*/
echo '<!--Page generated in '.getLapTime().' seconds.-->';
?> |
<?php
if (!isset($_GET['stoprefresh'])) {
echo '<a href="?stoprefresh">stop refreshing</a>';
} else {
echo '<a href=".">start refreshing</a>';
}
?>
| get your own at: <a href="https://github.com/dg9vh/MMDVMHost-Dashboard">https://github.com/dg9vh/MMDVMHost-Dashboard</a> | <a href="credits.php">Credits</a>
</div>
<noscript>
For full functionality of this site it is necessary to enable JavaScript.
Here are the <a href="http://www.enable-javascript.com/" target="_blank">
instructions how to enable JavaScript in your web browser</a>.
</noscript>
</body>
</html>
<?php
showLapTime("End of Page");
?>

View file

@ -14,8 +14,8 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && HALTUSER !== "" && HALTPW !== "") {
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
} else {
if ($_SERVER['PHP_AUTH_USER'] == HALTUSER && $_SERVER['PHP_AUTH_PW'] == HALTPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
if ($_SERVER['PHP_AUTH_USER'] == HALTUSER && $_SERVER['PHP_AUTH_PW'] == HALTPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
?>
<!doctype html>
<html lang="es">
@ -37,9 +37,9 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && HALTUSER !== "" && HALTPW !== "") {
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH for <?php
if (getConfigItem("General", "Duplex", $mmdvmconfigs) == "1") {
echo "Repeater";
echo "Repeater";
} else {
echo "Hotspot";
echo "Hotspot";
}
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?></h4>
@ -54,7 +54,7 @@ include "../include/sysinfo.php";
?>
<div class="alert alert-info" role="alert">Executing <b><?php echo HALTSYS ?></b><br>Halt in progress...bye</div>
<div class="panel panel-info">
<div class="panel panel-info">
<?php
@ -67,15 +67,15 @@ $time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<!--Page generated in '.$total_time.' seconds.-->';
} else {
} else {
header('WWW-Authenticate: Basic realm="Dashboard"');
header('HTTP/1.0 401 Unauthorized');
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
}
}
}
}
?> | get your own at: <a href="https://github.com/dg9vh/MMDVMHost-Dashboard">https://github.com/dg9vh/MMDVMHost-Dashboard</a>
</div>
</div>
</body>
</html>

View file

@ -16,8 +16,8 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && VIEWLOGUSER !== "" && VIEWLOGPW !== "")
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
} else {
if ($_SERVER['PHP_AUTH_USER'] == VIEWLOGUSER && $_SERVER['PHP_AUTH_PW'] == VIEWLOGPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
if ($_SERVER['PHP_AUTH_USER'] == VIEWLOGUSER && $_SERVER['PHP_AUTH_PW'] == VIEWLOGPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
?>
<!doctype html>
<html lang="es">
@ -41,9 +41,9 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && VIEWLOGUSER !== "" && VIEWLOGPW !== "")
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH for <?php
if (getConfigItem("General", "Duplex", $mmdvmconfigs) == "1") {
echo "Repeater";
echo "Repeater";
} else {
echo "Hotspot";
echo "Hotspot";
}
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?></h4>
@ -72,19 +72,19 @@ $file = new SplFileObject($fileName);
// Loop until we reach the end of the file.
while (!$file->eof()) {
$line = $file->fgets();
$line = $file->fgets();
// Echo one line from the file.
echo"<tr>";
echo"<tr>";
echo "<td>";
echo substr($line,0,3);
echo substr($line,0,3);
echo "</td>";
echo "<td>";
echo substr($line,3,24);
echo substr($line,3,24);
echo "</td>";
echo "<td>";
echo substr($line,27);
echo substr($line,27);
echo "</td>";
echo"</tr>\n";
echo"</tr>\n";
}
// Unset the file to call __destruct(), closing the file handle.
@ -93,7 +93,7 @@ $file = null;
</table>
</div>
</div>
<div class="panel panel-info">
<div class="panel panel-info">
<?php
@ -106,19 +106,19 @@ $time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<!--Page generated in '.$total_time.' seconds.-->';
} else {
} else {
header('WWW-Authenticate: Basic realm="Dashboard"');
header('HTTP/1.0 401 Unauthorized');
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
}
}
}
}
?> | get your own at: <a href="https://github.com/dg9vh/MMDVMHost-Dashboard">https://github.com/dg9vh/MMDVMHost-Dashboard</a>
</div>
<script>
</div>
<script>
$(document).ready(function(){
var logT = $('#log').dataTable( {
"aaSorting": [[1,'asc']]
} );}); </script>
} );}); </script>

View file

@ -14,8 +14,8 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && REBOOTUSER !== "" && REBOOTPW !== "") {
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
} else {
if ($_SERVER['PHP_AUTH_USER'] == REBOOTUSER && $_SERVER['PHP_AUTH_PW'] == REBOOTPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
if ($_SERVER['PHP_AUTH_USER'] == REBOOTUSER && $_SERVER['PHP_AUTH_PW'] == REBOOTPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
?>
<!doctype html>
@ -38,9 +38,9 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && REBOOTUSER !== "" && REBOOTPW !== "") {
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH for <?php
if (getConfigItem("General", "Duplex", $mmdvmconfigs) == "1") {
echo "Repeater";
echo "Repeater";
} else {
echo "Hotspot";
echo "Hotspot";
}
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?></h4>
@ -54,7 +54,7 @@ checkSetup();
?>
<div class="alert alert-info" role="alert">Executing <b><?php echo 'sleep 5s && '. REBOOTSYS . ' > /dev/null 2>&1 &'?></b><br>Reboot system in progress</div>
<div class="panel panel-info">
<div class="panel panel-info">
<?php
@ -67,15 +67,15 @@ $time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<!--Page generated in '.$total_time.' seconds.-->';
} else {
} else {
header('WWW-Authenticate: Basic realm="Dashboard"');
header('HTTP/1.0 401 Unauthorized');
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
}
}
}
}
?> | get your own at: <a href="https://github.com/dg9vh/MMDVMHost-Dashboard">https://github.com/dg9vh/MMDVMHost-Dashboard</a>
</div>
</div>
</body>
</html>

View file

@ -15,8 +15,8 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && RESTARTUSER !== "" && RESTARTPW !== "")
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
} else {
if ($_SERVER['PHP_AUTH_USER'] == RESTARTUSER && $_SERVER['PHP_AUTH_PW'] == RESTARTPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
if ($_SERVER['PHP_AUTH_USER'] == RESTARTUSER && $_SERVER['PHP_AUTH_PW'] == RESTARTPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
?>
<!doctype html>
<html lang="es">
@ -38,9 +38,9 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && RESTARTUSER !== "" && RESTARTPW !== "")
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH for <?php
if (getConfigItem("General", "Duplex", $mmdvmconfigs) == "1") {
echo "Repeater";
echo "Repeater";
} else {
echo "Hotspot";
echo "Hotspot";
}
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?></h4>
@ -55,7 +55,7 @@ include "../include/sysinfo.php";
?>
<div class="alert alert-info" role="alert">Executing <b><?php echo REBOOTMMDVM ?></b><br>Reboot MMDVMHost service in progress</div>
<div class="panel panel-info">
<div class="panel panel-info">
<?php
@ -68,15 +68,15 @@ $time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<!--Page generated in '.$total_time.' seconds.-->';
} else {
} else {
header('WWW-Authenticate: Basic realm="Dashboard"');
header('HTTP/1.0 401 Unauthorized');
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
}
}
}
}
?> | get your own at: <a href="https://github.com/dg9vh/MMDVMHost-Dashboard">https://github.com/dg9vh/MMDVMHost-Dashboard</a>
</div>
</div>
</body>
</html>

View file

@ -16,8 +16,8 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && SWITCHNETWORKUSER !== "" && SWITCHNETWO
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
} else {
if ($_SERVER['PHP_AUTH_USER'] == SWITCHNETWORKUSER && $_SERVER['PHP_AUTH_PW'] == SWITCHNETWORKPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
if ($_SERVER['PHP_AUTH_USER'] == SWITCHNETWORKUSER && $_SERVER['PHP_AUTH_PW'] == SWITCHNETWORKPW) {
$fileName = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
?>
<!doctype html>
<html lang="es">
@ -40,9 +40,9 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && SWITCHNETWORKUSER !== "" && SWITCHNETWO
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH for <?php
if (getConfigItem("General", "Duplex", $mmdvmconfigs) == "1") {
echo "Repeater";
echo "Repeater";
} else {
echo "Hotspot";
echo "Hotspot";
}
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?></h4>
@ -54,26 +54,26 @@ if (!isset($_SERVER['PHP_AUTH_USER']) && SWITCHNETWORKUSER !== "" && SWITCHNETWO
checkSetup();
include "../include/sysinfo.php";
if ($_GET['network'] == "DMRPLUS") {
setDMRNetwork("DMRplus");
exec( "sudo cp ".MMDVMINIPATH."/DMRPLUS.ini ".MMDVMINIPATH."/".MMDVMINIFILENAME );
exec( "sudo killall MMDVMHost");
sleep(1);
exec( "sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." > /dev/null 2>&1 &" );
// exec( "sudo killall MMDVMHost && sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." &");
// exec( "sudo /etc/init.d/start_mmdvm restart ");
setDMRNetwork("DMRplus");
exec( "sudo cp ".MMDVMINIPATH."/DMRPLUS.ini ".MMDVMINIPATH."/".MMDVMINIFILENAME );
exec( "sudo killall MMDVMHost");
sleep(1);
exec( "sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." > /dev/null 2>&1 &" );
// exec( "sudo killall MMDVMHost && sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." &");
// exec( "sudo /etc/init.d/start_mmdvm restart ");
}
if ($_GET['network'] == "BRANDMEISTER") {
setDMRNetwork("BrandMeister");
exec( "sudo cp ".MMDVMINIPATH."/BRANDMEISTER.ini ".MMDVMINIPATH."/".MMDVMINIFILENAME );
exec( "sudo killall MMDVMHost");
sleep(1);
exec( "sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." > /dev/null 2>&1 &" );
// exec( "sudo killall MMDVMHost && sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." &" );
setDMRNetwork("BrandMeister");
exec( "sudo cp ".MMDVMINIPATH."/BRANDMEISTER.ini ".MMDVMINIPATH."/".MMDVMINIFILENAME );
exec( "sudo killall MMDVMHost");
sleep(1);
exec( "sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." > /dev/null 2>&1 &" );
// exec( "sudo killall MMDVMHost && sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." &" );
}
?>
<div class="alert alert-info" role="alert">Switching network to <b><?php echo getDMRNetwork2() ?></b><br>Restarting in new selected network in progress</div>
<div class="panel panel-info">
<div class="panel panel-info">
<?php
@ -86,15 +86,15 @@ $time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<!--Page generated in '.$total_time.' seconds.-->';
} else {
} else {
header('WWW-Authenticate: Basic realm="Dashboard"');
header('HTTP/1.0 401 Unauthorized');
echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!';
exit;
}
}
}
}
?> | get your own at: <a href="https://github.com/dg9vh/MMDVMHost-Dashboard">https://github.com/dg9vh/MMDVMHost-Dashboard</a>
</div>
</div>
</body>
</html>

600
setup.php
View file

@ -1,300 +1,300 @@
<?php
include "config/config.php";
include "include/tools.php";
?>
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<!-- Das neueste kompilierte und minimierte CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optionales Theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Das neueste kompilierte und minimierte JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<title>MMDVM-Dashboard by DG9VH - Setup</title>
</head>
<body>
<?php
if (isset($_GET['cmd'])) {
if ( "writeconfig" == $_GET['cmd']) {
if (!file_exists('./config')) {
if (!mkdir('./config', 0777, true)) {
?>
<div class="alert alert-danger" role="alert">You forgot to give write-permissions to your webserver-user, see point 3 in <a href="linux-step-by-step.md">linux-step-by-step.md</a>!</div>
<?php
}
}
$configfile = fopen("config/config.php", 'w');
fwrite($configfile,"<?php\n");
fwrite($configfile,"# This is an auto-generated config-file!\n");
fwrite($configfile,"# Be careful, when manual editing this!\n\n");
fwrite($configfile,"date_default_timezone_set('UTC');\n");
fwrite($configfile, createConfigLines());
fwrite($configfile,"?>\n");
fclose($configfile);
?>
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH</small> Setup-Process</h1>
<div class="alert alert-success" role="alert">Your config-file is written in config/config.php, please remove setup.php for security reasons!</div>
<p><a href="index.php">Your dashboard is now available.</a></p>
</div>
<?php
}
} else {
?>
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH</small> Setup-Process</h1>
<h4>Please give necessary information below</h4>
</div>
<form id="config" action="setup.php" method="get">
<input type="hidden" name="cmd" value="writeconfig">
<div class="container">
<h2>MMDVMHost-Configuration</h2>
<div class="input-group">
<span class="input-group-addon" id="MMDVMLOGPATH" style="width: 300px">Path to MMDVMHost-logfile</span>
<input type="text" value="<?php echo constant("MMDVMLOGPATH") ?>" name="MMDVMLOGPATH" class="form-control" placeholder="/var/log/mmdvm/" aria-describedby="MMDVMLOGPATH" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="MMDVMINIPATH" style="width: 300px">Path to MMDVM.ini</span>
<input type="text" value="<?php echo constant("MMDVMINIPATH") ?>" name="MMDVMINIPATH" class="form-control" placeholder="/etc/mmdvm/" aria-describedby="MMDVMINIPATH" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="MMDVMINIFILENAME" style="width: 300px">MMDVM.ini-filename</span>
<input type="text" value="<?php echo constant("MMDVMINIFILENAME") ?>" name="MMDVMINIFILENAME" class="form-control" placeholder="MMDVM.ini" aria-describedby="MMDVMINIFILENAME" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="MMDVMHOSTPATH" style="width: 300px">Path to MMDVMHost-executable</span>
<input type="text" value="<?php echo constant("MMDVMHOSTPATH") ?>" name="MMDVMHOSTPATH" class="form-control" placeholder="/usr/local/bin/" aria-describedby="MMDVMHOSTPATH" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="ENABLEXTDLOOKUP" style="width: 300px">Enable extended lookup (show names)</span>
<div class="panel-body"><input type="checkbox" name="ENABLEXTDLOOKUP" <?php if (defined("ENABLEXTDLOOKUP")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="DMRIDDATPATH" style="width: 300px">Path to DMR-ID-Database-File (including filename)</span>
<input type="text" value="<?php echo constant("DMRIDDATPATH") ?>" name="DMRIDDATPATH" class="form-control" placeholder="/var/mmdvm/DMRIDs.dat" aria-describedby="DMRIDDATPATH">
</div>
</div>
<div class="container">
<h2>YSFGateway-Configuration</h2>
<div class="input-group">
<span class="input-group-addon" id="ENABLEYSFGATEWAY" style="width: 300px">Enable YSFGateway</span>
<div class="panel-body"><input type="checkbox" name="ENABLEYSFGATEWAY" <?php if (constant("ENABLEYSFGATEWAY")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYLOGPATH" style="width: 300px">Path to YSFGateway-logfile</span>
<input type="text" value="<?php echo constant("YSFGATEWAYLOGPATH") ?>" name="YSFGATEWAYLOGPATH" class="form-control" placeholder="/var/log/YSFGateway/" aria-describedby="YSFGATEWAYLOGPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYLOGPREFIX" style="width: 300px">Logfile-prefix</span>
<input type="text" value="<?php echo constant("YSFGATEWAYLOGPREFIX") ?>" name="YSFGATEWAYLOGPREFIX" class="form-control" placeholder="YSFGateway" aria-describedby="YSFGATEWAYLOGPREFIX">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYINIPATH" style="width: 300px">Path to YSFGateway.ini</span>
<input type="text" value="<?php echo constant("YSFGATEWAYINIPATH") ?>" name="YSFGATEWAYINIPATH" class="form-control" placeholder="/etc/YSFGateway/" aria-describedby="YSFGATEWAYINIPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYINIFILENAME" style="width: 300px">YSFGateway.ini-filename</span>
<input type="text" value="<?php echo constant("YSFGATEWAYINIFILENAME") ?>" name="YSFGATEWAYINIFILENAME" class="form-control" placeholder="YSFGateway.ini" aria-describedby="YSFGATEWAYINIFILENAME">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFHOSTSPATH" style="width: 300px">Path to YSFHosts.txt</span>
<input type="text" value="<?php echo constant("YSFHOSTSPATH") ?>" name="YSFHOSTSPATH" class="form-control" placeholder="/etc/YSFGateway/" aria-describedby="YSFHOSTSPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFHOSTSFILENAME" style="width: 300px">YSFHosts.txt-filename</span>
<input type="text" value="<?php echo constant("YSFHOSTSFILENAME") ?>" name="YSFHOSTSFILENAME" class="form-control" placeholder="YSFHosts.txt" aria-describedby="YSFHOSTSFILENAME">
</div>
</div>
<div class="container">
<h2>ircddbgateway-Configuration</h2>
<div class="input-group">
<span class="input-group-addon" id="LINKLOGPATH" style="width: 300px">Path to Links.log</span>
<input type="text" value="<?php echo constant("LINKLOGPATH") ?>" name="LINKLOGPATH" class="form-control" placeholder="/var/log/" aria-describedby="LINKLOGPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="IRCDDBGATEWAY" style="width: 300px">Name of ircddbgateway-executeable</span>
<input type="text" value="<?php echo constant("IRCDDBGATEWAY") ?>" name="IRCDDBGATEWAY" class="form-control" placeholder="ircddbgatewayd" aria-describedby="IRCDDBGATEWAY">
</div>
</div>
<div class="container">
<h2>Global Configuration</h2>
<?php
function get_tz_options($selectedzone, $label, $desc = '') {
echo '<div class="input-group">';
echo '<span class="input-group-addon" id="TIMEZONE" style="width: 300px">Timezone</span>';
echo '<div class="input"><select name="TIMEZONE">';
function timezonechoice($selectedzone) {
$all = timezone_identifiers_list();
$i = 0;
foreach($all AS $zone) {
$zone = explode('/',$zone);
$zonen[$i]['continent'] = isset($zone[0]) ? $zone[0] : '';
$zonen[$i]['city'] = isset($zone[1]) ? $zone[1] : '';
$zonen[$i]['subcity'] = isset($zone[2]) ? $zone[2] : '';
$i++;
}
asort($zonen);
$structure = '';
foreach($zonen AS $zone) {
extract($zone);
// if($continent == 'Africa' || $continent == 'America' || $continent == 'Antarctica' || $continent == 'Arctic' || $continent == 'Asia' || $continent == 'Atlantic' || $continent == 'Australia' || $continent == 'Europe' || $continent == 'Indian' || $continent == 'Pacific') {
if(!isset($selectcontinent)) {
$structure .= '<optgroup label="'.$continent.'">'; // continent
} elseif($selectcontinent != $continent) {
$structure .= '</optgroup><optgroup label="'.$continent.'">'; // continent
}
if(isset($city) != ''){
if (!empty($subcity) != ''){
$city = $city . '/'. $subcity;
}
if ($continent != "UTC") {
$structure .= "<option ".((($continent.'/'.$city)==$selectedzone)?'selected="selected "':'')." value=\"".($continent.'/'.$city)."\">".str_replace('_',' ',$city)."</option>"; //Timezone
} else {
$structure .= "<option ".(("UTC"==$selectedzone)?'selected="selected "':'')." value=\"UTC\">UTC</option>"; //Timezone
}
} else {
if (!empty($subcity) != ''){
$city = $city . '/'. $subcity;
}
$structure .= "<option ".(($continent==$selectedzone)?'selected="selected "':'')." value=\"".$continent."\">".$continent."</option>"; //Timezone
}
$selectcontinent = $continent;
// }
}
$structure .= '</optgroup>';
return $structure;
}
echo timezonechoice($selectedzone);
echo '</select>';
echo '</input>';
echo '</div>';
echo '</div>';
}
get_tz_options(constant("TIMEZONE"), "Timezone", '');
?>
<div class="input-group">
<span class="input-group-addon" id="LOGO" style="width: 300px">URL to Logo</span>
<input type="text" value="<?php echo constant("LOGO") ?>" name="LOGO" class="form-control" placeholder="http://your-logo" aria-describedby="LOGO">
</div>
<div class="input-group">
<span class="input-group-addon" id="DMRPLUSLOGO" style="width: 300px">URL to DMRplus-Logo</span>
<input type="text" value="<?php echo constant("DMRPLUSLOGO") ?>" name="DMRPLUSLOGO" class="form-control" placeholder="http://your-logo" aria-describedby="DMRPLUSLOGO">
</div>
<div class="input-group">
<span class="input-group-addon" id="BRANDMEISTERLOGO" style="width: 300px">URL to BrandMeister-Logo</span>
<input type="text" value="<?php echo constant("BRANDMEISTERLOGO") ?>" name="BRANDMEISTERLOGO" class="form-control" placeholder="http://your-logo" aria-describedby="BRANDMEISTERLOGO">
</div>
<div class="input-group">
<span class="input-group-addon" id="REFRESHAFTER" style="width: 300px">Refresh page after in seconds</span>
<input type="text" value="<?php echo constant("REFRESHAFTER") ?>" name="REFRESHAFTER" class="form-control" placeholder="60" aria-describedby="REFRESHAFTER" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="SHOWPROGRESSBARS" style="width: 300px">Show progressbars</span>
<div class="panel-body"><input type="checkbox" name="SHOWPROGRESSBARS" <?php if (defined("SHOWPROGRESSBARS")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="TEMPERATUREALERT" style="width: 300px">Enable CPU-temperature-warning</span>
<div class="panel-body"><input type="checkbox" name="TEMPERATUREALERT" <?php if (defined("TEMPERATUREALERT")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="TEMPERATUREHIGHLEVEL" style="width: 300px">Warning temperature</span>
<input type="text" value="<?php echo constant("TEMPERATUREHIGHLEVEL") ?>" name="TEMPERATUREHIGHLEVEL" class="form-control" placeholder="60" aria-describedby="TEMPERATUREHIGHLEVEL" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="ENABLENETWORKSWITCHING" style="width: 300px">Enable Network-Switching-Function</span>
<div class="panel-body"><input type="checkbox" name="ENABLENETWORKSWITCHING" <?php if (constant("ENABLENETWORKSWITCHING")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="SWITCHNETWORKUSER" style="width: 300px">Username for switching networks:</span>
<input type="text" value="<?php echo constant("SWITCHNETWORKUSER") ?>" name="SWITCHNETWORKUSER" class="form-control" placeholder="username" aria-describedby="SWITCHNETWORKUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="SWITCHNETWORKPW" style="width: 300px">Password for switching networks:</span>
<input type="text" value="<?php echo constant("SWITCHNETWORKPW") ?>" name="SWITCHNETWORKPW" class="form-control" placeholder="password" aria-describedby="SWITCHNETWORKPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="ENABLEMANAGEMENT" style="width: 300px">Enable Management-Functions below</span>
<div class="panel-body"><input type="checkbox" name="ENABLEMANAGEMENT" <?php if (constant("ENABLEMANAGEMENT")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="VIEWLOGUSER" style="width: 300px">Username for view log:</span>
<input type="text" value="<?php echo constant("VIEWLOGUSER") ?>" name="VIEWLOGUSER" class="form-control" placeholder="username" aria-describedby="VIEWLOGUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="VIEWLOGPW" style="width: 300px">Password for view log:</span>
<input type="text" value="<?php echo constant("VIEWLOGPW") ?>" name="VIEWLOGPW" class="form-control" placeholder="password" aria-describedby="VIEWLOGPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="HALTUSER" style="width: 300px">Username for halt:</span>
<input type="text" value="<?php echo constant("HALTUSER") ?>" name="HALTUSER" class="form-control" placeholder="username" aria-describedby="HALTUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="HALTPW" style="width: 300px">Password for halt:</span>
<input type="text" value="<?php echo constant("HALTPW") ?>" name="HALTPW" class="form-control" placeholder="password" aria-describedby="HALTPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="REBOOTUSER" style="width: 300px">Username for reboot:</span>
<input type="text" value="<?php echo constant("REBOOTUSER") ?>" name="REBOOTUSER" class="form-control" placeholder="username" aria-describedby="REBOOTUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="REBOOTPW" style="width: 300px">Password for reboot:</span>
<input type="text" value="<?php echo constant("REBOOTPW") ?>" name="REBOOTPW" class="form-control" placeholder="password" aria-describedby="REBOOTPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="RESTARTUSER" style="width: 300px">Username for restart:</span>
<input type="text" value="<?php echo constant("RESTARTUSER") ?>" name="RESTARTUSER" class="form-control" placeholder="username" aria-describedby="RESTARTUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="RESTARTPW" style="width: 300px">Password for restart:</span>
<input type="text" value="<?php echo constant("RESTARTPW") ?>" name="RESTARTPW" class="form-control" placeholder="password" aria-describedby="RESTARTPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="REBOOTMMDVM" style="width: 300px">Reboot MMDVMHost command:</span>
<input type="text" value="<?php echo constant("REBOOTMMDVM") ?>" name="REBOOTMMDVM" class="form-control" placeholder="sudo systemctl restart mmdvmhost.service" aria-describedby="REBOOTMMDVM">
</div>
<div class="input-group">
<span class="input-group-addon" id="REBOOTSYS" style="width: 300px">Reboot system command:</span>
<input type="text" value="<?php echo constant("REBOOTSYS") ?>" name="REBOOTSYS" class="form-control" placeholder="sudo reboot" aria-describedby="REBOOTSYS">
</div>
<div class="input-group">
<span class="input-group-addon" id="HALTSYS" style="width: 300px">Halt system command:</span>
<input type="text" value="<?php echo constant("HALTSYS") ?>" name="HALTSYS" class="form-control" placeholder="sudo halt" aria-describedby="HALTSYS">
</div>
<div class="input-group">
<span class="input-group-addon" id="SHOWPOWERSTATE" style="width: 300px">Show Powerstate (online or battery, wiringpi needed)</span>
<div class="panel-body"><input type="checkbox" name="SHOWPOWERSTATE" <?php if (defined("SHOWPOWERSTATE")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="POWERONLINEPIN" style="width: 300px">GPIO pin to monitor:</span>
<input type="text" value="<?php echo constant("POWERONLINEPIN") ?>" name="POWERONLINEPIN" class="form-control" placeholder="18" aria-describedby="POWERONLINEPIN">
</div>
<div class="input-group">
<span class="input-group-addon" id="POWERONLINESTATE" style="width: 300px">State that signalizes online-state:</span>
<input type="text" value="<?php echo constant("POWERONLINESTATE") ?>" name="POWERONLINESTATE" class="form-control" placeholder="1" aria-describedby="POWERONLINESTATE">
</div>
<div class="input-group">
<span class="input-group-addon" id="SHOWQRZ" style="width: 300px">Show link to QRZ.com on Callsigns</span>
<div class="panel-body"><input type="checkbox" name="SHOWQRZ" <?php if (defined("SHOWQRZ")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-default" type="submit" form="config">Save configuration</button>
</span>
</div>
</div>
</form>
<?php
}
?>
</body>
</html>
<?php
include "config/config.php";
include "include/tools.php";
?>
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<!-- Das neueste kompilierte und minimierte CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optionales Theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Das neueste kompilierte und minimierte JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<title>MMDVM-Dashboard by DG9VH - Setup</title>
</head>
<body>
<?php
if (isset($_GET['cmd'])) {
if ( "writeconfig" == $_GET['cmd']) {
if (!file_exists('./config')) {
if (!mkdir('./config', 0777, true)) {
?>
<div class="alert alert-danger" role="alert">You forgot to give write-permissions to your webserver-user, see point 3 in <a href="linux-step-by-step.md">linux-step-by-step.md</a>!</div>
<?php
}
}
$configfile = fopen("config/config.php", 'w');
fwrite($configfile,"<?php\n");
fwrite($configfile,"# This is an auto-generated config-file!\n");
fwrite($configfile,"# Be careful, when manual editing this!\n\n");
fwrite($configfile,"date_default_timezone_set('UTC');\n");
fwrite($configfile, createConfigLines());
fwrite($configfile,"?>\n");
fclose($configfile);
?>
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH</small> Setup-Process</h1>
<div class="alert alert-success" role="alert">Your config-file is written in config/config.php, please remove setup.php for security reasons!</div>
<p><a href="index.php">Your dashboard is now available.</a></p>
</div>
<?php
}
} else {
?>
<div class="page-header">
<h1><small>MMDVM-Dashboard by DG9VH</small> Setup-Process</h1>
<h4>Please give necessary information below</h4>
</div>
<form id="config" action="setup.php" method="get">
<input type="hidden" name="cmd" value="writeconfig">
<div class="container">
<h2>MMDVMHost-Configuration</h2>
<div class="input-group">
<span class="input-group-addon" id="MMDVMLOGPATH" style="width: 300px">Path to MMDVMHost-logfile</span>
<input type="text" value="<?php echo constant("MMDVMLOGPATH") ?>" name="MMDVMLOGPATH" class="form-control" placeholder="/var/log/mmdvm/" aria-describedby="MMDVMLOGPATH" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="MMDVMINIPATH" style="width: 300px">Path to MMDVM.ini</span>
<input type="text" value="<?php echo constant("MMDVMINIPATH") ?>" name="MMDVMINIPATH" class="form-control" placeholder="/etc/mmdvm/" aria-describedby="MMDVMINIPATH" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="MMDVMINIFILENAME" style="width: 300px">MMDVM.ini-filename</span>
<input type="text" value="<?php echo constant("MMDVMINIFILENAME") ?>" name="MMDVMINIFILENAME" class="form-control" placeholder="MMDVM.ini" aria-describedby="MMDVMINIFILENAME" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="MMDVMHOSTPATH" style="width: 300px">Path to MMDVMHost-executable</span>
<input type="text" value="<?php echo constant("MMDVMHOSTPATH") ?>" name="MMDVMHOSTPATH" class="form-control" placeholder="/usr/local/bin/" aria-describedby="MMDVMHOSTPATH" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="ENABLEXTDLOOKUP" style="width: 300px">Enable extended lookup (show names)</span>
<div class="panel-body"><input type="checkbox" name="ENABLEXTDLOOKUP" <?php if (defined("ENABLEXTDLOOKUP")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="DMRIDDATPATH" style="width: 300px">Path to DMR-ID-Database-File (including filename)</span>
<input type="text" value="<?php echo constant("DMRIDDATPATH") ?>" name="DMRIDDATPATH" class="form-control" placeholder="/var/mmdvm/DMRIDs.dat" aria-describedby="DMRIDDATPATH">
</div>
</div>
<div class="container">
<h2>YSFGateway-Configuration</h2>
<div class="input-group">
<span class="input-group-addon" id="ENABLEYSFGATEWAY" style="width: 300px">Enable YSFGateway</span>
<div class="panel-body"><input type="checkbox" name="ENABLEYSFGATEWAY" <?php if (constant("ENABLEYSFGATEWAY")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYLOGPATH" style="width: 300px">Path to YSFGateway-logfile</span>
<input type="text" value="<?php echo constant("YSFGATEWAYLOGPATH") ?>" name="YSFGATEWAYLOGPATH" class="form-control" placeholder="/var/log/YSFGateway/" aria-describedby="YSFGATEWAYLOGPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYLOGPREFIX" style="width: 300px">Logfile-prefix</span>
<input type="text" value="<?php echo constant("YSFGATEWAYLOGPREFIX") ?>" name="YSFGATEWAYLOGPREFIX" class="form-control" placeholder="YSFGateway" aria-describedby="YSFGATEWAYLOGPREFIX">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYINIPATH" style="width: 300px">Path to YSFGateway.ini</span>
<input type="text" value="<?php echo constant("YSFGATEWAYINIPATH") ?>" name="YSFGATEWAYINIPATH" class="form-control" placeholder="/etc/YSFGateway/" aria-describedby="YSFGATEWAYINIPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYINIFILENAME" style="width: 300px">YSFGateway.ini-filename</span>
<input type="text" value="<?php echo constant("YSFGATEWAYINIFILENAME") ?>" name="YSFGATEWAYINIFILENAME" class="form-control" placeholder="YSFGateway.ini" aria-describedby="YSFGATEWAYINIFILENAME">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFHOSTSPATH" style="width: 300px">Path to YSFHosts.txt</span>
<input type="text" value="<?php echo constant("YSFHOSTSPATH") ?>" name="YSFHOSTSPATH" class="form-control" placeholder="/etc/YSFGateway/" aria-describedby="YSFHOSTSPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFHOSTSFILENAME" style="width: 300px">YSFHosts.txt-filename</span>
<input type="text" value="<?php echo constant("YSFHOSTSFILENAME") ?>" name="YSFHOSTSFILENAME" class="form-control" placeholder="YSFHosts.txt" aria-describedby="YSFHOSTSFILENAME">
</div>
</div>
<div class="container">
<h2>ircddbgateway-Configuration</h2>
<div class="input-group">
<span class="input-group-addon" id="LINKLOGPATH" style="width: 300px">Path to Links.log</span>
<input type="text" value="<?php echo constant("LINKLOGPATH") ?>" name="LINKLOGPATH" class="form-control" placeholder="/var/log/" aria-describedby="LINKLOGPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="IRCDDBGATEWAY" style="width: 300px">Name of ircddbgateway-executeable</span>
<input type="text" value="<?php echo constant("IRCDDBGATEWAY") ?>" name="IRCDDBGATEWAY" class="form-control" placeholder="ircddbgatewayd" aria-describedby="IRCDDBGATEWAY">
</div>
</div>
<div class="container">
<h2>Global Configuration</h2>
<?php
function get_tz_options($selectedzone, $label, $desc = '') {
echo '<div class="input-group">';
echo '<span class="input-group-addon" id="TIMEZONE" style="width: 300px">Timezone</span>';
echo '<div class="input"><select name="TIMEZONE">';
function timezonechoice($selectedzone) {
$all = timezone_identifiers_list();
$i = 0;
foreach($all AS $zone) {
$zone = explode('/',$zone);
$zonen[$i]['continent'] = isset($zone[0]) ? $zone[0] : '';
$zonen[$i]['city'] = isset($zone[1]) ? $zone[1] : '';
$zonen[$i]['subcity'] = isset($zone[2]) ? $zone[2] : '';
$i++;
}
asort($zonen);
$structure = '';
foreach($zonen AS $zone) {
extract($zone);
// if($continent == 'Africa' || $continent == 'America' || $continent == 'Antarctica' || $continent == 'Arctic' || $continent == 'Asia' || $continent == 'Atlantic' || $continent == 'Australia' || $continent == 'Europe' || $continent == 'Indian' || $continent == 'Pacific') {
if(!isset($selectcontinent)) {
$structure .= '<optgroup label="'.$continent.'">'; // continent
} elseif($selectcontinent != $continent) {
$structure .= '</optgroup><optgroup label="'.$continent.'">'; // continent
}
if(isset($city) != ''){
if (!empty($subcity) != ''){
$city = $city . '/'. $subcity;
}
if ($continent != "UTC") {
$structure .= "<option ".((($continent.'/'.$city)==$selectedzone)?'selected="selected "':'')." value=\"".($continent.'/'.$city)."\">".str_replace('_',' ',$city)."</option>"; //Timezone
} else {
$structure .= "<option ".(("UTC"==$selectedzone)?'selected="selected "':'')." value=\"UTC\">UTC</option>"; //Timezone
}
} else {
if (!empty($subcity) != ''){
$city = $city . '/'. $subcity;
}
$structure .= "<option ".(($continent==$selectedzone)?'selected="selected "':'')." value=\"".$continent."\">".$continent."</option>"; //Timezone
}
$selectcontinent = $continent;
// }
}
$structure .= '</optgroup>';
return $structure;
}
echo timezonechoice($selectedzone);
echo '</select>';
echo '</input>';
echo '</div>';
echo '</div>';
}
get_tz_options(constant("TIMEZONE"), "Timezone", '');
?>
<div class="input-group">
<span class="input-group-addon" id="LOGO" style="width: 300px">URL to Logo</span>
<input type="text" value="<?php echo constant("LOGO") ?>" name="LOGO" class="form-control" placeholder="http://your-logo" aria-describedby="LOGO">
</div>
<div class="input-group">
<span class="input-group-addon" id="DMRPLUSLOGO" style="width: 300px">URL to DMRplus-Logo</span>
<input type="text" value="<?php echo constant("DMRPLUSLOGO") ?>" name="DMRPLUSLOGO" class="form-control" placeholder="http://your-logo" aria-describedby="DMRPLUSLOGO">
</div>
<div class="input-group">
<span class="input-group-addon" id="BRANDMEISTERLOGO" style="width: 300px">URL to BrandMeister-Logo</span>
<input type="text" value="<?php echo constant("BRANDMEISTERLOGO") ?>" name="BRANDMEISTERLOGO" class="form-control" placeholder="http://your-logo" aria-describedby="BRANDMEISTERLOGO">
</div>
<div class="input-group">
<span class="input-group-addon" id="REFRESHAFTER" style="width: 300px">Refresh page after in seconds</span>
<input type="text" value="<?php echo constant("REFRESHAFTER") ?>" name="REFRESHAFTER" class="form-control" placeholder="60" aria-describedby="REFRESHAFTER" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="SHOWPROGRESSBARS" style="width: 300px">Show progressbars</span>
<div class="panel-body"><input type="checkbox" name="SHOWPROGRESSBARS" <?php if (defined("SHOWPROGRESSBARS")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="TEMPERATUREALERT" style="width: 300px">Enable CPU-temperature-warning</span>
<div class="panel-body"><input type="checkbox" name="TEMPERATUREALERT" <?php if (defined("TEMPERATUREALERT")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="TEMPERATUREHIGHLEVEL" style="width: 300px">Warning temperature</span>
<input type="text" value="<?php echo constant("TEMPERATUREHIGHLEVEL") ?>" name="TEMPERATUREHIGHLEVEL" class="form-control" placeholder="60" aria-describedby="TEMPERATUREHIGHLEVEL" required data-fv-notempty-message="Value is required">
</div>
<div class="input-group">
<span class="input-group-addon" id="ENABLENETWORKSWITCHING" style="width: 300px">Enable Network-Switching-Function</span>
<div class="panel-body"><input type="checkbox" name="ENABLENETWORKSWITCHING" <?php if (constant("ENABLENETWORKSWITCHING")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="SWITCHNETWORKUSER" style="width: 300px">Username for switching networks:</span>
<input type="text" value="<?php echo constant("SWITCHNETWORKUSER") ?>" name="SWITCHNETWORKUSER" class="form-control" placeholder="username" aria-describedby="SWITCHNETWORKUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="SWITCHNETWORKPW" style="width: 300px">Password for switching networks:</span>
<input type="text" value="<?php echo constant("SWITCHNETWORKPW") ?>" name="SWITCHNETWORKPW" class="form-control" placeholder="password" aria-describedby="SWITCHNETWORKPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="ENABLEMANAGEMENT" style="width: 300px">Enable Management-Functions below</span>
<div class="panel-body"><input type="checkbox" name="ENABLEMANAGEMENT" <?php if (constant("ENABLEMANAGEMENT")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="VIEWLOGUSER" style="width: 300px">Username for view log:</span>
<input type="text" value="<?php echo constant("VIEWLOGUSER") ?>" name="VIEWLOGUSER" class="form-control" placeholder="username" aria-describedby="VIEWLOGUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="VIEWLOGPW" style="width: 300px">Password for view log:</span>
<input type="text" value="<?php echo constant("VIEWLOGPW") ?>" name="VIEWLOGPW" class="form-control" placeholder="password" aria-describedby="VIEWLOGPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="HALTUSER" style="width: 300px">Username for halt:</span>
<input type="text" value="<?php echo constant("HALTUSER") ?>" name="HALTUSER" class="form-control" placeholder="username" aria-describedby="HALTUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="HALTPW" style="width: 300px">Password for halt:</span>
<input type="text" value="<?php echo constant("HALTPW") ?>" name="HALTPW" class="form-control" placeholder="password" aria-describedby="HALTPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="REBOOTUSER" style="width: 300px">Username for reboot:</span>
<input type="text" value="<?php echo constant("REBOOTUSER") ?>" name="REBOOTUSER" class="form-control" placeholder="username" aria-describedby="REBOOTUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="REBOOTPW" style="width: 300px">Password for reboot:</span>
<input type="text" value="<?php echo constant("REBOOTPW") ?>" name="REBOOTPW" class="form-control" placeholder="password" aria-describedby="REBOOTPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="RESTARTUSER" style="width: 300px">Username for restart:</span>
<input type="text" value="<?php echo constant("RESTARTUSER") ?>" name="RESTARTUSER" class="form-control" placeholder="username" aria-describedby="RESTARTUSER">
</div>
<div class="input-group">
<span class="input-group-addon" id="RESTARTPW" style="width: 300px">Password for restart:</span>
<input type="text" value="<?php echo constant("RESTARTPW") ?>" name="RESTARTPW" class="form-control" placeholder="password" aria-describedby="RESTARTPW">
</div>
<div class="input-group">
<span class="input-group-addon" id="REBOOTMMDVM" style="width: 300px">Reboot MMDVMHost command:</span>
<input type="text" value="<?php echo constant("REBOOTMMDVM") ?>" name="REBOOTMMDVM" class="form-control" placeholder="sudo systemctl restart mmdvmhost.service" aria-describedby="REBOOTMMDVM">
</div>
<div class="input-group">
<span class="input-group-addon" id="REBOOTSYS" style="width: 300px">Reboot system command:</span>
<input type="text" value="<?php echo constant("REBOOTSYS") ?>" name="REBOOTSYS" class="form-control" placeholder="sudo reboot" aria-describedby="REBOOTSYS">
</div>
<div class="input-group">
<span class="input-group-addon" id="HALTSYS" style="width: 300px">Halt system command:</span>
<input type="text" value="<?php echo constant("HALTSYS") ?>" name="HALTSYS" class="form-control" placeholder="sudo halt" aria-describedby="HALTSYS">
</div>
<div class="input-group">
<span class="input-group-addon" id="SHOWPOWERSTATE" style="width: 300px">Show Powerstate (online or battery, wiringpi needed)</span>
<div class="panel-body"><input type="checkbox" name="SHOWPOWERSTATE" <?php if (defined("SHOWPOWERSTATE")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="POWERONLINEPIN" style="width: 300px">GPIO pin to monitor:</span>
<input type="text" value="<?php echo constant("POWERONLINEPIN") ?>" name="POWERONLINEPIN" class="form-control" placeholder="18" aria-describedby="POWERONLINEPIN">
</div>
<div class="input-group">
<span class="input-group-addon" id="POWERONLINESTATE" style="width: 300px">State that signalizes online-state:</span>
<input type="text" value="<?php echo constant("POWERONLINESTATE") ?>" name="POWERONLINESTATE" class="form-control" placeholder="1" aria-describedby="POWERONLINESTATE">
</div>
<div class="input-group">
<span class="input-group-addon" id="SHOWQRZ" style="width: 300px">Show link to QRZ.com on Callsigns</span>
<div class="panel-body"><input type="checkbox" name="SHOWQRZ" <?php if (defined("SHOWQRZ")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-default" type="submit" form="config">Save configuration</button>
</span>
</div>
</div>
</form>
<?php
}
?>
</body>
</html>

View file

@ -7,9 +7,9 @@ include "include/tools.php";
include "include/functions.php";
$mmdvmconfigs = getMMDVMConfig();
if (!defined("MMDVMLOGPREFIX"))
define("MMDVMLOGPREFIX", getConfigItem("Log", "FileRoot", $mmdvmconfigs));
define("MMDVMLOGPREFIX", getConfigItem("Log", "FileRoot", $mmdvmconfigs));
if (!defined("TIMEZONE"))
define("TIMEZONE", "UTC");
define("TIMEZONE", "UTC");
$logLinesMMDVM = getShortMMDVMLog();
$reverseLogLinesMMDVM = $logLinesMMDVM;
array_multisort($reverseLogLinesMMDVM,SORT_DESC);
@ -20,61 +20,61 @@ var_dump($lastHeard);
echo"-->";
$counter = 0;
foreach ($lastHeard as $listElem) {
$counter +=1;
if (defined("ENABLEXTDLOOKUP") && $listElem[7] == null || !defined("ENABLEXTDLOOKUP") && $listElem[6] == null) {
echo "<tr>";
echo"<td nowrap>$listElem[0]</td>";
echo"<td nowrap>$listElem[1]</td>";
/*if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";
}
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</td>";
}
}*/
echo"<td nowrap>$listElem[2]</td>";
$counter +=1;
if (defined("ENABLEXTDLOOKUP") && $listElem[7] == null || !defined("ENABLEXTDLOOKUP") && $listElem[6] == null) {
echo "<tr>";
echo"<td nowrap>$listElem[0]</td>";
echo"<td nowrap>$listElem[1]</td>";
/*if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";
}
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?usrid=$listElem[2]\">".$listElem[2]."</td>";
}
}*/
echo"<td nowrap>$listElem[2]</td>";
if (defined("ENABLEXTDLOOKUP")) {
//echo "<td nowrap>".getName($listElem[2])."</td>";
echo"<td nowrap>$listElem[3]</td>";
echo"<td nowrap>$listElem[4]</td>";
echo"<td nowrap>$listElem[5]</td>";
if ($listElem[6] == "RF"){
echo "<td nowrap><span class=\"label label-success\">RF</span></td>";
}else{
echo"<td nowrap>$listElem[6]</td>";
}
$d1 = new DateTime($listElem[0], new DateTimeZone(TIMEZONE));
$d2 = new DateTime('now', new DateTimeZone(TIMEZONE));
$diff = $d2->getTimestamp() - $d1->getTimestamp();
echo"<td nowrap>$diff s</td>";
} else {
echo"<td nowrap>$listElem[3]</td>";
echo"<td nowrap>$listElem[4]</td>";
if ($listElem[5] == "RF"){
echo "<td nowrap><span class=\"label label-success\">RF</span></td>";
}else{
echo"<td nowrap>$listElem[5]</td>";
}
$tz = new DateTimeZone(TIMEZONE);
$d1 = new DateTime($listElem[0], $tz);
$d2 = new DateTime('now', $tz);
$diff = $d2->getTimestamp() - $d1->getTimestamp();
echo"<td nowrap>$diff s</td>";
}
echo "</tr>";
} else {
if ($counter == 1) {
if (defined("ENABLEXTDLOOKUP")) {
echo "<tr><td colspan='8'></td></tr>";
} else {
echo "<tr><td colspan='7'></td></tr>";
}
}
}
if (defined("ENABLEXTDLOOKUP")) {
//echo "<td nowrap>".getName($listElem[2])."</td>";
echo"<td nowrap>$listElem[3]</td>";
echo"<td nowrap>$listElem[4]</td>";
echo"<td nowrap>$listElem[5]</td>";
if ($listElem[6] == "RF"){
echo "<td nowrap><span class=\"label label-success\">RF</span></td>";
}else{
echo"<td nowrap>$listElem[6]</td>";
}
$d1 = new DateTime($listElem[0], new DateTimeZone(TIMEZONE));
$d2 = new DateTime('now', new DateTimeZone(TIMEZONE));
$diff = $d2->getTimestamp() - $d1->getTimestamp();
echo"<td nowrap>$diff s</td>";
} else {
echo"<td nowrap>$listElem[3]</td>";
echo"<td nowrap>$listElem[4]</td>";
if ($listElem[5] == "RF"){
echo "<td nowrap><span class=\"label label-success\">RF</span></td>";
}else{
echo"<td nowrap>$listElem[5]</td>";
}
$tz = new DateTimeZone(TIMEZONE);
$d1 = new DateTime($listElem[0], $tz);
$d2 = new DateTime('now', $tz);
$diff = $d2->getTimestamp() - $d1->getTimestamp();
echo"<td nowrap>$diff s</td>";
}
echo "</tr>";
} else {
if ($counter == 1) {
if (defined("ENABLEXTDLOOKUP")) {
echo "<tr><td colspan='8'></td></tr>";
} else {
echo "<tr><td colspan='7'></td></tr>";
}
}
}
}
?>