make mode updated by ajax

This commit is contained in:
dg9vh 2016-10-09 20:34:09 +00:00
parent 4982146762
commit be58ad46fa
5 changed files with 10 additions and 5 deletions

View file

@ -11,6 +11,10 @@ $logLinesMMDVM = getMMDVMLog();
$reverseLogLinesMMDVM = $logLinesMMDVM;
array_multisort($reverseLogLinesMMDVM,SORT_DESC);
//$lastHeard = $_SESSION['lastHeard'];
if ($_GET['section'] == "mode") {
$mode = getActualMode(getLastHeard($reverseLogLinesMMDVM, TRUE), $mmdvmconfigs);
echo $mode;
}
if ($_GET['section'] == "lastHeard") {
$lastHeard = getLastHeard($reverseLogLinesMMDVM, FALSE);
echo '{"data": '.json_encode($lastHeard)."}";

View file

@ -328,7 +328,7 @@ function getActualMode($metaLastHeard, $mmdvmconfigs) {
if (startsWith($mode, "DMR")) {
$mode = "DMR";
}
if ($listElem[6] ==="") {
if ($listElem[7] ==="") {
return $mode;
} else {
$now = new DateTime();

View file

@ -13,7 +13,7 @@
</tr>
<?php
echo"<tr>";
echo"<td>".getActualMode($lastHeard, $mmdvmconfigs)."</td>";
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>";

View file

@ -44,8 +44,8 @@ function doXMLHTTPRequest(scriptname, elem) {
xmlhttp.send();
}
function refreshInQSOAndLastHeardList() {
doXMLHTTPRequest("txinfo.php","txline");
function refreshMode() {
doXMLHTTPRequest("ajax.php?section=mode","mode");
}
var transmitting = false;
@ -65,6 +65,7 @@ function loadXMLDoc() {
xmlhttp.send();
var timeout = window.setTimeout("loadXMLDoc()", 1000);
refreshMode();
}
loadXMLDoc();
</script>

View file

@ -1,3 +1,3 @@
<?php
define("VERSION", "20161009-2");
define("VERSION", "20161009-3");
?>