-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathframes.php
More file actions
168 lines (159 loc) · 6.38 KB
/
frames.php
File metadata and controls
168 lines (159 loc) · 6.38 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
/******************************************************************************************
This file is a part of SIMPLE WEB STATICSTICS GENERATOR FROM APRX LOG FILE
It's very simple and small APRX statictics generator in PHP. It's parted to smaller files and they will work independent from each other (but you always need chgif.php).
This script may have a lot of bugs, problems and it's written in very non-efficient way without a lot of good programming rules. But it works for me.
Author: Peter SQ8VPS, sq8vps[--at--]gmail.com & Alfredo IZ7BOJ
You can modify this program, but please give a credit to original author. Program is free for non-commercial use only.
(C) Peter SQ8VPS & Alfredo IZ7BOJ 2017-2018
Version 1.3.1beta
*******************************************************************************************/
?>
<?php
include 'config.php';
include 'common.php';
logexists();
session_start();
if(!isset($_SESSION['if']))
{
header('Refresh: 0; url=chgif.php?chgif=1');
die();
}
$call = $_SESSION['call'];
$callraw = $_SESSION['if'];
$lang = $_SESSION['lang'];
$frames = array();
if(isset($_GET['getcall']) and ($_GET['getcall'] !== ""))
{
global $logpath;
$scall = strtoupper($_GET['getcall']);
$linesinlog = 0;
global $callraw;
echo '<br>';
$logfile = file($logpath); //read log file
$linesinlog = count($logfile);
$b = 0;
//parse line by line
while($b < $linesinlog)
{
$line = $logfile[$b];
if(strpos($line, $callraw." R "))
{
$statcall = explode(">", $line); //odetnij wszystko za znakiem
$statcall = substr($statcall[0], strpos($statcall[0], $callraw." R ") + strlen($callraw." R ")); //obetnij linie do miejsca, gdzie jest znak
if($statcall == $scall)
{
$frames[] = str_replace($callraw." R ", " ", $line);
}
}
elseif(strpos($line, $callraw." d *"))
{
$statcall = explode(">", $line);
$statcall = substr($statcall[0], strpos($statcall[0], $callraw." d *") + strlen($callraw." d *"));
if($statcall == $scall)
{
$frames[] = str_replace($callraw." d *", " ", $line);
}
}
elseif(strpos($line, $callraw." d "))
{
$statcall = explode(">", $line);
//echo $statcall[0];
$statcall = substr($statcall[0], strpos($statcall[0], $callraw." d ") + strlen($callraw." d "));
//echo $statcall.'<br>';
if($statcall == $scall)
{
$frames[] = str_replace($callraw." d ", " ", $line);
}
}
$b++;
}//close while
}
if($lang == "en")
{
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="APRX statistics" />
<meta name="Keywords" content="" />
<meta name="Author" content="SQ8VPS" />
<title>APRX statistics - frames search</title>
</head>
<body>
<?php
if(file_exists($logourl)){
?>
<center><img src="<?php echo $logourl ?>" width="100px" height="100px" align="middle"></center><br>
<?php
}
?>
<center><font size="20"><b>APRX statistics</b></font>
<h2>for interface <font color="red"><b><?php echo $call; ?></b></font> - search frames</h2> <a href="chgif.php?chgif=1">Change interface</a>
<br>
<br><b>Show:</b> <a href="summary.php">Summary (main)</a> - <a href="frames.php">RAW frames from specified station</a> - <a href="details.php">Details of a specified station</a><br><br>
<hr>
</center>
<br>
<form action="frames.php" method="get">
Show all frames from the callsign: <input type="text" name="getcall" <?php if(isset($_GET['getcall'])) echo "value=\"".$_GET['getcall']."\""; ?>>
<input type="submit" value="Show">
</form>
<?php
if(isset($_GET['getcall']) and ($_GET['getcall'] !== ""))
{
echo "<font color=\"red\"><b>Found ".count($frames)." frames from station $scall</b></font><br><br>";
array_multisort($frames, SORT_DESC);
for($o = 0; $o < count($frames); $o++)
{
echo $frames[$o]."<br>";
}
}
}//close if english
else {
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="Statystyki APRX" />
<meta name="Keywords" content="" />
<meta name="Author" content="SQ8VPS" />
<title>Statystyki APRX - szukaj ramek</title>
</head>
<body>
<?php
if(file_exists($logourl)){
?>
<center><img src="<?php echo $logourl ?>" width="100px" height="100px" align="middle"></center><br>
<?php
}
?>
<center><font size="20"><b>Statystyki APRX</b></font>
<h2>dla interfejsu <font color="red"><b><?php echo $call; ?></b></font> - szukaj ramek</h2> <a href="chgif.php?chgif=1">Zmień interfejs</a>
<br>
<br><b>Pokaż:</b> <a href="summary.php">Podsumowanie (główna)</a> - <a href="frames.php">Surowe ramki wybranej stacji</a> - <a href="details.php">Szczegóły wybranej stacji</a><br><br>
<hr>
</center>
<br>
<form action="frames.php" method="get">
Pokaż wszystkie ramki od znaku: <input type="text" name="getcall" <?php if(isset($_GET['getcall'])) echo "value=\"".$_GET['getcall']."\""; ?>>
<input type="submit" value="Pokaż">
</form>
<?php
if(isset($_GET['getcall']) and ($_GET['getcall'] !== ""))
{
echo "<font color=\"red\"><b>Znaleziono ".count($frames)." ramek od stacji $scall </b></font><br><br>";
array_multisort($frames, SORT_DESC);
for($o = 0; $o < count($frames); $o++)
{
echo $frames[$o]."<br>";
}
} //close else language
} //close if issset GET['call']
?>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<center><a href="https://github.com/sq8vps/aprx-simplewebstat" target="_blank">APRX Simple Webstat version <?php echo $asw_version; ?></a> by Peter SQ8VPS and Alfredo IZ7BOJ</center>
</body>
</html>