This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
/
txinfo.php
95 lines (95 loc) · 3.71 KB
/
txinfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
//session_start();
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
include "config/config.php";
include "include/tools.php";
include "include/functions.php";
$mmdvmconfigs = getMMDVMConfig();
if (defined("RESOLVETGS")) {
$tgList = getTGList();
}
if (!defined("MMDVMLOGPREFIX"))
define("MMDVMLOGPREFIX", getConfigItem("Log", "FileRoot", $mmdvmconfigs));
if (!defined("TIMEZONE"))
define("TIMEZONE", "UTC");
$logLinesMMDVM = getShortMMDVMLog();
// echo"<!--";
// var_dump($logLinesMMDVM);
// echo"-->";
$reverseLogLinesMMDVM = $logLinesMMDVM;
array_multisort($reverseLogLinesMMDVM,SORT_DESC);
$lastHeard = getLastHeard($reverseLogLinesMMDVM, True);
$counter = 0;
foreach ($lastHeard as $listElem) {
$counter +=1;
// echo"<!--";
// var_dump($listElem);
// echo"-->";
if (getEnabled("D-Star", $mmdvmconfigs) == 1 && defined("ENABLEXTDLOOKUP") && $listElem[7] == null && $listElem[1] != "POCSAG" || !defined("ENABLEXTDLOOKUP") && $listElem[6] == null && $listElem[1] != "POCSAG" || \
getEnabled("D-Star", $mmdvmconfigs) == 0 && defined("ENABLEXTDLOOKUP") && $listElem[6] == null && $listElem[1] != "POCSAG" || !defined("ENABLEXTDLOOKUP") && $listElem[5] == null && $listElem[1] != "POCSAG" ) {
echo "<tr>";
echo"<td nowrap>$listElem[0]</td>";
echo"<td nowrap>$listElem[1]</td>";
echo"<td nowrap>$listElem[2]</td>";
if (defined("ENABLEXTDLOOKUP")) {
echo"<td nowrap>$listElem[3]</td>";
if (getEnabled("D-Star", $mmdvmconfigs) == 1) {
if (defined("TALKERALIAS"))
echo"<td nowrap>$listElem[11]</td>";
echo"<td nowrap>$listElem[4]</td>";
echo"<td nowrap>$listElem[5]</td>";
if ($listElem[6] == "RF"){
echo "<td nowrap><span class=\"badge badge-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 {
if (defined("TALKERALIAS"))
echo"<td nowrap>$listElem[10]</td>";
echo"<td nowrap>$listElem[4]</td>";
if ($listElem[5] == "RF"){
echo "<td nowrap><span class=\"badge badge-success\">RF</span></td>";
}else{
echo"<td nowrap>$listElem[5]</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 {
if (defined("TALKERALIAS"))
echo"<td nowrap>$listElem[10]</td>";
echo"<td nowrap>$listElem[3]</td>";
echo"<td nowrap>$listElem[4]</td>";
if ($listElem[5] == "RF"){
echo "<td nowrap><span class=\"badge badge-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) {
$colspan = 7;
if (defined("ENABLEXTDLOOKUP")) {
$colspan++;
}
if (defined("TALKERALIAS")) {
$colspan++;
}
echo "<tr><td colspan='".$colspan."'></td></tr>";
}
}
}
?>