@@ -30,8 +30,12 @@ discard block |
||
| 30 | 30 | //$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00"; |
| 31 | 31 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00"; |
| 32 | 32 | $sql_date = $end_date; |
| 33 | - } else $sql_date = ''; |
|
| 34 | -} else $sql_date = ''; |
|
| 33 | + } else { |
|
| 34 | + $sql_date = ''; |
|
| 35 | + } |
|
| 36 | + } else { |
|
| 37 | + $sql_date = ''; |
|
| 38 | +} |
|
| 35 | 39 | |
| 36 | 40 | if (isset($_GET['highest_altitude'])) { |
| 37 | 41 | //for altitude manipulation |
@@ -45,8 +49,12 @@ discard block |
||
| 45 | 49 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 46 | 50 | $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
| 47 | 51 | $sql_altitude = $start_altitude; |
| 48 | - } else $sql_altitude = ''; |
|
| 49 | -} else $sql_altitude = ''; |
|
| 52 | + } else { |
|
| 53 | + $sql_altitude = ''; |
|
| 54 | + } |
|
| 55 | + } else { |
|
| 56 | + $sql_altitude = ''; |
|
| 57 | +} |
|
| 50 | 58 | |
| 51 | 59 | //calculuation for the pagination |
| 52 | 60 | if(!isset($_GET['limit'])) |
@@ -64,7 +72,7 @@ discard block |
||
| 64 | 72 | $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
| 65 | 73 | $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
| 66 | 74 | } |
| 67 | -} else { |
|
| 75 | +} else { |
|
| 68 | 76 | $limit_explode = explode(",", $_GET['limit']); |
| 69 | 77 | $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
| 70 | 78 | $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
@@ -97,10 +105,15 @@ discard block |
||
| 97 | 105 | $origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_STRING); |
| 98 | 106 | $dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT); |
| 99 | 107 | if ($dist != '') { |
| 100 | - if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934; |
|
| 101 | - elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852; |
|
| 108 | + if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') { |
|
| 109 | + $dist = $dist*1.60934; |
|
| 110 | + } elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') { |
|
| 111 | + $dist = $dist*1.852; |
|
| 112 | + } |
|
| 113 | + } |
|
| 114 | + if (!isset($sql_date)) { |
|
| 115 | + $sql_date = ''; |
|
| 102 | 116 | } |
| 103 | - if (!isset($sql_date)) $sql_date = ''; |
|
| 104 | 117 | if ($archive == 1) { |
| 105 | 118 | $SpotterArchive = new SpotterArchive(); |
| 106 | 119 | $spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist); |
@@ -168,7 +181,10 @@ discard block |
||
| 168 | 181 | if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; } |
| 169 | 182 | if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; } |
| 170 | 183 | if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; } |
| 171 | - if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; } |
|
| 184 | + if (isset($_GET['highlights'])) { |
|
| 185 | + if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; |
|
| 186 | + } |
|
| 187 | + } |
|
| 172 | 188 | if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; } |
| 173 | 189 | if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; } |
| 174 | 190 | if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; } |
@@ -279,7 +295,10 @@ discard block |
||
| 279 | 295 | <div class="form-group"> |
| 280 | 296 | <label class="control-label col-sm-2"><?php echo _("Keywords"); ?></label> |
| 281 | 297 | <div class="col-sm-10"> |
| 282 | - <input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) print $q; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
| 298 | + <input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) { |
|
| 299 | + print $q; |
|
| 300 | +} |
|
| 301 | +?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
| 283 | 302 | </div> |
| 284 | 303 | </div> |
| 285 | 304 | </fieldset> |
@@ -294,7 +313,10 @@ discard block |
||
| 294 | 313 | </select> |
| 295 | 314 | </div> |
| 296 | 315 | </div> |
| 297 | - <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script> |
|
| 316 | + <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) { |
|
| 317 | + print $manufacturer; |
|
| 318 | +} |
|
| 319 | +?>')</script> |
|
| 298 | 320 | <div class="form-group"> |
| 299 | 321 | <label class="control-label col-sm-2"><?php echo _("Type"); ?></label> |
| 300 | 322 | <div class="col-sm-10"> |
@@ -303,11 +325,17 @@ discard block |
||
| 303 | 325 | </select> |
| 304 | 326 | </div> |
| 305 | 327 | </div> |
| 306 | - <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script> |
|
| 328 | + <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) { |
|
| 329 | + print $aircraft_icao; |
|
| 330 | +} |
|
| 331 | +?>');</script> |
|
| 307 | 332 | <div class="form-group"> |
| 308 | 333 | <label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> |
| 309 | 334 | <div class="col-sm-10"> |
| 310 | - <input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) print $registration; ?>" size="8" placeholder="<?php echo _("Registration"); ?>" /> |
|
| 335 | + <input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) { |
|
| 336 | + print $registration; |
|
| 337 | +} |
|
| 338 | +?>" size="8" placeholder="<?php echo _("Registration"); ?>" /> |
|
| 311 | 339 | </div> |
| 312 | 340 | </div> |
| 313 | 341 | <?php |
@@ -316,22 +344,31 @@ discard block |
||
| 316 | 344 | <div class="form-group"> |
| 317 | 345 | <label class="control-label col-sm-2"><?php echo _("Pilot id"); ?></label> |
| 318 | 346 | <div class="col-sm-10"> |
| 319 | - <input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $pilot_id; ?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" /> |
|
| 347 | + <input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) { |
|
| 348 | + print $pilot_id; |
|
| 349 | +} |
|
| 350 | +?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" /> |
|
| 320 | 351 | </div> |
| 321 | 352 | </div> |
| 322 | 353 | <div class="form-group"> |
| 323 | 354 | <label class="control-label col-sm-2"><?php echo _("Pilot name"); ?></label> |
| 324 | 355 | <div class="col-sm-10"> |
| 325 | - <input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $pilot_name; ?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" /> |
|
| 356 | + <input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) { |
|
| 357 | + print $pilot_name; |
|
| 358 | +} |
|
| 359 | +?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" /> |
|
| 326 | 360 | </div> |
| 327 | 361 | </div> |
| 328 | 362 | <?php |
| 329 | -}else { |
|
| 363 | +} else { |
|
| 330 | 364 | ?> |
| 331 | 365 | <div class="form-group"> |
| 332 | 366 | <label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> |
| 333 | 367 | <div class="col-sm-10"> |
| 334 | - <input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) print $owner; ?>" size="15" placeholder="<?php echo _("Owner name"); ?>" /> |
|
| 368 | + <input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) { |
|
| 369 | + print $owner; |
|
| 370 | +} |
|
| 371 | +?>" size="15" placeholder="<?php echo _("Owner name"); ?>" /> |
|
| 335 | 372 | </div> |
| 336 | 373 | </div> |
| 337 | 374 | <?php |
@@ -339,8 +376,14 @@ discard block |
||
| 339 | 376 | ?> |
| 340 | 377 | <div class="form-group"> |
| 341 | 378 | <div class="col-sm-offset-2 col-sm-10"> |
| 342 | - <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
| 343 | - <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
| 379 | + <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) { |
|
| 380 | + if ($_GET['highlights'] == "true"){ print 'checked="checked"'; |
|
| 381 | +} |
|
| 382 | +} ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
| 383 | + <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) { |
|
| 384 | + if ($_GET['highlights'] == "true"){ print 'checked="checked"'; |
|
| 385 | +} |
|
| 386 | +} ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
| 344 | 387 | </div> |
| 345 | 388 | </div> |
| 346 | 389 | </fieldset> |
@@ -354,7 +397,10 @@ discard block |
||
| 354 | 397 | </select> |
| 355 | 398 | </div> |
| 356 | 399 | </div> |
| 357 | - <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script> |
|
| 400 | + <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) { |
|
| 401 | + print $airline; |
|
| 402 | +} |
|
| 403 | +?>');</script> |
|
| 358 | 404 | <div class="form-group"> |
| 359 | 405 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
| 360 | 406 | <div class="col-sm-10"> |
@@ -363,19 +409,34 @@ discard block |
||
| 363 | 409 | </select> |
| 364 | 410 | </div> |
| 365 | 411 | </div> |
| 366 | - <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script> |
|
| 412 | + <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) { |
|
| 413 | + print $airline_country; |
|
| 414 | +} |
|
| 415 | +?>');</script> |
|
| 367 | 416 | <div class="form-group"> |
| 368 | 417 | <label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> |
| 369 | 418 | <div class="col-sm-10"> |
| 370 | - <input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" /> |
|
| 419 | + <input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) { |
|
| 420 | + print $callsign; |
|
| 421 | +} |
|
| 422 | +?>" size="8" placeholder="<?php echo _("Callsign"); ?>" /> |
|
| 371 | 423 | </div> |
| 372 | 424 | </div> |
| 373 | 425 | <div class="form-group"> |
| 374 | 426 | <div class="col-sm-offset-2 col-sm-10"> |
| 375 | 427 | <label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label> |
| 376 | - <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
| 377 | - <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
| 378 | - <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label> |
|
| 428 | + <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) { |
|
| 429 | + if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; |
|
| 430 | +} |
|
| 431 | +} ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
| 432 | + <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) { |
|
| 433 | + if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; |
|
| 434 | +} |
|
| 435 | +} ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
| 436 | + <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) { |
|
| 437 | + if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; |
|
| 438 | +} |
|
| 439 | +} ?>> <?php echo _("Only Military airlines"); ?></label> |
|
| 379 | 440 | </div> |
| 380 | 441 | </div> |
| 381 | 442 | </fieldset> |
@@ -389,7 +450,10 @@ discard block |
||
| 389 | 450 | </select> |
| 390 | 451 | </div> |
| 391 | 452 | </div> |
| 392 | - <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script> |
|
| 453 | + <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) { |
|
| 454 | + print $airport_icao; |
|
| 455 | +} |
|
| 456 | +?>');</script> |
|
| 393 | 457 | <div class="form-group"> |
| 394 | 458 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
| 395 | 459 | <div class="col-sm-10"> |
@@ -398,7 +462,10 @@ discard block |
||
| 398 | 462 | </select> |
| 399 | 463 | </div> |
| 400 | 464 | </div> |
| 401 | - <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script> |
|
| 465 | + <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) { |
|
| 466 | + print $airport_country; |
|
| 467 | +} |
|
| 468 | +?>');</script> |
|
| 402 | 469 | </fieldset> |
| 403 | 470 | <fieldset> |
| 404 | 471 | <legend><?php echo _("Route"); ?></legend> |
@@ -410,7 +477,10 @@ discard block |
||
| 410 | 477 | </select> |
| 411 | 478 | </div> |
| 412 | 479 | </div> |
| 413 | - <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script> |
|
| 480 | + <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) { |
|
| 481 | + print $departure_airport_route; |
|
| 482 | +} |
|
| 483 | +?>');</script> |
|
| 414 | 484 | <div class="form-group"> |
| 415 | 485 | <label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> |
| 416 | 486 | <div class="col-sm-10"> |
@@ -419,7 +489,10 @@ discard block |
||
| 419 | 489 | </select> |
| 420 | 490 | </div> |
| 421 | 491 | </div> |
| 422 | - <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script> |
|
| 492 | + <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) { |
|
| 493 | + print $arrival_airport_route; |
|
| 494 | +} |
|
| 495 | +?>');</script> |
|
| 423 | 496 | </fieldset> |
| 424 | 497 | <fieldset> |
| 425 | 498 | <legend><?php echo _("Date"); ?></legend> |
@@ -427,7 +500,10 @@ discard block |
||
| 427 | 500 | <label class="control-label col-sm-2"><?php echo _("Start Date"); ?></label> |
| 428 | 501 | <div class="col-sm-10"> |
| 429 | 502 | <div class='input-group date' id='datetimepicker1'> |
| 430 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) print $start_date; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
| 503 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) { |
|
| 504 | + print $start_date; |
|
| 505 | +} |
|
| 506 | +?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
| 431 | 507 | <span class="input-group-addon"> |
| 432 | 508 | <span class="glyphicon glyphicon-calendar"></span> |
| 433 | 509 | </span> |
@@ -438,7 +514,10 @@ discard block |
||
| 438 | 514 | <label class="control-label col-sm-2"><?php echo _("End Date"); ?></label> |
| 439 | 515 | <div class="col-sm-10"> |
| 440 | 516 | <div class='input-group date' id='datetimepicker2'> |
| 441 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) print $end_date; ?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
| 517 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) { |
|
| 518 | + print $end_date; |
|
| 519 | +} |
|
| 520 | +?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
| 442 | 521 | <span class="input-group-addon"> |
| 443 | 522 | <span class="glyphicon glyphicon-calendar"></span> |
| 444 | 523 | </span> |
@@ -511,19 +590,33 @@ discard block |
||
| 511 | 590 | <div class="form-group"> |
| 512 | 591 | <label class="control-label col-sm-2"><?php echo _("Latitude"); ?></label> |
| 513 | 592 | <div class="col-sm-10"> |
| 514 | - <input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) print $origlat; ?>" /> |
|
| 593 | + <input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) { |
|
| 594 | + print $origlat; |
|
| 595 | +} |
|
| 596 | +?>" /> |
|
| 515 | 597 | </div> |
| 516 | 598 | </div> |
| 517 | 599 | <div class="form-group"> |
| 518 | 600 | <label class="control-label col-sm-2"><?php echo _("Longitude"); ?></label> |
| 519 | 601 | <div class="col-sm-10"> |
| 520 | - <input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) print $origlon; ?>" /> |
|
| 602 | + <input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) { |
|
| 603 | + print $origlon; |
|
| 604 | +} |
|
| 605 | +?>" /> |
|
| 521 | 606 | </div> |
| 522 | 607 | </div> |
| 523 | 608 | <div class="form-group"> |
| 524 | - <label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label> |
|
| 609 | + <label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) { |
|
| 610 | + print $globalDistanceUnit; |
|
| 611 | +} else { |
|
| 612 | + print 'km'; |
|
| 613 | +} |
|
| 614 | +print ')'; ?></label> |
|
| 525 | 615 | <div class="col-sm-10"> |
| 526 | - <input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) print $distance; ?>" /> |
|
| 616 | + <input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) { |
|
| 617 | + print $distance; |
|
| 618 | +} |
|
| 619 | +?>" /> |
|
| 527 | 620 | </div> |
| 528 | 621 | </div> |
| 529 | 622 | </fieldset> |
@@ -131,45 +131,72 @@ discard block |
||
| 131 | 131 | </div> |
| 132 | 132 | <p> |
| 133 | 133 | <label for="dbhost">Database hostname</label> |
| 134 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
| 134 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
| 135 | + print $globalDBhost; |
|
| 136 | +} |
|
| 137 | +?>" /> |
|
| 135 | 138 | </p> |
| 136 | 139 | <p> |
| 137 | 140 | <label for="dbport">Database port</label> |
| 138 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
| 141 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
| 142 | + print $globalDBport; |
|
| 143 | +} |
|
| 144 | +?>" /> |
|
| 139 | 145 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
| 140 | 146 | </p> |
| 141 | 147 | <p> |
| 142 | 148 | <label for="dbname">Database name</label> |
| 143 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
| 149 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
| 150 | + print $globalDBname; |
|
| 151 | +} |
|
| 152 | +?>" /> |
|
| 144 | 153 | </p> |
| 145 | 154 | <p> |
| 146 | 155 | <label for="dbuser">Database user</label> |
| 147 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
| 156 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
| 157 | + print $globalDBuser; |
|
| 158 | +} |
|
| 159 | +?>" /> |
|
| 148 | 160 | </p> |
| 149 | 161 | <p> |
| 150 | 162 | <label for="dbuserpass">Database user password</label> |
| 151 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
| 163 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
| 164 | + print $globalDBpass; |
|
| 165 | +} |
|
| 166 | +?>" /> |
|
| 152 | 167 | </p> |
| 153 | 168 | </fieldset> |
| 154 | 169 | <fieldset id="site"> |
| 155 | 170 | <legend>Site configuration</legend> |
| 156 | 171 | <p> |
| 157 | 172 | <label for="sitename">Site name</label> |
| 158 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
| 173 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
| 174 | + print $globalName; |
|
| 175 | +} |
|
| 176 | +?>" /> |
|
| 159 | 177 | </p> |
| 160 | 178 | <p> |
| 161 | 179 | <label for="siteurl">Site directory</label> |
| 162 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
| 180 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
| 181 | + print $globalURL; |
|
| 182 | +} |
|
| 183 | +?>" /> |
|
| 163 | 184 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
| 164 | 185 | </p> |
| 165 | 186 | <p> |
| 166 | 187 | <label for="timezone">Timezone</label> |
| 167 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
| 188 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
| 189 | + print $globalTimezone; |
|
| 190 | +} |
|
| 191 | +?>" /> |
|
| 168 | 192 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
| 169 | 193 | </p> |
| 170 | 194 | <p> |
| 171 | 195 | <label for="language">Language</label> |
| 172 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
| 196 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
| 197 | + print $globalLanguage; |
|
| 198 | +} |
|
| 199 | +?>" /> |
|
| 173 | 200 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
| 174 | 201 | </p> |
| 175 | 202 | </fieldset> |
@@ -190,11 +217,17 @@ discard block |
||
| 190 | 217 | <div id="mapbox_data"> |
| 191 | 218 | <p> |
| 192 | 219 | <label for="mapboxid">Mapbox id</label> |
| 193 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
| 220 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
| 221 | + print $globalMapboxId; |
|
| 222 | +} |
|
| 223 | +?>" /> |
|
| 194 | 224 | </p> |
| 195 | 225 | <p> |
| 196 | 226 | <label for="mapboxtoken">Mapbox token</label> |
| 197 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
| 227 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
| 228 | + print $globalMapboxToken; |
|
| 229 | +} |
|
| 230 | +?>" /> |
|
| 198 | 231 | </p> |
| 199 | 232 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
| 200 | 233 | </div> |
@@ -202,7 +235,10 @@ discard block |
||
| 202 | 235 | <div id="google_data"> |
| 203 | 236 | <p> |
| 204 | 237 | <label for="googlekey">Google API key</label> |
| 205 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
| 238 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
| 239 | + print $globalGoogleAPIKey; |
|
| 240 | +} |
|
| 241 | +?>" /> |
|
| 206 | 242 | <p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p> |
| 207 | 243 | </p> |
| 208 | 244 | </div> |
@@ -210,7 +246,10 @@ discard block |
||
| 210 | 246 | <div id="bing_data"> |
| 211 | 247 | <p> |
| 212 | 248 | <label for="bingkey">Bing Map key</label> |
| 213 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
| 249 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
| 250 | + print $globalBingMapKey; |
|
| 251 | +} |
|
| 252 | +?>" /> |
|
| 214 | 253 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
| 215 | 254 | </p> |
| 216 | 255 | </div> |
@@ -218,7 +257,10 @@ discard block |
||
| 218 | 257 | <div id="mapquest_data"> |
| 219 | 258 | <p> |
| 220 | 259 | <label for="mapquestkey">MapQuest key</label> |
| 221 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
| 260 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
| 261 | + print $globalMapQuestKey; |
|
| 262 | +} |
|
| 263 | +?>" /> |
|
| 222 | 264 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
| 223 | 265 | </p> |
| 224 | 266 | </div> |
@@ -226,11 +268,17 @@ discard block |
||
| 226 | 268 | <div id="here_data"> |
| 227 | 269 | <p> |
| 228 | 270 | <label for="hereappid">Here App_Id</label> |
| 229 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
| 271 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
| 272 | + print $globalHereappId; |
|
| 273 | +} |
|
| 274 | +?>" /> |
|
| 230 | 275 | </p> |
| 231 | 276 | <p> |
| 232 | 277 | <label for="hereappcode">Here App_Code</label> |
| 233 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
| 278 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
| 279 | + print $globalHereappCode; |
|
| 280 | +} |
|
| 281 | +?>" /> |
|
| 234 | 282 | </p> |
| 235 | 283 | <p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p> |
| 236 | 284 | </div> |
@@ -238,7 +286,10 @@ discard block |
||
| 238 | 286 | <div id="openweathermap_data"> |
| 239 | 287 | <p> |
| 240 | 288 | <label for="openweathermapkey">OpenWeatherMap key (weather layer)</label> |
| 241 | - <input type="text" name="oepnweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" /> |
|
| 289 | + <input type="text" name="oepnweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) { |
|
| 290 | + print $globalOpenWeatherMapKey; |
|
| 291 | +} |
|
| 292 | +?>" /> |
|
| 242 | 293 | <p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p> |
| 243 | 294 | </p> |
| 244 | 295 | </div> |
@@ -248,42 +299,86 @@ discard block |
||
| 248 | 299 | <legend>Coverage area</legend> |
| 249 | 300 | <p> |
| 250 | 301 | <label for="latitudemax">The maximum latitude (north)</label> |
| 251 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
| 302 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
| 303 | + print $globalLatitudeMax; |
|
| 304 | +} |
|
| 305 | +?>" /> |
|
| 252 | 306 | </p> |
| 253 | 307 | <p> |
| 254 | 308 | <label for="latitudemin">The minimum latitude (south)</label> |
| 255 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
| 309 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
| 310 | + print $globalLatitudeMin; |
|
| 311 | +} |
|
| 312 | +?>" /> |
|
| 256 | 313 | </p> |
| 257 | 314 | <p> |
| 258 | 315 | <label for="longitudemax">The maximum longitude (west)</label> |
| 259 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
| 316 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
| 317 | + print $globalLongitudeMax; |
|
| 318 | +} |
|
| 319 | +?>" /> |
|
| 260 | 320 | </p> |
| 261 | 321 | <p> |
| 262 | 322 | <label for="longitudemin">The minimum longitude (east)</label> |
| 263 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
| 323 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
| 324 | + print $globalLongitudeMin; |
|
| 325 | +} |
|
| 326 | +?>" /> |
|
| 264 | 327 | </p> |
| 265 | 328 | <p> |
| 266 | 329 | <label for="latitudecenter">The latitude center</label> |
| 267 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
| 330 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
| 331 | + print $globalCenterLatitude; |
|
| 332 | +} |
|
| 333 | +?>" /> |
|
| 268 | 334 | </p> |
| 269 | 335 | <p> |
| 270 | 336 | <label for="longitudecenter">The longitude center</label> |
| 271 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
| 337 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
| 338 | + print $globalCenterLongitude; |
|
| 339 | +} |
|
| 340 | +?>" /> |
|
| 272 | 341 | </p> |
| 273 | 342 | <p> |
| 274 | 343 | <label for="livezoom">Default Zoom on live map</label> |
| 275 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
| 344 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
| 345 | + print $globalLiveZoom; |
|
| 346 | +} else { |
|
| 347 | + print '9'; |
|
| 348 | +} |
|
| 349 | +?>" /> |
|
| 276 | 350 | </p> |
| 277 | 351 | <p> |
| 278 | 352 | <label for="squawk_country">Country for squawk usage</label> |
| 279 | 353 | <select name="squawk_country" id="squawk_country"> |
| 280 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
| 281 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
| 282 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
| 283 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
| 284 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
| 285 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
| 286 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
| 354 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
| 355 | + print ' selected '; |
|
| 356 | +} |
|
| 357 | +?>>UK</option> |
|
| 358 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
| 359 | + print ' selected '; |
|
| 360 | +} |
|
| 361 | +?>>NZ</option> |
|
| 362 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
| 363 | + print ' selected '; |
|
| 364 | +} |
|
| 365 | +?>>US</option> |
|
| 366 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
| 367 | + print ' selected '; |
|
| 368 | +} |
|
| 369 | +?>>AU</option> |
|
| 370 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
| 371 | + print ' selected '; |
|
| 372 | +} |
|
| 373 | +?>>NL</option> |
|
| 374 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
| 375 | + print ' selected '; |
|
| 376 | +} |
|
| 377 | +?>>FR</option> |
|
| 378 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
| 379 | + print ' selected '; |
|
| 380 | +} |
|
| 381 | +?>>TR</option> |
|
| 287 | 382 | </select> |
| 288 | 383 | </p> |
| 289 | 384 | </fieldset> |
@@ -292,15 +387,24 @@ discard block |
||
| 292 | 387 | <p><i>Only put in DB flights that are inside a circle</i></p> |
| 293 | 388 | <p> |
| 294 | 389 | <label for="latitude">Center latitude</label> |
| 295 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
| 390 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
| 391 | + echo $globalDistanceIgnore['latitude']; |
|
| 392 | +} |
|
| 393 | +?>" /> |
|
| 296 | 394 | </p> |
| 297 | 395 | <p> |
| 298 | 396 | <label for="longitude">Center longitude</label> |
| 299 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
| 397 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
| 398 | + echo $globalDistanceIgnore['longitude']; |
|
| 399 | +} |
|
| 400 | +?>" /> |
|
| 300 | 401 | </p> |
| 301 | 402 | <p> |
| 302 | 403 | <label for="Distance">Distance (in km)</label> |
| 303 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
| 404 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
| 405 | + echo $globalDistanceIgnore['distance']; |
|
| 406 | +} |
|
| 407 | +?>" /> |
|
| 304 | 408 | </p> |
| 305 | 409 | </fieldset> |
| 306 | 410 | <fieldset id="sourceloc"> |
@@ -409,11 +513,17 @@ discard block |
||
| 409 | 513 | <div id="flightaware_data"> |
| 410 | 514 | <p> |
| 411 | 515 | <label for="flightawareusername">FlightAware username</label> |
| 412 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
| 516 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
| 517 | + print $globalFlightAwareUsername; |
|
| 518 | +} |
|
| 519 | +?>" /> |
|
| 413 | 520 | </p> |
| 414 | 521 | <p> |
| 415 | 522 | <label for="flightawarepassword">FlightAware password/API key</label> |
| 416 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
| 523 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
| 524 | + print $globalFlightAwarePassword; |
|
| 525 | +} |
|
| 526 | +?>" /> |
|
| 417 | 527 | </p> |
| 418 | 528 | </div> |
| 419 | 529 | --> |
@@ -473,29 +583,92 @@ discard block |
||
| 473 | 583 | ?> |
| 474 | 584 | <td> |
| 475 | 585 | <select name="format[]" id="format"> |
| 476 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
| 477 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
| 478 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
| 479 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
| 480 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
| 481 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
| 482 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
| 483 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
| 484 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
| 485 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
| 486 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
| 487 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
| 488 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
| 489 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
| 490 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
| 491 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
| 492 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
| 493 | - <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option> |
|
| 586 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
| 587 | + print 'selected'; |
|
| 588 | +} |
|
| 589 | +?>>Auto</option> |
|
| 590 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
| 591 | + print 'selected'; |
|
| 592 | +} |
|
| 593 | +?>>SBS</option> |
|
| 594 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
| 595 | + print 'selected'; |
|
| 596 | +} |
|
| 597 | +?>>TSV</option> |
|
| 598 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
| 599 | + print 'selected'; |
|
| 600 | +} |
|
| 601 | +?>>Raw</option> |
|
| 602 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
| 603 | + print 'selected'; |
|
| 604 | +} |
|
| 605 | +?>>APRS</option> |
|
| 606 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
| 607 | + print 'selected'; |
|
| 608 | +} |
|
| 609 | +?>>Radarcape deltadb.txt</option> |
|
| 610 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
| 611 | + print 'selected'; |
|
| 612 | +} |
|
| 613 | +?>>Vatsim</option> |
|
| 614 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
| 615 | + print 'selected'; |
|
| 616 | +} |
|
| 617 | +?>>Virtual Radar Server AircraftList.json</option> |
|
| 618 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
| 619 | + print 'selected'; |
|
| 620 | +} |
|
| 621 | +?>>Virtual Radar Server TCP</option> |
|
| 622 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
| 623 | + print 'selected'; |
|
| 624 | +} |
|
| 625 | +?>>phpVMS</option> |
|
| 626 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
| 627 | + print 'selected'; |
|
| 628 | +} |
|
| 629 | +?>>Virtual Airlines Manager</option> |
|
| 630 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
| 631 | + print 'selected'; |
|
| 632 | +} |
|
| 633 | +?>>IVAO</option> |
|
| 634 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
| 635 | + print 'selected'; |
|
| 636 | +} |
|
| 637 | +?>>FlightGear Multiplayer</option> |
|
| 638 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
| 639 | + print 'selected'; |
|
| 640 | +} |
|
| 641 | +?>>FlightGear Singleplayer</option> |
|
| 642 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
| 643 | + print 'selected'; |
|
| 644 | +} |
|
| 645 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
| 646 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
| 647 | + print 'selected'; |
|
| 648 | +} |
|
| 649 | +?>>ACARS SBS-3 over TCP</option> |
|
| 650 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
| 651 | + print 'selected'; |
|
| 652 | +} |
|
| 653 | +?>>NMEA AIS over TCP</option> |
|
| 654 | + <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') { |
|
| 655 | + print 'selected'; |
|
| 656 | +} |
|
| 657 | +?>>AirWhere website</option> |
|
| 494 | 658 | </select> |
| 495 | 659 | </td> |
| 496 | - <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /></td> |
|
| 497 | - <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td> |
|
| 498 | - <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td> |
|
| 660 | + <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
| 661 | + print $source['name']; |
|
| 662 | +} |
|
| 663 | +?>" /></td> |
|
| 664 | + <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) { |
|
| 665 | + print 'checked'; |
|
| 666 | +} |
|
| 667 | +?> /></td> |
|
| 668 | + <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) { |
|
| 669 | + print 'checked'; |
|
| 670 | +} |
|
| 671 | +?> /></td> |
|
| 499 | 672 | <td><input type="button" id="delhost" value="Delete" onclick="deleteRow(this)" /> <input type="button" id="addhost" value="Add" onclick="insRow()" /></td> |
| 500 | 673 | </tr> |
| 501 | 674 | <?php |
@@ -545,11 +718,17 @@ discard block |
||
| 545 | 718 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
| 546 | 719 | <p> |
| 547 | 720 | <label for="acarshost">ACARS UDP host</label> |
| 548 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
| 721 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
| 722 | + print $globalACARSHost; |
|
| 723 | +} |
|
| 724 | +?>" /> |
|
| 549 | 725 | </p> |
| 550 | 726 | <p> |
| 551 | 727 | <label for="acarsport">ACARS UDP port</label> |
| 552 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
| 728 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
| 729 | + print $globalACARSPort; |
|
| 730 | +} |
|
| 731 | +?>" /> |
|
| 553 | 732 | </p> |
| 554 | 733 | </fieldset> |
| 555 | 734 | </div> |
@@ -629,13 +808,19 @@ discard block |
||
| 629 | 808 | <div id="schedules_options"> |
| 630 | 809 | <p> |
| 631 | 810 | <label for="britishairways">British Airways API Key</label> |
| 632 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
| 811 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
| 812 | + print $globalBritishAirwaysKey; |
|
| 813 | +} |
|
| 814 | +?>" /> |
|
| 633 | 815 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
| 634 | 816 | </p> |
| 635 | 817 | <!-- |
| 636 | 818 | <p> |
| 637 | 819 | <label for="transavia">Transavia Test API Consumer Key</label> |
| 638 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
| 820 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
| 821 | + print $globalTransaviaKey; |
|
| 822 | +} |
|
| 823 | +?>" /> |
|
| 639 | 824 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
| 640 | 825 | </p> |
| 641 | 826 | --> |
@@ -644,10 +829,16 @@ discard block |
||
| 644 | 829 | <b>Lufthansa API Key</b> |
| 645 | 830 | <p> |
| 646 | 831 | <label for="lufthansakey">Key</label> |
| 647 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
| 832 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
| 833 | + print $globalLufthansaKey['key']; |
|
| 834 | +} |
|
| 835 | +?>" /> |
|
| 648 | 836 | </p><p> |
| 649 | 837 | <label for="lufthansasecret">Secret</label> |
| 650 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
| 838 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
| 839 | + print $globalLufthansaKey['secret']; |
|
| 840 | +} |
|
| 841 | +?>" /> |
|
| 651 | 842 | </p> |
| 652 | 843 | </div> |
| 653 | 844 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -667,7 +858,10 @@ discard block |
||
| 667 | 858 | </p> |
| 668 | 859 | <p> |
| 669 | 860 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
| 670 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
| 861 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
| 862 | + print $globalNOTAMSource; |
|
| 863 | +} |
|
| 864 | +?>" /> |
|
| 671 | 865 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
| 672 | 866 | </p> |
| 673 | 867 | <br /> |
@@ -683,14 +877,20 @@ discard block |
||
| 683 | 877 | <div id="metarsrc"> |
| 684 | 878 | <p> |
| 685 | 879 | <label for="metarsource">URL of your METAR source</label> |
| 686 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
| 880 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
| 881 | + print $globalMETARurl; |
|
| 882 | +} |
|
| 883 | +?>" /> |
|
| 687 | 884 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
| 688 | 885 | </p> |
| 689 | 886 | </div> |
| 690 | 887 | <br /> |
| 691 | 888 | <p> |
| 692 | 889 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
| 693 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
| 890 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
| 891 | + print $globalBitlyAccessToken; |
|
| 892 | +} |
|
| 893 | +?>" /> |
|
| 694 | 894 | </p> |
| 695 | 895 | <br /> |
| 696 | 896 | <p> |
@@ -710,7 +910,12 @@ discard block |
||
| 710 | 910 | </p> |
| 711 | 911 | <p> |
| 712 | 912 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
| 713 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" /> |
|
| 913 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
| 914 | + print $globalArchiveMonths; |
|
| 915 | +} else { |
|
| 916 | + echo '0'; |
|
| 917 | +} |
|
| 918 | +?>" /> |
|
| 714 | 919 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
| 715 | 920 | </p> |
| 716 | 921 | <p> |
@@ -720,12 +925,22 @@ discard block |
||
| 720 | 925 | </p> |
| 721 | 926 | <p> |
| 722 | 927 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
| 723 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" /> |
|
| 928 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
| 929 | + print $globalArchiveKeepMonths; |
|
| 930 | +} else { |
|
| 931 | + echo '0'; |
|
| 932 | +} |
|
| 933 | +?>" /> |
|
| 724 | 934 | <p class="help-block">0 to disable</p> |
| 725 | 935 | </p> |
| 726 | 936 | <p> |
| 727 | 937 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
| 728 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" /> |
|
| 938 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
| 939 | + print $globalArchiveKeepTrackMonths; |
|
| 940 | +} else { |
|
| 941 | + echo '0'; |
|
| 942 | +} |
|
| 943 | +?>" /> |
|
| 729 | 944 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
| 730 | 945 | </p> |
| 731 | 946 | <br /> |
@@ -735,7 +950,12 @@ discard block |
||
| 735 | 950 | <p class="help-block">Uncheck if the script is running as cron job</p> |
| 736 | 951 | <div id="cronends"> |
| 737 | 952 | <label for="cronend">Run script for xx seconds</label> |
| 738 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
| 953 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
| 954 | + print $globalCronEnd; |
|
| 955 | +} else { |
|
| 956 | + print '0'; |
|
| 957 | +} |
|
| 958 | +?>" /> |
|
| 739 | 959 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
| 740 | 960 | </div> |
| 741 | 961 | </p> |
@@ -788,15 +1008,30 @@ discard block |
||
| 788 | 1008 | <br /> |
| 789 | 1009 | <p> |
| 790 | 1010 | <label for="refresh">Show flights detected since xxx seconds</label> |
| 791 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
| 1011 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
| 1012 | + echo $globalLiveInterval; |
|
| 1013 | +} else { |
|
| 1014 | + echo '200'; |
|
| 1015 | +} |
|
| 1016 | +?>" /> |
|
| 792 | 1017 | </p> |
| 793 | 1018 | <p> |
| 794 | 1019 | <label for="maprefresh">Live map refresh (in seconds)</label> |
| 795 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
| 1020 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
| 1021 | + echo $globalMapRefresh; |
|
| 1022 | +} else { |
|
| 1023 | + echo '30'; |
|
| 1024 | +} |
|
| 1025 | +?>" /> |
|
| 796 | 1026 | </p> |
| 797 | 1027 | <p> |
| 798 | 1028 | <label for="mapidle">Map idle timeout (in minutes)</label> |
| 799 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
| 1029 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
| 1030 | + echo $globalMapIdleTimeout; |
|
| 1031 | +} else { |
|
| 1032 | + echo '30'; |
|
| 1033 | +} |
|
| 1034 | +?>" /> |
|
| 800 | 1035 | <p class="help-block">0 to disable</p> |
| 801 | 1036 | </p> |
| 802 | 1037 | <p> |
@@ -806,12 +1041,20 @@ discard block |
||
| 806 | 1041 | <br /> |
| 807 | 1042 | <p> |
| 808 | 1043 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
| 809 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
| 1044 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
| 1045 | + echo $globalClosestMinDist; |
|
| 1046 | +} else { |
|
| 1047 | + echo '50'; |
|
| 1048 | +} |
|
| 1049 | +?>" /> |
|
| 810 | 1050 | </p> |
| 811 | 1051 | <br /> |
| 812 | 1052 | <p> |
| 813 | 1053 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
| 814 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
| 1054 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
| 1055 | + echo $globalAircraftSize; |
|
| 1056 | +} |
|
| 1057 | +?>" /> |
|
| 815 | 1058 | </p> |
| 816 | 1059 | <br /> |
| 817 | 1060 | <p> |
@@ -824,7 +1067,12 @@ discard block |
||
| 824 | 1067 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 825 | 1068 | ?> |
| 826 | 1069 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
| 827 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
| 1070 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
| 1071 | + echo $globalAircraftIconColor; |
|
| 1072 | +} else { |
|
| 1073 | + echo '1a3151'; |
|
| 1074 | +} |
|
| 1075 | +?>" /> |
|
| 828 | 1076 | <?php |
| 829 | 1077 | if (!is_writable('../cache')) { |
| 830 | 1078 | ?> |
@@ -842,14 +1090,27 @@ discard block |
||
| 842 | 1090 | <p> |
| 843 | 1091 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
| 844 | 1092 | <div class="range"> |
| 845 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
| 846 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
| 1093 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
| 1094 | + echo $globalAirportZoom; |
|
| 1095 | +} else { |
|
| 1096 | + echo '7'; |
|
| 1097 | +} |
|
| 1098 | +?>" /> |
|
| 1099 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
| 1100 | + echo $globalAirportZoom; |
|
| 1101 | +} else { |
|
| 1102 | + echo '7'; |
|
| 1103 | +} |
|
| 1104 | +?></output> |
|
| 847 | 1105 | </div> |
| 848 | 1106 | </p> |
| 849 | 1107 | <br /> |
| 850 | 1108 | <p> |
| 851 | 1109 | <label for="customcss">Custom CSS web path</label> |
| 852 | - <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" /> |
|
| 1110 | + <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) { |
|
| 1111 | + echo $globalCustomCSS; |
|
| 1112 | +} |
|
| 1113 | +?>" /> |
|
| 853 | 1114 | </p> |
| 854 | 1115 | </fieldset> |
| 855 | 1116 | <input type="submit" name="submit" value="Create/Update database & write setup" /> |
@@ -876,8 +1137,12 @@ discard block |
||
| 876 | 1137 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
| 877 | 1138 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
| 878 | 1139 | |
| 879 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
| 880 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1140 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
| 1141 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
| 1142 | + } |
|
| 1143 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
| 1144 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1145 | + } |
|
| 881 | 1146 | |
| 882 | 1147 | $_SESSION['database_root'] = $dbroot; |
| 883 | 1148 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -945,15 +1210,23 @@ discard block |
||
| 945 | 1210 | $source_city = $_POST['source_city']; |
| 946 | 1211 | $source_country = $_POST['source_country']; |
| 947 | 1212 | $source_ref = $_POST['source_ref']; |
| 948 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
| 949 | - else $source_id = array(); |
|
| 1213 | + if (isset($source_id)) { |
|
| 1214 | + $source_id = $_POST['source_id']; |
|
| 1215 | + } else { |
|
| 1216 | + $source_id = array(); |
|
| 1217 | + } |
|
| 950 | 1218 | |
| 951 | 1219 | $sources = array(); |
| 952 | 1220 | foreach ($source_name as $keys => $name) { |
| 953 | - 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]); |
|
| 954 | - 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]); |
|
| 1221 | + if (isset($source_id[$keys])) { |
|
| 1222 | + $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]); |
|
| 1223 | + } else { |
|
| 1224 | + $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]); |
|
| 1225 | + } |
|
| 1226 | + } |
|
| 1227 | + if (count($sources) > 0) { |
|
| 1228 | + $_SESSION['sources'] = $sources; |
|
| 955 | 1229 | } |
| 956 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
| 957 | 1230 | |
| 958 | 1231 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
| 959 | 1232 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -974,14 +1247,23 @@ discard block |
||
| 974 | 1247 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
| 975 | 1248 | |
| 976 | 1249 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
| 977 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 978 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1250 | + if ($globalaircraft == 'aircraft') { |
|
| 1251 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 1252 | + } else { |
|
| 1253 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1254 | + } |
|
| 979 | 1255 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
| 980 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 981 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1256 | + if ($globaltracker == 'tracker') { |
|
| 1257 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 1258 | + } else { |
|
| 1259 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1260 | + } |
|
| 982 | 1261 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
| 983 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 984 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1262 | + if ($globalmarine == 'marine') { |
|
| 1263 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 1264 | + } else { |
|
| 1265 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1266 | + } |
|
| 985 | 1267 | |
| 986 | 1268 | /* |
| 987 | 1269 | $globalSBS1Hosts = array(); |
@@ -1002,19 +1284,35 @@ discard block |
||
| 1002 | 1284 | $port = $_POST['port']; |
| 1003 | 1285 | $name = $_POST['name']; |
| 1004 | 1286 | $format = $_POST['format']; |
| 1005 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
| 1006 | - else $sourcestats = array(); |
|
| 1007 | - if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive']; |
|
| 1008 | - else $noarchive = array(); |
|
| 1287 | + if (isset($_POST['sourcestats'])) { |
|
| 1288 | + $sourcestats = $_POST['sourcestats']; |
|
| 1289 | + } else { |
|
| 1290 | + $sourcestats = array(); |
|
| 1291 | + } |
|
| 1292 | + if (isset($_POST['noarchive'])) { |
|
| 1293 | + $noarchive = $_POST['noarchive']; |
|
| 1294 | + } else { |
|
| 1295 | + $noarchive = array(); |
|
| 1296 | + } |
|
| 1009 | 1297 | $gSources = array(); |
| 1010 | 1298 | $forcepilots = false; |
| 1011 | 1299 | foreach ($host as $key => $h) { |
| 1012 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
| 1013 | - else $cov = 'FALSE'; |
|
| 1014 | - if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
|
| 1015 | - else $arch = 'FALSE'; |
|
| 1016 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch); |
|
| 1017 | - if ($format[$key] == 'airwhere') $forcepilots = true; |
|
| 1300 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
| 1301 | + $cov = 'TRUE'; |
|
| 1302 | + } else { |
|
| 1303 | + $cov = 'FALSE'; |
|
| 1304 | + } |
|
| 1305 | + if (isset($noarchive[$key]) && $noarchive[$key] == 1) { |
|
| 1306 | + $arch = 'TRUE'; |
|
| 1307 | + } else { |
|
| 1308 | + $arch = 'FALSE'; |
|
| 1309 | + } |
|
| 1310 | + if ($h != '') { |
|
| 1311 | + $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch); |
|
| 1312 | + } |
|
| 1313 | + if ($format[$key] == 'airwhere') { |
|
| 1314 | + $forcepilots = true; |
|
| 1315 | + } |
|
| 1018 | 1316 | } |
| 1019 | 1317 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
| 1020 | 1318 | |
@@ -1042,7 +1340,9 @@ discard block |
||
| 1042 | 1340 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
| 1043 | 1341 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
| 1044 | 1342 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
| 1045 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1343 | + } else { |
|
| 1344 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1345 | + } |
|
| 1046 | 1346 | |
| 1047 | 1347 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
| 1048 | 1348 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1081,7 +1381,9 @@ discard block |
||
| 1081 | 1381 | |
| 1082 | 1382 | // Create in settings.php keys not yet configurable if not already here |
| 1083 | 1383 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
| 1084 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1384 | + if (!isset($globalDebug)) { |
|
| 1385 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1386 | + } |
|
| 1085 | 1387 | |
| 1086 | 1388 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
| 1087 | 1389 | if ($resetyearstats == 'resetyearstats') { |
@@ -1118,37 +1420,56 @@ discard block |
||
| 1118 | 1420 | } |
| 1119 | 1421 | */ |
| 1120 | 1422 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
| 1121 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1122 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1123 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1124 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1423 | + if ($globalsbs == 'sbs') { |
|
| 1424 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1425 | + } else { |
|
| 1426 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1427 | + } |
|
| 1428 | + if ($globalaprs == 'aprs') { |
|
| 1429 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1430 | + } else { |
|
| 1431 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1432 | + } |
|
| 1125 | 1433 | $va = false; |
| 1126 | 1434 | if ($globalivao == 'ivao') { |
| 1127 | 1435 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
| 1128 | 1436 | $va = true; |
| 1129 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1437 | + } else { |
|
| 1438 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1439 | + } |
|
| 1130 | 1440 | if ($globalvatsim == 'vatsim') { |
| 1131 | 1441 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
| 1132 | 1442 | $va = true; |
| 1133 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1443 | + } else { |
|
| 1444 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1445 | + } |
|
| 1134 | 1446 | if ($globalphpvms == 'phpvms') { |
| 1135 | 1447 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
| 1136 | 1448 | $va = true; |
| 1137 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1449 | + } else { |
|
| 1450 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1451 | + } |
|
| 1138 | 1452 | if ($globalvam == 'vam') { |
| 1139 | 1453 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
| 1140 | 1454 | $va = true; |
| 1141 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1455 | + } else { |
|
| 1456 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1457 | + } |
|
| 1142 | 1458 | if ($va) { |
| 1143 | 1459 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
| 1144 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1460 | + } else { |
|
| 1461 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1462 | + } |
|
| 1145 | 1463 | if ($globalva == 'va' || $va) { |
| 1146 | 1464 | $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
| 1147 | 1465 | $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
| 1148 | 1466 | } else { |
| 1149 | 1467 | $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
| 1150 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1151 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
| 1468 | + if ($forcepilots) { |
|
| 1469 | + $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1470 | + } else { |
|
| 1471 | + $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
| 1472 | + } |
|
| 1152 | 1473 | } |
| 1153 | 1474 | |
| 1154 | 1475 | |
@@ -1309,7 +1630,9 @@ discard block |
||
| 1309 | 1630 | $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
| 1310 | 1631 | } |
| 1311 | 1632 | |
| 1312 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1633 | + if (!isset($globalTransaction)) { |
|
| 1634 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1635 | + } |
|
| 1313 | 1636 | |
| 1314 | 1637 | // Set some defaults values... |
| 1315 | 1638 | if (!isset($globalAircraftImageSources)) { |
@@ -1324,15 +1647,23 @@ discard block |
||
| 1324 | 1647 | |
| 1325 | 1648 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
| 1326 | 1649 | |
| 1327 | - if ($error == '') settings::modify_settings($settings); |
|
| 1328 | - if ($error == '') settings::comment_settings($settings_comment); |
|
| 1650 | + if ($error == '') { |
|
| 1651 | + settings::modify_settings($settings); |
|
| 1652 | + } |
|
| 1653 | + if ($error == '') { |
|
| 1654 | + settings::comment_settings($settings_comment); |
|
| 1655 | + } |
|
| 1329 | 1656 | if ($error != '') { |
| 1330 | 1657 | print '<div class="info column">'.$error.'</div>'; |
| 1331 | 1658 | require('../footer.php'); |
| 1332 | 1659 | exit; |
| 1333 | 1660 | } else { |
| 1334 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
| 1335 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
| 1661 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
| 1662 | + $_SESSION['waypoints'] = 1; |
|
| 1663 | + } |
|
| 1664 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
| 1665 | + $_SESSION['owner'] = 1; |
|
| 1666 | + } |
|
| 1336 | 1667 | if (isset($_POST['createdb'])) { |
| 1337 | 1668 | $_SESSION['install'] = 'database_create'; |
| 1338 | 1669 | } else { |
@@ -1373,10 +1704,18 @@ discard block |
||
| 1373 | 1704 | $popw = false; |
| 1374 | 1705 | foreach ($_SESSION['done'] as $done) { |
| 1375 | 1706 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
| 1376 | - if ($done == 'Create database') $pop = true; |
|
| 1377 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
| 1378 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
| 1379 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
| 1707 | + if ($done == 'Create database') { |
|
| 1708 | + $pop = true; |
|
| 1709 | + } |
|
| 1710 | + if ($_SESSION['install'] == 'database_create') { |
|
| 1711 | + $pop = true; |
|
| 1712 | + } |
|
| 1713 | + if ($_SESSION['install'] == 'database_import') { |
|
| 1714 | + $popi = true; |
|
| 1715 | + } |
|
| 1716 | + if ($_SESSION['install'] == 'waypoints') { |
|
| 1717 | + $popw = true; |
|
| 1718 | + } |
|
| 1380 | 1719 | } |
| 1381 | 1720 | if ($pop) { |
| 1382 | 1721 | sleep(5); |
@@ -1387,7 +1726,9 @@ discard block |
||
| 1387 | 1726 | } else if ($popw) { |
| 1388 | 1727 | sleep(5); |
| 1389 | 1728 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
| 1390 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 1729 | + } else { |
|
| 1730 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 1731 | + } |
|
| 1391 | 1732 | print '</div></ul>'; |
| 1392 | 1733 | print '<div id="error"></div>'; |
| 1393 | 1734 | /* foreach ($_SESSION['done'] as $done) { |