-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemlist.php
executable file
·297 lines (244 loc) · 8.33 KB
/
memlist.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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?php
// Load the language support
require_once('../config/language.php');
//Load the Pi-Star Release file
$pistarReleaseConfig = '/etc/pistar-release';
$configPistarRelease = array();
$configPistarRelease = parse_ini_file($pistarReleaseConfig, true);
//Load the Version Info
require_once('../config/version.php');
$fileLocation = getenv("DOCUMENT_ROOT") . "/castmemlist.txt";
if(file_exists($fileLocation))
{
}
else
{
shell_exec('sudo mount -o remount,rw /');
$nf = fopen($fileLocation, "w");
fwrite($nf, "DRM,204,Netherlands,\n");
fclose($nf);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
<head>
<meta name="robots" content="index" />
<meta name="robots" content="follow" />
<meta name="language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Author" content="Andrew Taylor (MW0MWZ)" />
<meta name="Description" content="Pi-Star Expert Editor" />
<meta name="KeyWords" content="Pi-Star" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="pragma" content="no-cache" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<meta http-equiv="Expires" content="0" />
<title>Pi-Star - Digital Voice Dashboard - Update is Ready</title>
<link rel="stylesheet" type="text/css" href="../css/pistar-css.php" />
</head>
<body>
<div class="container">
<?php include './mem_list.inc'; ?>
<div class="contentwide">
<tr><h3>Add item to memory list</h3></tr>
<table style="width:100%">
<tr>
<th style="width:33%">D-Star</th>
<th style="width:33%">DMR</th>
<th style="width:33%">Fusion</th>
</tr>
<tr>
<form action="add_item.php" method="post" enctype="multipart/form-data">
<td><BR>
Reflector
<select name="RTG_ref">
<?php
$fileLocation = "/usr/local/etc/DCS_Hosts.txt";
$names=file($fileLocation);
foreach($names as $name)
{
if(substr($name,0,3) == "DCS")
{
$li = substr($name,0,6);
echo"<option value='".$li."'>". $li . "</option>";
}
}
$fileLocation = "/usr/local/etc/XLXHosts.txt";
$names=file($fileLocation);
foreach($names as $name)
{
if(substr($name,0,1) != "#")
{
$li = "XLX". substr($name,0,3);
echo"<option value='".$li."'>". $li . "</option>";
}
}
$fileLocation = "/usr/local/etc/DPlus_Hosts.txt";
$names=file($fileLocation);
foreach($names as $name)
{
if(substr($name,0,3) == "REF")
{
$li = substr($name,0,6);
echo"<option value='".$li."'>". $li . "</option>";
}
}
$fileLocation = "/usr/local/etc/DExtra_Hosts.txt";
$names=file($fileLocation);
foreach($names as $name)
{
if(substr($name,0,3) == "XRF")
{
$li = substr($name,0,6);
echo"<option value='".$li."'>". $li . "</option>";
}
}
?>
</select>
<select name="RTG_mod">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
<option value="E">E</option>
<option value="F">F</option>
<option value="G">G</option>
<option value="H">H</option>
<option value="I">I</option>
<option value="J">J</option>
<option value="K">K</option>
<option value="L">L</option>
<option value="M">M</option>
<option value="N">N</option>
<option value="O">O</option>
<option value="P">P</option>
<option value="Q">Q</option>
<option value="R">R</option>
<option value="S">S</option>
<option value="T">T</option>
<option value="U">U</option>
<option value="V">V</option>
<option value="W">W</option>
<option value="X">X</option>
<option value="Y">Y</option>
<option value="Z">Z</option>
</select>
<BR><BR>
<input type="hidden" id="mode" name="mode" value="DST">
List name <input type="text" maxlength="12" size = "11" id="RTG_lab" name="RTG_lab">
<BR><BR>
<center><input type="submit" value="Add D-Star reflector" name="submit"><BR><BR></center>
</td>
</form>
<form action="add_item.php" method="post" enctype="multipart/form-data">
<td><BR>
Talkgroup <input type="text" maxlength="9" size = "11" id="RTG_ref" name="RTG_ref">
<BR><BR>
<input type="hidden" id="mode" name="mode" value="DMR">
<input type="hidden" id="RTG_mod" name="RTG_mod" value="0">
List name <input type="text" maxlength="12" size = "11" id="RTG_lab" name="RTG_lab">
<BR><BR>
<center><input type="submit" value="Add DMR Talkgroup" name="submit"><BR><BR></center>
</td>
</form>
<form action="add_item.php" method="post" enctype="multipart/form-data">
<td><BR>
Room
<select name="RTG_ref" style="width: 200px;">
<?php
$fileLocation = "/usr/local/etc/YSFHosts.txt";
$names=file($fileLocation);
foreach($names as $name)
{
if(substr($name,0,1) != "#")
{
$i = 0;
// $li = "YSF". substr($name,0,5) . " ";
$li = "";
do{
$li .= substr($name,6+$i,1);
$i += 1;
} while(substr($name,6+$i, 1) != ";");
echo"<option value='".$li."'>". $li . "</option>";
}
}
$fileLocation = "/usr/local/etc/FCSHosts.txt";
$names=file($fileLocation);
foreach($names as $name)
{
if(substr($name,0,3) == "FCS")
{
$li = substr($name,0,8);
echo"<option value='".$li."'>". $li . "</option>";
}
}
?>
</select>
<BR><BR>
<input type="hidden" id="mode" name="mode" value="YSF">
<input type="hidden" id="RTG_mod" name="RTG_mod" value="0">
List name <input type="text" maxlength="12" size="11" id="RTG_lab" name="RTG_lab">
<BR><BR>
<center><input type="submit" value="Add Fusion room" name="submit"><BR><BR></center>
</td>
</form>
</table>
<BR>
<?php
$fileLocation = getenv("DOCUMENT_ROOT") . "/castmemlist.txt";
$names=file($fileLocation);
echo "<tr><h3>Stored memory list (". count($names) . "/25)";
if(count($names) > 24) echo " Memory full !";
//echo copy($names,'/home/pi-star/castmemlist.txt);
echo "</h3></tr> <BR>";
echo "<table style='width:100%'>";
echo "<tr>";
echo "<th style='width:25%'>Mode</th>";
echo "<th style='width:25%'>Refl / TG / Room</th>";
echo "<th style='width:25%'>Listname</th>";
echo "<th style='width:25%'>Action</th>";
echo "</tr>";
$fileLocation = getenv("DOCUMENT_ROOT") . "/castmemlist.txt";
$names=file($fileLocation);
foreach($names as $name)
{
if(strlen($name) > 5)
{
echo "<tr><td>";
for ($i = 0; $i <= strlen($name); $i++)
{
if(substr($name, $i, 1) != ',')
{
echo substr($name, $i,1);
}
else
{
echo "</td>";
if($i < strlen($name)-2) echo "<td>";
}
}
echo "<td>";
echo " <form action='act_item.php' method='post' enctype='multipart/form-data'>";
echo "<input type='hidden' id='memId' name='memId' value='".$name."'>";
echo "<input type='submit' value='Down' name='submit' style=' width:50px'>";
echo "<input type='submit' value='Up' name='submit' style=' width:50px'>";
echo "<input type='submit' value='Delete' name='submit' style=' width:50px'>";
echo "</form>";
echo "</td>";
echo "</tr>";
}
}
echo "</table><BR><BR>";
?>
</div>
<div class="footer">
Pi-Star / Pi-Star Dashboard, © Andy Taylor (MW0MWZ) 2014-<?php echo date("Y"); ?>.<br />
ircDDBGateway Dashboard by Hans-J. Barthen (DL5DI),<br />
MMDVMDash developed by Kim Huebel (DG9VH), <br />
Need help? Click <a style="color: #ffffff;" href="https://www.facebook.com/groups/pistar/" target="_new">here for the Support Group</a><br />
Get your copy of Pi-Star from <a style="color: #ffffff;" href="http://www.pistar.uk/downloads/" target="_new">here</a>.<br />
</div>
</div>
</body>
</html>