@@ -49,7 +49,10 @@ discard block  | 
                                                    ||
| 49 | 49 | <?php  | 
                                                        
| 50 | 50 |      if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { | 
                                                        
| 51 | 51 | ?>  | 
                                                        
| 52 | -<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script>  | 
                                                        |
| 52 | +<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) { | 
                                                        |
| 53 | + print '?tsk='.$tsk;  | 
                                                        |
| 54 | +}  | 
                                                        |
| 55 | +?>"></script>  | 
                                                        |
| 53 | 56 | <?php  | 
                                                        
| 54 | 57 |  	if (!isset($globalAircraft) || $globalAircraft) { | 
                                                        
| 55 | 58 | ?>  | 
                                                        
@@ -163,11 +166,26 @@ discard block  | 
                                                    ||
| 163 | 166 |  				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam();" /><?php echo _("Display NOTAM"); ?></label></div></li> | 
                                                        
| 164 | 167 |  				<li><?php echo _("NOTAM scope:"); ?> | 
                                                        
| 165 | 168 | <select class="selectpicker" onchange="notamscope(this);">  | 
                                                        
| 166 | - <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>  | 
                                                        |
| 167 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>  | 
                                                        |
| 168 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>  | 
                                                        |
| 169 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>  | 
                                                        |
| 170 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>  | 
                                                        |
| 169 | +						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') { | 
                                                        |
| 170 | + print ' selected';  | 
                                                        |
| 171 | +}  | 
                                                        |
| 172 | +?>>All</option>  | 
                                                        |
| 173 | +						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') { | 
                                                        |
| 174 | + print ' selected';  | 
                                                        |
| 175 | +}  | 
                                                        |
| 176 | +?>>Airport/Enroute warning</option>  | 
                                                        |
| 177 | +						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') { | 
                                                        |
| 178 | + print ' selected';  | 
                                                        |
| 179 | +}  | 
                                                        |
| 180 | +?>>Airport warning</option>  | 
                                                        |
| 181 | +						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') { | 
                                                        |
| 182 | + print ' selected';  | 
                                                        |
| 183 | +}  | 
                                                        |
| 184 | +?>>Navigation warning</option>  | 
                                                        |
| 185 | +						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') { | 
                                                        |
| 186 | + print ' selected';  | 
                                                        |
| 187 | +}  | 
                                                        |
| 188 | +?>>Enroute warning</option>  | 
                                                        |
| 171 | 189 | </select  | 
                                                        
| 172 | 190 | </li>  | 
                                                        
| 173 | 191 | </ul>  | 
                                                        
@@ -195,7 +213,12 @@ discard block  | 
                                                    ||
| 195 | 213 | <div class="form-group">  | 
                                                        
| 196 | 214 | <label>From (UTC):</label>  | 
                                                        
| 197 | 215 | <div class='input-group date' id='datetimepicker1'>  | 
                                                        
| 198 | -            			<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 /> | 
                                                        |
| 216 | +            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) { | 
                                                        |
| 217 | + print $_POST['start_date'];  | 
                                                        |
| 218 | +} elseif (isset($_COOKIE['archive_begin'])) { | 
                                                        |
| 219 | +	print date("m/d/Y h:i a",$_COOKIE['archive_begin']); | 
                                                        |
| 220 | +}  | 
                                                        |
| 221 | +?>" required />  | 
                                                        |
| 199 | 222 | <span class="input-group-addon">  | 
                                                        
| 200 | 223 | <span class="glyphicon glyphicon-calendar"></span>  | 
                                                        
| 201 | 224 | </span>  | 
                                                        
@@ -204,7 +227,12 @@ discard block  | 
                                                    ||
| 204 | 227 | <div class="form-group">  | 
                                                        
| 205 | 228 | <label>To (UTC):</label>  | 
                                                        
| 206 | 229 | <div class='input-group date' id='datetimepicker2'>  | 
                                                        
| 207 | -		                <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']); ?>" /> | 
                                                        |
| 230 | +		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) { | 
                                                        |
| 231 | + print $_POST['end_date'];  | 
                                                        |
| 232 | +} elseif (isset($_COOKIE['archive_end'])) { | 
                                                        |
| 233 | +	print date("m/d/Y h:i a",$_COOKIE['archive_end']); | 
                                                        |
| 234 | +}  | 
                                                        |
| 235 | +?>" />  | 
                                                        |
| 208 | 236 | <span class="input-group-addon">  | 
                                                        
| 209 | 237 | <span class="glyphicon glyphicon-calendar"></span>  | 
                                                        
| 210 | 238 | </span>  | 
                                                        
@@ -229,8 +257,20 @@ discard block  | 
                                                    ||
| 229 | 257 | </script>  | 
                                                        
| 230 | 258 |  		    <li><?php echo _("Playback speed:"); ?> | 
                                                        
| 231 | 259 | <div class="range">  | 
                                                        
| 232 | - <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'; ?>">  | 
                                                        |
| 233 | - <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>  | 
                                                        |
| 260 | +			    <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) { | 
                                                        |
| 261 | + print $_POST['archivespeed'];  | 
                                                        |
| 262 | +} elseif (isset($_COOKIE['archive_speed'])) { | 
                                                        |
| 263 | + print $_COOKIE['archive_speed'];  | 
                                                        |
| 264 | +} else { | 
                                                        |
| 265 | + print '1';  | 
                                                        |
| 266 | +}  | 
                                                        |
| 267 | +?>">  | 
                                                        |
| 268 | +			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) { | 
                                                        |
| 269 | + print $_COOKIE['archive_speed'];  | 
                                                        |
| 270 | +} else { | 
                                                        |
| 271 | + print '1';  | 
                                                        |
| 272 | +}  | 
                                                        |
| 273 | +?></output>  | 
                                                        |
| 234 | 274 | </div>  | 
                                                        
| 235 | 275 | </li>  | 
                                                        
| 236 | 276 | <li><input type="submit" name="archive" value="Show archive" class="btn btn-primary" /></li>  | 
                                                        
@@ -252,25 +292,43 @@ discard block  | 
                                                    ||
| 252 | 292 |  		    <li><?php echo _("Type of Map:"); ?> | 
                                                        
| 253 | 293 | <select class="selectpicker" onchange="mapType(this);">  | 
                                                        
| 254 | 294 | <?php  | 
                                                        
| 255 | - if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;  | 
                                                        |
| 256 | - else $MapType = $_COOKIE['MapType'];  | 
                                                        |
| 295 | +				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') { | 
                                                        |
| 296 | + $MapType = $globalMapProvider;  | 
                                                        |
| 297 | +				} else { | 
                                                        |
| 298 | + $MapType = $_COOKIE['MapType'];  | 
                                                        |
| 299 | + }  | 
                                                        |
| 257 | 300 | ?>  | 
                                                        
| 258 | 301 | <?php  | 
                                                        
| 259 | 302 |  				if (isset($globalMapOffline) && $globalMapOffline === TRUE) { | 
                                                        
| 260 | 303 | ?>  | 
                                                        
| 261 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>  | 
                                                        |
| 304 | +			    <option value="offline"<?php if ($MapType == 'offline') { | 
                                                        |
| 305 | + print ' selected';  | 
                                                        |
| 306 | +}  | 
                                                        |
| 307 | +?>>Natural Earth (local)</option>  | 
                                                        |
| 262 | 308 | <?php  | 
                                                        
| 263 | 309 |  				} else { | 
                                                        
| 264 | 310 |  				    if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) { | 
                                                        
| 265 | 311 | ?>  | 
                                                        
| 266 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>  | 
                                                        |
| 312 | +			    <option value="offline"<?php if ($MapType == 'offline') { | 
                                                        |
| 313 | + print ' selected';  | 
                                                        |
| 314 | +}  | 
                                                        |
| 315 | +?>>Natural Earth (local)</option>  | 
                                                        |
| 267 | 316 | <?php  | 
                                                        
| 268 | 317 | }  | 
                                                        
| 269 | 318 |  				    if (isset($globalBingMapKey) && $globalBingMapKey != '') { | 
                                                        
| 270 | 319 | ?>  | 
                                                        
| 271 | - <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>  | 
                                                        |
| 272 | - <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>  | 
                                                        |
| 273 | - <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>  | 
                                                        |
| 320 | +			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') { | 
                                                        |
| 321 | + print ' selected';  | 
                                                        |
| 322 | +}  | 
                                                        |
| 323 | +?>>Bing-Aerial</option>  | 
                                                        |
| 324 | +			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') { | 
                                                        |
| 325 | + print ' selected';  | 
                                                        |
| 326 | +}  | 
                                                        |
| 327 | +?>>Bing-Hybrid</option>  | 
                                                        |
| 328 | +			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') { | 
                                                        |
| 329 | + print ' selected';  | 
                                                        |
| 330 | +}  | 
                                                        |
| 331 | +?>>Bing-Road</option>  | 
                                                        |
| 274 | 332 | <?php  | 
                                                        
| 275 | 333 | }  | 
                                                        
| 276 | 334 | ?>  | 
                                                        
@@ -280,58 +338,139 @@ discard block  | 
                                                    ||
| 280 | 338 | <?php  | 
                                                        
| 281 | 339 |  					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { | 
                                                        
| 282 | 340 | ?>  | 
                                                        
| 283 | - <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>  | 
                                                        |
| 284 | - <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>  | 
                                                        |
| 285 | - <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>  | 
                                                        |
| 341 | +			    <option value="Here-Aerial"<?php if ($MapType == 'Here') { | 
                                                        |
| 342 | + print ' selected';  | 
                                                        |
| 343 | +}  | 
                                                        |
| 344 | +?>>Here-Aerial</option>  | 
                                                        |
| 345 | +			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') { | 
                                                        |
| 346 | + print ' selected';  | 
                                                        |
| 347 | +}  | 
                                                        |
| 348 | +?>>Here-Hybrid</option>  | 
                                                        |
| 349 | +			    <option value="Here-Road"<?php if ($MapType == 'Here') { | 
                                                        |
| 350 | + print ' selected';  | 
                                                        |
| 351 | +}  | 
                                                        |
| 352 | +?>>Here-Road</option>  | 
                                                        |
| 286 | 353 | <?php  | 
                                                        
| 287 | 354 | }  | 
                                                        
| 288 | 355 | ?>  | 
                                                        
| 289 | 356 | <?php  | 
                                                        
| 290 | 357 |  					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { | 
                                                        
| 291 | 358 | ?>  | 
                                                        
| 292 | - <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>  | 
                                                        |
| 293 | - <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>  | 
                                                        |
| 294 | - <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>  | 
                                                        |
| 295 | - <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>  | 
                                                        |
| 359 | +			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') { | 
                                                        |
| 360 | + print ' selected';  | 
                                                        |
| 361 | +}  | 
                                                        |
| 362 | +?>>Google Roadmap</option>  | 
                                                        |
| 363 | +			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') { | 
                                                        |
| 364 | + print ' selected';  | 
                                                        |
| 365 | +}  | 
                                                        |
| 366 | +?>>Google Satellite</option>  | 
                                                        |
| 367 | +			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') { | 
                                                        |
| 368 | + print ' selected';  | 
                                                        |
| 369 | +}  | 
                                                        |
| 370 | +?>>Google Hybrid</option>  | 
                                                        |
| 371 | +			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') { | 
                                                        |
| 372 | + print ' selected';  | 
                                                        |
| 373 | +}  | 
                                                        |
| 374 | +?>>Google Terrain</option>  | 
                                                        |
| 296 | 375 | <?php  | 
                                                        
| 297 | 376 | }  | 
                                                        
| 298 | 377 | ?>  | 
                                                        
| 299 | 378 | <?php  | 
                                                        
| 300 | 379 |  					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { | 
                                                        
| 301 | 380 | ?>  | 
                                                        
| 302 | - <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>  | 
                                                        |
| 303 | - <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>  | 
                                                        |
| 304 | - <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>  | 
                                                        |
| 381 | +			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') { | 
                                                        |
| 382 | + print ' selected';  | 
                                                        |
| 383 | +}  | 
                                                        |
| 384 | +?>>MapQuest-OSM</option>  | 
                                                        |
| 385 | +			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') { | 
                                                        |
| 386 | + print ' selected';  | 
                                                        |
| 387 | +}  | 
                                                        |
| 388 | +?>>MapQuest-Aerial</option>  | 
                                                        |
| 389 | +			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') { | 
                                                        |
| 390 | + print ' selected';  | 
                                                        |
| 391 | +}  | 
                                                        |
| 392 | +?>>MapQuest-Hybrid</option>  | 
                                                        |
| 305 | 393 | <?php  | 
                                                        
| 306 | 394 | }  | 
                                                        
| 307 | 395 | ?>  | 
                                                        
| 308 | - <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>  | 
                                                        |
| 309 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option>  | 
                                                        |
| 396 | +			    <option value="Yandex"<?php if ($MapType == 'Yandex') { | 
                                                        |
| 397 | + print ' selected';  | 
                                                        |
| 398 | +}  | 
                                                        |
| 399 | +?>>Yandex</option>  | 
                                                        |
| 400 | +			    <option value="offline"<?php if ($MapType == 'offline') { | 
                                                        |
| 401 | + print ' selected';  | 
                                                        |
| 402 | +}  | 
                                                        |
| 403 | +?>>Natural Earth</option>  | 
                                                        |
| 310 | 404 | <?php  | 
                                                        
| 311 | 405 | }  | 
                                                        
| 312 | 406 | ?>  | 
                                                        
| 313 | 407 | <?php  | 
                                                        
| 314 | 408 |  				    if (isset($globalMapboxToken) && $globalMapboxToken != '') { | 
                                                        
| 315 | - if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';  | 
                                                        |
| 316 | - else $MapBoxId = $_COOKIE['MapTypeId'];  | 
                                                        |
| 409 | +					if (!isset($_COOKIE['MapTypeId'])) { | 
                                                        |
| 410 | + $MapBoxId = 'default';  | 
                                                        |
| 411 | +					} else { | 
                                                        |
| 412 | + $MapBoxId = $_COOKIE['MapTypeId'];  | 
                                                        |
| 413 | + }  | 
                                                        |
| 317 | 414 | ?>  | 
                                                        
| 318 | - <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option>  | 
                                                        |
| 319 | - <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>  | 
                                                        |
| 320 | - <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>  | 
                                                        |
| 321 | - <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>  | 
                                                        |
| 322 | - <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>  | 
                                                        |
| 323 | - <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>  | 
                                                        |
| 324 | - <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>  | 
                                                        |
| 325 | - <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>  | 
                                                        |
| 326 | - <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>  | 
                                                        |
| 327 | - <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>  | 
                                                        |
| 328 | - <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>  | 
                                                        |
| 329 | - <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>  | 
                                                        |
| 330 | - <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>  | 
                                                        |
| 415 | +			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') { | 
                                                        |
| 416 | + print ' selected';  | 
                                                        |
| 417 | +}  | 
                                                        |
| 418 | +?>>Mapbox GL</option>  | 
                                                        |
| 419 | +			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') { | 
                                                        |
| 420 | + print ' selected';  | 
                                                        |
| 421 | +}  | 
                                                        |
| 422 | +?>>Mapbox default</option>  | 
                                                        |
| 423 | +			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') { | 
                                                        |
| 424 | + print ' selected';  | 
                                                        |
| 425 | +}  | 
                                                        |
| 426 | +?>>Mapbox streets</option>  | 
                                                        |
| 427 | +			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') { | 
                                                        |
| 428 | + print ' selected';  | 
                                                        |
| 429 | +}  | 
                                                        |
| 430 | +?>>Mapbox light</option>  | 
                                                        |
| 431 | +			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') { | 
                                                        |
| 432 | + print ' selected';  | 
                                                        |
| 433 | +}  | 
                                                        |
| 434 | +?>>Mapbox dark</option>  | 
                                                        |
| 435 | +			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') { | 
                                                        |
| 436 | + print ' selected';  | 
                                                        |
| 437 | +}  | 
                                                        |
| 438 | +?>>Mapbox satellite</option>  | 
                                                        |
| 439 | +			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') { | 
                                                        |
| 440 | + print ' selected';  | 
                                                        |
| 441 | +}  | 
                                                        |
| 442 | +?>>Mapbox streets-satellite</option>  | 
                                                        |
| 443 | +			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') { | 
                                                        |
| 444 | + print ' selected';  | 
                                                        |
| 445 | +}  | 
                                                        |
| 446 | +?>>Mapbox streets-basic</option>  | 
                                                        |
| 447 | +			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') { | 
                                                        |
| 448 | + print ' selected';  | 
                                                        |
| 449 | +}  | 
                                                        |
| 450 | +?>>Mapbox comic</option>  | 
                                                        |
| 451 | +			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') { | 
                                                        |
| 452 | + print ' selected';  | 
                                                        |
| 453 | +}  | 
                                                        |
| 454 | +?>>Mapbox outdoors</option>  | 
                                                        |
| 455 | +			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') { | 
                                                        |
| 456 | + print ' selected';  | 
                                                        |
| 457 | +}  | 
                                                        |
| 458 | +?>>Mapbox pencil</option>  | 
                                                        |
| 459 | +			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') { | 
                                                        |
| 460 | + print ' selected';  | 
                                                        |
| 461 | +}  | 
                                                        |
| 462 | +?>>Mapbox pirates</option>  | 
                                                        |
| 463 | +			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') { | 
                                                        |
| 464 | + print ' selected';  | 
                                                        |
| 465 | +}  | 
                                                        |
| 466 | +?>>Mapbox emerald</option>  | 
                                                        |
| 331 | 467 | <?php  | 
                                                        
| 332 | 468 | }  | 
                                                        
| 333 | 469 | ?>  | 
                                                        
| 334 | - <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>  | 
                                                        |
| 470 | +			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') { | 
                                                        |
| 471 | + print ' selected';  | 
                                                        |
| 472 | +}  | 
                                                        |
| 473 | +?>>OpenStreetMap</option>  | 
                                                        |
| 335 | 474 | <?php  | 
                                                        
| 336 | 475 | }  | 
                                                        
| 337 | 476 | ?>  | 
                                                        
@@ -342,10 +481,22 @@ discard block  | 
                                                    ||
| 342 | 481 | ?>  | 
                                                        
| 343 | 482 |  		    <li><?php echo _("Type of Terrain:"); ?> | 
                                                        
| 344 | 483 | <select class="selectpicker" onchange="terrainType(this);">  | 
                                                        
| 345 | - <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>  | 
                                                        |
| 346 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>  | 
                                                        |
| 347 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>  | 
                                                        |
| 348 | - <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option>  | 
                                                        |
| 484 | +			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') { | 
                                                        |
| 485 | + print ' selected';  | 
                                                        |
| 486 | +}  | 
                                                        |
| 487 | +?>>stk terrain</option>  | 
                                                        |
| 488 | +			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') { | 
                                                        |
| 489 | + print ' selected';  | 
                                                        |
| 490 | +}  | 
                                                        |
| 491 | +?>>ellipsoid</option>  | 
                                                        |
| 492 | +			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') { | 
                                                        |
| 493 | + print ' selected';  | 
                                                        |
| 494 | +}  | 
                                                        |
| 495 | +?>>vr terrain</option>  | 
                                                        |
| 496 | +			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') { | 
                                                        |
| 497 | + print ' selected';  | 
                                                        |
| 498 | +}  | 
                                                        |
| 499 | +?>>ArticDEM</option>  | 
                                                        |
| 349 | 500 | </select>  | 
                                                        
| 350 | 501 | </li>  | 
                                                        
| 351 | 502 | <?php  | 
                                                        
@@ -354,38 +505,77 @@ discard block  | 
                                                    ||
| 354 | 505 | <?php  | 
                                                        
| 355 | 506 |      if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { | 
                                                        
| 356 | 507 | ?>  | 
                                                        
| 357 | -		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if ((isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') || (!isset($_COOKIE['Map2DBuildings']))) print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> | 
                                                        |
| 508 | +		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if ((isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') || (!isset($_COOKIE['Map2DBuildings']))) { | 
                                                        |
| 509 | + print 'checked';  | 
                                                        |
| 510 | +}  | 
                                                        |
| 511 | +?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> | 
                                                        |
| 358 | 512 | |
| 359 | 513 | <?php  | 
                                                        
| 360 | 514 |  	if (!isset($globalAircraft) || $globalAircraft === TRUE) { | 
                                                        
| 361 | 515 | ?>  | 
                                                        
| 362 | -		    <!--<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>--> | 
                                                        |
| 363 | -		    <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> | 
                                                        |
| 364 | -		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li> | 
                                                        |
| 365 | -		    <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> | 
                                                        |
| 366 | -		    <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> | 
                                                        |
| 516 | +		    <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') { | 
                                                        |
| 517 | + print 'checked';  | 
                                                        |
| 518 | +}  | 
                                                        |
| 519 | +?> ><?php echo _("Display flight info as popup"); ?></label></div></li>--> | 
                                                        |
| 520 | +		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) { | 
                                                        |
| 521 | + print 'checked';  | 
                                                        |
| 522 | +}  | 
                                                        |
| 523 | +?> ><?php echo _("Display flight path"); ?></label></div></li> | 
                                                        |
| 524 | +		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) { | 
                                                        |
| 525 | + print 'checked';  | 
                                                        |
| 526 | +}  | 
                                                        |
| 527 | +?> ><?php echo _("Display flight route on click"); ?></label></div></li> | 
                                                        |
| 528 | +		    <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)) { | 
                                                        |
| 529 | + print 'checked';  | 
                                                        |
| 530 | +}  | 
                                                        |
| 531 | +?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> | 
                                                        |
| 532 | +		    <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)) { | 
                                                        |
| 533 | + print 'checked';  | 
                                                        |
| 534 | +}  | 
                                                        |
| 535 | +?> ><?php echo _("Planes animate between updates"); ?></label></div></li> | 
                                                        |
| 367 | 536 | <?php  | 
                                                        
| 368 | 537 | }  | 
                                                        
| 369 | 538 |  	if (isset($globalSatellite) && $globalSatellite === TRUE) { | 
                                                        
| 370 | 539 | ?>  | 
                                                        
| 371 | -		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> | 
                                                        |
| 540 | +		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { | 
                                                        |
| 541 | + print 'checked';  | 
                                                        |
| 542 | +}  | 
                                                        |
| 543 | +?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> | 
                                                        |
| 372 | 544 | <?php  | 
                                                        
| 373 | 545 | }  | 
                                                        
| 374 | 546 | }  | 
                                                        
| 375 | 547 | ?>  | 
                                                        
| 376 | -		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> | 
                                                        |
| 377 | -		    <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> | 
                                                        |
| 378 | -		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li> | 
                                                        |
| 379 | -		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li> | 
                                                        |
| 548 | +		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) { | 
                                                        |
| 549 | + print 'checked';  | 
                                                        |
| 550 | +}  | 
                                                        |
| 551 | +?> ><?php echo _("Display airports on map"); ?></label></div></li> | 
                                                        |
| 552 | +		    <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))) { | 
                                                        |
| 553 | + print 'checked';  | 
                                                        |
| 554 | +}  | 
                                                        |
| 555 | +?> ><?php echo _("Display ground station on map"); ?></label></div></li> | 
                                                        |
| 556 | +		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) { | 
                                                        |
| 557 | + print 'checked';  | 
                                                        |
| 558 | +}  | 
                                                        |
| 559 | +?> ><?php echo _("Display weather station on map"); ?></label></div></li> | 
                                                        |
| 560 | +		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) { | 
                                                        |
| 561 | + print 'checked';  | 
                                                        |
| 562 | +}  | 
                                                        |
| 563 | +?> ><?php echo _("Display lightning on map"); ?></label></div></li> | 
                                                        |
| 380 | 564 | <?php  | 
                                                        
| 381 | 565 |  	if (isset($globalFires)) { | 
                                                        
| 382 | 566 | ?>  | 
                                                        
| 383 | -		    <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) print 'checked'; ?> ><?php echo _("Display fires on map"); ?></label></div></li> | 
                                                        |
| 567 | +		    <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) { | 
                                                        |
| 568 | + print 'checked';  | 
                                                        |
| 569 | +}  | 
                                                        |
| 570 | +?> ><?php echo _("Display fires on map"); ?></label></div></li> | 
                                                        |
| 384 | 571 | <?php  | 
                                                        
| 385 | 572 | }  | 
                                                        
| 386 | 573 |      if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { | 
                                                        
| 387 | 574 | ?>  | 
                                                        
| 388 | -		    <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> | 
                                                        |
| 575 | +		    <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')) { | 
                                                        |
| 576 | + print 'checked';  | 
                                                        |
| 577 | +}  | 
                                                        |
| 578 | +?> ><?php echo _("Show mini-map"); ?></label></div></li> | 
                                                        |
| 389 | 579 | <?php  | 
                                                        
| 390 | 580 | }  | 
                                                        
| 391 | 581 |      if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { | 
                                                        
@@ -398,17 +588,25 @@ discard block  | 
                                                    ||
| 398 | 588 |  			if (function_exists('array_column')) { | 
                                                        
| 399 | 589 |  			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { | 
                                                        
| 400 | 590 | ?>  | 
                                                        
| 401 | -		    <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> | 
                                                        |
| 591 | +		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { | 
                                                        |
| 592 | + print 'checked';  | 
                                                        |
| 593 | +}  | 
                                                        |
| 594 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> | 
                                                        |
| 402 | 595 | <?php  | 
                                                        
| 403 | 596 | }  | 
                                                        
| 404 | 597 |  			} elseif (isset($globalSources)) { | 
                                                        
| 405 | 598 | $dispolar = false;  | 
                                                        
| 406 | 599 |  			    foreach ($globalSources as $testsource) { | 
                                                        
| 407 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;  | 
                                                        |
| 600 | +			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) { | 
                                                        |
| 601 | + $dispolar = true;  | 
                                                        |
| 602 | + }  | 
                                                        |
| 408 | 603 | }  | 
                                                        
| 409 | 604 |  			    if ($dispolar) { | 
                                                        
| 410 | 605 | ?>  | 
                                                        
| 411 | -		    <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> | 
                                                        |
| 606 | +		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { | 
                                                        |
| 607 | + print 'checked';  | 
                                                        |
| 608 | +}  | 
                                                        |
| 609 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> | 
                                                        |
| 412 | 610 | <?php  | 
                                                        
| 413 | 611 | }  | 
                                                        
| 414 | 612 | }  | 
                                                        
@@ -421,12 +619,22 @@ discard block  | 
                                                    ||
| 421 | 619 |  			if (!isset($globalAircraft) || $globalAircraft === TRUE) { | 
                                                        
| 422 | 620 |  		    	    if (extension_loaded('gd') && function_exists('gd_info')) { | 
                                                        
| 423 | 621 | ?>  | 
                                                        
| 424 | -		    <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> | 
                                                        |
| 622 | +		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') { | 
                                                        |
| 623 | + print 'checked';  | 
                                                        |
| 624 | +}  | 
                                                        |
| 625 | +?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> | 
                                                        |
| 425 | 626 | <?php  | 
                                                        
| 426 | 627 |  				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { | 
                                                        
| 427 | 628 | ?>  | 
                                                        
| 428 | 629 |  		    <li><?php echo _("Aircraft icon color:"); ?> | 
                                                        
| 429 | - <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'; ?>">  | 
                                                        |
| 630 | +			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { | 
                                                        |
| 631 | + print $_COOKIE['IconColor'];  | 
                                                        |
| 632 | +} elseif (isset($globalAircraftIconColor)) { | 
                                                        |
| 633 | + print $globalAircraftIconColor;  | 
                                                        |
| 634 | +} else { | 
                                                        |
| 635 | + print '1a3151';  | 
                                                        |
| 636 | +}  | 
                                                        |
| 637 | +?>">  | 
                                                        |
| 430 | 638 | </li>  | 
                                                        
| 431 | 639 | <?php  | 
                                                        
| 432 | 640 | }  | 
                                                        
@@ -438,7 +646,14 @@ discard block  | 
                                                    ||
| 438 | 646 |  			    if (extension_loaded('gd') && function_exists('gd_info')) { | 
                                                        
| 439 | 647 | ?>  | 
                                                        
| 440 | 648 |  		    <li><?php echo _("Marine icon color:"); ?> | 
                                                        
| 441 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">  | 
                                                        |
| 649 | +			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { | 
                                                        |
| 650 | + print $_COOKIE['MarineIconColor'];  | 
                                                        |
| 651 | +} elseif (isset($globalMarineIconColor)) { | 
                                                        |
| 652 | + print $globalMarineIconColor;  | 
                                                        |
| 653 | +} else { | 
                                                        |
| 654 | + print '1a3151';  | 
                                                        |
| 655 | +}  | 
                                                        |
| 656 | +?>">  | 
                                                        |
| 442 | 657 | </li>  | 
                                                        
| 443 | 658 | <?php  | 
                                                        
| 444 | 659 | }  | 
                                                        
@@ -449,7 +664,14 @@ discard block  | 
                                                    ||
| 449 | 664 |  			    if (extension_loaded('gd') && function_exists('gd_info')) { | 
                                                        
| 450 | 665 | ?>  | 
                                                        
| 451 | 666 |  		    <li><?php echo _("Tracker icon color:"); ?> | 
                                                        
| 452 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>">  | 
                                                        |
| 667 | +			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { | 
                                                        |
| 668 | + print $_COOKIE['TrackerIconColor'];  | 
                                                        |
| 669 | +} elseif (isset($globalTrackerIconColor)) { | 
                                                        |
| 670 | + print $globalTrackerIconColor;  | 
                                                        |
| 671 | +} else { | 
                                                        |
| 672 | + print '1a3151';  | 
                                                        |
| 673 | +}  | 
                                                        |
| 674 | +?>">  | 
                                                        |
| 453 | 675 | </li>  | 
                                                        
| 454 | 676 | <?php  | 
                                                        
| 455 | 677 | }  | 
                                                        
@@ -460,8 +682,22 @@ discard block  | 
                                                    ||
| 460 | 682 | ?>  | 
                                                        
| 461 | 683 |  		    <li><?php echo _("Show airport icon at zoom level:"); ?> | 
                                                        
| 462 | 684 | <div class="range">  | 
                                                        
| 463 | - <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'; ?>">  | 
                                                        |
| 464 | - <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>  | 
                                                        |
| 685 | +			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) { | 
                                                        |
| 686 | + print $_COOKIE['AirportZoom'];  | 
                                                        |
| 687 | +} elseif (isset($globalAirportZoom)) { | 
                                                        |
| 688 | + print $globalAirportZoom;  | 
                                                        |
| 689 | +} else { | 
                                                        |
| 690 | + print '7';  | 
                                                        |
| 691 | +}  | 
                                                        |
| 692 | +?>">  | 
                                                        |
| 693 | +			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) { | 
                                                        |
| 694 | + print $_COOKIE['AirportZoom'];  | 
                                                        |
| 695 | +} elseif (isset($globalAirportZoom)) { | 
                                                        |
| 696 | + print $globalAirportZoom;  | 
                                                        |
| 697 | +} else { | 
                                                        |
| 698 | + print '7';  | 
                                                        |
| 699 | +}  | 
                                                        |
| 700 | +?></output>  | 
                                                        |
| 465 | 701 | </div>  | 
                                                        
| 466 | 702 | </li>  | 
                                                        
| 467 | 703 | <?php  | 
                                                        
@@ -473,10 +709,23 @@ discard block  | 
                                                    ||
| 473 | 709 | <?php  | 
                                                        
| 474 | 710 |  	if (!isset($globalAircraft) || $globalAircraft === TRUE) { | 
                                                        
| 475 | 711 | ?>  | 
                                                        
| 476 | -		    <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') print 'checked'; ?> ><?php echo _("Use airlines liveries"); ?></li> | 
                                                        |
| 477 | -		    <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> | 
                                                        |
| 712 | +		    <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') { | 
                                                        |
| 713 | + print 'checked';  | 
                                                        |
| 714 | +}  | 
                                                        |
| 715 | +?> ><?php echo _("Use airlines liveries"); ?></li> | 
                                                        |
| 716 | +		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') { | 
                                                        |
| 717 | + print 'checked';  | 
                                                        |
| 718 | +}  | 
                                                        |
| 719 | +?> ><?php echo _("Force Aircraft color"); ?></li> | 
                                                        |
| 478 | 720 |  		    <li><?php echo _("Aircraft icon color:"); ?> | 
                                                        
| 479 | - <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'; ?>">  | 
                                                        |
| 721 | +			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { | 
                                                        |
| 722 | + print $_COOKIE['IconColor'];  | 
                                                        |
| 723 | +} elseif (isset($globalAircraftIconColor)) { | 
                                                        |
| 724 | + print $globalAircraftIconColor;  | 
                                                        |
| 725 | +} else { | 
                                                        |
| 726 | + print 'ff0000';  | 
                                                        |
| 727 | +}  | 
                                                        |
| 728 | +?>">  | 
                                                        |
| 480 | 729 | </li>  | 
                                                        
| 481 | 730 | <?php  | 
                                                        
| 482 | 731 | }  | 
                                                        
@@ -484,9 +733,19 @@ discard block  | 
                                                    ||
| 484 | 733 | <?php  | 
                                                        
| 485 | 734 |  	if (isset($globalMarine) && $globalMarine === TRUE) { | 
                                                        
| 486 | 735 | ?>  | 
                                                        
| 487 | -		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?></li> | 
                                                        |
| 736 | +		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') { | 
                                                        |
| 737 | + print 'checked';  | 
                                                        |
| 738 | +}  | 
                                                        |
| 739 | +?> ><?php echo _("Force Marine color"); ?></li> | 
                                                        |
| 488 | 740 |  		    <li><?php echo _("Marine icon color:"); ?> | 
                                                        
| 489 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>">  | 
                                                        |
| 741 | +			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { | 
                                                        |
| 742 | + print $_COOKIE['MarineIconColor'];  | 
                                                        |
| 743 | +} elseif (isset($globalMarineIconColor)) { | 
                                                        |
| 744 | + print $globalMarineIconColor;  | 
                                                        |
| 745 | +} else { | 
                                                        |
| 746 | + print 'ff0000';  | 
                                                        |
| 747 | +}  | 
                                                        |
| 748 | +?>">  | 
                                                        |
| 490 | 749 | </li>  | 
                                                        
| 491 | 750 | <?php  | 
                                                        
| 492 | 751 | }  | 
                                                        
@@ -494,9 +753,19 @@ discard block  | 
                                                    ||
| 494 | 753 | <?php  | 
                                                        
| 495 | 754 |  	if (isset($globalTracker) && $globalTracker === TRUE) { | 
                                                        
| 496 | 755 | ?>  | 
                                                        
| 497 | -		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Tracker color"); ?></li> | 
                                                        |
| 756 | +		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') { | 
                                                        |
| 757 | + print 'checked';  | 
                                                        |
| 758 | +}  | 
                                                        |
| 759 | +?> ><?php echo _("Force Tracker color"); ?></li> | 
                                                        |
| 498 | 760 |  		    <li><?php echo _("Tracker icon color:"); ?> | 
                                                        
| 499 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print 'ff0000'; ?>">  | 
                                                        |
| 761 | +			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { | 
                                                        |
| 762 | + print $_COOKIE['TrackerIconColor'];  | 
                                                        |
| 763 | +} elseif (isset($globalTrackerIconColor)) { | 
                                                        |
| 764 | + print $globalTrackerIconColor;  | 
                                                        |
| 765 | +} else { | 
                                                        |
| 766 | + print 'ff0000';  | 
                                                        |
| 767 | +}  | 
                                                        |
| 768 | +?>">  | 
                                                        |
| 500 | 769 | </li>  | 
                                                        
| 501 | 770 | <?php  | 
                                                        
| 502 | 771 | }  | 
                                                        
@@ -504,22 +773,46 @@ discard block  | 
                                                    ||
| 504 | 773 | ?>  | 
                                                        
| 505 | 774 |  		    <li><?php echo _("Distance unit:"); ?> | 
                                                        
| 506 | 775 | <select class="selectpicker" onchange="unitdistance(this);">  | 
                                                        
| 507 | - <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>  | 
                                                        |
| 508 | - <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>  | 
                                                        |
| 509 | - <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>  | 
                                                        |
| 776 | +			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { | 
                                                        |
| 777 | + echo ' selected';  | 
                                                        |
| 778 | +}  | 
                                                        |
| 779 | +?>>km</option>  | 
                                                        |
| 780 | +			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { | 
                                                        |
| 781 | + echo ' selected';  | 
                                                        |
| 782 | +}  | 
                                                        |
| 783 | +?>>nm</option>  | 
                                                        |
| 784 | +			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { | 
                                                        |
| 785 | + echo ' selected';  | 
                                                        |
| 786 | +}  | 
                                                        |
| 787 | +?>>mi</option>  | 
                                                        |
| 510 | 788 | </select>  | 
                                                        
| 511 | 789 | </li>  | 
                                                        
| 512 | 790 |  		    <li><?php echo _("Altitude unit:"); ?> | 
                                                        
| 513 | 791 | <select class="selectpicker" onchange="unitaltitude(this);">  | 
                                                        
| 514 | - <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>  | 
                                                        |
| 515 | - <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>  | 
                                                        |
| 792 | +			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) { | 
                                                        |
| 793 | + echo ' selected';  | 
                                                        |
| 794 | +}  | 
                                                        |
| 795 | +?>>m</option>  | 
                                                        |
| 796 | +			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { | 
                                                        |
| 797 | + echo ' selected';  | 
                                                        |
| 798 | +}  | 
                                                        |
| 799 | +?>>feet</option>  | 
                                                        |
| 516 | 800 | </select>  | 
                                                        
| 517 | 801 | </li>  | 
                                                        
| 518 | 802 |  		    <li><?php echo _("Speed unit:"); ?> | 
                                                        
| 519 | 803 | <select class="selectpicker" onchange="unitspeed(this);">  | 
                                                        
| 520 | - <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>  | 
                                                        |
| 521 | - <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>  | 
                                                        |
| 522 | - <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>  | 
                                                        |
| 804 | +			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) { | 
                                                        |
| 805 | + echo ' selected';  | 
                                                        |
| 806 | +}  | 
                                                        |
| 807 | +?>>km/h</option>  | 
                                                        |
| 808 | +			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { | 
                                                        |
| 809 | + echo ' selected';  | 
                                                        |
| 810 | +}  | 
                                                        |
| 811 | +?>>mph</option>  | 
                                                        |
| 812 | +			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { | 
                                                        |
| 813 | + echo ' selected';  | 
                                                        |
| 814 | +}  | 
                                                        |
| 815 | +?>>knots</option>  | 
                                                        |
| 523 | 816 | </select>  | 
                                                        
| 524 | 817 | </li>  | 
                                                        
| 525 | 818 | |
@@ -537,9 +830,18 @@ discard block  | 
                                                    ||
| 537 | 830 | <?php  | 
                                                        
| 538 | 831 |  			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { | 
                                                        
| 539 | 832 | ?>  | 
                                                        
| 540 | -			<?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 } ?> | 
                                                        |
| 541 | -			<?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 } ?> | 
                                                        |
| 542 | -			<?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 } ?> | 
                                                        |
| 833 | +			<?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'])) { | 
                                                        |
| 834 | + print 'checked';  | 
                                                        |
| 835 | +}  | 
                                                        |
| 836 | +?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> | 
                                                        |
| 837 | +			<?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'])) { | 
                                                        |
| 838 | + print 'checked';  | 
                                                        |
| 839 | +}  | 
                                                        |
| 840 | +?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> | 
                                                        |
| 841 | +			<?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'])) { | 
                                                        |
| 842 | + print 'checked';  | 
                                                        |
| 843 | +}  | 
                                                        |
| 844 | +?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> | 
                                                        |
| 543 | 845 | <?php  | 
                                                        
| 544 | 846 | }  | 
                                                        
| 545 | 847 | ?>  | 
                                                        
@@ -547,10 +849,16 @@ discard block  | 
                                                    ||
| 547 | 849 |  			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { | 
                                                        
| 548 | 850 | ?>  | 
                                                        
| 549 | 851 |  			<?php if (isset($globalSBS1) && $globalSBS1) { ?> | 
                                                        
| 550 | -			    <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> | 
                                                        |
| 852 | +			    <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'])) { | 
                                                        |
| 853 | + print 'checked';  | 
                                                        |
| 854 | +}  | 
                                                        |
| 855 | +?> ><?php echo _("Display ADS-B data"); ?></label></div></li> | 
                                                        |
| 551 | 856 | <?php } ?>  | 
                                                        
| 552 | 857 |  			<?php if (isset($globalAPRS) && $globalAPRS) { ?> | 
                                                        
| 553 | -			    <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> | 
                                                        |
| 858 | +			    <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'])) { | 
                                                        |
| 859 | + print 'checked';  | 
                                                        |
| 860 | +}  | 
                                                        |
| 861 | +?> ><?php echo _("Display APRS data"); ?></label></div></li> | 
                                                        |
| 554 | 862 | <?php } ?>  | 
                                                        
| 555 | 863 | <?php  | 
                                                        
| 556 | 864 | }  | 
                                                        
@@ -567,7 +875,9 @@ discard block  | 
                                                    ||
| 567 | 875 | }  | 
                                                        
| 568 | 876 |  				foreach($allairlinenames as $airline) { | 
                                                        
| 569 | 877 | $airline_name = $airline['airline_name'];  | 
                                                        
| 570 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';  | 
                                                        |
| 878 | +					if (strlen($airline_name) > 30) { | 
                                                        |
| 879 | + $airline_name = substr($airline_name,0,30).'...';  | 
                                                        |
| 880 | + }  | 
                                                        |
| 571 | 881 |  					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { | 
                                                        
| 572 | 882 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';  | 
                                                        
| 573 | 883 |  					} else { | 
                                                        
@@ -585,7 +895,10 @@ discard block  | 
                                                    ||
| 585 | 895 |  		    <li><?php echo _("Display alliance:"); ?> | 
                                                        
| 586 | 896 | <br/>  | 
                                                        
| 587 | 897 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance">  | 
                                                        
| 588 | -			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> | 
                                                        |
| 898 | +			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') { | 
                                                        |
| 899 | + echo ' selected';  | 
                                                        |
| 900 | +}  | 
                                                        |
| 901 | +?>><?php echo _("All"); ?></option> | 
                                                        |
| 589 | 902 | <?php  | 
                                                        
| 590 | 903 |  				foreach($allalliancenames as $alliance) { | 
                                                        
| 591 | 904 | $alliance_name = $alliance['alliance'];  | 
                                                        
@@ -644,10 +957,22 @@ discard block  | 
                                                    ||
| 644 | 957 | ?>  | 
                                                        
| 645 | 958 |  		    <li><?php echo _("Display airlines of type:"); ?><br/> | 
                                                        
| 646 | 959 | <select class="selectpicker" onchange="airlinestype(this);">  | 
                                                        
| 647 | -			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> | 
                                                        |
| 648 | -			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option> | 
                                                        |
| 649 | -			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option> | 
                                                        |
| 650 | -			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option> | 
                                                        |
| 960 | +			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') { | 
                                                        |
| 961 | + echo ' selected';  | 
                                                        |
| 962 | +}  | 
                                                        |
| 963 | +?>><?php echo _("All"); ?></option> | 
                                                        |
| 964 | +			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') { | 
                                                        |
| 965 | + echo ' selected';  | 
                                                        |
| 966 | +}  | 
                                                        |
| 967 | +?>><?php echo _("Passenger"); ?></option> | 
                                                        |
| 968 | +			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') { | 
                                                        |
| 969 | + echo ' selected';  | 
                                                        |
| 970 | +}  | 
                                                        |
| 971 | +?>><?php echo _("Cargo"); ?></option> | 
                                                        |
| 972 | +			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') { | 
                                                        |
| 973 | + echo ' selected';  | 
                                                        |
| 974 | +}  | 
                                                        |
| 975 | +?>><?php echo _("Military"); ?></option> | 
                                                        |
| 651 | 976 | </select>  | 
                                                        
| 652 | 977 | </li>  | 
                                                        
| 653 | 978 | <?php  | 
                                                        
@@ -661,14 +986,20 @@ discard block  | 
                                                    ||
| 661 | 986 | ?>  | 
                                                        
| 662 | 987 | <li>  | 
                                                        
| 663 | 988 |  			<?php echo _("Display vessels with MMSI:"); ?> | 
                                                        
| 664 | - <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" />  | 
                                                        |
| 989 | +			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) { | 
                                                        |
| 990 | + print $_COOKIE['filter_mmsi'];  | 
                                                        |
| 991 | +}  | 
                                                        |
| 992 | +?>" />  | 
                                                        |
| 665 | 993 | </li>  | 
                                                        
| 666 | 994 | <?php  | 
                                                        
| 667 | 995 | }  | 
                                                        
| 668 | 996 | ?>  | 
                                                        
| 669 | 997 | <li>  | 
                                                        
| 670 | 998 |  			<?php echo _("Display with ident:"); ?> | 
                                                        
| 671 | - <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />  | 
                                                        |
| 999 | +			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) { | 
                                                        |
| 1000 | + print $_COOKIE['filter_ident'];  | 
                                                        |
| 1001 | +}  | 
                                                        |
| 1002 | +?>" />  | 
                                                        |
| 672 | 1003 | </li>  | 
                                                        
| 673 | 1004 | </ul>  | 
                                                        
| 674 | 1005 | </form>  | 
                                                        
@@ -684,7 +1015,10 @@ discard block  | 
                                                    ||
| 684 | 1015 |  	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> | 
                                                        
| 685 | 1016 | <form>  | 
                                                        
| 686 | 1017 | <ul>  | 
                                                        
| 687 | -		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> | 
                                                        |
| 1018 | +		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) { | 
                                                        |
| 1019 | + print 'checked';  | 
                                                        |
| 1020 | +}  | 
                                                        |
| 1021 | +?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> | 
                                                        |
| 688 | 1022 |  		    <li><?php echo _("Type:"); ?> | 
                                                        
| 689 | 1023 | <select class="selectpicker" multiple onchange="sattypes(this);">  | 
                                                        
| 690 | 1024 | <?php  | 
                                                        
@@ -692,25 +1026,45 @@ discard block  | 
                                                    ||
| 692 | 1026 | $types = $Satellite->get_tle_types();  | 
                                                        
| 693 | 1027 |  				foreach ($types as $type) { | 
                                                        
| 694 | 1028 | $type_name = $type['tle_type'];  | 
                                                        
| 695 | - if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';  | 
                                                        |
| 696 | - else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';  | 
                                                        |
| 697 | - else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';  | 
                                                        |
| 698 | - else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';  | 
                                                        |
| 699 | - else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';  | 
                                                        |
| 700 | - else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';  | 
                                                        |
| 701 | - else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';  | 
                                                        |
| 702 | - else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';  | 
                                                        |
| 703 | - else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';  | 
                                                        |
| 704 | - else if ($type_name == 'resource') $type_name = 'Earth Resources';  | 
                                                        |
| 705 | - else if ($type_name == 'stations') $type_name = 'Space Stations';  | 
                                                        |
| 706 | - else if ($type_name == 'geo') $type_name = 'Geostationary';  | 
                                                        |
| 707 | - else if ($type_name == 'amateur') $type_name = 'Amateur Radio';  | 
                                                        |
| 708 | - else if ($type_name == 'x-comm') $type_name = 'Experimental';  | 
                                                        |
| 709 | - else if ($type_name == 'other-comm') $type_name = 'Other Comm';  | 
                                                        |
| 710 | - else if ($type_name == 'science') $type_name = 'Space & Earth Science';  | 
                                                        |
| 711 | - else if ($type_name == 'military') $type_name = 'Miscellaneous Military';  | 
                                                        |
| 712 | - else if ($type_name == 'radar') $type_name = 'Radar Calibration';  | 
                                                        |
| 713 | - else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';  | 
                                                        |
| 1029 | +					if ($type_name == 'musson') { | 
                                                        |
| 1030 | + $type_name = 'Russian LEO Navigation';  | 
                                                        |
| 1031 | +					} else if ($type_name == 'nnss') { | 
                                                        |
| 1032 | + $type_name = 'Navi Navigation Satellite System';  | 
                                                        |
| 1033 | +					} else if ($type_name == 'sbas') { | 
                                                        |
| 1034 | + $type_name = 'Satellite-Based Augmentation System';  | 
                                                        |
| 1035 | +					} else if ($type_name == 'glo-ops') { | 
                                                        |
| 1036 | + $type_name = 'Glonass Operational';  | 
                                                        |
| 1037 | +					} else if ($type_name == 'gps-ops') { | 
                                                        |
| 1038 | + $type_name = 'GPS Operational';  | 
                                                        |
| 1039 | +					} else if ($type_name == 'argos') { | 
                                                        |
| 1040 | + $type_name = 'ARGOS Data Collection System';  | 
                                                        |
| 1041 | +					} else if ($type_name == 'tdrss') { | 
                                                        |
| 1042 | + $type_name = 'Tracking and Data Relay Satellite System';  | 
                                                        |
| 1043 | +					} else if ($type_name == 'sarsat') { | 
                                                        |
| 1044 | + $type_name = 'Search & Rescue';  | 
                                                        |
| 1045 | +					} else if ($type_name == 'dmc') { | 
                                                        |
| 1046 | + $type_name = 'Disaster Monitoring';  | 
                                                        |
| 1047 | +					} else if ($type_name == 'resource') { | 
                                                        |
| 1048 | + $type_name = 'Earth Resources';  | 
                                                        |
| 1049 | +					} else if ($type_name == 'stations') { | 
                                                        |
| 1050 | + $type_name = 'Space Stations';  | 
                                                        |
| 1051 | +					} else if ($type_name == 'geo') { | 
                                                        |
| 1052 | + $type_name = 'Geostationary';  | 
                                                        |
| 1053 | +					} else if ($type_name == 'amateur') { | 
                                                        |
| 1054 | + $type_name = 'Amateur Radio';  | 
                                                        |
| 1055 | +					} else if ($type_name == 'x-comm') { | 
                                                        |
| 1056 | + $type_name = 'Experimental';  | 
                                                        |
| 1057 | +					} else if ($type_name == 'other-comm') { | 
                                                        |
| 1058 | + $type_name = 'Other Comm';  | 
                                                        |
| 1059 | +					} else if ($type_name == 'science') { | 
                                                        |
| 1060 | + $type_name = 'Space & Earth Science';  | 
                                                        |
| 1061 | +					} else if ($type_name == 'military') { | 
                                                        |
| 1062 | + $type_name = 'Miscellaneous Military';  | 
                                                        |
| 1063 | +					} else if ($type_name == 'radar') { | 
                                                        |
| 1064 | + $type_name = 'Radar Calibration';  | 
                                                        |
| 1065 | +					} else if ($type_name == 'tle-new') { | 
                                                        |
| 1066 | + $type_name = 'Last 30 days launches';  | 
                                                        |
| 1067 | + }  | 
                                                        |
| 714 | 1068 | |
| 715 | 1069 |  					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { | 
                                                        
| 716 | 1070 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';  | 
                                                        
@@ -188,13 +188,13 @@ discard block  | 
                                                    ||
| 188 | 188 | <p>  | 
                                                        
| 189 | 189 | <label for="siteurl">Site directory</label>  | 
                                                        
| 190 | 190 | <?php  | 
                                                        
| 191 | - // Try to detect site directory  | 
                                                        |
| 192 | -				    if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) { | 
                                                        |
| 191 | + // Try to detect site directory  | 
                                                        |
| 192 | +					if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) { | 
                                                        |
| 193 | 193 |  					if (isset($_SERVER['REQUEST_URI'])) { | 
                                                        
| 194 | 194 | $URL = $_SERVER['REQUEST_URI'];  | 
                                                        
| 195 | 195 |  						$globalURL = str_replace('/install','',str_replace('/install/','',str_replace('/install/index.php','',$URL))); | 
                                                        
| 196 | 196 | }  | 
                                                        
| 197 | - }  | 
                                                        |
| 197 | + }  | 
                                                        |
| 198 | 198 | ?>  | 
                                                        
| 199 | 199 | <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />  | 
                                                        
| 200 | 200 | <p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>  | 
                                                        
@@ -373,17 +373,17 @@ discard block  | 
                                                    ||
| 373 | 373 | </tr>  | 
                                                        
| 374 | 374 | |
| 375 | 375 | <?php  | 
                                                        
| 376 | -		    if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') { | 
                                                        |
| 376 | +			if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') { | 
                                                        |
| 377 | 377 | ?>  | 
                                                        
| 378 | 378 | <!--  | 
                                                        
| 379 | 379 | <?php  | 
                                                        
| 380 | - require_once(dirname(__FILE__).'/../require/class.Connection.php');  | 
                                                        |
| 381 | - $Connection = new Connection();  | 
                                                        |
| 380 | + require_once(dirname(__FILE__).'/../require/class.Connection.php');  | 
                                                        |
| 381 | + $Connection = new Connection();  | 
                                                        |
| 382 | 382 | ?>  | 
                                                        
| 383 | 383 | -->  | 
                                                        
| 384 | 384 | <?php  | 
                                                        
| 385 | 385 |  			if ($Connection->db != NULL) { | 
                                                        
| 386 | -			    if ($Connection->tableExists('source_location')) { | 
                                                        |
| 386 | +				if ($Connection->tableExists('source_location')) { | 
                                                        |
| 387 | 387 | require_once(dirname(__FILE__).'/../require/class.Source.php');  | 
                                                        
| 388 | 388 | $Source = new Source();  | 
                                                        
| 389 | 389 | //$alllocations = $Source->getAllLocationInfo();  | 
                                                        
@@ -403,9 +403,9 @@ discard block  | 
                                                    ||
| 403 | 403 | |
| 404 | 404 | <?php  | 
                                                        
| 405 | 405 | }  | 
                                                        
| 406 | - }  | 
                                                        |
| 406 | + }  | 
                                                        |
| 407 | + }  | 
                                                        |
| 407 | 408 | }  | 
                                                        
| 408 | - }  | 
                                                        |
| 409 | 409 | ?>  | 
                                                        
| 410 | 410 | |
| 411 | 411 | <tr>  | 
                                                        
@@ -515,12 +515,12 @@ discard block  | 
                                                    ||
| 515 | 515 | ?>  | 
                                                        
| 516 | 516 | <tr>  | 
                                                        
| 517 | 517 | <?php  | 
                                                        
| 518 | -								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) { | 
                                                        |
| 518 | +									if (filter_var($source['host'],FILTER_VALIDATE_URL)) { | 
                                                        |
| 519 | 519 | ?>  | 
                                                        
| 520 | 520 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>  | 
                                                        
| 521 | 521 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>  | 
                                                        
| 522 | 522 | <?php  | 
                                                        
| 523 | -								    } else { | 
                                                        |
| 523 | +									} else { | 
                                                        |
| 524 | 524 |  									$hostport = explode(':',$source['host']); | 
                                                        
| 525 | 525 |  									if (isset($hostport[1])) { | 
                                                        
| 526 | 526 | $host = $hostport[0];  | 
                                                        
@@ -533,7 +533,7 @@ discard block  | 
                                                    ||
| 533 | 533 | <td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td>  | 
                                                        
| 534 | 534 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php print $port; ?>" /></td>  | 
                                                        
| 535 | 535 | <?php  | 
                                                        
| 536 | - }  | 
                                                        |
| 536 | + }  | 
                                                        |
| 537 | 537 | ?>  | 
                                                        
| 538 | 538 | <td>  | 
                                                        
| 539 | 539 | <select name="format[]" id="format">  | 
                                                        
@@ -673,9 +673,9 @@ discard block  | 
                                                    ||
| 673 | 673 | </thead>  | 
                                                        
| 674 | 674 | <tbody>  | 
                                                        
| 675 | 675 | <?php  | 
                                                        
| 676 | -				    if (isset($globalNewsFeeds) && !empty($globalNewsFeeds)) { | 
                                                        |
| 676 | +					if (isset($globalNewsFeeds) && !empty($globalNewsFeeds)) { | 
                                                        |
| 677 | 677 |  					foreach ($globalNewsFeeds as $type => $feedslng) { | 
                                                        
| 678 | -					    foreach ($feedslng as $lng => $feeds) { | 
                                                        |
| 678 | +						foreach ($feedslng as $lng => $feeds) { | 
                                                        |
| 679 | 679 |  						foreach ($feeds as $feed) { | 
                                                        
| 680 | 680 | ?>  | 
                                                        
| 681 | 681 | <tr>  | 
                                                        
@@ -700,9 +700,9 @@ discard block  | 
                                                    ||
| 700 | 700 | |
| 701 | 701 | <?php  | 
                                                        
| 702 | 702 | }  | 
                                                        
| 703 | - }  | 
                                                        |
| 703 | + }  | 
                                                        |
| 704 | + }  | 
                                                        |
| 704 | 705 | }  | 
                                                        
| 705 | - }  | 
                                                        |
| 706 | 706 | ?>  | 
                                                        
| 707 | 707 | <tr>  | 
                                                        
| 708 | 708 | <td><input type="url" name="newsurl[]" /></td>  | 
                                                        
@@ -1092,7 +1092,7 @@ discard block  | 
                                                    ||
| 1092 | 1092 | <br />  | 
                                                        
| 1093 | 1093 | <p>  | 
                                                        
| 1094 | 1094 | <?php  | 
                                                        
| 1095 | -			    if (extension_loaded('gd') && function_exists('gd_info')) { | 
                                                        |
| 1095 | +				if (extension_loaded('gd') && function_exists('gd_info')) { | 
                                                        |
| 1096 | 1096 | ?>  | 
                                                        
| 1097 | 1097 | <label for="aircrafticoncolor">Color of aircraft icon on map</label>  | 
                                                        
| 1098 | 1098 | <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />  | 
                                                        
@@ -1102,11 +1102,11 @@ discard block  | 
                                                    ||
| 1102 | 1102 | <b>The directory cache is not writable, aircraft icon will not be cached</b>  | 
                                                        
| 1103 | 1103 | <?php  | 
                                                        
| 1104 | 1104 | }  | 
                                                        
| 1105 | -			    } else { | 
                                                        |
| 1105 | +				} else { | 
                                                        |
| 1106 | 1106 | ?>  | 
                                                        
| 1107 | 1107 | <b>PHP GD is not installed, you can't change color of aircraft icon on map</b>  | 
                                                        
| 1108 | 1108 | <?php  | 
                                                        
| 1109 | - }  | 
                                                        |
| 1109 | + }  | 
                                                        |
| 1110 | 1110 | ?>  | 
                                                        
| 1111 | 1111 | </p>  | 
                                                        
| 1112 | 1112 | <br />  | 
                                                        
@@ -1130,7 +1130,7 @@ discard block  | 
                                                    ||
| 1130 | 1130 | </p>  | 
                                                        
| 1131 | 1131 | <?php  | 
                                                        
| 1132 | 1132 |  	require('../footer.php'); | 
                                                        
| 1133 | - exit;  | 
                                                        |
| 1133 | + exit;  | 
                                                        |
| 1134 | 1134 | }  | 
                                                        
| 1135 | 1135 | // '  | 
                                                        
| 1136 | 1136 | $settings = array();  | 
                                                        
@@ -1221,8 +1221,8 @@ discard block  | 
                                                    ||
| 1221 | 1221 | |
| 1222 | 1222 | $sources = array();  | 
                                                        
| 1223 | 1223 |  	foreach ($source_name as $keys => $name) { | 
                                                        
| 1224 | -	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); | 
                                                        |
| 1225 | -	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); | 
                                                        |
| 1224 | +		if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); | 
                                                        |
| 1225 | +		else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); | 
                                                        |
| 1226 | 1226 | }  | 
                                                        
| 1227 | 1227 | if (count($sources) > 0) $_SESSION['sources'] = $sources;  | 
                                                        
| 1228 | 1228 | |
@@ -1232,13 +1232,13 @@ discard block  | 
                                                    ||
| 1232 | 1232 | |
| 1233 | 1233 | $newsfeeds = array();  | 
                                                        
| 1234 | 1234 |  	foreach($newsurl as $newskey => $url) { | 
                                                        
| 1235 | -	    if ($url != '') { | 
                                                        |
| 1235 | +		if ($url != '') { | 
                                                        |
| 1236 | 1236 | $type = $newstype[$newskey];  | 
                                                        
| 1237 | 1237 | $lng = $newslng[$newskey];  | 
                                                        
| 1238 | 1238 |  		if (isset($newsfeeds[$type][$lng])) { | 
                                                        
| 1239 | - $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));  | 
                                                        |
| 1239 | + $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));  | 
                                                        |
| 1240 | 1240 | } else $newsfeeds[$type][$lng] = array($url);  | 
                                                        
| 1241 | - }  | 
                                                        |
| 1241 | + }  | 
                                                        |
| 1242 | 1242 | }  | 
                                                        
| 1243 | 1243 |  	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds)); | 
                                                        
| 1244 | 1244 | |
@@ -1681,14 +1681,14 @@ discard block  | 
                                                    ||
| 1681 | 1681 | |
| 1682 | 1682 | // Set some defaults values...  | 
                                                        
| 1683 | 1683 |  	if (!isset($globalAircraftImageSources)) { | 
                                                        
| 1684 | -	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); | 
                                                        |
| 1685 | -	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); | 
                                                        |
| 1684 | +		$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); | 
                                                        |
| 1685 | +		$settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); | 
                                                        |
| 1686 | 1686 | }  | 
                                                        
| 1687 | 1687 | |
| 1688 | 1688 |  	if (!isset($globalSchedulesSources)) { | 
                                                        
| 1689 | -	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); | 
                                                        |
| 1690 | -    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); | 
                                                        |
| 1691 | - }  | 
                                                        |
| 1689 | +		$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); | 
                                                        |
| 1690 | +			$settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); | 
                                                        |
| 1691 | + }  | 
                                                        |
| 1692 | 1692 | |
| 1693 | 1693 |  	$settings = array_merge($settings,array('globalInstalled' => 'TRUE')); | 
                                                        
| 1694 | 1694 | |
@@ -1736,21 +1736,21 @@ discard block  | 
                                                    ||
| 1736 | 1736 | $popi = false;  | 
                                                        
| 1737 | 1737 | $popw = false;  | 
                                                        
| 1738 | 1738 |  	foreach ($_SESSION['done'] as $done) { | 
                                                        
| 1739 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>';  | 
                                                        |
| 1740 | - if ($done == 'Create database') $pop = true;  | 
                                                        |
| 1741 | - if ($_SESSION['install'] == 'database_create') $pop = true;  | 
                                                        |
| 1742 | - if ($_SESSION['install'] == 'database_import') $popi = true;  | 
                                                        |
| 1743 | - if ($_SESSION['install'] == 'waypoints') $popw = true;  | 
                                                        |
| 1739 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>';  | 
                                                        |
| 1740 | + if ($done == 'Create database') $pop = true;  | 
                                                        |
| 1741 | + if ($_SESSION['install'] == 'database_create') $pop = true;  | 
                                                        |
| 1742 | + if ($_SESSION['install'] == 'database_import') $popi = true;  | 
                                                        |
| 1743 | + if ($_SESSION['install'] == 'waypoints') $popw = true;  | 
                                                        |
| 1744 | 1744 | }  | 
                                                        
| 1745 | 1745 |  	if ($pop) { | 
                                                        
| 1746 | - sleep(5);  | 
                                                        |
| 1747 | - print '<li>Create database....<img src="../images/loading.gif" /></li>';  | 
                                                        |
| 1746 | + sleep(5);  | 
                                                        |
| 1747 | + print '<li>Create database....<img src="../images/loading.gif" /></li>';  | 
                                                        |
| 1748 | 1748 |  	} else if ($popi) { | 
                                                        
| 1749 | - sleep(5);  | 
                                                        |
| 1750 | - print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';  | 
                                                        |
| 1749 | + sleep(5);  | 
                                                        |
| 1750 | + print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';  | 
                                                        |
| 1751 | 1751 |  	} else if ($popw) { | 
                                                        
| 1752 | - sleep(5);  | 
                                                        |
| 1753 | - print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';  | 
                                                        |
| 1752 | + sleep(5);  | 
                                                        |
| 1753 | + print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';  | 
                                                        |
| 1754 | 1754 | } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';  | 
                                                        
| 1755 | 1755 | print '</div></ul>';  | 
                                                        
| 1756 | 1756 | print '<div id="error"></div>';  | 
                                                        
@@ -1816,7 +1816,7 @@ discard block  | 
                                                    ||
| 1816 | 1816 | unset($_COOKIE['install']);  | 
                                                        
| 1817 | 1817 | print '<div class="info column"><ul>';  | 
                                                        
| 1818 | 1818 |  	foreach ($_SESSION['done'] as $done) { | 
                                                        
| 1819 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>';  | 
                                                        |
| 1819 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>';  | 
                                                        |
| 1820 | 1820 | }  | 
                                                        
| 1821 | 1821 | print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>';  | 
                                                        
| 1822 | 1822 | print '</ul></div>';  | 
                                                        
@@ -22,7 +22,7 @@ discard block  | 
                                                    ||
| 22 | 22 | require_once(dirname(__FILE__).'/class.create_db.php');  | 
                                                        
| 23 | 23 | require_once(dirname(__FILE__).'/class.update_schema.php');  | 
                                                        
| 24 | 24 | require_once(dirname(__FILE__).'/class.settings.php');  | 
                                                        
| 25 | -$title="Install";  | 
                                                        |
| 25 | +$title = "Install";  | 
                                                        |
| 26 | 26 | require(dirname(__FILE__).'/../require/settings.php');  | 
                                                        
| 27 | 27 | require_once(dirname(__FILE__).'/../require/class.Common.php');  | 
                                                        
| 28 | 28 | require(dirname(__FILE__).'/header.php');  | 
                                                        
@@ -95,8 +95,8 @@ discard block  | 
                                                    ||
| 95 | 95 |  	if (!extension_loaded('curl')) { | 
                                                        
| 96 | 96 | $error[] = "Curl is not loaded.";  | 
                                                        
| 97 | 97 | }  | 
                                                        
| 98 | -	if(function_exists('apache_get_modules') ){ | 
                                                        |
| 99 | -		if(!in_array('mod_rewrite',apache_get_modules())) { | 
                                                        |
| 98 | +	if (function_exists('apache_get_modules')) { | 
                                                        |
| 99 | +		if (!in_array('mod_rewrite', apache_get_modules())) { | 
                                                        |
| 100 | 100 | $error[] = "mod_rewrite is not available.";  | 
                                                        
| 101 | 101 | }  | 
                                                        
| 102 | 102 | /*  | 
                                                        
@@ -112,8 +112,8 @@ discard block  | 
                                                    ||
| 112 | 112 | print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>';  | 
                                                        
| 113 | 113 |  	if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { | 
                                                        
| 114 | 114 |  		if (function_exists('get_headers')) { | 
                                                        
| 115 | -			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); | 
                                                        |
| 116 | -			if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { | 
                                                        |
| 115 | +			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); | 
                                                        |
| 116 | +			if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { | 
                                                        |
| 117 | 117 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>';  | 
                                                        
| 118 | 118 | }  | 
                                                        
| 119 | 119 | }  | 
                                                        
@@ -192,7 +192,7 @@ discard block  | 
                                                    ||
| 192 | 192 |  				    if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) { | 
                                                        
| 193 | 193 |  					if (isset($_SERVER['REQUEST_URI'])) { | 
                                                        
| 194 | 194 | $URL = $_SERVER['REQUEST_URI'];  | 
                                                        
| 195 | -						$globalURL = str_replace('/install','',str_replace('/install/','',str_replace('/install/index.php','',$URL))); | 
                                                        |
| 195 | +						$globalURL = str_replace('/install', '', str_replace('/install/', '', str_replace('/install/index.php', '', $URL))); | 
                                                        |
| 196 | 196 | }  | 
                                                        
| 197 | 197 | }  | 
                                                        
| 198 | 198 | ?>  | 
                                                        
@@ -515,13 +515,13 @@ discard block  | 
                                                    ||
| 515 | 515 | ?>  | 
                                                        
| 516 | 516 | <tr>  | 
                                                        
| 517 | 517 | <?php  | 
                                                        
| 518 | -								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) { | 
                                                        |
| 518 | +								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) { | 
                                                        |
| 519 | 519 | ?>  | 
                                                        
| 520 | 520 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>  | 
                                                        
| 521 | 521 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>  | 
                                                        
| 522 | 522 | <?php  | 
                                                        
| 523 | 523 |  								    } else { | 
                                                        
| 524 | -									$hostport = explode(':',$source['host']); | 
                                                        |
| 524 | +									$hostport = explode(':', $source['host']); | 
                                                        |
| 525 | 525 |  									if (isset($hostport[1])) { | 
                                                        
| 526 | 526 | $host = $hostport[0];  | 
                                                        
| 527 | 527 | $port = $hostport[1];  | 
                                                        
@@ -570,7 +570,7 @@ discard block  | 
                                                    ||
| 570 | 570 | <select name="timezones[]" id="timezones">  | 
                                                        
| 571 | 571 | <?php  | 
                                                        
| 572 | 572 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);  | 
                                                        
| 573 | -									foreach($timezonelist as $timezones){ | 
                                                        |
| 573 | +									foreach ($timezonelist as $timezones) { | 
                                                        |
| 574 | 574 |  										if (isset($source['timezone']) && $source['timezone'] == $timezones) { | 
                                                        
| 575 | 575 | print '<option selected>'.$timezones.'</option>';  | 
                                                        
| 576 | 576 |  										} elseif (!isset($source['timezone']) && $timezones == 'UTC') { | 
                                                        
@@ -624,7 +624,7 @@ discard block  | 
                                                    ||
| 624 | 624 | <select name="timezones[]" id="timezones">  | 
                                                        
| 625 | 625 | <?php  | 
                                                        
| 626 | 626 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);  | 
                                                        
| 627 | -									foreach($timezonelist as $timezones){ | 
                                                        |
| 627 | +									foreach ($timezonelist as $timezones) { | 
                                                        |
| 628 | 628 |  										if ($timezones == 'UTC') { | 
                                                        
| 629 | 629 | print '<option selected>'.$timezones.'</option>';  | 
                                                        
| 630 | 630 | } else print '<option>'.$timezones.'</option>';  | 
                                                        
@@ -1076,7 +1076,7 @@ discard block  | 
                                                    ||
| 1076 | 1076 | <br />  | 
                                                        
| 1077 | 1077 | <p>  | 
                                                        
| 1078 | 1078 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>  | 
                                                        
| 1079 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />  | 
                                                        |
| 1079 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />  | 
                                                        |
| 1080 | 1080 | </p>  | 
                                                        
| 1081 | 1081 | <br />  | 
                                                        
| 1082 | 1082 | <p>  | 
                                                        
@@ -1138,14 +1138,14 @@ discard block  | 
                                                    ||
| 1138 | 1138 | $error = '';  | 
                                                        
| 1139 | 1139 | |
| 1140 | 1140 |  if (isset($_POST['dbtype'])) { | 
                                                        
| 1141 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1142 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1143 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1144 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1145 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1146 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1147 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1148 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1141 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1142 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1143 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1144 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1145 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1146 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1147 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1148 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1149 | 1149 | |
| 1150 | 1150 |  	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; | 
                                                        
| 1151 | 1151 |  	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; | 
                                                        
@@ -1165,49 +1165,49 @@ discard block  | 
                                                    ||
| 1165 | 1165 |  	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); | 
                                                        
| 1166 | 1166 | */  | 
                                                        
| 1167 | 1167 | |
| 1168 | -	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); | 
                                                        |
| 1168 | +	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); | 
                                                        |
| 1169 | 1169 | |
| 1170 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1171 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1172 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1173 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1174 | -	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); | 
                                                        |
| 1170 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1171 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1172 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1173 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1174 | +	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); | 
                                                        |
| 1175 | 1175 | |
| 1176 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1177 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1178 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1179 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1180 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1181 | - $openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1182 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1183 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1184 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1185 | -	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey)); | 
                                                        |
| 1176 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1177 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1178 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1179 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1180 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1181 | + $openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1182 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1183 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1184 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1185 | +	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey)); | 
                                                        |
| 1186 | 1186 | |
| 1187 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1188 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1189 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1190 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1191 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1192 | -	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); | 
                                                        |
| 1187 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1188 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1189 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1190 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1191 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1192 | +	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); | 
                                                        |
| 1193 | 1193 | |
| 1194 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1195 | -	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); | 
                                                        |
| 1194 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1195 | +	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); | 
                                                        |
| 1196 | 1196 | |
| 1197 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1198 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1199 | -	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); | 
                                                        |
| 1197 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1198 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1199 | +	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); | 
                                                        |
| 1200 | 1200 | |
| 1201 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1201 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1202 | 1202 |  	if ($acars == 'acars') { | 
                                                        
| 1203 | -		$settings = array_merge($settings,array('globalACARS' => 'TRUE')); | 
                                                        |
| 1203 | +		$settings = array_merge($settings, array('globalACARS' => 'TRUE')); | 
                                                        |
| 1204 | 1204 |  	} else { | 
                                                        
| 1205 | -		$settings = array_merge($settings,array('globalACARS' => 'FALSE')); | 
                                                        |
| 1205 | +		$settings = array_merge($settings, array('globalACARS' => 'FALSE')); | 
                                                        |
| 1206 | 1206 | }  | 
                                                        
| 1207 | 1207 | |
| 1208 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1209 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1210 | -	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); | 
                                                        |
| 1208 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1209 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1210 | +	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); | 
                                                        |
| 1211 | 1211 | |
| 1212 | 1212 | $source_name = $_POST['source_name'];  | 
                                                        
| 1213 | 1213 | $source_latitude = $_POST['source_latitude'];  | 
                                                        
@@ -1221,8 +1221,8 @@ discard block  | 
                                                    ||
| 1221 | 1221 | |
| 1222 | 1222 | $sources = array();  | 
                                                        
| 1223 | 1223 |  	foreach ($source_name as $keys => $name) { | 
                                                        
| 1224 | -	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); | 
                                                        |
| 1225 | -	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); | 
                                                        |
| 1224 | +	    if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]); | 
                                                        |
| 1225 | +	    else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]); | 
                                                        |
| 1226 | 1226 | }  | 
                                                        
| 1227 | 1227 | if (count($sources) > 0) $_SESSION['sources'] = $sources;  | 
                                                        
| 1228 | 1228 | |
@@ -1231,16 +1231,16 @@ discard block  | 
                                                    ||
| 1231 | 1231 | $newstype = $_POST['newstype'];  | 
                                                        
| 1232 | 1232 | |
| 1233 | 1233 | $newsfeeds = array();  | 
                                                        
| 1234 | -	foreach($newsurl as $newskey => $url) { | 
                                                        |
| 1234 | +	foreach ($newsurl as $newskey => $url) { | 
                                                        |
| 1235 | 1235 |  	    if ($url != '') { | 
                                                        
| 1236 | 1236 | $type = $newstype[$newskey];  | 
                                                        
| 1237 | 1237 | $lng = $newslng[$newskey];  | 
                                                        
| 1238 | 1238 |  		if (isset($newsfeeds[$type][$lng])) { | 
                                                        
| 1239 | - $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));  | 
                                                        |
| 1239 | + $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng], array($url));  | 
                                                        |
| 1240 | 1240 | } else $newsfeeds[$type][$lng] = array($url);  | 
                                                        
| 1241 | 1241 | }  | 
                                                        
| 1242 | 1242 | }  | 
                                                        
| 1243 | -	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds)); | 
                                                        |
| 1243 | +	$settings = array_merge($settings, array('globalNewsFeeds' => $newsfeeds)); | 
                                                        |
| 1244 | 1244 | |
| 1245 | 1245 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);  | 
                                                        
| 1246 | 1246 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        
@@ -1251,27 +1251,27 @@ discard block  | 
                                                    ||
| 1251 | 1251 | $sbsurl = $_POST['sbsurl'];  | 
                                                        
| 1252 | 1252 | */  | 
                                                        
| 1253 | 1253 | |
| 1254 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1255 | - $globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1256 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1257 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1258 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1259 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1260 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1261 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1254 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1255 | + $globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1256 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1257 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1258 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1259 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1260 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1261 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1262 | 1262 | |
| 1263 | - $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1264 | -	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); | 
                                                        |
| 1265 | -	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); | 
                                                        |
| 1266 | - $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1267 | -	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); | 
                                                        |
| 1268 | -	else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); | 
                                                        |
| 1269 | - $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1270 | -	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); | 
                                                        |
| 1271 | -	else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); | 
                                                        |
| 1272 | - $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1273 | -	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); | 
                                                        |
| 1274 | -	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); | 
                                                        |
| 1263 | + $globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1264 | +	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE')); | 
                                                        |
| 1265 | +	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE')); | 
                                                        |
| 1266 | + $globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1267 | +	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE')); | 
                                                        |
| 1268 | +	else $settings = array_merge($settings, array('globalTracker' => 'FALSE')); | 
                                                        |
| 1269 | + $globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1270 | +	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE')); | 
                                                        |
| 1271 | +	else $settings = array_merge($settings, array('globalMarine' => 'FALSE')); | 
                                                        |
| 1272 | + $globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1273 | +	if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE')); | 
                                                        |
| 1274 | +	else $settings = array_merge($settings, array('globalSatellite' => 'FALSE')); | 
                                                        |
| 1275 | 1275 | |
| 1276 | 1276 | /*  | 
                                                        
| 1277 | 1277 | $globalSBS1Hosts = array();  | 
                                                        
@@ -1287,7 +1287,7 @@ discard block  | 
                                                    ||
| 1287 | 1287 | }  | 
                                                        
| 1288 | 1288 |  	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); | 
                                                        
| 1289 | 1289 | */  | 
                                                        
| 1290 | -	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); | 
                                                        |
| 1290 | +	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); | 
                                                        |
| 1291 | 1291 | $host = $_POST['host'];  | 
                                                        
| 1292 | 1292 | $port = $_POST['port'];  | 
                                                        
| 1293 | 1293 | $name = $_POST['name'];  | 
                                                        
@@ -1304,115 +1304,115 @@ discard block  | 
                                                    ||
| 1304 | 1304 | else $cov = 'FALSE';  | 
                                                        
| 1305 | 1305 | if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';  | 
                                                        
| 1306 | 1306 | else $arch = 'FALSE';  | 
                                                        
| 1307 | -		if (strpos($format[$key],'_callback')) { | 
                                                        |
| 1308 | -			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); | 
                                                        |
| 1307 | +		if (strpos($format[$key], '_callback')) { | 
                                                        |
| 1308 | +			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE'); | 
                                                        |
| 1309 | 1309 |  		} elseif ($h != '' || $name[$key] != '') { | 
                                                        
| 1310 | -			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); | 
                                                        |
| 1310 | +			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE'); | 
                                                        |
| 1311 | 1311 | }  | 
                                                        
| 1312 | 1312 | if ($format[$key] == 'airwhere') $forcepilots = true;  | 
                                                        
| 1313 | 1313 | }  | 
                                                        
| 1314 | -	$settings = array_merge($settings,array('globalSources' => $gSources)); | 
                                                        |
| 1314 | +	$settings = array_merge($settings, array('globalSources' => $gSources)); | 
                                                        |
| 1315 | 1315 | |
| 1316 | 1316 | /*  | 
                                                        
| 1317 | 1317 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        
| 1318 | 1318 |  	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); | 
                                                        
| 1319 | 1319 | */  | 
                                                        
| 1320 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1321 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1322 | -	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); | 
                                                        |
| 1320 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1321 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1322 | +	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); | 
                                                        |
| 1323 | 1323 | |
| 1324 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1325 | -	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); | 
                                                        |
| 1324 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1325 | +	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); | 
                                                        |
| 1326 | 1326 | |
| 1327 | - $customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1328 | -	$settings = array_merge($settings,array('globalCustomCSS' => $customcss)); | 
                                                        |
| 1327 | + $customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1328 | +	$settings = array_merge($settings, array('globalCustomCSS' => $customcss)); | 
                                                        |
| 1329 | 1329 | |
| 1330 | - $map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1331 | -	$settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile)); | 
                                                        |
| 1330 | + $map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1331 | +	$settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile)); | 
                                                        |
| 1332 | 1332 | |
| 1333 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1334 | -	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); | 
                                                        |
| 1335 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1336 | -	$settings = array_merge($settings,array('globalMETARurl' => $metarsource)); | 
                                                        |
| 1333 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1334 | +	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); | 
                                                        |
| 1335 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1336 | +	$settings = array_merge($settings, array('globalMETARurl' => $metarsource)); | 
                                                        |
| 1337 | 1337 | |
| 1338 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1339 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1340 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1338 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1339 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1340 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1341 | 1341 |  	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { | 
                                                        
| 1342 | -		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); | 
                                                        |
| 1343 | -	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); | 
                                                        |
| 1342 | +		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); | 
                                                        |
| 1343 | +	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); | 
                                                        |
| 1344 | 1344 | |
| 1345 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1346 | -	$settings = array_merge($settings,array('globalLiveInterval' => $refresh)); | 
                                                        |
| 1347 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1348 | -	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); | 
                                                        |
| 1349 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1350 | -	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); | 
                                                        |
| 1351 | - $minfetch = filter_input(INPUT_POST,'minfetch',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1352 | -	$settings = array_merge($settings,array('globalMinFetch' => $minfetch)); | 
                                                        |
| 1353 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1354 | -	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); | 
                                                        |
| 1345 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1346 | +	$settings = array_merge($settings, array('globalLiveInterval' => $refresh)); | 
                                                        |
| 1347 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1348 | +	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); | 
                                                        |
| 1349 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1350 | +	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); | 
                                                        |
| 1351 | + $minfetch = filter_input(INPUT_POST, 'minfetch', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1352 | +	$settings = array_merge($settings, array('globalMinFetch' => $minfetch)); | 
                                                        |
| 1353 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1354 | +	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); | 
                                                        |
| 1355 | 1355 | |
| 1356 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1357 | -	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); | 
                                                        |
| 1356 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1357 | +	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); | 
                                                        |
| 1358 | 1358 | |
| 1359 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1360 | -	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); | 
                                                        |
| 1359 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1360 | +	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); | 
                                                        |
| 1361 | 1361 | |
| 1362 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1362 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1363 | 1363 |  	if ($archiveyear == "archiveyear") { | 
                                                        
| 1364 | -		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); | 
                                                        |
| 1364 | +		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); | 
                                                        |
| 1365 | 1365 |  	} else { | 
                                                        
| 1366 | -		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); | 
                                                        |
| 1366 | +		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); | 
                                                        |
| 1367 | 1367 | }  | 
                                                        
| 1368 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1369 | -	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); | 
                                                        |
| 1370 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1371 | -	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); | 
                                                        |
| 1368 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1369 | +	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); | 
                                                        |
| 1370 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1371 | +	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); | 
                                                        |
| 1372 | 1372 | |
| 1373 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1374 | -	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); | 
                                                        |
| 1375 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1376 | -	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); | 
                                                        |
| 1373 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1374 | +	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); | 
                                                        |
| 1375 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1376 | +	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); | 
                                                        |
| 1377 | 1377 | |
| 1378 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1379 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1380 | -	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); | 
                                                        |
| 1378 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1379 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1380 | +	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); | 
                                                        |
| 1381 | 1381 | |
| 1382 | 1382 | // Create in settings.php keys not yet configurable if not already here  | 
                                                        
| 1383 | 1383 |  	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); | 
                                                        
| 1384 | -	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); | 
                                                        |
| 1384 | +	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); | 
                                                        |
| 1385 | 1385 | |
| 1386 | - $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1386 | + $resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1387 | 1387 |  	if ($resetyearstats == 'resetyearstats') { | 
                                                        
| 1388 | -		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE')); | 
                                                        |
| 1388 | +		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE')); | 
                                                        |
| 1389 | 1389 |  	} else { | 
                                                        
| 1390 | -		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE')); | 
                                                        |
| 1390 | +		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE')); | 
                                                        |
| 1391 | 1391 | }  | 
                                                        
| 1392 | 1392 | |
| 1393 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1393 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1394 | 1394 |  	if ($archive == 'archive') { | 
                                                        
| 1395 | -		$settings = array_merge($settings,array('globalArchive' => 'TRUE')); | 
                                                        |
| 1395 | +		$settings = array_merge($settings, array('globalArchive' => 'TRUE')); | 
                                                        |
| 1396 | 1396 |  	} else { | 
                                                        
| 1397 | -		$settings = array_merge($settings,array('globalArchive' => 'FALSE')); | 
                                                        |
| 1397 | +		$settings = array_merge($settings, array('globalArchive' => 'FALSE')); | 
                                                        |
| 1398 | 1398 | }  | 
                                                        
| 1399 | - $archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1399 | + $archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1400 | 1400 |  	if ($archiveresults == 'archiveresults') { | 
                                                        
| 1401 | -		$settings = array_merge($settings,array('globalArchiveResults' => 'TRUE')); | 
                                                        |
| 1401 | +		$settings = array_merge($settings, array('globalArchiveResults' => 'TRUE')); | 
                                                        |
| 1402 | 1402 |  	} else { | 
                                                        
| 1403 | -		$settings = array_merge($settings,array('globalArchiveResults' => 'FALSE')); | 
                                                        |
| 1403 | +		$settings = array_merge($settings, array('globalArchiveResults' => 'FALSE')); | 
                                                        |
| 1404 | 1404 | }  | 
                                                        
| 1405 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1405 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1406 | 1406 |  	if ($daemon == 'daemon') { | 
                                                        
| 1407 | -		$settings = array_merge($settings,array('globalDaemon' => 'TRUE')); | 
                                                        |
| 1407 | +		$settings = array_merge($settings, array('globalDaemon' => 'TRUE')); | 
                                                        |
| 1408 | 1408 |  	} else { | 
                                                        
| 1409 | -		$settings = array_merge($settings,array('globalDaemon' => 'FALSE')); | 
                                                        |
| 1409 | +		$settings = array_merge($settings, array('globalDaemon' => 'FALSE')); | 
                                                        |
| 1410 | 1410 | }  | 
                                                        
| 1411 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1411 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1412 | 1412 |  	if ($schedules == 'schedules') { | 
                                                        
| 1413 | -		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); | 
                                                        |
| 1413 | +		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); | 
                                                        |
| 1414 | 1414 |  	} else { | 
                                                        
| 1415 | -		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); | 
                                                        |
| 1415 | +		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); | 
                                                        |
| 1416 | 1416 | }  | 
                                                        
| 1417 | 1417 | |
| 1418 | 1418 | /*  | 
                                                        
@@ -1423,274 +1423,274 @@ discard block  | 
                                                    ||
| 1423 | 1423 |  		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); | 
                                                        
| 1424 | 1424 | }  | 
                                                        
| 1425 | 1425 | */  | 
                                                        
| 1426 | -	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); | 
                                                        |
| 1427 | -	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); | 
                                                        |
| 1428 | -	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); | 
                                                        |
| 1429 | -	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); | 
                                                        |
| 1430 | -	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); | 
                                                        |
| 1426 | +	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); | 
                                                        |
| 1427 | +	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); | 
                                                        |
| 1428 | +	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); | 
                                                        |
| 1429 | +	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); | 
                                                        |
| 1430 | +	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); | 
                                                        |
| 1431 | 1431 | $va = false;  | 
                                                        
| 1432 | 1432 |  	if ($globalivao == 'ivao') { | 
                                                        
| 1433 | -		$settings = array_merge($settings,array('globalIVAO' => 'TRUE')); | 
                                                        |
| 1433 | +		$settings = array_merge($settings, array('globalIVAO' => 'TRUE')); | 
                                                        |
| 1434 | 1434 | $va = true;  | 
                                                        
| 1435 | -	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); | 
                                                        |
| 1435 | +	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); | 
                                                        |
| 1436 | 1436 |  	if ($globalvatsim == 'vatsim') { | 
                                                        
| 1437 | -		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); | 
                                                        |
| 1437 | +		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); | 
                                                        |
| 1438 | 1438 | $va = true;  | 
                                                        
| 1439 | -	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); | 
                                                        |
| 1439 | +	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); | 
                                                        |
| 1440 | 1440 |  	if ($globalphpvms == 'phpvms') { | 
                                                        
| 1441 | -		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); | 
                                                        |
| 1441 | +		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); | 
                                                        |
| 1442 | 1442 | $va = true;  | 
                                                        
| 1443 | -	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); | 
                                                        |
| 1443 | +	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); | 
                                                        |
| 1444 | 1444 |  	if ($globalvam == 'vam') { | 
                                                        
| 1445 | -		$settings = array_merge($settings,array('globalVAM' => 'TRUE')); | 
                                                        |
| 1445 | +		$settings = array_merge($settings, array('globalVAM' => 'TRUE')); | 
                                                        |
| 1446 | 1446 | $va = true;  | 
                                                        
| 1447 | -	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); | 
                                                        |
| 1447 | +	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); | 
                                                        |
| 1448 | 1448 |  	if ($va) { | 
                                                        
| 1449 | -		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); | 
                                                        |
| 1450 | -	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); | 
                                                        |
| 1449 | +		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); | 
                                                        |
| 1450 | +	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); | 
                                                        |
| 1451 | 1451 |  	if ($globalva == 'va' || $va) { | 
                                                        
| 1452 | -		$settings = array_merge($settings,array('globalVA' => 'TRUE')); | 
                                                        |
| 1453 | -		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); | 
                                                        |
| 1452 | +		$settings = array_merge($settings, array('globalVA' => 'TRUE')); | 
                                                        |
| 1453 | +		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); | 
                                                        |
| 1454 | 1454 |  	} else { | 
                                                        
| 1455 | -		$settings = array_merge($settings,array('globalVA' => 'FALSE')); | 
                                                        |
| 1456 | -		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); | 
                                                        |
| 1457 | -		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); | 
                                                        |
| 1455 | +		$settings = array_merge($settings, array('globalVA' => 'FALSE')); | 
                                                        |
| 1456 | +		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); | 
                                                        |
| 1457 | +		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE')); | 
                                                        |
| 1458 | 1458 | }  | 
                                                        
| 1459 | 1459 | |
| 1460 | 1460 | |
| 1461 | - $mapoffline = filter_input(INPUT_POST,'mapoffline',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1461 | + $mapoffline = filter_input(INPUT_POST, 'mapoffline', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1462 | 1462 |  	if ($mapoffline == 'mapoffline') { | 
                                                        
| 1463 | -		$settings = array_merge($settings,array('globalMapOffline' => 'TRUE')); | 
                                                        |
| 1463 | +		$settings = array_merge($settings, array('globalMapOffline' => 'TRUE')); | 
                                                        |
| 1464 | 1464 |  	} else { | 
                                                        
| 1465 | -		$settings = array_merge($settings,array('globalMapOffline' => 'FALSE')); | 
                                                        |
| 1465 | +		$settings = array_merge($settings, array('globalMapOffline' => 'FALSE')); | 
                                                        |
| 1466 | 1466 | }  | 
                                                        
| 1467 | - $globaloffline = filter_input(INPUT_POST,'globaloffline',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1467 | + $globaloffline = filter_input(INPUT_POST, 'globaloffline', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1468 | 1468 |  	if ($globaloffline == 'globaloffline') { | 
                                                        
| 1469 | -		$settings = array_merge($settings,array('globalOffline' => 'TRUE')); | 
                                                        |
| 1469 | +		$settings = array_merge($settings, array('globalOffline' => 'TRUE')); | 
                                                        |
| 1470 | 1470 |  	} else { | 
                                                        
| 1471 | -		$settings = array_merge($settings,array('globalOffline' => 'FALSE')); | 
                                                        |
| 1471 | +		$settings = array_merge($settings, array('globalOffline' => 'FALSE')); | 
                                                        |
| 1472 | 1472 | }  | 
                                                        
| 1473 | 1473 | |
| 1474 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1474 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1475 | 1475 |  	if ($notam == 'notam') { | 
                                                        
| 1476 | -		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); | 
                                                        |
| 1476 | +		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); | 
                                                        |
| 1477 | 1477 |  	} else { | 
                                                        
| 1478 | -		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); | 
                                                        |
| 1478 | +		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); | 
                                                        |
| 1479 | 1479 | }  | 
                                                        
| 1480 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1480 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1481 | 1481 |  	if ($owner == 'owner') { | 
                                                        
| 1482 | -		$settings = array_merge($settings,array('globalOwner' => 'TRUE')); | 
                                                        |
| 1482 | +		$settings = array_merge($settings, array('globalOwner' => 'TRUE')); | 
                                                        |
| 1483 | 1483 |  	} else { | 
                                                        
| 1484 | -		$settings = array_merge($settings,array('globalOwner' => 'FALSE')); | 
                                                        |
| 1484 | +		$settings = array_merge($settings, array('globalOwner' => 'FALSE')); | 
                                                        |
| 1485 | 1485 | }  | 
                                                        
| 1486 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1486 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1487 | 1487 |  	if ($map3d == 'map3d') { | 
                                                        
| 1488 | -		$settings = array_merge($settings,array('globalMap3D' => 'TRUE')); | 
                                                        |
| 1488 | +		$settings = array_merge($settings, array('globalMap3D' => 'TRUE')); | 
                                                        |
| 1489 | 1489 |  	} else { | 
                                                        
| 1490 | -		$settings = array_merge($settings,array('globalMap3D' => 'FALSE')); | 
                                                        |
| 1490 | +		$settings = array_merge($settings, array('globalMap3D' => 'FALSE')); | 
                                                        |
| 1491 | 1491 | }  | 
                                                        
| 1492 | - $crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1492 | + $crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1493 | 1493 |  	if ($crash == 'crash') { | 
                                                        
| 1494 | -		$settings = array_merge($settings,array('globalAccidents' => 'TRUE')); | 
                                                        |
| 1494 | +		$settings = array_merge($settings, array('globalAccidents' => 'TRUE')); | 
                                                        |
| 1495 | 1495 |  	} else { | 
                                                        
| 1496 | -		$settings = array_merge($settings,array('globalAccidents' => 'FALSE')); | 
                                                        |
| 1496 | +		$settings = array_merge($settings, array('globalAccidents' => 'FALSE')); | 
                                                        |
| 1497 | 1497 | }  | 
                                                        
| 1498 | - $fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1498 | + $fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1499 | 1499 |  	if ($fires == 'fires') { | 
                                                        
| 1500 | -		$settings = array_merge($settings,array('globalMapFires' => 'TRUE')); | 
                                                        |
| 1500 | +		$settings = array_merge($settings, array('globalMapFires' => 'TRUE')); | 
                                                        |
| 1501 | 1501 |  	} else { | 
                                                        
| 1502 | -		$settings = array_merge($settings,array('globalMapFires' => 'FALSE')); | 
                                                        |
| 1502 | +		$settings = array_merge($settings, array('globalMapFires' => 'FALSE')); | 
                                                        |
| 1503 | 1503 | }  | 
                                                        
| 1504 | - $firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1504 | + $firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1505 | 1505 |  	if ($firessupport == 'firessupport') { | 
                                                        
| 1506 | -		$settings = array_merge($settings,array('globalFires' => 'TRUE')); | 
                                                        |
| 1506 | +		$settings = array_merge($settings, array('globalFires' => 'TRUE')); | 
                                                        |
| 1507 | 1507 |  	} else { | 
                                                        
| 1508 | -		$settings = array_merge($settings,array('globalFires' => 'FALSE')); | 
                                                        |
| 1508 | +		$settings = array_merge($settings, array('globalFires' => 'FALSE')); | 
                                                        |
| 1509 | 1509 | }  | 
                                                        
| 1510 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1510 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1511 | 1511 |  	if ($mapsatellites == 'mapsatellites') { | 
                                                        
| 1512 | -		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); | 
                                                        |
| 1512 | +		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); | 
                                                        |
| 1513 | 1513 |  	} else { | 
                                                        
| 1514 | -		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); | 
                                                        |
| 1514 | +		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); | 
                                                        |
| 1515 | 1515 | }  | 
                                                        
| 1516 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1516 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1517 | 1517 |  	if ($map3ddefault == 'map3ddefault') { | 
                                                        
| 1518 | -		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); | 
                                                        |
| 1518 | +		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); | 
                                                        |
| 1519 | 1519 |  	} else { | 
                                                        
| 1520 | -		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); | 
                                                        |
| 1520 | +		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); | 
                                                        |
| 1521 | 1521 | }  | 
                                                        
| 1522 | - $map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1522 | + $map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1523 | 1523 |  	if ($map3dliveries == 'map3dliveries') { | 
                                                        
| 1524 | -		$settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE')); | 
                                                        |
| 1524 | +		$settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE')); | 
                                                        |
| 1525 | 1525 |  	} else { | 
                                                        
| 1526 | -		$settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE')); | 
                                                        |
| 1526 | +		$settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE')); | 
                                                        |
| 1527 | 1527 | }  | 
                                                        
| 1528 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1528 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1529 | 1529 |  	if ($translate == 'translate') { | 
                                                        
| 1530 | -		$settings = array_merge($settings,array('globalTranslate' => 'TRUE')); | 
                                                        |
| 1530 | +		$settings = array_merge($settings, array('globalTranslate' => 'TRUE')); | 
                                                        |
| 1531 | 1531 |  	} else { | 
                                                        
| 1532 | -		$settings = array_merge($settings,array('globalTranslate' => 'FALSE')); | 
                                                        |
| 1532 | +		$settings = array_merge($settings, array('globalTranslate' => 'FALSE')); | 
                                                        |
| 1533 | 1533 | }  | 
                                                        
| 1534 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1534 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1535 | 1535 |  	if ($realairlines == 'realairlines') { | 
                                                        
| 1536 | -		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); | 
                                                        |
| 1536 | +		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); | 
                                                        |
| 1537 | 1537 |  	} else { | 
                                                        
| 1538 | -		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); | 
                                                        |
| 1538 | +		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); | 
                                                        |
| 1539 | 1539 | }  | 
                                                        
| 1540 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1540 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1541 | 1541 |  	if ($estimation == 'estimation') { | 
                                                        
| 1542 | -		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); | 
                                                        |
| 1542 | +		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); | 
                                                        |
| 1543 | 1543 |  	} else { | 
                                                        
| 1544 | -		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); | 
                                                        |
| 1544 | +		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); | 
                                                        |
| 1545 | 1545 | }  | 
                                                        
| 1546 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1546 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1547 | 1547 |  	if ($metar == 'metar') { | 
                                                        
| 1548 | -		$settings = array_merge($settings,array('globalMETAR' => 'TRUE')); | 
                                                        |
| 1548 | +		$settings = array_merge($settings, array('globalMETAR' => 'TRUE')); | 
                                                        |
| 1549 | 1549 |  	} else { | 
                                                        
| 1550 | -		$settings = array_merge($settings,array('globalMETAR' => 'FALSE')); | 
                                                        |
| 1550 | +		$settings = array_merge($settings, array('globalMETAR' => 'FALSE')); | 
                                                        |
| 1551 | 1551 | }  | 
                                                        
| 1552 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1552 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1553 | 1553 |  	if ($metarcycle == 'metarcycle') { | 
                                                        
| 1554 | -		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); | 
                                                        |
| 1554 | +		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); | 
                                                        |
| 1555 | 1555 |  	} else { | 
                                                        
| 1556 | -		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); | 
                                                        |
| 1556 | +		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); | 
                                                        |
| 1557 | 1557 | }  | 
                                                        
| 1558 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1558 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1559 | 1559 |  	if ($fork == 'fork') { | 
                                                        
| 1560 | -		$settings = array_merge($settings,array('globalFork' => 'TRUE')); | 
                                                        |
| 1560 | +		$settings = array_merge($settings, array('globalFork' => 'TRUE')); | 
                                                        |
| 1561 | 1561 |  	} else { | 
                                                        
| 1562 | -		$settings = array_merge($settings,array('globalFork' => 'FALSE')); | 
                                                        |
| 1562 | +		$settings = array_merge($settings, array('globalFork' => 'FALSE')); | 
                                                        |
| 1563 | 1563 | }  | 
                                                        
| 1564 | 1564 | |
| 1565 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1565 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1566 | 1566 |  	if ($colormap == 'colormap') { | 
                                                        
| 1567 | -		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); | 
                                                        |
| 1567 | +		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); | 
                                                        |
| 1568 | 1568 |  	} else { | 
                                                        
| 1569 | -		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); | 
                                                        |
| 1569 | +		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); | 
                                                        |
| 1570 | 1570 | }  | 
                                                        
| 1571 | 1571 | |
| 1572 | 1572 |  	if (isset($_POST['aircrafticoncolor'])) { | 
                                                        
| 1573 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1574 | -		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); | 
                                                        |
| 1573 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1574 | +		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); | 
                                                        |
| 1575 | 1575 | }  | 
                                                        
| 1576 | 1576 | |
| 1577 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1578 | -	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); | 
                                                        |
| 1577 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 1578 | +	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); | 
                                                        |
| 1579 | 1579 | |
| 1580 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1581 | -	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); | 
                                                        |
| 1582 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1583 | -	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); | 
                                                        |
| 1584 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1585 | -	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); | 
                                                        |
| 1580 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1581 | +	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); | 
                                                        |
| 1582 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1583 | +	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); | 
                                                        |
| 1584 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1585 | +	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); | 
                                                        |
| 1586 | 1586 | |
| 1587 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1587 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1588 | 1588 |  	if ($mappopup == 'mappopup') { | 
                                                        
| 1589 | -		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); | 
                                                        |
| 1589 | +		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); | 
                                                        |
| 1590 | 1590 |  	} else { | 
                                                        
| 1591 | -		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); | 
                                                        |
| 1591 | +		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); | 
                                                        |
| 1592 | 1592 | }  | 
                                                        
| 1593 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1593 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1594 | 1594 |  	if ($airportpopup == 'airportpopup') { | 
                                                        
| 1595 | -		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); | 
                                                        |
| 1595 | +		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); | 
                                                        |
| 1596 | 1596 |  	} else { | 
                                                        
| 1597 | -		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); | 
                                                        |
| 1597 | +		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); | 
                                                        |
| 1598 | 1598 | }  | 
                                                        
| 1599 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1599 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1600 | 1600 |  	if ($maphistory == 'maphistory') { | 
                                                        
| 1601 | -		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); | 
                                                        |
| 1601 | +		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); | 
                                                        |
| 1602 | 1602 |  	} else { | 
                                                        
| 1603 | -		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); | 
                                                        |
| 1603 | +		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); | 
                                                        |
| 1604 | 1604 | }  | 
                                                        
| 1605 | - $maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1605 | + $maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1606 | 1606 |  	if ($maptooltip == 'maptooltip') { | 
                                                        
| 1607 | -		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE')); | 
                                                        |
| 1607 | +		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE')); | 
                                                        |
| 1608 | 1608 |  	} else { | 
                                                        
| 1609 | -		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE')); | 
                                                        |
| 1609 | +		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE')); | 
                                                        |
| 1610 | 1610 | }  | 
                                                        
| 1611 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1611 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1612 | 1612 |  	if ($flightroute == 'flightroute') { | 
                                                        
| 1613 | -		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); | 
                                                        |
| 1613 | +		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); | 
                                                        |
| 1614 | 1614 |  	} else { | 
                                                        
| 1615 | -		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); | 
                                                        |
| 1615 | +		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); | 
                                                        |
| 1616 | 1616 | }  | 
                                                        
| 1617 | - $flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1617 | + $flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1618 | 1618 |  	if ($flightremainingroute == 'flightremainingroute') { | 
                                                        
| 1619 | -		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE')); | 
                                                        |
| 1619 | +		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE')); | 
                                                        |
| 1620 | 1620 |  	} else { | 
                                                        
| 1621 | -		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE')); | 
                                                        |
| 1621 | +		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE')); | 
                                                        |
| 1622 | 1622 | }  | 
                                                        
| 1623 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1623 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1624 | 1624 |  	if ($allflights == 'allflights') { | 
                                                        
| 1625 | -		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); | 
                                                        |
| 1625 | +		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); | 
                                                        |
| 1626 | 1626 |  	} else { | 
                                                        
| 1627 | -		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); | 
                                                        |
| 1627 | +		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); | 
                                                        |
| 1628 | 1628 | }  | 
                                                        
| 1629 | - $bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1629 | + $bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1630 | 1630 |  	if ($bbox == 'bbox') { | 
                                                        
| 1631 | -		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE')); | 
                                                        |
| 1631 | +		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE')); | 
                                                        |
| 1632 | 1632 |  	} else { | 
                                                        
| 1633 | -		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE')); | 
                                                        |
| 1633 | +		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE')); | 
                                                        |
| 1634 | 1634 | }  | 
                                                        
| 1635 | - $groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1635 | + $groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1636 | 1636 |  	if ($groundaltitude == 'groundaltitude') { | 
                                                        
| 1637 | -		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE')); | 
                                                        |
| 1637 | +		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE')); | 
                                                        |
| 1638 | 1638 |  	} else { | 
                                                        
| 1639 | -		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE')); | 
                                                        |
| 1639 | +		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE')); | 
                                                        |
| 1640 | 1640 | }  | 
                                                        
| 1641 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1641 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1642 | 1642 |  	if ($waypoints == 'waypoints') { | 
                                                        
| 1643 | -		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); | 
                                                        |
| 1643 | +		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); | 
                                                        |
| 1644 | 1644 |  	} else { | 
                                                        
| 1645 | -		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); | 
                                                        |
| 1645 | +		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); | 
                                                        |
| 1646 | 1646 | }  | 
                                                        
| 1647 | - $geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1647 | + $geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1648 | 1648 |  	if ($geoid == 'geoid') { | 
                                                        
| 1649 | -		$settings = array_merge($settings,array('globalGeoid' => 'TRUE')); | 
                                                        |
| 1649 | +		$settings = array_merge($settings, array('globalGeoid' => 'TRUE')); | 
                                                        |
| 1650 | 1650 |  	} else { | 
                                                        
| 1651 | -		$settings = array_merge($settings,array('globalGeoid' => 'FALSE')); | 
                                                        |
| 1651 | +		$settings = array_merge($settings, array('globalGeoid' => 'FALSE')); | 
                                                        |
| 1652 | 1652 | }  | 
                                                        
| 1653 | - $geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1654 | -	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source)); | 
                                                        |
| 1653 | + $geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1654 | +	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source)); | 
                                                        |
| 1655 | 1655 | |
| 1656 | - $noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1656 | + $noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1657 | 1657 |  	if ($noairlines == 'noairlines') { | 
                                                        
| 1658 | -		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE')); | 
                                                        |
| 1658 | +		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE')); | 
                                                        |
| 1659 | 1659 |  	} else { | 
                                                        
| 1660 | -		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); | 
                                                        |
| 1660 | +		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE')); | 
                                                        |
| 1661 | 1661 | }  | 
                                                        
| 1662 | 1662 | |
| 1663 | - $tsk = filter_input(INPUT_POST,'tsk',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1663 | + $tsk = filter_input(INPUT_POST, 'tsk', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1664 | 1664 |  	if ($tsk == 'tsk') { | 
                                                        
| 1665 | -		$settings = array_merge($settings,array('globalTSK' => 'TRUE')); | 
                                                        |
| 1665 | +		$settings = array_merge($settings, array('globalTSK' => 'TRUE')); | 
                                                        |
| 1666 | 1666 |  	} else { | 
                                                        
| 1667 | -		$settings = array_merge($settings,array('globalTSK' => 'FALSE')); | 
                                                        |
| 1667 | +		$settings = array_merge($settings, array('globalTSK' => 'FALSE')); | 
                                                        |
| 1668 | 1668 | }  | 
                                                        
| 1669 | - $mapmatching = filter_input(INPUT_POST,'mapmatching',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1669 | + $mapmatching = filter_input(INPUT_POST, 'mapmatching', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1670 | 1670 |  	if ($mapmatching == 'mapmatching') { | 
                                                        
| 1671 | -		$settings = array_merge($settings,array('globalMapMatching' => 'TRUE')); | 
                                                        |
| 1671 | +		$settings = array_merge($settings, array('globalMapMatching' => 'TRUE')); | 
                                                        |
| 1672 | 1672 |  	} else { | 
                                                        
| 1673 | -		$settings = array_merge($settings,array('globalMapMatching' => 'FALSE')); | 
                                                        |
| 1673 | +		$settings = array_merge($settings, array('globalMapMatching' => 'FALSE')); | 
                                                        |
| 1674 | 1674 | }  | 
                                                        
| 1675 | - $mapmatchingsource = filter_input(INPUT_POST,'mapmatchingsource',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1676 | -	$settings = array_merge($settings,array('globalMapMatchingSource' => $mapmatchingsource)); | 
                                                        |
| 1677 | - $graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);  | 
                                                        |
| 1678 | -	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper)); | 
                                                        |
| 1675 | + $mapmatchingsource = filter_input(INPUT_POST, 'mapmatchingsource', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1676 | +	$settings = array_merge($settings, array('globalMapMatchingSource' => $mapmatchingsource)); | 
                                                        |
| 1677 | + $graphhopper = filter_input(INPUT_POST, 'graphhopper', FILTER_SANITIZE_STRING);  | 
                                                        |
| 1678 | +	$settings = array_merge($settings, array('globalGraphHopperKey' => $graphhopper)); | 
                                                        |
| 1679 | 1679 | |
| 1680 | -	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); | 
                                                        |
| 1680 | +	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); | 
                                                        |
| 1681 | 1681 | |
| 1682 | 1682 | // Set some defaults values...  | 
                                                        
| 1683 | 1683 |  	if (!isset($globalAircraftImageSources)) { | 
                                                        
| 1684 | -	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); | 
                                                        |
| 1685 | -	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); | 
                                                        |
| 1684 | +	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); | 
                                                        |
| 1685 | +	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); | 
                                                        |
| 1686 | 1686 | }  | 
                                                        
| 1687 | 1687 | |
| 1688 | 1688 |  	if (!isset($globalSchedulesSources)) { | 
                                                        
| 1689 | -	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); | 
                                                        |
| 1690 | -    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); | 
                                                        |
| 1689 | +	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); | 
                                                        |
| 1690 | +    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); | 
                                                        |
| 1691 | 1691 | }  | 
                                                        
| 1692 | 1692 | |
| 1693 | -	$settings = array_merge($settings,array('globalInstalled' => 'TRUE')); | 
                                                        |
| 1693 | +	$settings = array_merge($settings, array('globalInstalled' => 'TRUE')); | 
                                                        |
| 1694 | 1694 | |
| 1695 | 1695 | if ($error == '') settings::modify_settings($settings);  | 
                                                        
| 1696 | 1696 | if ($error == '') settings::comment_settings($settings_comment);  | 
                                                        
@@ -13,23 +13,23 @@ discard block  | 
                                                    ||
| 13 | 13 | $marine = false;  | 
                                                        
| 14 | 14 | $usecoord = false;  | 
                                                        
| 15 | 15 |  if (isset($_GET['tracker'])) { | 
                                                        
| 16 | - $tracker = true;  | 
                                                        |
| 16 | + $tracker = true;  | 
                                                        |
| 17 | 17 | }  | 
                                                        
| 18 | 18 |  if (isset($_GET['marine'])) { | 
                                                        
| 19 | - $marine = true;  | 
                                                        |
| 19 | + $marine = true;  | 
                                                        |
| 20 | 20 | }  | 
                                                        
| 21 | 21 |  if ($tracker) { | 
                                                        
| 22 | -    require_once('require/class.Tracker.php'); | 
                                                        |
| 23 | -    require_once('require/class.TrackerLive.php'); | 
                                                        |
| 24 | -    require_once('require/class.TrackerArchive.php'); | 
                                                        |
| 22 | +	require_once('require/class.Tracker.php'); | 
                                                        |
| 23 | +	require_once('require/class.TrackerLive.php'); | 
                                                        |
| 24 | +	require_once('require/class.TrackerArchive.php'); | 
                                                        |
| 25 | 25 |  } elseif ($marine) { | 
                                                        
| 26 | -    require_once('require/class.Marine.php'); | 
                                                        |
| 27 | -    require_once('require/class.MarineLive.php'); | 
                                                        |
| 28 | -    require_once('require/class.MarineArchive.php'); | 
                                                        |
| 26 | +	require_once('require/class.Marine.php'); | 
                                                        |
| 27 | +	require_once('require/class.MarineLive.php'); | 
                                                        |
| 28 | +	require_once('require/class.MarineArchive.php'); | 
                                                        |
| 29 | 29 |  } else { | 
                                                        
| 30 | -    require_once('require/class.Spotter.php'); | 
                                                        |
| 31 | -    require_once('require/class.SpotterLive.php'); | 
                                                        |
| 32 | -    require_once('require/class.SpotterArchive.php'); | 
                                                        |
| 30 | +	require_once('require/class.Spotter.php'); | 
                                                        |
| 31 | +	require_once('require/class.SpotterLive.php'); | 
                                                        |
| 32 | +	require_once('require/class.SpotterArchive.php'); | 
                                                        |
| 33 | 33 | }  | 
                                                        
| 34 | 34 | |
| 35 | 35 | $begintime = microtime(true);  | 
                                                        
@@ -49,10 +49,10 @@ discard block  | 
                                                    ||
| 49 | 49 | $Common = new Common();  | 
                                                        
| 50 | 50 | |
| 51 | 51 |  if (isset($_GET['download'])) { | 
                                                        
| 52 | - if ($_GET['download'] == "true")  | 
                                                        |
| 53 | -    { | 
                                                        |
| 52 | + if ($_GET['download'] == "true")  | 
                                                        |
| 53 | +	{ | 
                                                        |
| 54 | 54 |  	header('Content-disposition: attachment; filename="flightairmap.json"'); | 
                                                        
| 55 | - }  | 
                                                        |
| 55 | + }  | 
                                                        |
| 56 | 56 | }  | 
                                                        
| 57 | 57 |  header('Content-Type: text/javascript'); | 
                                                        
| 58 | 58 | |
@@ -130,7 +130,7 @@ discard block  | 
                                                    ||
| 130 | 130 | $usecoord = true;  | 
                                                        
| 131 | 131 |  	$coord = explode(',',$_GET['coord']); | 
                                                        
| 132 | 132 | if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT)  | 
                                                        
| 133 | -	    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { | 
                                                        |
| 133 | +		&& $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { | 
                                                        |
| 134 | 134 |  		if ($tracker) { | 
                                                        
| 135 | 135 | $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);  | 
                                                        
| 136 | 136 |  		} elseif ($marine) { | 
                                                        
@@ -634,17 +634,17 @@ discard block  | 
                                                    ||
| 634 | 634 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];  | 
                                                        
| 635 | 635 | |
| 636 | 636 | if (  | 
                                                        
| 637 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')  | 
                                                        |
| 638 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)  | 
                                                        |
| 637 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')  | 
                                                        |
| 638 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)  | 
                                                        |
| 639 | 639 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))  | 
                                                        
| 640 | 640 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])  | 
                                                        
| 641 | -				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) | 
                                                        |
| 642 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])  | 
                                                        |
| 643 | -				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) | 
                                                        |
| 644 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])  | 
                                                        |
| 645 | -				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) | 
                                                        |
| 646 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])  | 
                                                        |
| 647 | -				    ) { | 
                                                        |
| 641 | +					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) | 
                                                        |
| 642 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])  | 
                                                        |
| 643 | +					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) | 
                                                        |
| 644 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])  | 
                                                        |
| 645 | +					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) | 
                                                        |
| 646 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])  | 
                                                        |
| 647 | +					) { | 
                                                        |
| 648 | 648 |  					if ($tracker) { | 
                                                        
| 649 | 649 |  						if ($from_archive || $globalArchive) { | 
                                                        
| 650 | 650 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']);  | 
                                                        
@@ -652,7 +652,7 @@ discard block  | 
                                                    ||
| 652 | 652 | $spotter_history_array = $TrackerLive->getAllLiveTrackerDataById($spotter_item['famtrackid']);  | 
                                                        
| 653 | 653 | }  | 
                                                        
| 654 | 654 | if ($globalMapMatching === TRUE && isset($_GET['zoom']) && $_GET['zoom'] > 12 &&  | 
                                                        
| 655 | - isset($spotter_item['type']) && (  | 
                                                        |
| 655 | + isset($spotter_item['type']) && (  | 
                                                        |
| 656 | 656 | $spotter_item['type'] == 'Firetruck' ||  | 
                                                        
| 657 | 657 | $spotter_item['type'] == 'Ambulance' ||  | 
                                                        
| 658 | 658 | $spotter_item['type'] == 'Truck (18 Wheeler)' ||  | 
                                                        
@@ -664,7 +664,7 @@ discard block  | 
                                                    ||
| 664 | 664 | $spotter_item['type'] == 'Jeep' ||  | 
                                                        
| 665 | 665 | $spotter_item['type'] == 'Motorcycle' ||  | 
                                                        
| 666 | 666 | $spotter_item['type'] == 'Car'  | 
                                                        
| 667 | - )  | 
                                                        |
| 667 | + )  | 
                                                        |
| 668 | 668 |  						) { | 
                                                        
| 669 | 669 | require(dirname(__FILE__).'/require/class.MapMatching.php');  | 
                                                        
| 670 | 670 | $MapMatching = new MapMatching();  | 
                                                        
@@ -753,65 +753,65 @@ discard block  | 
                                                    ||
| 753 | 753 | }  | 
                                                        
| 754 | 754 | |
| 755 | 755 |  				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) | 
                                                        
| 756 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))  | 
                                                        |
| 757 | - && (isset($spotter_item['departure_airport'])  | 
                                                        |
| 758 | - && $spotter_item['departure_airport'] != 'NA'  | 
                                                        |
| 759 | - && isset($spotter_item['arrival_airport'])  | 
                                                        |
| 760 | - && $spotter_item['arrival_airport'] != 'NA'  | 
                                                        |
| 761 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true")  | 
                                                        |
| 762 | -				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { | 
                                                        |
| 763 | -				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 764 | -				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 765 | -				    if (isset($spotter_item['departure_airport_latitude'])) { | 
                                                        |
| 756 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))  | 
                                                        |
| 757 | + && (isset($spotter_item['departure_airport'])  | 
                                                        |
| 758 | + && $spotter_item['departure_airport'] != 'NA'  | 
                                                        |
| 759 | + && isset($spotter_item['arrival_airport'])  | 
                                                        |
| 760 | + && $spotter_item['arrival_airport'] != 'NA'  | 
                                                        |
| 761 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true")  | 
                                                        |
| 762 | +							|| (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { | 
                                                        |
| 763 | +					if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 764 | +					else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 765 | +					if (isset($spotter_item['departure_airport_latitude'])) { | 
                                                        |
| 766 | 766 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';  | 
                                                        
| 767 | -				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { | 
                                                        |
| 767 | +					} elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { | 
                                                        |
| 768 | 768 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']);  | 
                                                        
| 769 | 769 |  					if (isset($dairport[0]['latitude'])) { | 
                                                        
| 770 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';  | 
                                                        |
| 770 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';  | 
                                                        |
| 771 | 771 | }  | 
                                                        
| 772 | - }  | 
                                                        |
| 773 | -				    if (isset($spotter_item['arrival_airport_latitude'])) { | 
                                                        |
| 772 | + }  | 
                                                        |
| 773 | +					if (isset($spotter_item['arrival_airport_latitude'])) { | 
                                                        |
| 774 | 774 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],';  | 
                                                        
| 775 | -				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { | 
                                                        |
| 775 | +					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { | 
                                                        |
| 776 | 776 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);  | 
                                                        
| 777 | 777 |  					if (isset($aairport[0]['latitude'])) { | 
                                                        
| 778 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';  | 
                                                        |
| 778 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';  | 
                                                        |
| 779 | 779 | }  | 
                                                        
| 780 | - }  | 
                                                        |
| 781 | - $output_air = substr($output_air, 0, -1);  | 
                                                        |
| 782 | - $output_air .= ']}},';  | 
                                                        |
| 783 | - $output .= $output_air;  | 
                                                        |
| 784 | - unset($output_air);  | 
                                                        |
| 780 | + }  | 
                                                        |
| 781 | + $output_air = substr($output_air, 0, -1);  | 
                                                        |
| 782 | + $output_air .= ']}},';  | 
                                                        |
| 783 | + $output .= $output_air;  | 
                                                        |
| 784 | + unset($output_air);  | 
                                                        |
| 785 | 785 | }  | 
                                                        
| 786 | 786 | |
| 787 | 787 |  				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { | 
                                                        
| 788 | 788 |  				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { | 
                                                        
| 789 | 789 |  				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) | 
                                                        
| 790 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))  | 
                                                        |
| 791 | - && (isset($spotter_item['arrival_airport'])  | 
                                                        |
| 792 | - && $spotter_item['arrival_airport'] != 'NA'  | 
                                                        |
| 793 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true")  | 
                                                        |
| 794 | - || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute)  | 
                                                        |
| 795 | -				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { | 
                                                        |
| 796 | - $havedata = false;  | 
                                                        |
| 797 | -				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 798 | -				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 799 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';  | 
                                                        |
| 790 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))  | 
                                                        |
| 791 | + && (isset($spotter_item['arrival_airport'])  | 
                                                        |
| 792 | + && $spotter_item['arrival_airport'] != 'NA'  | 
                                                        |
| 793 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true")  | 
                                                        |
| 794 | + || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute)  | 
                                                        |
| 795 | +							|| (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { | 
                                                        |
| 796 | + $havedata = false;  | 
                                                        |
| 797 | +					if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 798 | +					else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 799 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';  | 
                                                        |
| 800 | 800 | |
| 801 | -				    if (isset($spotter_item['arrival_airport_latitude'])) { | 
                                                        |
| 801 | +					if (isset($spotter_item['arrival_airport_latitude'])) { | 
                                                        |
| 802 | 802 | $output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']';  | 
                                                        
| 803 | 803 | $havedata = true;  | 
                                                        
| 804 | -				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { | 
                                                        |
| 804 | +					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { | 
                                                        |
| 805 | 805 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);  | 
                                                        
| 806 | 806 |  					if (isset($aairport[0]['latitude'])) { | 
                                                        
| 807 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';  | 
                                                        |
| 808 | - $havedata = true;  | 
                                                        |
| 807 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';  | 
                                                        |
| 808 | + $havedata = true;  | 
                                                        |
| 809 | 809 | }  | 
                                                        
| 810 | - }  | 
                                                        |
| 811 | - //$output_dest = substr($output_dest, 0, -1);  | 
                                                        |
| 812 | - $output_dest .= ']}},';  | 
                                                        |
| 813 | - if ($havedata) $output .= $output_dest;  | 
                                                        |
| 814 | - unset($output_dest);  | 
                                                        |
| 810 | + }  | 
                                                        |
| 811 | + //$output_dest = substr($output_dest, 0, -1);  | 
                                                        |
| 812 | + $output_dest .= ']}},';  | 
                                                        |
| 813 | + if ($havedata) $output .= $output_dest;  | 
                                                        |
| 814 | + unset($output_dest);  | 
                                                        |
| 815 | 815 | }  | 
                                                        
| 816 | 816 | }  | 
                                                        
| 817 | 817 | $output = substr($output, 0, -1);  | 
                                                        
@@ -63,17 +63,17 @@ discard block  | 
                                                    ||
| 63 | 63 | $min = true;  | 
                                                        
| 64 | 64 | $allhistory = false;  | 
                                                        
| 65 | 65 | $filter['source'] = array();  | 
                                                        
| 66 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); | 
                                                        |
| 67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); | 
                                                        |
| 68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); | 
                                                        |
| 69 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); | 
                                                        |
| 70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); | 
                                                        |
| 71 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 72 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 73 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); | 
                                                        |
| 74 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); | 
                                                        |
| 75 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 76 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 66 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); | 
                                                        |
| 67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); | 
                                                        |
| 68 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); | 
                                                        |
| 69 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); | 
                                                        |
| 70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); | 
                                                        |
| 71 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);  | 
                                                        |
| 72 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);  | 
                                                        |
| 73 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); | 
                                                        |
| 74 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); | 
                                                        |
| 75 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);  | 
                                                        |
| 76 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);  | 
                                                        |
| 77 | 77 | |
| 78 | 78 |  if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { | 
                                                        
| 79 | 79 | $min = true;  | 
                                                        
@@ -82,7 +82,7 @@ discard block  | 
                                                    ||
| 82 | 82 | $spotter_array = array();  | 
                                                        
| 83 | 83 | |
| 84 | 84 |  if (isset($_GET['ident'])) { | 
                                                        
| 85 | - $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));  | 
                                                        |
| 85 | + $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));  | 
                                                        |
| 86 | 86 |  	if ($tracker) { | 
                                                        
| 87 | 87 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);  | 
                                                        
| 88 | 88 |  	} elseif ($marine) { | 
                                                        
@@ -96,7 +96,7 @@ discard block  | 
                                                    ||
| 96 | 96 | }  | 
                                                        
| 97 | 97 | $allhistory = true;  | 
                                                        
| 98 | 98 |  } elseif (isset($_GET['flightaware_id'])) { | 
                                                        
| 99 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);  | 
                                                        |
| 99 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);  | 
                                                        |
| 100 | 100 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);  | 
                                                        
| 101 | 101 |  	if (empty($spotter_array)) { | 
                                                        
| 102 | 102 | $from_archive = true;  | 
                                                        
@@ -104,11 +104,11 @@ discard block  | 
                                                    ||
| 104 | 104 | }  | 
                                                        
| 105 | 105 | $allhistory = true;  | 
                                                        
| 106 | 106 |  } elseif (isset($_GET['famtrack_id'])) { | 
                                                        
| 107 | - $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING));  | 
                                                        |
| 107 | + $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING));  | 
                                                        |
| 108 | 108 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id);  | 
                                                        
| 109 | 109 | $allhistory = true;  | 
                                                        
| 110 | 110 |  } elseif (isset($_GET['fammarine_id'])) { | 
                                                        
| 111 | - $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING));  | 
                                                        |
| 111 | + $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING));  | 
                                                        |
| 112 | 112 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id);  | 
                                                        
| 113 | 113 | $allhistory = true;  | 
                                                        
| 114 | 114 | /*  | 
                                                        
@@ -128,15 +128,15 @@ discard block  | 
                                                    ||
| 128 | 128 | */  | 
                                                        
| 129 | 129 |  } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) { | 
                                                        
| 130 | 130 | $usecoord = true;  | 
                                                        
| 131 | -	$coord = explode(',',$_GET['coord']); | 
                                                        |
| 132 | - if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT)  | 
                                                        |
| 131 | +	$coord = explode(',', $_GET['coord']); | 
                                                        |
| 132 | + if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT)  | 
                                                        |
| 133 | 133 |  	    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { | 
                                                        
| 134 | 134 |  		if ($tracker) { | 
                                                        
| 135 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);  | 
                                                        |
| 135 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter);  | 
                                                        |
| 136 | 136 |  		} elseif ($marine) { | 
                                                        
| 137 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter);  | 
                                                        |
| 137 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter);  | 
                                                        |
| 138 | 138 |  		} else { | 
                                                        
| 139 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter);  | 
                                                        |
| 139 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter);  | 
                                                        |
| 140 | 140 | }  | 
                                                        
| 141 | 141 |  	} else { | 
                                                        
| 142 | 142 |  		if ($tracker) { | 
                                                        
@@ -151,12 +151,12 @@ discard block  | 
                                                    ||
| 151 | 151 | $from_archive = true;  | 
                                                        
| 152 | 152 |  //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); | 
                                                        
| 153 | 153 |  //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); | 
                                                        
| 154 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 155 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 156 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 157 | -	$begindate = date('Y-m-d H:i:s',$begindate); | 
                                                        |
| 158 | -	$enddate = date('Y-m-d H:i:s',$enddate); | 
                                                        |
| 159 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);  | 
                                                        |
| 154 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 155 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 156 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 157 | +	$begindate = date('Y-m-d H:i:s', $begindate); | 
                                                        |
| 158 | +	$enddate = date('Y-m-d H:i:s', $enddate); | 
                                                        |
| 159 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);  | 
                                                        |
| 160 | 160 |  } elseif ($min) { | 
                                                        
| 161 | 161 |  	if ($tracker) { | 
                                                        
| 162 | 162 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter);  | 
                                                        
@@ -168,17 +168,17 @@ discard block  | 
                                                    ||
| 168 | 168 | # $min = true;  | 
                                                        
| 169 | 169 |  } else { | 
                                                        
| 170 | 170 |  	if ($tracker) { | 
                                                        
| 171 | -		$spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); | 
                                                        |
| 171 | +		$spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); | 
                                                        |
| 172 | 172 |  	} elseif ($marine) { | 
                                                        
| 173 | -		$spotter_array = $marineLive->getLiveMarineData('','',$filter); | 
                                                        |
| 173 | +		$spotter_array = $marineLive->getLiveMarineData('', '', $filter); | 
                                                        |
| 174 | 174 |  	} else { | 
                                                        
| 175 | -		$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); | 
                                                        |
| 175 | +		$spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); | 
                                                        |
| 176 | 176 | }  | 
                                                        
| 177 | 177 | }  | 
                                                        
| 178 | 178 | |
| 179 | 179 |  if ($usecoord) { | 
                                                        
| 180 | 180 |  	if (isset($_GET['archive'])) { | 
                                                        
| 181 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);  | 
                                                        |
| 181 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);  | 
                                                        |
| 182 | 182 |  	} else { | 
                                                        
| 183 | 183 |  		if ($tracker) { | 
                                                        
| 184 | 184 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter);  | 
                                                        
@@ -191,9 +191,9 @@ discard block  | 
                                                    ||
| 191 | 191 | if ($flightcnt == '') $flightcnt = 0;  | 
                                                        
| 192 | 192 | } else $flightcnt = 0;  | 
                                                        
| 193 | 193 | |
| 194 | -$sqltime = round(microtime(true)-$begintime,2);  | 
                                                        |
| 194 | +$sqltime = round(microtime(true) - $begintime, 2);  | 
                                                        |
| 195 | 195 | |
| 196 | -$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 196 | +$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 197 | 197 | if ($currenttime != '') $currenttime = round($currenttime/1000);  | 
                                                        
| 198 | 198 | |
| 199 | 199 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;  | 
                                                        
@@ -212,7 +212,7 @@ discard block  | 
                                                    ||
| 212 | 212 | if (!empty($spotter_array) && is_array($spotter_array))  | 
                                                        
| 213 | 213 |  		{ | 
                                                        
| 214 | 214 | $output .= '"features": [';  | 
                                                        
| 215 | - foreach($spotter_array as $spotter_item)  | 
                                                        |
| 215 | + foreach ($spotter_array as $spotter_item)  | 
                                                        |
| 216 | 216 |  			{ | 
                                                        
| 217 | 217 | $j++;  | 
                                                        
| 218 | 218 | unset($idistance);  | 
                                                        
@@ -269,8 +269,8 @@ discard block  | 
                                                    ||
| 269 | 269 | */  | 
                                                        
| 270 | 270 | //$output .= '"fc": "'.$spotter_item['nb'].'",';  | 
                                                        
| 271 | 271 |  						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { | 
                                                        
| 272 | -							if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; | 
                                                        |
| 273 | -							else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; | 
                                                        |
| 272 | +							if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; | 
                                                        |
| 273 | +							else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; | 
                                                        |
| 274 | 274 | //"  | 
                                                        
| 275 | 275 |  						} else { | 
                                                        
| 276 | 276 | if ($compress) $output .= '"c": "NA",';  | 
                                                        
@@ -279,7 +279,7 @@ discard block  | 
                                                    ||
| 279 | 279 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';  | 
                                                        
| 280 | 280 |  						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { | 
                                                        
| 281 | 281 |  							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; | 
                                                        
| 282 | -							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; | 
                                                        |
| 282 | +							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; | 
                                                        |
| 283 | 283 |  						} elseif (isset($spotter_item['aircraft_type'])) { | 
                                                        
| 284 | 284 |  							$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; | 
                                                        
| 285 | 285 |  						} elseif (!$min) { | 
                                                        
@@ -422,15 +422,15 @@ discard block  | 
                                                    ||
| 422 | 422 |  						if (isset($archivespeed) || $usenextlatlon) { | 
                                                        
| 423 | 423 |  							if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { | 
                                                        
| 424 | 424 |  								if (isset($spotter_item['arrival_airport_latitude'])) { | 
                                                        
| 425 | - $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);  | 
                                                        |
| 426 | - $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);  | 
                                                        |
| 425 | + $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);  | 
                                                        |
| 426 | + $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);  | 
                                                        |
| 427 | 427 | $farr_lat = $spotter_item['arrival_airport_latitude'];  | 
                                                        
| 428 | 428 | $farr_lon = $spotter_item['arrival_airport_longitude'];  | 
                                                        
| 429 | 429 |  								} else { | 
                                                        
| 430 | 430 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);  | 
                                                        
| 431 | 431 |  									if (isset($aairport[0]['latitude'])) { | 
                                                        
| 432 | - $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);  | 
                                                        |
| 433 | - $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);  | 
                                                        |
| 432 | + $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);  | 
                                                        |
| 433 | + $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);  | 
                                                        |
| 434 | 434 | $farr_lat = $aairport[0]['latitude'];  | 
                                                        
| 435 | 435 | $farr_lon = $aairport[0]['longitude'];  | 
                                                        
| 436 | 436 | }  | 
                                                        
@@ -443,59 +443,59 @@ discard block  | 
                                                    ||
| 443 | 443 |  						if ($currenttime != '') { | 
                                                        
| 444 | 444 |  							if (strtotime($spotter_item['date']) < $currenttime) { | 
                                                        
| 445 | 445 |  								if (isset($archivespeed)) { | 
                                                        
| 446 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));  | 
                                                        |
| 447 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        |
| 446 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));  | 
                                                        |
| 447 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);  | 
                                                        |
| 448 | 448 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 449 | 449 |  									else { | 
                                                        
| 450 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));  | 
                                                        |
| 451 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        |
| 450 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));  | 
                                                        |
| 451 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);  | 
                                                        |
| 452 | 452 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 453 | 453 |  										else { | 
                                                        
| 454 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);  | 
                                                        |
| 454 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);  | 
                                                        |
| 455 | 455 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 456 | 456 | }  | 
                                                        
| 457 | 457 | }  | 
                                                        
| 458 | 458 |  								} elseif ($usenextlatlon) { | 
                                                        
| 459 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));  | 
                                                        |
| 460 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        |
| 459 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));  | 
                                                        |
| 460 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);  | 
                                                        |
| 461 | 461 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 462 | 462 |  									else { | 
                                                        
| 463 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));  | 
                                                        |
| 464 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        |
| 463 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));  | 
                                                        |
| 464 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);  | 
                                                        |
| 465 | 465 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 466 | 466 |  										else { | 
                                                        
| 467 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);  | 
                                                        |
| 467 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);  | 
                                                        |
| 468 | 468 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 469 | 469 | }  | 
                                                        
| 470 | 470 | }  | 
                                                        
| 471 | 471 | }  | 
                                                        
| 472 | 472 |  							} else { | 
                                                        
| 473 | 473 |  								if (isset($archivespeed)) { | 
                                                        
| 474 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);  | 
                                                        |
| 474 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);  | 
                                                        |
| 475 | 475 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 476 | 476 |  								} elseif ($usenextlatlon) { | 
                                                        
| 477 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);  | 
                                                        |
| 477 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);  | 
                                                        |
| 478 | 478 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 479 | 479 | }  | 
                                                        
| 480 | 480 | }  | 
                                                        
| 481 | 481 |  						} else { | 
                                                        
| 482 | 482 |  							if (isset($archivespeed)) { | 
                                                        
| 483 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);  | 
                                                        |
| 484 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        |
| 483 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);  | 
                                                        |
| 484 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);  | 
                                                        |
| 485 | 485 |  								if (!isset($idistance) || $fdistance < $idistance) { | 
                                                        
| 486 | 486 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 487 | 487 |  								} else { | 
                                                        
| 488 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed);  | 
                                                        |
| 488 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed);  | 
                                                        |
| 489 | 489 | //$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        
| 490 | 490 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 491 | 491 | }  | 
                                                        
| 492 | 492 |  							} elseif ($usenextlatlon) { | 
                                                        
| 493 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);  | 
                                                        |
| 494 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        |
| 493 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);  | 
                                                        |
| 494 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);  | 
                                                        |
| 495 | 495 |  								if (!isset($idistance) || $fdistance < $idistance) { | 
                                                        
| 496 | 496 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 497 | 497 |  								} else { | 
                                                        
| 498 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading);  | 
                                                        |
| 498 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading);  | 
                                                        |
| 499 | 499 | //$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        
| 500 | 500 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 501 | 501 | }  | 
                                                        
@@ -504,7 +504,7 @@ discard block  | 
                                                    ||
| 504 | 504 | |
| 505 | 505 | if (!$min) $output .= '"image": "'.$image.'",';  | 
                                                        
| 506 | 506 |  						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { | 
                                                        
| 507 | -							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; | 
                                                        |
| 507 | +							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; | 
                                                        |
| 508 | 508 | }  | 
                                                        
| 509 | 509 |  						if (isset($spotter_item['image_source_website'])) { | 
                                                        
| 510 | 510 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';  | 
                                                        
@@ -526,7 +526,7 @@ discard block  | 
                                                    ||
| 526 | 526 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",';  | 
                                                        
| 527 | 527 | }  | 
                                                        
| 528 | 528 |  						if (isset($spotter_item['acars'])) { | 
                                                        
| 529 | -							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; | 
                                                        |
| 529 | +							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; | 
                                                        |
| 530 | 530 | }  | 
                                                        
| 531 | 531 | // type when not aircraft ?  | 
                                                        
| 532 | 532 |  						if (isset($spotter_item['type'])) { | 
                                                        
@@ -546,12 +546,12 @@ discard block  | 
                                                    ||
| 546 | 546 |  								if ($currenttime != '') { | 
                                                        
| 547 | 547 |  									if (strtotime($spotter_item['date']) < $currenttime) { | 
                                                        
| 548 | 548 | if (!isset($archivespeed)) $archivespeed = 1;  | 
                                                        
| 549 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));  | 
                                                        |
| 550 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        |
| 549 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));  | 
                                                        |
| 550 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);  | 
                                                        |
| 551 | 551 | if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];  | 
                                                        
| 552 | 552 |  										else { | 
                                                        
| 553 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));  | 
                                                        |
| 554 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        |
| 553 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));  | 
                                                        |
| 554 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);  | 
                                                        |
| 555 | 555 | if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];  | 
                                                        
| 556 | 556 |  											else { | 
                                                        
| 557 | 557 | $output .= $spotter_item['longitude'].', ';  | 
                                                        
@@ -630,7 +630,7 @@ discard block  | 
                                                    ||
| 630 | 630 | |
| 631 | 631 | }  | 
                                                        
| 632 | 632 | */  | 
                                                        
| 633 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);  | 
                                                        |
| 633 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);  | 
                                                        |
| 634 | 634 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];  | 
                                                        
| 635 | 635 | |
| 636 | 636 | if (  | 
                                                        
@@ -638,11 +638,11 @@ discard block  | 
                                                    ||
| 638 | 638 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)  | 
                                                        
| 639 | 639 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))  | 
                                                        
| 640 | 640 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])  | 
                                                        
| 641 | -				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) | 
                                                        |
| 641 | +				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) | 
                                                        |
| 642 | 642 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])  | 
                                                        
| 643 | -				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) | 
                                                        |
| 643 | +				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) | 
                                                        |
| 644 | 644 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])  | 
                                                        
| 645 | -				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) | 
                                                        |
| 645 | +				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) | 
                                                        |
| 646 | 646 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])  | 
                                                        
| 647 | 647 |  				    ) { | 
                                                        
| 648 | 648 |  					if ($tracker) { | 
                                                        
@@ -698,9 +698,9 @@ discard block  | 
                                                    ||
| 698 | 698 |  								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        
| 699 | 699 | }  | 
                                                        
| 700 | 700 | $output_history .= '[';  | 
                                                        
| 701 | - $output_history .= $spotter_history['longitude'].', ';  | 
                                                        |
| 702 | - $output_history .= $spotter_history['latitude'].', ';  | 
                                                        |
| 703 | - $output_history .= $spotter_history['altitude']*30.48;  | 
                                                        |
| 701 | + $output_history .= $spotter_history['longitude'].', ';  | 
                                                        |
| 702 | + $output_history .= $spotter_history['latitude'].', ';  | 
                                                        |
| 703 | + $output_history .= $spotter_history['altitude']*30.48;  | 
                                                        |
| 704 | 704 | $output_history .= '],';  | 
                                                        
| 705 | 705 | /*  | 
                                                        
| 706 | 706 |  							if ($from_archive === false) { | 
                                                        
@@ -719,8 +719,8 @@ discard block  | 
                                                    ||
| 719 | 719 | $d = true;  | 
                                                        
| 720 | 720 | }  | 
                                                        
| 721 | 721 | $output_history .= '[';  | 
                                                        
| 722 | - $output_history .= $spotter_history['longitude'].', ';  | 
                                                        |
| 723 | - $output_history .= $spotter_history['latitude'];  | 
                                                        |
| 722 | + $output_history .= $spotter_history['longitude'].', ';  | 
                                                        |
| 723 | + $output_history .= $spotter_history['latitude'];  | 
                                                        |
| 724 | 724 | $output_history .= '],';  | 
                                                        
| 725 | 725 | /*  | 
                                                        
| 726 | 726 |  							if ($from_archive === false) { | 
                                                        
@@ -736,9 +736,9 @@ discard block  | 
                                                    ||
| 736 | 736 | //echo $output_history;  | 
                                                        
| 737 | 737 |  						if ($from_archive === false) { | 
                                                        
| 738 | 738 | $output_historyd = '[';  | 
                                                        
| 739 | - $output_historyd .= $spotter_item['longitude'].', ';  | 
                                                        |
| 740 | - $output_historyd .= $spotter_item['latitude'];  | 
                                                        |
| 741 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;  | 
                                                        |
| 739 | + $output_historyd .= $spotter_item['longitude'].', ';  | 
                                                        |
| 740 | + $output_historyd .= $spotter_item['latitude'];  | 
                                                        |
| 741 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;  | 
                                                        |
| 742 | 742 | $output_historyd .= '],';  | 
                                                        
| 743 | 743 | //$output_history = $output_historyd.$output_history;  | 
                                                        
| 744 | 744 | $output_history = $output_history.$output_historyd;  | 
                                                        
@@ -752,7 +752,7 @@ discard block  | 
                                                    ||
| 752 | 752 | }  | 
                                                        
| 753 | 753 | }  | 
                                                        
| 754 | 754 | |
| 755 | -				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) | 
                                                        |
| 755 | +				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) | 
                                                        |
| 756 | 756 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))  | 
                                                        
| 757 | 757 | && (isset($spotter_item['departure_airport'])  | 
                                                        
| 758 | 758 | && $spotter_item['departure_airport'] != 'NA'  | 
                                                        
@@ -786,7 +786,7 @@ discard block  | 
                                                    ||
| 786 | 786 | |
| 787 | 787 |  				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { | 
                                                        
| 788 | 788 |  				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { | 
                                                        
| 789 | -				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) | 
                                                        |
| 789 | +				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) | 
                                                        |
| 790 | 790 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))  | 
                                                        
| 791 | 791 | && (isset($spotter_item['arrival_airport'])  | 
                                                        
| 792 | 792 | && $spotter_item['arrival_airport'] != 'NA'  | 
                                                        
@@ -817,7 +817,7 @@ discard block  | 
                                                    ||
| 817 | 817 | $output = substr($output, 0, -1);  | 
                                                        
| 818 | 818 | $output .= ']';  | 
                                                        
| 819 | 819 | $output .= ',"initial_sqltime": "'.$sqltime.'",';  | 
                                                        
| 820 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';  | 
                                                        |
| 820 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';  | 
                                                        |
| 821 | 821 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';  | 
                                                        
| 822 | 822 | $output .= '"fc": "'.$j.'"';  | 
                                                        
| 823 | 823 |  		} else { | 
                                                        
@@ -56,28 +56,55 @@ discard block  | 
                                                    ||
| 56 | 56 | }  | 
                                                        
| 57 | 57 |  header('Content-Type: text/javascript'); | 
                                                        
| 58 | 58 | |
| 59 | -if (!isset($globalJsonCompress)) $compress = true;  | 
                                                        |
| 60 | -else $compress = $globalJsonCompress;  | 
                                                        |
| 59 | +if (!isset($globalJsonCompress)) { | 
                                                        |
| 60 | + $compress = true;  | 
                                                        |
| 61 | +} else { | 
                                                        |
| 62 | + $compress = $globalJsonCompress;  | 
                                                        |
| 63 | +}  | 
                                                        |
| 61 | 64 | |
| 62 | 65 | $from_archive = false;  | 
                                                        
| 63 | 66 | $min = true;  | 
                                                        
| 64 | 67 | $allhistory = false;  | 
                                                        
| 65 | 68 | $filter['source'] = array();  | 
                                                        
| 66 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); | 
                                                        |
| 67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); | 
                                                        |
| 68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); | 
                                                        |
| 69 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); | 
                                                        |
| 70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); | 
                                                        |
| 71 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 72 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 73 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); | 
                                                        |
| 74 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); | 
                                                        |
| 75 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 76 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 69 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { | 
                                                        |
| 70 | +	$filter['source'] = array_merge($filter['source'],array('vatsimtxt')); | 
                                                        |
| 71 | +}  | 
                                                        |
| 72 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { | 
                                                        |
| 73 | +	$filter['source'] = array_merge($filter['source'],array('whazzup')); | 
                                                        |
| 74 | +}  | 
                                                        |
| 75 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { | 
                                                        |
| 76 | +	$filter['source'] = array_merge($filter['source'],array('phpvmacars')); | 
                                                        |
| 77 | +}  | 
                                                        |
| 78 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { | 
                                                        |
| 79 | +	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); | 
                                                        |
| 80 | +}  | 
                                                        |
| 81 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { | 
                                                        |
| 82 | +	$filter['source'] = array_merge($filter['source'],array('aprs')); | 
                                                        |
| 83 | +}  | 
                                                        |
| 84 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { | 
                                                        |
| 85 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 86 | +}  | 
                                                        |
| 87 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { | 
                                                        |
| 88 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 89 | +}  | 
                                                        |
| 90 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { | 
                                                        |
| 91 | +	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); | 
                                                        |
| 92 | +}  | 
                                                        |
| 93 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { | 
                                                        |
| 94 | +	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); | 
                                                        |
| 95 | +}  | 
                                                        |
| 96 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { | 
                                                        |
| 97 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 98 | +}  | 
                                                        |
| 99 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { | 
                                                        |
| 100 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);  | 
                                                        |
| 101 | +}  | 
                                                        |
| 77 | 102 | |
| 78 | 103 |  if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { | 
                                                        
| 79 | 104 | $min = true;  | 
                                                        
| 80 | -} else $min = false;  | 
                                                        |
| 105 | +} else { | 
                                                        |
| 106 | + $min = false;  | 
                                                        |
| 107 | +}  | 
                                                        |
| 81 | 108 | |
| 82 | 109 | $spotter_array = array();  | 
                                                        
| 83 | 110 | |
@@ -188,24 +215,38 @@ discard block  | 
                                                    ||
| 188 | 215 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter);  | 
                                                        
| 189 | 216 | }  | 
                                                        
| 190 | 217 | }  | 
                                                        
| 191 | - if ($flightcnt == '') $flightcnt = 0;  | 
                                                        |
| 192 | -} else $flightcnt = 0;  | 
                                                        |
| 218 | +	if ($flightcnt == '') { | 
                                                        |
| 219 | + $flightcnt = 0;  | 
                                                        |
| 220 | + }  | 
                                                        |
| 221 | +	} else { | 
                                                        |
| 222 | + $flightcnt = 0;  | 
                                                        |
| 223 | +}  | 
                                                        |
| 193 | 224 | |
| 194 | 225 | $sqltime = round(microtime(true)-$begintime,2);  | 
                                                        
| 195 | 226 | |
| 196 | 227 | $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        
| 197 | -if ($currenttime != '') $currenttime = round($currenttime/1000);  | 
                                                        |
| 228 | +if ($currenttime != '') { | 
                                                        |
| 229 | + $currenttime = round($currenttime/1000);  | 
                                                        |
| 230 | +}  | 
                                                        |
| 198 | 231 | |
| 199 | -if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;  | 
                                                        |
| 200 | -else $usenextlatlon = true;  | 
                                                        |
| 201 | -if ($usenextlatlon === false) $currenttime = '';  | 
                                                        |
| 232 | +if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) { | 
                                                        |
| 233 | + $usenextlatlon = false;  | 
                                                        |
| 234 | +} else { | 
                                                        |
| 235 | + $usenextlatlon = true;  | 
                                                        |
| 236 | +}  | 
                                                        |
| 237 | +if ($usenextlatlon === false) { | 
                                                        |
| 238 | + $currenttime = '';  | 
                                                        |
| 239 | +}  | 
                                                        |
| 202 | 240 | $j = 0;  | 
                                                        
| 203 | 241 | $prev_flightaware_id = '';  | 
                                                        
| 204 | 242 | $aircrafts_shadow = array();  | 
                                                        
| 205 | 243 |  $output = '{'; | 
                                                        
| 206 | 244 | $output .= '"type": "FeatureCollection",';  | 
                                                        
| 207 | - if ($min) $output .= '"minimal": "true",';  | 
                                                        |
| 208 | - else $output .= '"minimal": "false",';  | 
                                                        |
| 245 | +		if ($min) { | 
                                                        |
| 246 | + $output .= '"minimal": "true",';  | 
                                                        |
| 247 | +		} else { | 
                                                        |
| 248 | + $output .= '"minimal": "false",';  | 
                                                        |
| 249 | + }  | 
                                                        |
| 209 | 250 | //$output .= '"fc": "'.$flightcnt.'",';  | 
                                                        
| 210 | 251 | $output .= '"sqt": "'.$sqltime.'",';  | 
                                                        
| 211 | 252 | |
@@ -250,18 +291,29 @@ discard block  | 
                                                    ||
| 250 | 291 | }  | 
                                                        
| 251 | 292 |  						$output .= '"properties": {'; | 
                                                        
| 252 | 293 |  						if (isset($spotter_item['flightaware_id'])) { | 
                                                        
| 253 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",';  | 
                                                        |
| 254 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';  | 
                                                        |
| 294 | +							if ($compress) { | 
                                                        |
| 295 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",';  | 
                                                        |
| 296 | +							} else { | 
                                                        |
| 297 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';  | 
                                                        |
| 298 | + }  | 
                                                        |
| 255 | 299 |  						} elseif (isset($spotter_item['famtrackid'])) { | 
                                                        
| 256 | - if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",';  | 
                                                        |
| 257 | - else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';  | 
                                                        |
| 300 | +							if ($compress) { | 
                                                        |
| 301 | + $output .= '"fti": "'.$spotter_item['famtrackid'].'",';  | 
                                                        |
| 302 | +							} else { | 
                                                        |
| 303 | + $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';  | 
                                                        |
| 304 | + }  | 
                                                        |
| 258 | 305 |  						} elseif (isset($spotter_item['fammarine_id'])) { | 
                                                        
| 259 | - if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';  | 
                                                        |
| 260 | - else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';  | 
                                                        |
| 306 | +							if ($compress) { | 
                                                        |
| 307 | + $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';  | 
                                                        |
| 308 | +							} else { | 
                                                        |
| 309 | + $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';  | 
                                                        |
| 310 | + }  | 
                                                        |
| 261 | 311 | }  | 
                                                        
| 262 | 312 | $output .= '"fc": "'.$flightcnt.'",';  | 
                                                        
| 263 | 313 | $output .= '"sqt": "'.$sqltime.'",';  | 
                                                        
| 264 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';  | 
                                                        |
| 314 | +							if (isset($begindate)) { | 
                                                        |
| 315 | + $output .= '"archive_date": "'.$begindate.'",';  | 
                                                        |
| 316 | + }  | 
                                                        |
| 265 | 317 | |
| 266 | 318 | /*  | 
                                                        
| 267 | 319 | if ($min) $output .= '"minimal": "true",';  | 
                                                        
@@ -269,14 +321,22 @@ discard block  | 
                                                    ||
| 269 | 321 | */  | 
                                                        
| 270 | 322 | //$output .= '"fc": "'.$spotter_item['nb'].'",';  | 
                                                        
| 271 | 323 |  						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { | 
                                                        
| 272 | -							if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; | 
                                                        |
| 273 | -							else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; | 
                                                        |
| 324 | +							if ($compress) { | 
                                                        |
| 325 | +								$output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; | 
                                                        |
| 326 | +							} else { | 
                                                        |
| 327 | +								$output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; | 
                                                        |
| 328 | + }  | 
                                                        |
| 274 | 329 | //"  | 
                                                        
| 275 | 330 |  						} else { | 
                                                        
| 276 | - if ($compress) $output .= '"c": "NA",';  | 
                                                        |
| 277 | - else $output .= '"callsign": "NA",';  | 
                                                        |
| 331 | +							if ($compress) { | 
                                                        |
| 332 | + $output .= '"c": "NA",';  | 
                                                        |
| 333 | +							} else { | 
                                                        |
| 334 | + $output .= '"callsign": "NA",';  | 
                                                        |
| 335 | + }  | 
                                                        |
| 336 | + }  | 
                                                        |
| 337 | +						if (isset($spotter_item['registration'])) { | 
                                                        |
| 338 | + $output .= '"registration": "'.$spotter_item['registration'].'",';  | 
                                                        |
| 278 | 339 | }  | 
                                                        
| 279 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';  | 
                                                        |
| 280 | 340 |  						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { | 
                                                        
| 281 | 341 |  							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; | 
                                                        
| 282 | 342 |  							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; | 
                                                        
@@ -289,16 +349,23 @@ discard block  | 
                                                    ||
| 289 | 349 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';  | 
                                                        
| 290 | 350 | }  | 
                                                        
| 291 | 351 |  						if (!isset($spotter_item['aircraft_shadow']) && !$tracker) { | 
                                                        
| 292 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = '';  | 
                                                        |
| 293 | -							else { | 
                                                        |
| 352 | +							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { | 
                                                        |
| 353 | + $spotter_item['aircraft_shadow'] = '';  | 
                                                        |
| 354 | +							} else { | 
                                                        |
| 294 | 355 | $aircraft_icao = $spotter_item['aircraft_icao'];  | 
                                                        
| 295 | - if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];  | 
                                                        |
| 296 | -								else { | 
                                                        |
| 356 | +								if (isset($aircrafts_shadow[$aircraft_icao])) { | 
                                                        |
| 357 | + $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];  | 
                                                        |
| 358 | +								} else { | 
                                                        |
| 297 | 359 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']);  | 
                                                        
| 298 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];  | 
                                                        |
| 299 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png';  | 
                                                        |
| 300 | - elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';  | 
                                                        |
| 301 | - else $spotter_item['aircraft_shadow'] = '';  | 
                                                        |
| 360 | +									if (count($aircraft_info) > 0) { | 
                                                        |
| 361 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];  | 
                                                        |
| 362 | +									} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { | 
                                                        |
| 363 | + $spotter_item['aircraft_shadow'] = 'PA18.png';  | 
                                                        |
| 364 | +									} elseif ($aircraft_icao == 'PARAGLIDER') { | 
                                                        |
| 365 | + $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';  | 
                                                        |
| 366 | +									} else { | 
                                                        |
| 367 | + $spotter_item['aircraft_shadow'] = '';  | 
                                                        |
| 368 | + }  | 
                                                        |
| 302 | 369 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow'];  | 
                                                        
| 303 | 370 | }  | 
                                                        
| 304 | 371 | }  | 
                                                        
@@ -306,73 +373,139 @@ discard block  | 
                                                    ||
| 306 | 373 |  						if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') { | 
                                                        
| 307 | 374 |  							if ($tracker) { | 
                                                        
| 308 | 375 |  								if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') { | 
                                                        
| 309 | - if ($compress) $output .= '"as": "ambulance.png",';  | 
                                                        |
| 310 | - else $output .= '"aircraft_shadow": "ambulance.png",';  | 
                                                        |
| 376 | +									if ($compress) { | 
                                                        |
| 377 | + $output .= '"as": "ambulance.png",';  | 
                                                        |
| 378 | +									} else { | 
                                                        |
| 379 | + $output .= '"aircraft_shadow": "ambulance.png",';  | 
                                                        |
| 380 | + }  | 
                                                        |
| 311 | 381 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { | 
                                                        
| 312 | - if ($compress) $output .= '"as": "police.png",';  | 
                                                        |
| 313 | - else $output .= '"aircraft_shadow": "police.png",';  | 
                                                        |
| 382 | +									if ($compress) { | 
                                                        |
| 383 | + $output .= '"as": "police.png",';  | 
                                                        |
| 384 | +									} else { | 
                                                        |
| 385 | + $output .= '"aircraft_shadow": "police.png",';  | 
                                                        |
| 386 | + }  | 
                                                        |
| 314 | 387 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { | 
                                                        
| 315 | - if ($compress) $output .= '"as": "ship.png",';  | 
                                                        |
| 316 | - else $output .= '"aircraft_shadow": "ship.png",';  | 
                                                        |
| 388 | +									if ($compress) { | 
                                                        |
| 389 | + $output .= '"as": "ship.png",';  | 
                                                        |
| 390 | +									} else { | 
                                                        |
| 391 | + $output .= '"aircraft_shadow": "ship.png",';  | 
                                                        |
| 392 | + }  | 
                                                        |
| 317 | 393 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { | 
                                                        
| 318 | - if ($compress) $output .= '"as": "ship.png",';  | 
                                                        |
| 319 | - else $output .= '"aircraft_shadow": "ship.png",';  | 
                                                        |
| 394 | +									if ($compress) { | 
                                                        |
| 395 | + $output .= '"as": "ship.png",';  | 
                                                        |
| 396 | +									} else { | 
                                                        |
| 397 | + $output .= '"aircraft_shadow": "ship.png",';  | 
                                                        |
| 398 | + }  | 
                                                        |
| 320 | 399 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { | 
                                                        
| 321 | - if ($compress) $output .= '"as": "ship.png",';  | 
                                                        |
| 322 | - else $output .= '"aircraft_shadow": "ship.png",';  | 
                                                        |
| 400 | +									if ($compress) { | 
                                                        |
| 401 | + $output .= '"as": "ship.png",';  | 
                                                        |
| 402 | +									} else { | 
                                                        |
| 403 | + $output .= '"aircraft_shadow": "ship.png",';  | 
                                                        |
| 404 | + }  | 
                                                        |
| 323 | 405 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { | 
                                                        
| 324 | - if ($compress) $output .= '"as": "truck.png",';  | 
                                                        |
| 325 | - else $output .= '"aircraft_shadow": "truck.png",';  | 
                                                        |
| 406 | +									if ($compress) { | 
                                                        |
| 407 | + $output .= '"as": "truck.png",';  | 
                                                        |
| 408 | +									} else { | 
                                                        |
| 409 | + $output .= '"aircraft_shadow": "truck.png",';  | 
                                                        |
| 410 | + }  | 
                                                        |
| 326 | 411 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { | 
                                                        
| 327 | - if ($compress) $output .= '"as": "truck.png",';  | 
                                                        |
| 328 | - else $output .= '"aircraft_shadow": "truck.png",';  | 
                                                        |
| 412 | +									if ($compress) { | 
                                                        |
| 413 | + $output .= '"as": "truck.png",';  | 
                                                        |
| 414 | +									} else { | 
                                                        |
| 415 | + $output .= '"aircraft_shadow": "truck.png",';  | 
                                                        |
| 416 | + }  | 
                                                        |
| 329 | 417 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { | 
                                                        
| 330 | - if ($compress) $output .= '"as": "aircraft.png",';  | 
                                                        |
| 331 | - else $output .= '"aircraft_shadow": "aircraft.png",';  | 
                                                        |
| 418 | +									if ($compress) { | 
                                                        |
| 419 | + $output .= '"as": "aircraft.png",';  | 
                                                        |
| 420 | +									} else { | 
                                                        |
| 421 | + $output .= '"aircraft_shadow": "aircraft.png",';  | 
                                                        |
| 422 | + }  | 
                                                        |
| 332 | 423 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { | 
                                                        
| 333 | - if ($compress) $output .= '"as": "aircraft.png",';  | 
                                                        |
| 334 | - else $output .= '"aircraft_shadow": "aircraft.png",';  | 
                                                        |
| 424 | +									if ($compress) { | 
                                                        |
| 425 | + $output .= '"as": "aircraft.png",';  | 
                                                        |
| 426 | +									} else { | 
                                                        |
| 427 | + $output .= '"aircraft_shadow": "aircraft.png",';  | 
                                                        |
| 428 | + }  | 
                                                        |
| 335 | 429 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { | 
                                                        
| 336 | - if ($compress) $output .= '"as": "helico.png",';  | 
                                                        |
| 337 | - else $output .= '"aircraft_shadow": "helico.png",';  | 
                                                        |
| 430 | +									if ($compress) { | 
                                                        |
| 431 | + $output .= '"as": "helico.png",';  | 
                                                        |
| 432 | +									} else { | 
                                                        |
| 433 | + $output .= '"aircraft_shadow": "helico.png",';  | 
                                                        |
| 434 | + }  | 
                                                        |
| 338 | 435 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { | 
                                                        
| 339 | - if ($compress) $output .= '"as": "rail.png",';  | 
                                                        |
| 340 | - else $output .= '"aircraft_shadow": "rail.png",';  | 
                                                        |
| 436 | +									if ($compress) { | 
                                                        |
| 437 | + $output .= '"as": "rail.png",';  | 
                                                        |
| 438 | +									} else { | 
                                                        |
| 439 | + $output .= '"aircraft_shadow": "rail.png",';  | 
                                                        |
| 440 | + }  | 
                                                        |
| 341 | 441 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { | 
                                                        
| 342 | - if ($compress) $output .= '"as": "firetruck.png",';  | 
                                                        |
| 343 | - else $output .= '"aircraft_shadow": "firetruck.png",';  | 
                                                        |
| 442 | +									if ($compress) { | 
                                                        |
| 443 | + $output .= '"as": "firetruck.png",';  | 
                                                        |
| 444 | +									} else { | 
                                                        |
| 445 | + $output .= '"aircraft_shadow": "firetruck.png",';  | 
                                                        |
| 446 | + }  | 
                                                        |
| 344 | 447 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { | 
                                                        
| 345 | - if ($compress) $output .= '"as": "bus.png",';  | 
                                                        |
| 346 | - else $output .= '"aircraft_shadow": "bus.png",';  | 
                                                        |
| 448 | +									if ($compress) { | 
                                                        |
| 449 | + $output .= '"as": "bus.png",';  | 
                                                        |
| 450 | +									} else { | 
                                                        |
| 451 | + $output .= '"aircraft_shadow": "bus.png",';  | 
                                                        |
| 452 | + }  | 
                                                        |
| 347 | 453 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { | 
                                                        
| 348 | - if ($compress) $output .= '"as": "phone.png",';  | 
                                                        |
| 349 | - else $output .= '"aircraft_shadow": "phone.png",';  | 
                                                        |
| 454 | +									if ($compress) { | 
                                                        |
| 455 | + $output .= '"as": "phone.png",';  | 
                                                        |
| 456 | +									} else { | 
                                                        |
| 457 | + $output .= '"aircraft_shadow": "phone.png",';  | 
                                                        |
| 458 | + }  | 
                                                        |
| 350 | 459 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { | 
                                                        
| 351 | - if ($compress) $output .= '"as": "jogger.png",';  | 
                                                        |
| 352 | - else $output .= '"aircraft_shadow": "jogger.png",';  | 
                                                        |
| 460 | +									if ($compress) { | 
                                                        |
| 461 | + $output .= '"as": "jogger.png",';  | 
                                                        |
| 462 | +									} else { | 
                                                        |
| 463 | + $output .= '"aircraft_shadow": "jogger.png",';  | 
                                                        |
| 464 | + }  | 
                                                        |
| 353 | 465 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { | 
                                                        
| 354 | - if ($compress) $output .= '"as": "bike.png",';  | 
                                                        |
| 355 | - else $output .= '"aircraft_shadow": "bike.png",';  | 
                                                        |
| 466 | +									if ($compress) { | 
                                                        |
| 467 | + $output .= '"as": "bike.png",';  | 
                                                        |
| 468 | +									} else { | 
                                                        |
| 469 | + $output .= '"aircraft_shadow": "bike.png",';  | 
                                                        |
| 470 | + }  | 
                                                        |
| 356 | 471 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { | 
                                                        
| 357 | - if ($compress) $output .= '"as": "motorcycle.png",';  | 
                                                        |
| 358 | - else $output .= '"aircraft_shadow": "motorcycle.png",';  | 
                                                        |
| 472 | +									if ($compress) { | 
                                                        |
| 473 | + $output .= '"as": "motorcycle.png",';  | 
                                                        |
| 474 | +									} else { | 
                                                        |
| 475 | + $output .= '"aircraft_shadow": "motorcycle.png",';  | 
                                                        |
| 476 | + }  | 
                                                        |
| 359 | 477 |  								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { | 
                                                        
| 360 | - if ($compress) $output .= '"as": "balloon.png",';  | 
                                                        |
| 361 | - else $output .= '"aircraft_shadow": "balloon.png",';  | 
                                                        |
| 478 | +									if ($compress) { | 
                                                        |
| 479 | + $output .= '"as": "balloon.png",';  | 
                                                        |
| 480 | +									} else { | 
                                                        |
| 481 | + $output .= '"aircraft_shadow": "balloon.png",';  | 
                                                        |
| 482 | + }  | 
                                                        |
| 362 | 483 |  								} else { | 
                                                        
| 363 | - if ($compress) $output .= '"as": "car.png",';  | 
                                                        |
| 364 | - else $output .= '"aircraft_shadow": "car.png",';  | 
                                                        |
| 484 | +									if ($compress) { | 
                                                        |
| 485 | + $output .= '"as": "car.png",';  | 
                                                        |
| 486 | +									} else { | 
                                                        |
| 487 | + $output .= '"aircraft_shadow": "car.png",';  | 
                                                        |
| 488 | + }  | 
                                                        |
| 365 | 489 | }  | 
                                                        
| 366 | 490 |  							} elseif ($marine) { | 
                                                        
| 367 | - if ($compress) $output .= '"as": "ship.png",';  | 
                                                        |
| 368 | - else $output .= '"aircraft_shadow": "ship.png",';  | 
                                                        |
| 491 | +								if ($compress) { | 
                                                        |
| 492 | + $output .= '"as": "ship.png",';  | 
                                                        |
| 493 | +								} else { | 
                                                        |
| 494 | + $output .= '"aircraft_shadow": "ship.png",';  | 
                                                        |
| 495 | + }  | 
                                                        |
| 369 | 496 |  							} else { | 
                                                        
| 370 | - if ($compress) $output .= '"as": "default.png",';  | 
                                                        |
| 371 | - else $output .= '"aircraft_shadow": "default.png",';  | 
                                                        |
| 497 | +								if ($compress) { | 
                                                        |
| 498 | + $output .= '"as": "default.png",';  | 
                                                        |
| 499 | +								} else { | 
                                                        |
| 500 | + $output .= '"aircraft_shadow": "default.png",';  | 
                                                        |
| 501 | + }  | 
                                                        |
| 372 | 502 | }  | 
                                                        
| 373 | 503 |  						} else { | 
                                                        
| 374 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';  | 
                                                        |
| 375 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';  | 
                                                        |
| 504 | +							if ($compress) { | 
                                                        |
| 505 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';  | 
                                                        |
| 506 | +							} else { | 
                                                        |
| 507 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';  | 
                                                        |
| 508 | + }  | 
                                                        |
| 376 | 509 | }  | 
                                                        
| 377 | 510 |  						if (isset($spotter_item['airline_name'])) { | 
                                                        
| 378 | 511 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",';  | 
                                                        
@@ -380,8 +513,11 @@ discard block  | 
                                                    ||
| 380 | 513 | $output .= '"airline_name": "NA",';  | 
                                                        
| 381 | 514 | }  | 
                                                        
| 382 | 515 |  						if (isset($spotter_item['departure_airport'])) { | 
                                                        
| 383 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",';  | 
                                                        |
| 384 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';  | 
                                                        |
| 516 | +							if ($compress) { | 
                                                        |
| 517 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",';  | 
                                                        |
| 518 | +							} else { | 
                                                        |
| 519 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';  | 
                                                        |
| 520 | + }  | 
                                                        |
| 385 | 521 | }  | 
                                                        
| 386 | 522 |  						if (isset($spotter_item['departure_airport_city'])) { | 
                                                        
| 387 | 523 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",';  | 
                                                        
@@ -393,8 +529,11 @@ discard block  | 
                                                    ||
| 393 | 529 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",';  | 
                                                        
| 394 | 530 | }  | 
                                                        
| 395 | 531 |  						if (isset($spotter_item['arrival_airport'])) { | 
                                                        
| 396 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",';  | 
                                                        |
| 397 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';  | 
                                                        |
| 532 | +							if ($compress) { | 
                                                        |
| 533 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",';  | 
                                                        |
| 534 | +							} else { | 
                                                        |
| 535 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';  | 
                                                        |
| 536 | + }  | 
                                                        |
| 398 | 537 | }  | 
                                                        
| 399 | 538 |  						if (isset($spotter_item['arrival_airport_city'])) { | 
                                                        
| 400 | 539 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",';  | 
                                                        
@@ -413,8 +552,11 @@ discard block  | 
                                                    ||
| 413 | 552 | }  | 
                                                        
| 414 | 553 | |
| 415 | 554 |  						if (isset($spotter_item['altitude'])) { | 
                                                        
| 416 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",';  | 
                                                        |
| 417 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",';  | 
                                                        |
| 555 | +							if ($compress) { | 
                                                        |
| 556 | + $output .= '"a": "'.$spotter_item['altitude'].'",';  | 
                                                        |
| 557 | +							} else { | 
                                                        |
| 558 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",';  | 
                                                        |
| 559 | + }  | 
                                                        |
| 418 | 560 | }  | 
                                                        
| 419 | 561 | |
| 420 | 562 | $heading = $spotter_item['heading'];  | 
                                                        
@@ -438,19 +580,24 @@ discard block  | 
                                                    ||
| 438 | 580 | }  | 
                                                        
| 439 | 581 | }  | 
                                                        
| 440 | 582 | |
| 441 | - if ($compress)$output .= '"h": "'.$heading.'",';  | 
                                                        |
| 442 | - else $output .= '"heading": "'.$heading.'",';  | 
                                                        |
| 583 | +						if ($compress) { | 
                                                        |
| 584 | + $output .= '"h": "'.$heading.'",';  | 
                                                        |
| 585 | +						} else { | 
                                                        |
| 586 | + $output .= '"heading": "'.$heading.'",';  | 
                                                        |
| 587 | + }  | 
                                                        |
| 443 | 588 |  						if ($currenttime != '') { | 
                                                        
| 444 | 589 |  							if (strtotime($spotter_item['date']) < $currenttime) { | 
                                                        
| 445 | 590 |  								if (isset($archivespeed)) { | 
                                                        
| 446 | 591 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));  | 
                                                        
| 447 | 592 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        
| 448 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        |
| 449 | -									else { | 
                                                        |
| 593 | +									if (!isset($idistance) || $fdistance < $idistance) { | 
                                                        |
| 594 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        |
| 595 | +									} else { | 
                                                        |
| 450 | 596 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));  | 
                                                        
| 451 | 597 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        
| 452 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        |
| 453 | -										else { | 
                                                        |
| 598 | +										if (!isset($idistance) || $fdistance < $idistance) { | 
                                                        |
| 599 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        |
| 600 | +										} else { | 
                                                        |
| 454 | 601 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);  | 
                                                        
| 455 | 602 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 456 | 603 | }  | 
                                                        
@@ -458,12 +605,14 @@ discard block  | 
                                                    ||
| 458 | 605 |  								} elseif ($usenextlatlon) { | 
                                                        
| 459 | 606 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));  | 
                                                        
| 460 | 607 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        
| 461 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        |
| 462 | -									else { | 
                                                        |
| 608 | +									if (!isset($idistance) || $fdistance < $idistance) { | 
                                                        |
| 609 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        |
| 610 | +									} else { | 
                                                        |
| 463 | 611 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));  | 
                                                        
| 464 | 612 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        
| 465 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        |
| 466 | -										else { | 
                                                        |
| 613 | +										if (!isset($idistance) || $fdistance < $idistance) { | 
                                                        |
| 614 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        |
| 615 | +										} else { | 
                                                        |
| 467 | 616 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);  | 
                                                        
| 468 | 617 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';  | 
                                                        
| 469 | 618 | }  | 
                                                        
@@ -502,7 +651,9 @@ discard block  | 
                                                    ||
| 502 | 651 | }  | 
                                                        
| 503 | 652 | }  | 
                                                        
| 504 | 653 | |
| 505 | - if (!$min) $output .= '"image": "'.$image.'",';  | 
                                                        |
| 654 | +						if (!$min) { | 
                                                        |
| 655 | + $output .= '"image": "'.$image.'",';  | 
                                                        |
| 656 | + }  | 
                                                        |
| 506 | 657 |  						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { | 
                                                        
| 507 | 658 |  							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; | 
                                                        
| 508 | 659 | }  | 
                                                        
@@ -510,8 +661,11 @@ discard block  | 
                                                    ||
| 510 | 661 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';  | 
                                                        
| 511 | 662 | }  | 
                                                        
| 512 | 663 |  						if (isset($spotter_item['squawk'])) { | 
                                                        
| 513 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",';  | 
                                                        |
| 514 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",';  | 
                                                        |
| 664 | +							if ($compress) { | 
                                                        |
| 665 | + $output .= '"sq": "'.$spotter_item['squawk'].'",';  | 
                                                        |
| 666 | +							} else { | 
                                                        |
| 667 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",';  | 
                                                        |
| 668 | + }  | 
                                                        |
| 515 | 669 | }  | 
                                                        
| 516 | 670 |  						if (isset($spotter_item['squawk_usage'])) { | 
                                                        
| 517 | 671 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",';  | 
                                                        
@@ -530,14 +684,23 @@ discard block  | 
                                                    ||
| 530 | 684 | }  | 
                                                        
| 531 | 685 | // type when not aircraft ?  | 
                                                        
| 532 | 686 |  						if (isset($spotter_item['type'])) { | 
                                                        
| 533 | - if ($compress) $output .= '"t": "'.$spotter_item['type'].'"';  | 
                                                        |
| 534 | - else $output .= '"type": "'.$spotter_item['type'].'"';  | 
                                                        |
| 687 | +							if ($compress) { | 
                                                        |
| 688 | + $output .= '"t": "'.$spotter_item['type'].'"';  | 
                                                        |
| 689 | +							} else { | 
                                                        |
| 690 | + $output .= '"type": "'.$spotter_item['type'].'"';  | 
                                                        |
| 691 | + }  | 
                                                        |
| 535 | 692 |  						} elseif ($marine) { | 
                                                        
| 536 | - if ($compress) $output .= '"t": "ship"';  | 
                                                        |
| 537 | - else $output .= '"type": "ship"';  | 
                                                        |
| 693 | +							if ($compress) { | 
                                                        |
| 694 | + $output .= '"t": "ship"';  | 
                                                        |
| 695 | +							} else { | 
                                                        |
| 696 | + $output .= '"type": "ship"';  | 
                                                        |
| 697 | + }  | 
                                                        |
| 538 | 698 |  						} else { | 
                                                        
| 539 | - if ($compress) $output .= '"t": "aircraft"';  | 
                                                        |
| 540 | - else $output .= '"type": "aircraft"';  | 
                                                        |
| 699 | +							if ($compress) { | 
                                                        |
| 700 | + $output .= '"t": "aircraft"';  | 
                                                        |
| 701 | +							} else { | 
                                                        |
| 702 | + $output .= '"type": "aircraft"';  | 
                                                        |
| 703 | + }  | 
                                                        |
| 541 | 704 | }  | 
                                                        
| 542 | 705 | $output .= '},';  | 
                                                        
| 543 | 706 |  						$output .= '"geometry": {'; | 
                                                        
@@ -545,15 +708,19 @@ discard block  | 
                                                    ||
| 545 | 708 | $output .= '"coordinates": [';  | 
                                                        
| 546 | 709 |  								if ($currenttime != '') { | 
                                                        
| 547 | 710 |  									if (strtotime($spotter_item['date']) < $currenttime) { | 
                                                        
| 548 | - if (!isset($archivespeed)) $archivespeed = 1;  | 
                                                        |
| 711 | +										if (!isset($archivespeed)) { | 
                                                        |
| 712 | + $archivespeed = 1;  | 
                                                        |
| 713 | + }  | 
                                                        |
| 549 | 714 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));  | 
                                                        
| 550 | 715 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        
| 551 | - if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];  | 
                                                        |
| 552 | -										else { | 
                                                        |
| 716 | +										if (!isset($idistance) || $fdistance < $idistance) { | 
                                                        |
| 717 | + $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];  | 
                                                        |
| 718 | +										} else { | 
                                                        |
| 553 | 719 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));  | 
                                                        
| 554 | 720 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);  | 
                                                        
| 555 | - if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];  | 
                                                        |
| 556 | -											else { | 
                                                        |
| 721 | +											if (!isset($idistance) || $fdistance < $idistance) { | 
                                                        |
| 722 | + $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];  | 
                                                        |
| 723 | +											} else { | 
                                                        |
| 557 | 724 | $output .= $spotter_item['longitude'].', ';  | 
                                                        
| 558 | 725 | $output .= $spotter_item['latitude'];  | 
                                                        
| 559 | 726 | }  | 
                                                        
@@ -631,7 +798,9 @@ discard block  | 
                                                    ||
| 631 | 798 | }  | 
                                                        
| 632 | 799 | */  | 
                                                        
| 633 | 800 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);  | 
                                                        
| 634 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];  | 
                                                        |
| 801 | +				if ($history == '' && isset($_COOKIE['history'])) { | 
                                                        |
| 802 | + $history = $_COOKIE['history'];  | 
                                                        |
| 803 | + }  | 
                                                        |
| 635 | 804 | |
| 636 | 805 | if (  | 
                                                        
| 637 | 806 | (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')  | 
                                                        
@@ -694,8 +863,11 @@ discard block  | 
                                                    ||
| 694 | 863 | $output_history .= ']}},';  | 
                                                        
| 695 | 864 | $output .= $output_history;  | 
                                                        
| 696 | 865 | }  | 
                                                        
| 697 | -								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 698 | -								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 866 | +								if ($compress) { | 
                                                        |
| 867 | +									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 868 | +								} else { | 
                                                        |
| 869 | +									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 870 | + }  | 
                                                        |
| 699 | 871 | }  | 
                                                        
| 700 | 872 | $output_history .= '[';  | 
                                                        
| 701 | 873 | $output_history .= $spotter_history['longitude'].', ';  | 
                                                        
@@ -714,8 +886,11 @@ discard block  | 
                                                    ||
| 714 | 886 | $prev_alt = $alt;  | 
                                                        
| 715 | 887 |  						} else { | 
                                                        
| 716 | 888 |  							if ($d == false) { | 
                                                        
| 717 | -								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 718 | -								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 889 | +								if ($compress) { | 
                                                        |
| 890 | +									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 891 | +								} else { | 
                                                        |
| 892 | +									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 893 | + }  | 
                                                        |
| 719 | 894 | $d = true;  | 
                                                        
| 720 | 895 | }  | 
                                                        
| 721 | 896 | $output_history .= '[';  | 
                                                        
@@ -738,7 +913,9 @@ discard block  | 
                                                    ||
| 738 | 913 | $output_historyd = '[';  | 
                                                        
| 739 | 914 | $output_historyd .= $spotter_item['longitude'].', ';  | 
                                                        
| 740 | 915 | $output_historyd .= $spotter_item['latitude'];  | 
                                                        
| 741 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;  | 
                                                        |
| 916 | +							if (isset($spotter_history['altitude'])) { | 
                                                        |
| 917 | + $output_historyd .= ','.$spotter_item['altitude']*30.48;  | 
                                                        |
| 918 | + }  | 
                                                        |
| 742 | 919 | $output_historyd .= '],';  | 
                                                        
| 743 | 920 | //$output_history = $output_historyd.$output_history;  | 
                                                        
| 744 | 921 | $output_history = $output_history.$output_historyd;  | 
                                                        
@@ -760,8 +937,11 @@ discard block  | 
                                                    ||
| 760 | 937 | && $spotter_item['arrival_airport'] != 'NA'  | 
                                                        
| 761 | 938 | && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true")  | 
                                                        
| 762 | 939 |  				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { | 
                                                        
| 763 | -				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 764 | -				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 940 | +				    if ($compress) { | 
                                                        |
| 941 | +				    	$output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 942 | +				    } else { | 
                                                        |
| 943 | +				    	$output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 944 | + }  | 
                                                        |
| 765 | 945 |  				    if (isset($spotter_item['departure_airport_latitude'])) { | 
                                                        
| 766 | 946 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';  | 
                                                        
| 767 | 947 |  				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { | 
                                                        
@@ -794,8 +974,11 @@ discard block  | 
                                                    ||
| 794 | 974 | || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute)  | 
                                                        
| 795 | 975 |  				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { | 
                                                        
| 796 | 976 | $havedata = false;  | 
                                                        
| 797 | -				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 798 | -				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 977 | +				    if ($compress) { | 
                                                        |
| 978 | +				    	$output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 979 | +				    } else { | 
                                                        |
| 980 | +				    	$output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; | 
                                                        |
| 981 | + }  | 
                                                        |
| 799 | 982 | $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';  | 
                                                        
| 800 | 983 | |
| 801 | 984 |  				    if (isset($spotter_item['arrival_airport_latitude'])) { | 
                                                        
@@ -810,7 +993,9 @@ discard block  | 
                                                    ||
| 810 | 993 | }  | 
                                                        
| 811 | 994 | //$output_dest = substr($output_dest, 0, -1);  | 
                                                        
| 812 | 995 | $output_dest .= ']}},';  | 
                                                        
| 813 | - if ($havedata) $output .= $output_dest;  | 
                                                        |
| 996 | +				    if ($havedata) { | 
                                                        |
| 997 | + $output .= $output_dest;  | 
                                                        |
| 998 | + }  | 
                                                        |
| 814 | 999 | unset($output_dest);  | 
                                                        
| 815 | 1000 | }  | 
                                                        
| 816 | 1001 | }  | 
                                                        
@@ -818,7 +1003,9 @@ discard block  | 
                                                    ||
| 818 | 1003 | $output .= ']';  | 
                                                        
| 819 | 1004 | $output .= ',"initial_sqltime": "'.$sqltime.'",';  | 
                                                        
| 820 | 1005 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';  | 
                                                        
| 821 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';  | 
                                                        |
| 1006 | +			if (isset($begindate)) { | 
                                                        |
| 1007 | + $output .= '"archive_date": "'.$begindate.'",';  | 
                                                        |
| 1008 | + }  | 
                                                        |
| 822 | 1009 | $output .= '"fc": "'.$j.'"';  | 
                                                        
| 823 | 1010 |  		} else { | 
                                                        
| 824 | 1011 | $output .= '"features": ';  |