From 2e3eff7d67abcd2624b517cfad7a16c1785bfd85 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Mon, 2 May 2016 10:19:08 +0200 Subject: [PATCH] First start of repeater info --- include/functions.php | 33 +++++++++++++++++++++++++++++++++ include/repeaterinfo.php | 25 +++++++++++++++++++++++++ index.php | 1 + 3 files changed, 59 insertions(+) create mode 100644 include/repeaterinfo.php diff --git a/include/functions.php b/include/functions.php index 5b81863..034b045 100644 --- a/include/functions.php +++ b/include/functions.php @@ -67,6 +67,39 @@ function getLastHeard($logLines) { 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 $logLines = getLog(); ?> \ No newline at end of file diff --git a/include/repeaterinfo.php b/include/repeaterinfo.php new file mode 100644 index 0000000..9f7271a --- /dev/null +++ b/include/repeaterinfo.php @@ -0,0 +1,25 @@ +
+ +
Repeater Info
+ + + + + + + + + + +"; + echo""; + echo""; + echo""; + echo""; + echo"\n"; +?> +
Actual ModeD-Star linked toDMR TS1DMR TS2
".getActualMode($logLines)."".getActualLink($logLines, "D-Star")."".getActualLink($logLines, "DMR Slot 1")."".getActualLink($logLines, "DMR Slot 2")."
+
\ No newline at end of file diff --git a/index.php b/index.php index c90d5d3..0c061fe 100644 --- a/index.php +++ b/index.php @@ -26,6 +26,7 @@ include "include/functions.php";