First start of repeater info

This commit is contained in:
dg9vh 2016-05-02 10:19:08 +02:00
parent a70608a6d4
commit 2e3eff7d67
3 changed files with 59 additions and 0 deletions

View file

@ -67,6 +67,39 @@ function getLastHeard($logLines) {
return $lastHeard; return $lastHeard;
} }
function getActualMode($logLines) {
array_multisort($logLines,SORT_DESC);
foreach ($logLines as $logLine) {
if (strpos($logLine, "Mode set to")) {
return substr($logLine, 39);
//break;
}
}
return "Idle";
}
function getActualLink($logLines, $mode) {
//M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S"
array_multisort($logLines,SORT_DESC);
switch ($mode) {
case "D-Star":
foreach ($logLines as $logLine) {
if (strpos($logLine, "D-Star link status set to")) {
return substr($logLine, 54, strlen($logLine) - 56);
}
}
break;
case "DMR Slot 1":
return "still to be implemented";
break;
case "DMR Slot 2":
return "still to be implemented";
break;
}
return "still to be implemented";
}
//Some basic inits //Some basic inits
$logLines = getLog(); $logLines = getLog();
?> ?>

25
include/repeaterinfo.php Normal file
View file

@ -0,0 +1,25 @@
<div class="panel panel-default">
<!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Repeater Info</div>
<!--<div class="panel-body">
<p>Put here some text</p>
</div>-->
<!-- Tabelle -->
<table class="table">
<tr>
<th>Actual Mode</th>
<th>D-Star linked to</th>
<th>DMR TS1</th>
<th>DMR TS2</th>
</tr>
<?php
echo"<tr>";
echo"<td>".getActualMode($logLines)."</td>";
echo"<td>".getActualLink($logLines, "D-Star")."</td>";
echo"<td>".getActualLink($logLines, "DMR Slot 1")."</td>";
echo"<td>".getActualLink($logLines, "DMR Slot 2")."</td>";
echo"</tr>\n";
?>
</table>
</div>

View file

@ -26,6 +26,7 @@ include "include/functions.php";
</div> </div>
<?php <?php
include "include/sysinfo.php"; include "include/sysinfo.php";
include "include/repeaterinfo.php";
include "include/lh.php"; include "include/lh.php";
?> ?>
<div class="panel panel-info"> <div class="panel panel-info">