@@ -41,7 +41,9 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | if (isset($globalTimezone)) { |
| 43 | 43 | date_default_timezone_set($globalTimezone); |
| 44 | - } else date_default_timezone_set('UTC'); |
|
| 44 | + } else { |
|
| 45 | + date_default_timezone_set('UTC'); |
|
| 46 | + } |
|
| 45 | 47 | print '<tr>'; |
| 46 | 48 | if (isset($_GET['image']) && $_GET['image'] == "true") |
| 47 | 49 | { |
@@ -98,10 +100,14 @@ discard block |
||
| 98 | 100 | print '</div>'; |
| 99 | 101 | print '<div class="other2">'; |
| 100 | 102 | print '<span><i class="fa fa-arrow-up"></i> '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country']; |
| 101 | - if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') print ' ('.$spotter_item['departure_airport_time'].')'; |
|
| 103 | + if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
|
| 104 | + print ' ('.$spotter_item['departure_airport_time'].')'; |
|
| 105 | + } |
|
| 102 | 106 | print '</span>'; |
| 103 | 107 | print '<span><i class="fa fa-arrow-down"></i> '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country']; |
| 104 | - if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') print ' ('.$spotter_item['arrival_airport_time'].')'; |
|
| 108 | + if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') { |
|
| 109 | + print ' ('.$spotter_item['arrival_airport_time'].')'; |
|
| 110 | + } |
|
| 105 | 111 | print '</span>'; |
| 106 | 112 | print '</div>'; |
| 107 | 113 | print '<div class="other3">'; |
@@ -51,7 +51,9 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | if (isset($globalTimezone)) { |
| 53 | 53 | date_default_timezone_set($globalTimezone); |
| 54 | - } else date_default_timezone_set('UTC'); |
|
| 54 | + } else { |
|
| 55 | + date_default_timezone_set('UTC'); |
|
| 56 | + } |
|
| 55 | 57 | |
| 56 | 58 | //date_default_timezone_set('UTC'); |
| 57 | 59 | if (is_array($all_data) && count($all_data) > 0) { |
@@ -300,9 +302,13 @@ discard block |
||
| 300 | 302 | print '<div>'; |
| 301 | 303 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
| 302 | 304 | { |
| 303 | - if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 304 | - elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 305 | - else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 305 | + if ($spotter_item['format_source'] == 'whazzup') { |
|
| 306 | + print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 307 | + } elseif ($spotter_item['format_source'] == 'vatsimtxt') { |
|
| 308 | + print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
| 309 | + } else { |
|
| 310 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 311 | + } |
|
| 306 | 312 | } else { |
| 307 | 313 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
| 308 | 314 | { |
@@ -71,8 +71,12 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
| 73 | 73 | $ident = $spotter_array[0]['ident']; |
| 74 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
| 75 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
| 74 | + if (isset($spotter_array[0]['latitude'])) { |
|
| 75 | + $latitude = $spotter_array[0]['latitude']; |
|
| 76 | + } |
|
| 77 | + if (isset($spotter_array[0]['longitude'])) { |
|
| 78 | + $longitude = $spotter_array[0]['longitude']; |
|
| 79 | + } |
|
| 76 | 80 | require_once('header.php'); |
| 77 | 81 | if (isset($globalArchive) && $globalArchive) { |
| 78 | 82 | // Requirement for altitude graph |
@@ -80,7 +84,9 @@ discard block |
||
| 80 | 84 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
| 81 | 85 | if (isset($globalTimezone)) { |
| 82 | 86 | date_default_timezone_set($globalTimezone); |
| 83 | - } else date_default_timezone_set('UTC'); |
|
| 87 | + } else { |
|
| 88 | + date_default_timezone_set('UTC'); |
|
| 89 | + } |
|
| 84 | 90 | if (count($all_data) > 0) { |
| 85 | 91 | print '<div id="chart6" class="chart" width="100%"></div> |
| 86 | 92 | <script> |
@@ -5,8 +5,11 @@ |
||
| 5 | 5 | |
| 6 | 6 | $Spotter = new Spotter(); |
| 7 | 7 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 8 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 9 | -else $spotter_array = ''; |
|
| 8 | +if (isset($_GET['date'])) { |
|
| 9 | + $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 10 | +} else { |
|
| 11 | + $spotter_array = ''; |
|
| 12 | +} |
|
| 10 | 13 | |
| 11 | 14 | if (!empty($spotter_array)) |
| 12 | 15 | { |
@@ -11,10 +11,21 @@ |
||
| 11 | 11 | <p>You can contribute to <?php print $globalName; ?> if you have an ADS-B receiver.</p> |
| 12 | 12 | <h3>You need to : </h3> |
| 13 | 13 | <ul> |
| 14 | - <li>Create an account on <a href="<?php if (isset($globalContributeLogin)) print $globalContributeLogin.'">'.$globalContributeLogin; else print 'https://login.flightairmap.fr">login.flightairmap.fr'; ?></a></li> |
|
| 14 | + <li>Create an account on <a href="<?php if (isset($globalContributeLogin)) { |
|
| 15 | + print $globalContributeLogin.'">'.$globalContributeLogin; |
|
| 16 | +} else { |
|
| 17 | + print 'https://login.flightairmap.fr">login.flightairmap.fr'; |
|
| 18 | +} |
|
| 19 | +?></a></li> |
|
| 15 | 20 | <li>Download dump1090 fork from <a href="https://github.com/Ysurac/dump1090">https://github.com/Ysurac/dump1090</a></li> |
| 16 | 21 | <li>Compile zfamup1090 with <em>make zfamup1090</em> (you need to have libcurl installed)</li> |
| 17 | - <li>Run zfamup1090 : <em>./zfamup1090 --net-zfam-user YourUsername --net-zfam-pass YourPassword<?php if (isset($globalContributeURL)) print ' --net-zfam-addr '.$globalContributeURL; if (isset($globalContributePort)) print ' --net-zfam-port '.$globalContributePort; ?></em> (add <em>--net-bo-ipaddr ipofbeastsource --net-bo-port portofbeastsource</em> if needed, default to 127.0.0.1 and 30005)</li> |
|
| 22 | + <li>Run zfamup1090 : <em>./zfamup1090 --net-zfam-user YourUsername --net-zfam-pass YourPassword<?php if (isset($globalContributeURL)) { |
|
| 23 | + print ' --net-zfam-addr '.$globalContributeURL; |
|
| 24 | +} |
|
| 25 | +if (isset($globalContributePort)) { |
|
| 26 | + print ' --net-zfam-port '.$globalContributePort; |
|
| 27 | +} |
|
| 28 | +?></em> (add <em>--net-bo-ipaddr ipofbeastsource --net-bo-port portofbeastsource</em> if needed, default to 127.0.0.1 and 30005)</li> |
|
| 18 | 29 | </ul> |
| 19 | 30 | </div> |
| 20 | 31 | <?php |
@@ -26,8 +26,12 @@ discard block |
||
| 26 | 26 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 27 | 27 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00"; |
| 28 | 28 | $sql_date = $end_date; |
| 29 | - } else $sql_date = ''; |
|
| 30 | -} else $sql_date = ''; |
|
| 29 | + } else { |
|
| 30 | + $sql_date = ''; |
|
| 31 | + } |
|
| 32 | + } else { |
|
| 33 | + $sql_date = ''; |
|
| 34 | +} |
|
| 31 | 35 | |
| 32 | 36 | if (isset($_GET['highest_altitude'])) { |
| 33 | 37 | //for altitude manipulation |
@@ -41,8 +45,12 @@ discard block |
||
| 41 | 45 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 42 | 46 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 43 | 47 | $sql_altitude = $start_altitude; |
| 44 | - } else $sql_altitude = ''; |
|
| 45 | -} else $sql_altitude = ''; |
|
| 48 | + } else { |
|
| 49 | + $sql_altitude = ''; |
|
| 50 | + } |
|
| 51 | + } else { |
|
| 52 | + $sql_altitude = ''; |
|
| 53 | +} |
|
| 46 | 54 | |
| 47 | 55 | //calculuation for the pagination |
| 48 | 56 | if(!isset($_GET['limit'])) |
@@ -60,7 +68,7 @@ discard block |
||
| 60 | 68 | $limit_end = $_GET['number_results']; |
| 61 | 69 | $absolute_difference = $_GET['number_results']; |
| 62 | 70 | } |
| 63 | -} else { |
|
| 71 | +} else { |
|
| 64 | 72 | $limit_explode = explode(",", $_GET['limit']); |
| 65 | 73 | $limit_start = $limit_explode[0]; |
| 66 | 74 | $limit_end = $limit_explode[1]; |
@@ -93,10 +101,15 @@ discard block |
||
| 93 | 101 | $origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_STRING); |
| 94 | 102 | $dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT); |
| 95 | 103 | if ($dist != '') { |
| 96 | - if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934; |
|
| 97 | - elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852; |
|
| 104 | + if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') { |
|
| 105 | + $dist = $dist*1.60934; |
|
| 106 | + } elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') { |
|
| 107 | + $dist = $dist*1.852; |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | + if (!isset($sql_date)) { |
|
| 111 | + $sql_date = ''; |
|
| 98 | 112 | } |
| 99 | - if (!isset($sql_date)) $sql_date = ''; |
|
| 100 | 113 | if ($archive == 1) { |
| 101 | 114 | $SpotterArchive = new SpotterArchive(); |
| 102 | 115 | $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); |
@@ -164,7 +177,10 @@ discard block |
||
| 164 | 177 | if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$_GET['aircraft'].'</span> '; } |
| 165 | 178 | if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$_GET['manufacturer'].'</span> '; } |
| 166 | 179 | if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$_GET['registration'].'</span> '; } |
| 167 | - if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$_GET['highlights'].'</span> '; } |
|
| 180 | + if (isset($_GET['highlights'])) { |
|
| 181 | + if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$_GET['highlights'].'</span> '; |
|
| 182 | + } |
|
| 183 | + } |
|
| 168 | 184 | if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$_GET['airline'].'</span> '; } |
| 169 | 185 | if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$_GET['airline_country'].'</span> '; } |
| 170 | 186 | if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$_GET['airline_type'].'</span> '; } |
@@ -274,7 +290,10 @@ discard block |
||
| 274 | 290 | <fieldset> |
| 275 | 291 | <div class="form-group"> |
| 276 | 292 | <label><?php echo _("Keywords"); ?></label> |
| 277 | - <input type="text" id="q" name="q" value="<?php if (isset($_GET['q'])) print $_GET['q']; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
| 293 | + <input type="text" id="q" name="q" value="<?php if (isset($_GET['q'])) { |
|
| 294 | + print $_GET['q']; |
|
| 295 | +} |
|
| 296 | +?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
| 278 | 297 | </div> |
| 279 | 298 | </fieldset> |
| 280 | 299 | <div class="advanced-form"> |
@@ -286,41 +305,62 @@ discard block |
||
| 286 | 305 | <option></option> |
| 287 | 306 | </select> |
| 288 | 307 | </div> |
| 289 | - <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $_GET['manufacturer']; ?>')</script> |
|
| 308 | + <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) { |
|
| 309 | + print $_GET['manufacturer']; |
|
| 310 | +} |
|
| 311 | +?>')</script> |
|
| 290 | 312 | <div class="form-group"> |
| 291 | 313 | <label><?php echo _("Type"); ?></label> |
| 292 | 314 | <select name="aircraft" id="aircrafttypes" class="selectpicker" data-live-search="true"> |
| 293 | 315 | <option></option> |
| 294 | 316 | </select> |
| 295 | 317 | </div> |
| 296 | - <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $_GET['aircraft_icao']; ?>');</script> |
|
| 318 | + <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) { |
|
| 319 | + print $_GET['aircraft_icao']; |
|
| 320 | +} |
|
| 321 | +?>');</script> |
|
| 297 | 322 | <div class="form-group"> |
| 298 | 323 | <label><?php echo _("Registration"); ?></label> |
| 299 | - <input type="text" name="registration" value="<?php if (isset($_GET['registration'])) print $_GET['registration']; ?>" size="8" /> |
|
| 324 | + <input type="text" name="registration" value="<?php if (isset($_GET['registration'])) { |
|
| 325 | + print $_GET['registration']; |
|
| 326 | +} |
|
| 327 | +?>" size="8" /> |
|
| 300 | 328 | </div> |
| 301 | 329 | <?php |
| 302 | 330 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 303 | 331 | ?> |
| 304 | 332 | <div class="form-group"> |
| 305 | 333 | <label><?php echo _("Pilot id"); ?></label> |
| 306 | - <input type="text" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $_GET['pilot_id']; ?>" size="15" /> |
|
| 334 | + <input type="text" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) { |
|
| 335 | + print $_GET['pilot_id']; |
|
| 336 | +} |
|
| 337 | +?>" size="15" /> |
|
| 307 | 338 | </div> |
| 308 | 339 | <div class="form-group"> |
| 309 | 340 | <label><?php echo _("Pilot name"); ?></label> |
| 310 | - <input type="text" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $_GET['pilot_name']; ?>" size="15" /> |
|
| 341 | + <input type="text" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) { |
|
| 342 | + print $_GET['pilot_name']; |
|
| 343 | +} |
|
| 344 | +?>" size="15" /> |
|
| 311 | 345 | </div> |
| 312 | 346 | <?php |
| 313 | -}else { |
|
| 347 | +} else { |
|
| 314 | 348 | ?> |
| 315 | 349 | <div class="form-group"> |
| 316 | 350 | <label><?php echo _("Owner name"); ?></label> |
| 317 | - <input type="text" name="owner" value="<?php if (isset($_GET['owner'])) print $_GET['owner']; ?>" size="15" /> |
|
| 351 | + <input type="text" name="owner" value="<?php if (isset($_GET['owner'])) { |
|
| 352 | + print $_GET['owner']; |
|
| 353 | +} |
|
| 354 | +?>" size="15" /> |
|
| 318 | 355 | </div> |
| 319 | 356 | <?php |
| 320 | 357 | } |
| 321 | 358 | ?> |
| 322 | 359 | <div class="form-group checkbox"> |
| 323 | - <div><input type="checkbox" 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> |
|
| 360 | + <div><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) { |
|
| 361 | + if ($_GET['highlights'] == "true"){ print 'checked="checked"'; |
|
| 362 | +} |
|
| 363 | +} ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div> |
|
| 324 | 364 | </div> |
| 325 | 365 | </fieldset> |
| 326 | 366 | <fieldset> |
@@ -331,23 +371,41 @@ discard block |
||
| 331 | 371 | <option></option> |
| 332 | 372 | </select> |
| 333 | 373 | </div> |
| 334 | - <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $_GET['airline']; ?>');</script> |
|
| 374 | + <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) { |
|
| 375 | + print $_GET['airline']; |
|
| 376 | +} |
|
| 377 | +?>');</script> |
|
| 335 | 378 | <div class="form-group"> |
| 336 | 379 | <label><?php echo _("Country"); ?></label> |
| 337 | 380 | <select name="airline_country" id="airlinecountries" class="selectpicker" data-live-search="true"> |
| 338 | 381 | <option></option> |
| 339 | 382 | </select> |
| 340 | 383 | </div> |
| 341 | - <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $_GET['airline_country']; ?>');</script> |
|
| 384 | + <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) { |
|
| 385 | + print $_GET['airline_country']; |
|
| 386 | +} |
|
| 387 | +?>');</script> |
|
| 342 | 388 | <div class="form-group"> |
| 343 | 389 | <label><?php echo _("Callsign"); ?></label> |
| 344 | - <input type="text" name="callsign" value="<?php if (isset($_GET['callsign'])) print $_GET['callsign']; ?>" size="8" /> |
|
| 390 | + <input type="text" name="callsign" value="<?php if (isset($_GET['callsign'])) { |
|
| 391 | + print $_GET['callsign']; |
|
| 392 | +} |
|
| 393 | +?>" size="8" /> |
|
| 345 | 394 | </div> |
| 346 | 395 | <div class="form-group radio"> |
| 347 | 396 | <div><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"'; } ?>> <label for="airline_type_all"><?php echo _("All airlines types"); ?></label></div> |
| 348 | - <div><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"'; } ?>> <label for="airline_type_passenger"><?php echo _("Only Passenger airlines"); ?></label></div> |
|
| 349 | - <div><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"'; } ?>> <label for="airline_type_cargo"><?php echo _("Only Cargo airlines"); ?></label></div> |
|
| 350 | - <div><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"'; } ?>> <label for="airline_type_military"><?php echo _("Only Military airlines"); ?></label></div> |
|
| 397 | + <div><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) { |
|
| 398 | + if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; |
|
| 399 | +} |
|
| 400 | +} ?>> <label for="airline_type_passenger"><?php echo _("Only Passenger airlines"); ?></label></div> |
|
| 401 | + <div><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) { |
|
| 402 | + if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; |
|
| 403 | +} |
|
| 404 | +} ?>> <label for="airline_type_cargo"><?php echo _("Only Cargo airlines"); ?></label></div> |
|
| 405 | + <div><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) { |
|
| 406 | + if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; |
|
| 407 | +} |
|
| 408 | +} ?>> <label for="airline_type_military"><?php echo _("Only Military airlines"); ?></label></div> |
|
| 351 | 409 | </div> |
| 352 | 410 | </fieldset> |
| 353 | 411 | <fieldset> |
@@ -358,14 +416,20 @@ discard block |
||
| 358 | 416 | <option></option> |
| 359 | 417 | </select> |
| 360 | 418 | </div> |
| 361 | - <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $_GET['airport_icao']; ?>');</script> |
|
| 419 | + <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) { |
|
| 420 | + print $_GET['airport_icao']; |
|
| 421 | +} |
|
| 422 | +?>');</script> |
|
| 362 | 423 | <div class="form-group"> |
| 363 | 424 | <label><?php echo _("Country"); ?></label> |
| 364 | 425 | <select name="airport_country" id="airportcountries" class="selectpicker" data-live-search="true"> |
| 365 | 426 | <option></option> |
| 366 | 427 | </select> |
| 367 | 428 | </div> |
| 368 | - <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $_GET['airport_country']; ?>');</script> |
|
| 429 | + <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) { |
|
| 430 | + print $_GET['airport_country']; |
|
| 431 | +} |
|
| 432 | +?>');</script> |
|
| 369 | 433 | </fieldset> |
| 370 | 434 | <fieldset> |
| 371 | 435 | <legend><?php echo _("Route"); ?></legend> |
@@ -375,21 +439,30 @@ discard block |
||
| 375 | 439 | <option></option> |
| 376 | 440 | </select> |
| 377 | 441 | </div> |
| 378 | - <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $_GET['departure_airport_route']; ?>');</script> |
|
| 442 | + <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) { |
|
| 443 | + print $_GET['departure_airport_route']; |
|
| 444 | +} |
|
| 445 | +?>');</script> |
|
| 379 | 446 | <div class="form-group"> |
| 380 | 447 | <label><?php echo _("Arrival Airport"); ?></label> |
| 381 | 448 | <select name="arrival_airport_route" id="arrivalairportnames" class="selectpicker" data-live-search="true"> |
| 382 | 449 | <option></option> |
| 383 | 450 | </select> |
| 384 | 451 | </div> |
| 385 | - <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $_GET['arrival_airport_route']; ?>');</script> |
|
| 452 | + <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) { |
|
| 453 | + print $_GET['arrival_airport_route']; |
|
| 454 | +} |
|
| 455 | +?>');</script> |
|
| 386 | 456 | </fieldset> |
| 387 | 457 | <fieldset> |
| 388 | 458 | <legend><?php echo _("Date"); ?></legend> |
| 389 | 459 | <div class="form-group"> |
| 390 | 460 | <label><?php echo _("Start Date"); ?></label> |
| 391 | 461 | <div class='input-group date' id='datetimepicker1'> |
| 392 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) print $_GET['start_date']; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
| 462 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) { |
|
| 463 | + print $_GET['start_date']; |
|
| 464 | +} |
|
| 465 | +?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
| 393 | 466 | <span class="input-group-addon"> |
| 394 | 467 | <span class="glyphicon glyphicon-calendar"></span> |
| 395 | 468 | </span> |
@@ -398,7 +471,10 @@ discard block |
||
| 398 | 471 | <div class="form-group"> |
| 399 | 472 | <label><?php echo _("End Date"); ?></label> |
| 400 | 473 | <div class='input-group date' id='datetimepicker2'> |
| 401 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) print $_GET['end_date']; ?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
| 474 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) { |
|
| 475 | + print $_GET['end_date']; |
|
| 476 | +} |
|
| 477 | +?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
| 402 | 478 | <span class="input-group-addon"> |
| 403 | 479 | <span class="glyphicon glyphicon-calendar"></span> |
| 404 | 480 | </span> |
@@ -474,7 +550,12 @@ discard block |
||
| 474 | 550 | <input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" /> |
| 475 | 551 | </div> |
| 476 | 552 | <div class="form-group"> |
| 477 | - <label><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label> |
|
| 553 | + <label><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) { |
|
| 554 | + print $globalDistanceUnit; |
|
| 555 | +} else { |
|
| 556 | + print 'km'; |
|
| 557 | +} |
|
| 558 | +print ')'; ?></label> |
|
| 478 | 559 | <input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" /> |
| 479 | 560 | </div> |
| 480 | 561 | </fieldset> |
@@ -11,7 +11,9 @@ discard block |
||
| 11 | 11 | $lines = file($filename); |
| 12 | 12 | foreach ($lines as $line) |
| 13 | 13 | { |
| 14 | - if (substr($line,0,2) == '--' || $line == '') continue; |
|
| 14 | + if (substr($line,0,2) == '--' || $line == '') { |
|
| 15 | + continue; |
|
| 16 | + } |
|
| 15 | 17 | $templine .= $line; |
| 16 | 18 | if (substr(trim($line), -1,1) == ';') |
| 17 | 19 | { |
@@ -35,7 +37,9 @@ discard block |
||
| 35 | 37 | //foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename) |
| 36 | 38 | while(false !== ($filename = readdir($dh))) |
| 37 | 39 | { |
| 38 | - if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename); |
|
| 40 | + if (preg_match('/\.sql$/',$filename)) { |
|
| 41 | + $error .= create_db::import_file($directory.$filename); |
|
| 42 | + } |
|
| 39 | 43 | } |
| 40 | 44 | return $error; |
| 41 | 45 | } |
@@ -51,13 +55,17 @@ discard block |
||
| 51 | 55 | // Dirty hack |
| 52 | 56 | if ($host != 'localhost' && $host != '127.0.0.1') { |
| 53 | 57 | $grantright = $_SERVER['SERVER_ADDR']; |
| 54 | - } else $grantright = 'localhost'; |
|
| 58 | + } else { |
|
| 59 | + $grantright = 'localhost'; |
|
| 60 | + } |
|
| 55 | 61 | try { |
| 56 | 62 | $dbh = new PDO($db_type.':host='.$host,$root,$root_pass); |
| 57 | 63 | $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 58 | 64 | if ($db_type == 'mysql') { |
| 59 | 65 | $dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
| 60 | - if ($grantright == 'localhost') $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
| 66 | + if ($grantright == 'localhost') { |
|
| 67 | + $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
| 68 | + } |
|
| 61 | 69 | } else if ($db_type == 'pgsql') { |
| 62 | 70 | $dbh->exec("CREATE DATABASE ".$db.";"); |
| 63 | 71 | $dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."'; |
@@ -215,14 +215,7 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | $r = null; |
| 217 | 217 | |
| 218 | - if( $code == "select" ) { $r = $this->test_select(); } |
|
| 219 | - elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } |
|
| 220 | - elseif( $code == "math_as" ) { $r = $this->test_math_as(); } |
|
| 221 | - elseif( $code == "count" ) { $r = $this->test_count(); } |
|
| 222 | - elseif( $code == "max" ) { $r = $this->test_max(); } |
|
| 223 | - elseif( $code == "load" ) { $r = $this->test_load(); } |
|
| 224 | - elseif( $code == "sample" ) { $r = $this->test_sample(); } |
|
| 225 | - else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
|
| 218 | + if( $code == "select" ) { $r = $this->test_select(); } elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } elseif( $code == "math_as" ) { $r = $this->test_math_as(); } elseif( $code == "count" ) { $r = $this->test_count(); } elseif( $code == "max" ) { $r = $this->test_max(); } elseif( $code == "load" ) { $r = $this->test_load(); } elseif( $code == "sample" ) { $r = $this->test_sample(); } else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
|
| 226 | 219 | $this->caps[$code] = $r; |
| 227 | 220 | if( isset( $this->caps_cache ) ) |
| 228 | 221 | { |
@@ -231,8 +224,7 @@ discard block |
||
| 231 | 224 | if( $was_cached ) |
| 232 | 225 | { |
| 233 | 226 | dba_replace( $db_key, $db_val, $this->caps_cache ); |
| 234 | - } |
|
| 235 | - else |
|
| 227 | + } else |
|
| 236 | 228 | { |
| 237 | 229 | dba_insert( $db_key, $db_val, $this->caps_cache ); |
| 238 | 230 | } |
@@ -164,15 +164,21 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 166 | 166 | $_SESSION['install'] = 'vatsim'; |
| 167 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 168 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 167 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 168 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 169 | + } else { |
|
| 170 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 171 | + } |
|
| 169 | 172 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
| 170 | 173 | $_SESSION['install'] = 'vatsim'; |
| 171 | 174 | $_SESSION['next'] = 'Insert VATSIM data'; |
| 172 | 175 | } elseif (isset($globalIVAO) && $globalIVAO) { |
| 173 | 176 | $_SESSION['install'] = 'vatsim'; |
| 174 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 175 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 177 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 178 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 179 | + } else { |
|
| 180 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 181 | + } |
|
| 176 | 182 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
| 177 | 183 | $_SESSION['install'] = 'vatsim'; |
| 178 | 184 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -303,7 +309,9 @@ discard block |
||
| 303 | 309 | $Source = new Source(); |
| 304 | 310 | $Source->deleteAllLocation(); |
| 305 | 311 | foreach ($sources as $src) { |
| 306 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
| 312 | + if (isset($src['latitude']) && $src['latitude'] != '') { |
|
| 313 | + $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
| 314 | + } |
|
| 307 | 315 | } |
| 308 | 316 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
| 309 | 317 | unset($_SESSION['sources']); |
@@ -314,15 +322,21 @@ discard block |
||
| 314 | 322 | */ |
| 315 | 323 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 316 | 324 | $_SESSION['install'] = 'vatsim'; |
| 317 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 318 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 325 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 326 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 327 | + } else { |
|
| 328 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 329 | + } |
|
| 319 | 330 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
| 320 | 331 | $_SESSION['install'] = 'vatsim'; |
| 321 | 332 | $_SESSION['next'] = 'Insert VATSIM data'; |
| 322 | 333 | } elseif (isset($globalIVAO) && $globalIVAO) { |
| 323 | 334 | $_SESSION['install'] = 'vatsim'; |
| 324 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 325 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 335 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 336 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 337 | + } else { |
|
| 338 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 339 | + } |
|
| 326 | 340 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
| 327 | 341 | $_SESSION['install'] = 'vatsim'; |
| 328 | 342 | $_SESSION['next'] = 'Insert phpVMS data'; |