Completed
Push — master ( 8d660b...f1b687 )
by Yannick
08:48
created
index.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 require_once('require/class.Satellite.php');
6 6
 
7
-$trackident = filter_input(INPUT_GET,'trackid',FILTER_SANITIZE_STRING);
7
+$trackident = filter_input(INPUT_GET, 'trackid', FILTER_SANITIZE_STRING);
8 8
 if ($trackident != '') {
9 9
 	require_once('require/class.SpotterLive.php');
10 10
 	$SpotterLive = new SpotterLive();
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 		$spotterid = $Spotter->getSpotterIDBasedOnFlightAwareID($trackident);
15 15
 		header('Location: '.$globalURL.'/flightid/'.$spotterid);
16 16
 	} else {
17
-		setcookie('MapTrack',$resulttrackident[0]['flightaware_id']);
17
+		setcookie('MapTrack', $resulttrackident[0]['flightaware_id']);
18 18
 	}
19 19
 } else {
20 20
 	unset($_COOKIE['MapTrack']);
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		        <div class="form-group">
190 190
 			    <label>From (UTC):</label>
191 191
 		            <div class='input-group date' id='datetimepicker1'>
192
-            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required />
192
+            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a", $_COOKIE['archive_begin']); ?>" required />
193 193
 		                <span class="input-group-addon">
194 194
             			    <span class="glyphicon glyphicon-calendar"></span>
195 195
 		                </span>
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		        <div class="form-group">
199 199
 			    <label>To (UTC):</label>
200 200
 		            <div class='input-group date' id='datetimepicker2'>
201
-		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" />
201
+		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a", $_COOKIE['archive_end']); ?>" />
202 202
             			<span class="input-group-addon">
203 203
 		                    <span class="glyphicon glyphicon-calendar"></span>
204 204
             			</span>
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
 		    <li><?php echo _("Type of Terrain:"); ?>
324 324
 			<select  class="selectpicker" onchange="terrainType(this);">
325 325
 			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
326
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
327
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
328
-			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option>
326
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected'; ?>>ellipsoid</option>
327
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected'; ?>>vr terrain</option>
328
+			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected'; ?>>ArticDEM</option>
329 329
 			</select>
330 330
 		    </li>
331 331
 <?php
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
352 352
 <?php
353 353
     }
354
-    if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
354
+    if (time() > mktime(0, 0, 0, 12, 1, date("Y")) && time() < mktime(0, 0, 0, 12, 31, date("Y"))) {
355 355
 ?>
356 356
 		    <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li>
357 357
 <?php
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
 					$Spotter = new Spotter();
508 508
 					$allairlinenames = $Spotter->getAllAirlineNames();
509 509
 				}
510
-				foreach($allairlinenames as $airline) {
510
+				foreach ($allairlinenames as $airline) {
511 511
 					$airline_name = $airline['airline_name'];
512
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
513
-					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) {
512
+					if (strlen($airline_name) > 30) $airline_name = substr($airline_name, 0, 30).'...';
513
+					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'], explode(',', $_COOKIE['filter_Airlines']))) {
514 514
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
515 515
 					} else {
516 516
 						echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>';
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
530 530
 			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
531 531
 			    <?php
532
-				foreach($allalliancenames as $alliance) {
532
+				foreach ($allalliancenames as $alliance) {
533 533
 					$alliance_name = $alliance['alliance'];
534 534
 					if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] == $alliance_name) {
535 535
 						echo '<option value="'.$alliance_name.'" selected>'.$alliance_name.'</option>';
@@ -553,8 +553,8 @@  discard block
 block discarded – undo
553 553
 			<select class="selectpicker" multiple onchange="sources(this);">
554 554
 			    <?php
555 555
 				$Spotter = new Spotter();
556
-				foreach($Spotter->getAllSourceName('aprs') as $source) {
557
-					if (isset($_COOKIE['filter_Sources']) && in_array($source['source_name'],explode(',',$_COOKIE['filter_Sources']))) {
556
+				foreach ($Spotter->getAllSourceName('aprs') as $source) {
557
+					if (isset($_COOKIE['filter_Sources']) && in_array($source['source_name'], explode(',', $_COOKIE['filter_Sources']))) {
558 558
 						echo '<option value="'.$source['source_name'].'" selected>'.$source['source_name'].'</option>';
559 559
 					} else {
560 560
 						echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>';
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
633 633
 					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
634 634
 					
635
-					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
635
+					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'], explode(',', $_COOKIE['sattypes']))) {
636 636
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
637 637
 					} else {
638 638
 						print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>';
Please login to merge, or discard this patch.
Braces   +405 added lines, -104 removed lines patch added patch discarded remove patch
@@ -157,11 +157,26 @@  discard block
 block discarded – undo
157 157
 				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam();" /><?php echo _("Display NOTAM"); ?></label></div></li>
158 158
 				<li><?php echo _("NOTAM scope:"); ?>
159 159
 					<select class="selectpicker" onchange="notamscope(this);">
160
-						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>
161
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>
162
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>
163
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>
164
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>
160
+						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') {
161
+	print ' selected';
162
+}
163
+?>>All</option>
164
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') {
165
+	print ' selected';
166
+}
167
+?>>Airport/Enroute warning</option>
168
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') {
169
+	print ' selected';
170
+}
171
+?>>Airport warning</option>
172
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') {
173
+	print ' selected';
174
+}
175
+?>>Navigation warning</option>
176
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') {
177
+	print ' selected';
178
+}
179
+?>>Enroute warning</option>
165 180
 					</select
166 181
 				</li>
167 182
 			</ul>
@@ -189,7 +204,12 @@  discard block
 block discarded – undo
189 204
 		        <div class="form-group">
190 205
 			    <label>From (UTC):</label>
191 206
 		            <div class='input-group date' id='datetimepicker1'>
192
-            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required />
207
+            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) {
208
+	print $_POST['start_date'];
209
+} elseif (isset($_COOKIE['archive_begin'])) {
210
+	print date("m/d/Y h:i a",$_COOKIE['archive_begin']);
211
+}
212
+?>" required />
193 213
 		                <span class="input-group-addon">
194 214
             			    <span class="glyphicon glyphicon-calendar"></span>
195 215
 		                </span>
@@ -198,7 +218,12 @@  discard block
 block discarded – undo
198 218
 		        <div class="form-group">
199 219
 			    <label>To (UTC):</label>
200 220
 		            <div class='input-group date' id='datetimepicker2'>
201
-		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" />
221
+		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) {
222
+	print $_POST['end_date'];
223
+} elseif (isset($_COOKIE['archive_end'])) {
224
+	print date("m/d/Y h:i a",$_COOKIE['archive_end']);
225
+}
226
+?>" />
202 227
             			<span class="input-group-addon">
203 228
 		                    <span class="glyphicon glyphicon-calendar"></span>
204 229
             			</span>
@@ -224,8 +249,20 @@  discard block
 block discarded – undo
224 249
 
225 250
 		    <li><?php echo _("Playback speed:"); ?>
226 251
 			<div class="range">
227
-			    <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>">
228
-			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>
252
+			    <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) {
253
+	print $_POST['archivespeed'];
254
+} elseif (isset($_COOKIE['archive_speed'])) {
255
+	print $_COOKIE['archive_speed'];
256
+} else {
257
+	print '1';
258
+}
259
+?>">
260
+			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) {
261
+	print $_COOKIE['archive_speed'];
262
+} else {
263
+	print '1';
264
+}
265
+?></output>
229 266
 			</div>
230 267
 		    </li>
231 268
 		    <li><input type="submit" name="archive" value="Show archive" class="btn btn-primary" /></li>
@@ -247,15 +284,27 @@  discard block
 block discarded – undo
247 284
 		    <li><?php echo _("Type of Map:"); ?>
248 285
 			<select  class="selectpicker" onchange="mapType(this);">
249 286
 			    <?php
250
-				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
251
-				else $MapType = $_COOKIE['MapType'];
287
+				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') {
288
+					$MapType = $globalMapProvider;
289
+				} else {
290
+					$MapType = $_COOKIE['MapType'];
291
+				}
252 292
 			    ?>
253 293
 			    <?php
254 294
 				if (isset($globalBingMapKey) && $globalBingMapKey != '') {
255 295
 			    ?>
256
-			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
257
-			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
258
-			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
296
+			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') {
297
+	print ' selected';
298
+}
299
+?>>Bing-Aerial</option>
300
+			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') {
301
+	print ' selected';
302
+}
303
+?>>Bing-Hybrid</option>
304
+			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') {
305
+	print ' selected';
306
+}
307
+?>>Bing-Road</option>
259 308
 			    <?php
260 309
 				}
261 310
 			    ?>
@@ -265,56 +314,131 @@  discard block
 block discarded – undo
265 314
 			    <?php
266 315
 				    if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
267 316
 			    ?>
268
-			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
269
-			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
270
-			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
317
+			    <option value="Here-Aerial"<?php if ($MapType == 'Here') {
318
+	print ' selected';
319
+}
320
+?>>Here-Aerial</option>
321
+			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') {
322
+	print ' selected';
323
+}
324
+?>>Here-Hybrid</option>
325
+			    <option value="Here-Road"<?php if ($MapType == 'Here') {
326
+	print ' selected';
327
+}
328
+?>>Here-Road</option>
271 329
 			    <?php
272 330
 				    }
273 331
 			    ?>
274 332
 			    <?php
275 333
 				    if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
276 334
 			    ?>
277
-			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
278
-			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
279
-			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
280
-			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
335
+			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') {
336
+	print ' selected';
337
+}
338
+?>>Google Roadmap</option>
339
+			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') {
340
+	print ' selected';
341
+}
342
+?>>Google Satellite</option>
343
+			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') {
344
+	print ' selected';
345
+}
346
+?>>Google Hybrid</option>
347
+			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') {
348
+	print ' selected';
349
+}
350
+?>>Google Terrain</option>
281 351
 			    <?php
282 352
 				    }
283 353
 			    ?>
284 354
 			    <?php
285 355
 				    if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
286 356
 			    ?>
287
-			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
288
-			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
289
-			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
357
+			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') {
358
+	print ' selected';
359
+}
360
+?>>MapQuest-OSM</option>
361
+			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') {
362
+	print ' selected';
363
+}
364
+?>>MapQuest-Aerial</option>
365
+			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') {
366
+	print ' selected';
367
+}
368
+?>>MapQuest-Hybrid</option>
290 369
 			    <?php
291 370
 				    }
292 371
 			    ?>
293
-			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
372
+			    <option value="Yandex"<?php if ($MapType == 'Yandex') {
373
+	print ' selected';
374
+}
375
+?>>Yandex</option>
294 376
 			    <?php
295 377
 				}
296 378
 			    ?>
297 379
 			    <?php
298 380
 				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
299
-					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
300
-					else $MapBoxId = $_COOKIE['MapTypeId'];
381
+					if (!isset($_COOKIE['MapTypeId'])) {
382
+						$MapBoxId = 'default';
383
+					} else {
384
+						$MapBoxId = $_COOKIE['MapTypeId'];
385
+					}
301 386
 			    ?>
302
-			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
303
-			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
304
-			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
305
-			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>
306
-			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>
307
-			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>
308
-			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>
309
-			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>
310
-			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>
311
-			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>
312
-			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
313
-			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
387
+			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') {
388
+	print ' selected';
389
+}
390
+?>>Mapbox default</option>
391
+			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') {
392
+	print ' selected';
393
+}
394
+?>>Mapbox streets</option>
395
+			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') {
396
+	print ' selected';
397
+}
398
+?>>Mapbox light</option>
399
+			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') {
400
+	print ' selected';
401
+}
402
+?>>Mapbox dark</option>
403
+			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') {
404
+	print ' selected';
405
+}
406
+?>>Mapbox satellite</option>
407
+			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') {
408
+	print ' selected';
409
+}
410
+?>>Mapbox streets-satellite</option>
411
+			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') {
412
+	print ' selected';
413
+}
414
+?>>Mapbox streets-basic</option>
415
+			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') {
416
+	print ' selected';
417
+}
418
+?>>Mapbox comic</option>
419
+			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') {
420
+	print ' selected';
421
+}
422
+?>>Mapbox outdoors</option>
423
+			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') {
424
+	print ' selected';
425
+}
426
+?>>Mapbox pencil</option>
427
+			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') {
428
+	print ' selected';
429
+}
430
+?>>Mapbox pirates</option>
431
+			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') {
432
+	print ' selected';
433
+}
434
+?>>Mapbox emerald</option>
314 435
 			    <?php
315 436
 				    }
316 437
 			    ?>
317
-			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
438
+			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') {
439
+	print ' selected';
440
+}
441
+?>>OpenStreetMap</option>
318 442
 			</select>
319 443
 		    </li>
320 444
 <?php
@@ -322,10 +446,22 @@  discard block
 block discarded – undo
322 446
 ?>
323 447
 		    <li><?php echo _("Type of Terrain:"); ?>
324 448
 			<select  class="selectpicker" onchange="terrainType(this);">
325
-			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
326
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
327
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
328
-			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option>
449
+			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') {
450
+	print ' selected';
451
+}
452
+?>>stk terrain</option>
453
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') {
454
+	print ' selected';
455
+}
456
+?>>ellipsoid</option>
457
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') {
458
+	print ' selected';
459
+}
460
+?>>vr terrain</option>
461
+			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') {
462
+	print ' selected';
463
+}
464
+?>>ArticDEM</option>
329 465
 			</select>
330 466
 		    </li>
331 467
 <?php
@@ -335,20 +471,44 @@  discard block
 block discarded – undo
335 471
     if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
336 472
 ?>
337 473
 		    
338
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
339
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li>
340
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
341
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
342
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
474
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') {
475
+	print 'checked';
476
+}
477
+?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
478
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) {
479
+	print 'checked';
480
+}
481
+?> ><?php echo _("Display flight path"); ?></label></div></li>
482
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) {
483
+	print 'checked';
484
+}
485
+?> ><?php echo _("Display flight route on click"); ?></label></div></li>
486
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) {
487
+	print 'checked';
488
+}
489
+?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
490
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) {
491
+	print 'checked';
492
+}
493
+?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
343 494
 <?php
344 495
     }
345 496
 ?>
346
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
347
-		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li>
497
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') {
498
+	print 'checked';
499
+}
500
+?> ><?php echo _("Display airports on map"); ?></label></div></li>
501
+		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) {
502
+	print 'checked';
503
+}
504
+?> ><?php echo _("Display ground station on map"); ?></label></div></li>
348 505
 <?php
349 506
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
350 507
 ?>
351
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
508
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) {
509
+	print 'checked';
510
+}
511
+?> ><?php echo _("Show mini-map"); ?></label></div></li>
352 512
 <?php
353 513
     }
354 514
     if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
@@ -362,17 +522,25 @@  discard block
 block discarded – undo
362 522
 			if (function_exists('array_column')) {
363 523
 			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
364 524
 		    ?>
365
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
525
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
526
+	print 'checked';
527
+}
528
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
366 529
 		    <?php
367 530
 			    }
368 531
 			} elseif (isset($globalSources)) {
369 532
 			    $dispolar = false;
370 533
 			    foreach ($globalSources as $testsource) {
371
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
534
+			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) {
535
+			        	$dispolar = true;
536
+			        }
372 537
 			    }
373 538
 			    if ($dispolar) {
374 539
 		    ?>
375
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
540
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
541
+	print 'checked';
542
+}
543
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
376 544
 		    <?php
377 545
 			    }
378 546
 		        }
@@ -385,12 +553,22 @@  discard block
 block discarded – undo
385 553
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
386 554
 		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
387 555
 		    ?>
388
-		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
556
+		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') {
557
+	print 'checked';
558
+}
559
+?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
389 560
 		    <?php 
390 561
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
391 562
 		    ?>
392 563
 		    <li><?php echo _("Aircraft icon color:"); ?>
393
-			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>">
564
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
565
+	print $_COOKIE['IconColor'];
566
+} elseif (isset($globalAircraftIconColor)) {
567
+	print $globalAircraftIconColor;
568
+} else {
569
+	print '1a3151';
570
+}
571
+?>">
394 572
 		    </li>
395 573
 		    <?php
396 574
 				}
@@ -402,7 +580,14 @@  discard block
 block discarded – undo
402 580
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
403 581
 		    ?>
404 582
 		    <li><?php echo _("Marine icon color:"); ?>
405
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">
583
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
584
+	print $_COOKIE['MarineIconColor'];
585
+} elseif (isset($globalMarineIconColor)) {
586
+	print $globalMarineIconColor;
587
+} else {
588
+	print '1a3151';
589
+}
590
+?>">
406 591
 		    </li>
407 592
 		    <?php
408 593
 			    }
@@ -413,8 +598,22 @@  discard block
 block discarded – undo
413 598
 		    ?>
414 599
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
415 600
 			<div class="range">
416
-			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
417
-			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>
601
+			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) {
602
+	print $_COOKIE['AirportZoom'];
603
+} elseif (isset($globalAirportZoom)) {
604
+	print $globalAirportZoom;
605
+} else {
606
+	print '7';
607
+}
608
+?>">
609
+			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) {
610
+	print $_COOKIE['AirportZoom'];
611
+} elseif (isset($globalAirportZoom)) {
612
+	print $globalAirportZoom;
613
+} else {
614
+	print '7';
615
+}
616
+?></output>
418 617
 			</div>
419 618
 		    </li>
420 619
 		    <?php
@@ -426,9 +625,19 @@  discard block
 block discarded – undo
426 625
 <?php
427 626
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
428 627
 ?>
429
-		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Aircraft color"); ?></li>
628
+		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') {
629
+	print 'checked';
630
+}
631
+?> ><?php echo _("Force Aircraft color"); ?></li>
430 632
 		    <li><?php echo _("Aircraft icon color:"); ?>
431
-			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>">
633
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
634
+	print $_COOKIE['IconColor'];
635
+} elseif (isset($globalAircraftIconColor)) {
636
+	print $globalAircraftIconColor;
637
+} else {
638
+	print 'ff0000';
639
+}
640
+?>">
432 641
 		    </li>
433 642
 <?php
434 643
 	}
@@ -436,9 +645,19 @@  discard block
 block discarded – undo
436 645
 <?php
437 646
 	if (isset($globalMarine) && $globalMarine === TRUE) {
438 647
 ?>
439
-		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?></li>
648
+		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') {
649
+	print 'checked';
650
+}
651
+?> ><?php echo _("Force Marine color"); ?></li>
440 652
 		    <li><?php echo _("Marine icon color:"); ?>
441
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>">
653
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
654
+	print $_COOKIE['MarineIconColor'];
655
+} elseif (isset($globalMarineIconColor)) {
656
+	print $globalMarineIconColor;
657
+} else {
658
+	print 'ff0000';
659
+}
660
+?>">
442 661
 		    </li>
443 662
 <?php
444 663
 	}
@@ -446,22 +665,46 @@  discard block
 block discarded – undo
446 665
 ?>
447 666
 		    <li><?php echo _("Distance unit:"); ?>
448 667
 			<select class="selectpicker" onchange="unitdistance(this);">
449
-			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
450
-			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>
451
-			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>
668
+			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
669
+	echo ' selected';
670
+}
671
+?>>km</option>
672
+			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
673
+	echo ' selected';
674
+}
675
+?>>nm</option>
676
+			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
677
+	echo ' selected';
678
+}
679
+?>>mi</option>
452 680
 		        </select>
453 681
 		    </li>
454 682
 		    <li><?php echo _("Altitude unit:"); ?>
455 683
 			<select class="selectpicker" onchange="unitaltitude(this);">
456
-			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>
457
-			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>
684
+			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) {
685
+	echo ' selected';
686
+}
687
+?>>m</option>
688
+			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
689
+	echo ' selected';
690
+}
691
+?>>feet</option>
458 692
 		        </select>
459 693
 		    </li>
460 694
 		    <li><?php echo _("Speed unit:"); ?>
461 695
 			<select class="selectpicker" onchange="unitspeed(this);">
462
-			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option>
463
-			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>
464
-			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>
696
+			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) {
697
+	echo ' selected';
698
+}
699
+?>>km/h</option>
700
+			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
701
+	echo ' selected';
702
+}
703
+?>>mph</option>
704
+			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
705
+	echo ' selected';
706
+}
707
+?>>knots</option>
465 708
 		        </select>
466 709
 		    </li>
467 710
 
@@ -479,9 +722,18 @@  discard block
 block discarded – undo
479 722
 		    <?php
480 723
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
481 724
 		    ?>
482
-			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
483
-			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
484
-			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
725
+			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) {
726
+	print 'checked';
727
+}
728
+?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
729
+			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) {
730
+	print 'checked';
731
+}
732
+?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
733
+			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) {
734
+	print 'checked';
735
+}
736
+?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
485 737
 		    <?php
486 738
 			}
487 739
 		    ?>
@@ -489,10 +741,16 @@  discard block
 block discarded – undo
489 741
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
490 742
 		    ?>
491 743
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
492
-			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
744
+			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) {
745
+	print 'checked';
746
+}
747
+?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
493 748
 			<?php } ?>
494 749
 			<?php if (isset($globalAPRS) && $globalAPRS) { ?>
495
-			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li>
750
+			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) {
751
+	print 'checked';
752
+}
753
+?> ><?php echo _("Display APRS data"); ?></label></div></li>
496 754
 			<?php } ?>
497 755
 		    <?php
498 756
 			}
@@ -509,7 +767,9 @@  discard block
 block discarded – undo
509 767
 				}
510 768
 				foreach($allairlinenames as $airline) {
511 769
 					$airline_name = $airline['airline_name'];
512
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
770
+					if (strlen($airline_name) > 30) {
771
+						$airline_name = substr($airline_name,0,30).'...';
772
+					}
513 773
 					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) {
514 774
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
515 775
 					} else {
@@ -527,7 +787,10 @@  discard block
 block discarded – undo
527 787
 		    <li><?php echo _("Display alliance:"); ?>
528 788
 		    <br/>
529 789
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
530
-			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
790
+			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') {
791
+	echo ' selected';
792
+}
793
+?>><?php echo _("All"); ?></option>
531 794
 			    <?php
532 795
 				foreach($allalliancenames as $alliance) {
533 796
 					$alliance_name = $alliance['alliance'];
@@ -574,10 +837,22 @@  discard block
 block discarded – undo
574 837
 		    ?>
575 838
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
576 839
 			<select class="selectpicker" onchange="airlinestype(this);">
577
-			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
578
-			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option>
579
-			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option>
580
-			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option>
840
+			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') {
841
+	echo ' selected';
842
+}
843
+?>><?php echo _("All"); ?></option>
844
+			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') {
845
+	echo ' selected';
846
+}
847
+?>><?php echo _("Passenger"); ?></option>
848
+			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') {
849
+	echo ' selected';
850
+}
851
+?>><?php echo _("Cargo"); ?></option>
852
+			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') {
853
+	echo ' selected';
854
+}
855
+?>><?php echo _("Military"); ?></option>
581 856
 			</select>
582 857
 		    </li>
583 858
 		    <?php
@@ -585,7 +860,10 @@  discard block
 block discarded – undo
585 860
 		    ?>
586 861
 		    <li>
587 862
 			<?php echo _("Display flight with ident:"); ?>
588
-			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
863
+			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) {
864
+	print $_COOKIE['filter_ident'];
865
+}
866
+?>" />
589 867
 		    </li>
590 868
 		    <?php
591 869
 			}
@@ -604,7 +882,10 @@  discard block
 block discarded – undo
604 882
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
605 883
 	    <form>
606 884
 		<ul>
607
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
885
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') {
886
+	print 'checked';
887
+}
888
+?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
608 889
 		    <li><?php echo _("Type:"); ?>
609 890
 			<select class="selectpicker" multiple onchange="sattypes(this);">
610 891
 			    <?php
@@ -612,25 +893,45 @@  discard block
 block discarded – undo
612 893
 				$types = $Satellite->get_tle_types();
613 894
 				foreach ($types as $type) {
614 895
 					$type_name = $type['tle_type'];
615
-					if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';
616
-					else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';
617
-					else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';
618
-					else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';
619
-					else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';
620
-					else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';
621
-					else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';
622
-					else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';
623
-					else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';
624
-					else if ($type_name == 'resource') $type_name = 'Earth Resources';
625
-					else if ($type_name == 'stations') $type_name = 'Space Stations';
626
-					else if ($type_name == 'geo') $type_name = 'Geostationary';
627
-					else if ($type_name == 'amateur') $type_name = 'Amateur Radio';
628
-					else if ($type_name == 'x-comm') $type_name = 'Experimental';
629
-					else if ($type_name == 'other-comm') $type_name = 'Other Comm';
630
-					else if ($type_name == 'science') $type_name = 'Space & Earth Science';
631
-					else if ($type_name == 'military') $type_name = 'Miscellaneous Military';
632
-					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
633
-					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
896
+					if ($type_name == 'musson') {
897
+						$type_name = 'Russian LEO Navigation';
898
+					} else if ($type_name == 'nnss') {
899
+						$type_name = 'Navi Navigation Satellite System';
900
+					} else if ($type_name == 'sbas') {
901
+						$type_name = 'Satellite-Based Augmentation System';
902
+					} else if ($type_name == 'glo-ops') {
903
+						$type_name = 'Glonass Operational';
904
+					} else if ($type_name == 'gps-ops') {
905
+						$type_name = 'GPS Operational';
906
+					} else if ($type_name == 'argos') {
907
+						$type_name = 'ARGOS Data Collection System';
908
+					} else if ($type_name == 'tdrss') {
909
+						$type_name = 'Tracking and Data Relay Satellite System';
910
+					} else if ($type_name == 'sarsat') {
911
+						$type_name = 'Search & Rescue';
912
+					} else if ($type_name == 'dmc') {
913
+						$type_name = 'Disaster Monitoring';
914
+					} else if ($type_name == 'resource') {
915
+						$type_name = 'Earth Resources';
916
+					} else if ($type_name == 'stations') {
917
+						$type_name = 'Space Stations';
918
+					} else if ($type_name == 'geo') {
919
+						$type_name = 'Geostationary';
920
+					} else if ($type_name == 'amateur') {
921
+						$type_name = 'Amateur Radio';
922
+					} else if ($type_name == 'x-comm') {
923
+						$type_name = 'Experimental';
924
+					} else if ($type_name == 'other-comm') {
925
+						$type_name = 'Other Comm';
926
+					} else if ($type_name == 'science') {
927
+						$type_name = 'Space & Earth Science';
928
+					} else if ($type_name == 'military') {
929
+						$type_name = 'Miscellaneous Military';
930
+					} else if ($type_name == 'radar') {
931
+						$type_name = 'Radar Calibration';
932
+					} else if ($type_name == 'tle-new') {
933
+						$type_name = 'Last 30 days launches';
934
+					}
634 935
 					
635 936
 					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
636 937
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
Please login to merge, or discard this patch.