@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
72 | 73 | } |
@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
72 | 73 | } |
@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
72 | 73 | } |
@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
72 | 73 | } |
@@ -25,7 +25,9 @@ discard block |
||
25 | 25 | echo json_encode($marinecnt); |
26 | 26 | } elseif ($ask == 'manufacturer') { |
27 | 27 | $manufacturers = $Stats->getAllManufacturers(); |
28 | - if (empty($manufacturers)) $manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + if (empty($manufacturers)) { |
|
29 | + $manufacturers = $Spotter->getAllManufacturers(); |
|
30 | + } |
|
29 | 31 | $all_manufacturers = array(); |
30 | 32 | foreach($manufacturers as $manufacturer) |
31 | 33 | { |
@@ -34,7 +36,9 @@ discard block |
||
34 | 36 | echo json_encode($all_manufacturers); |
35 | 37 | } elseif ($ask == 'aircrafttypes') { |
36 | 38 | $aircraft_types = $Stats->getAllAircraftTypes(); |
37 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
39 | + if (empty($aircraft_types)) { |
|
40 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
41 | + } |
|
38 | 42 | $all_aircraft_types = array(); |
39 | 43 | foreach($aircraft_types as $aircraft_type) |
40 | 44 | { |
@@ -59,7 +63,9 @@ discard block |
||
59 | 63 | echo json_encode($all_airline_countries); |
60 | 64 | } elseif ($ask == 'airportnames' || $ask == 'departureairportnames' || $ask == 'arrivalairportnames') { |
61 | 65 | $airport_names = $Stats->getAllAirportNames(); |
62 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
66 | + if (empty($airport_names)) { |
|
67 | + $airport_names = $Spotter->getAllAirportNames(); |
|
68 | + } |
|
63 | 69 | ksort($airport_names); |
64 | 70 | $all_airport_names = array(); |
65 | 71 | foreach($airport_names as $airport_name) |
@@ -31,7 +31,9 @@ discard block |
||
31 | 31 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
32 | 32 | |
33 | 33 | $aircraft_types = $Stats->getAllAircraftTypes(); |
34 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
34 | + if (empty($aircraft_types)) { |
|
35 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
36 | + } |
|
35 | 37 | foreach($aircraft_types as $aircraft_item) |
36 | 38 | { |
37 | 39 | $output .= '<url>'; |
@@ -81,7 +83,9 @@ discard block |
||
81 | 83 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
82 | 84 | |
83 | 85 | $airport_names = $Stats->getAllAirportNames(); |
84 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
86 | + if (empty($airport_names)) { |
|
87 | + $airport_names = $Spotter->getAllAirportNames(); |
|
88 | + } |
|
85 | 89 | foreach($airport_names as $airport_item) |
86 | 90 | { |
87 | 91 | $output .= '<url>'; |
@@ -98,7 +102,9 @@ discard block |
||
98 | 102 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
99 | 103 | |
100 | 104 | $manufacturer_names = $Stats->getAllManufacturers(); |
101 | - if (empty($manufacturer_names)) $manufacturer_names = $Spotter->getAllManufacturers(); |
|
105 | + if (empty($manufacturer_names)) { |
|
106 | + $manufacturer_names = $Spotter->getAllManufacturers(); |
|
107 | + } |
|
102 | 108 | foreach($manufacturer_names as $manufacturer_item) |
103 | 109 | { |
104 | 110 | $output .= '<url>'; |
@@ -36,8 +36,10 @@ discard block |
||
36 | 36 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00"; |
37 | 37 | $sql_date = $end_date; |
38 | 38 | } |
39 | - } else $sql_date = ''; |
|
40 | -} |
|
39 | + } else { |
|
40 | + $sql_date = ''; |
|
41 | + } |
|
42 | + } |
|
41 | 43 | |
42 | 44 | if (isset($_GET['highest_altitude'])) { |
43 | 45 | //for altitude manipulation |
@@ -51,8 +53,12 @@ discard block |
||
51 | 53 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
52 | 54 | $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
53 | 55 | $sql_altitude = $start_altitude; |
54 | - } else $sql_altitude = ''; |
|
55 | -} else $sql_altitude = ''; |
|
56 | + } else { |
|
57 | + $sql_altitude = ''; |
|
58 | + } |
|
59 | + } else { |
|
60 | + $sql_altitude = ''; |
|
61 | +} |
|
56 | 62 | |
57 | 63 | //calculuation for the pagination |
58 | 64 | if(!isset($_GET['limit'])) |
@@ -70,7 +76,7 @@ discard block |
||
70 | 76 | $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
71 | 77 | $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
72 | 78 | } |
73 | -} else { |
|
79 | +} else { |
|
74 | 80 | $limit_explode = explode(",", $_GET['limit']); |
75 | 81 | $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
76 | 82 | $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
@@ -103,10 +109,15 @@ discard block |
||
103 | 109 | $origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_NUMBER_FLOAT); |
104 | 110 | $dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT); |
105 | 111 | if ($dist != '') { |
106 | - if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934; |
|
107 | - elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852; |
|
112 | + if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') { |
|
113 | + $dist = $dist*1.60934; |
|
114 | + } elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') { |
|
115 | + $dist = $dist*1.852; |
|
116 | + } |
|
117 | + } |
|
118 | + if (!isset($sql_date)) { |
|
119 | + $sql_date = ''; |
|
108 | 120 | } |
109 | - if (!isset($sql_date)) $sql_date = ''; |
|
110 | 121 | if ($archive == 1) { |
111 | 122 | $SpotterArchive = new SpotterArchive(); |
112 | 123 | $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); |
@@ -174,7 +185,10 @@ discard block |
||
174 | 185 | if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; } |
175 | 186 | if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; } |
176 | 187 | if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; } |
177 | - if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; } |
|
188 | + if (isset($_GET['highlights'])) { |
|
189 | + if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; |
|
190 | + } |
|
191 | + } |
|
178 | 192 | if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; } |
179 | 193 | if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; } |
180 | 194 | if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; } |
@@ -285,7 +299,10 @@ discard block |
||
285 | 299 | <div class="form-group"> |
286 | 300 | <label class="control-label col-sm-2"><?php echo _("Keywords"); ?></label> |
287 | 301 | <div class="col-sm-10"> |
288 | - <input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) print $q; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
302 | + <input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) { |
|
303 | + print $q; |
|
304 | +} |
|
305 | +?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
289 | 306 | </div> |
290 | 307 | </div> |
291 | 308 | </fieldset> |
@@ -300,7 +317,10 @@ discard block |
||
300 | 317 | </select> |
301 | 318 | </div> |
302 | 319 | </div> |
303 | - <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script> |
|
320 | + <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) { |
|
321 | + print $manufacturer; |
|
322 | +} |
|
323 | +?>')</script> |
|
304 | 324 | <div class="form-group"> |
305 | 325 | <label class="control-label col-sm-2"><?php echo _("Type"); ?></label> |
306 | 326 | <div class="col-sm-10"> |
@@ -309,11 +329,17 @@ discard block |
||
309 | 329 | </select> |
310 | 330 | </div> |
311 | 331 | </div> |
312 | - <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script> |
|
332 | + <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) { |
|
333 | + print $aircraft_icao; |
|
334 | +} |
|
335 | +?>');</script> |
|
313 | 336 | <div class="form-group"> |
314 | 337 | <label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> |
315 | 338 | <div class="col-sm-10"> |
316 | - <input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) print $registration; ?>" size="8" placeholder="<?php echo _("Registration"); ?>" /> |
|
339 | + <input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) { |
|
340 | + print $registration; |
|
341 | +} |
|
342 | +?>" size="8" placeholder="<?php echo _("Registration"); ?>" /> |
|
317 | 343 | </div> |
318 | 344 | </div> |
319 | 345 | <?php |
@@ -322,22 +348,31 @@ discard block |
||
322 | 348 | <div class="form-group"> |
323 | 349 | <label class="control-label col-sm-2"><?php echo _("Pilot id"); ?></label> |
324 | 350 | <div class="col-sm-10"> |
325 | - <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"); ?>" /> |
|
351 | + <input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) { |
|
352 | + print $pilot_id; |
|
353 | +} |
|
354 | +?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" /> |
|
326 | 355 | </div> |
327 | 356 | </div> |
328 | 357 | <div class="form-group"> |
329 | 358 | <label class="control-label col-sm-2"><?php echo _("Pilot name"); ?></label> |
330 | 359 | <div class="col-sm-10"> |
331 | - <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"); ?>" /> |
|
360 | + <input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) { |
|
361 | + print $pilot_name; |
|
362 | +} |
|
363 | +?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" /> |
|
332 | 364 | </div> |
333 | 365 | </div> |
334 | 366 | <?php |
335 | -}else { |
|
367 | +} else { |
|
336 | 368 | ?> |
337 | 369 | <div class="form-group"> |
338 | 370 | <label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> |
339 | 371 | <div class="col-sm-10"> |
340 | - <input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) print $owner; ?>" size="15" placeholder="<?php echo _("Owner name"); ?>" /> |
|
372 | + <input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) { |
|
373 | + print $owner; |
|
374 | +} |
|
375 | +?>" size="15" placeholder="<?php echo _("Owner name"); ?>" /> |
|
341 | 376 | </div> |
342 | 377 | </div> |
343 | 378 | <?php |
@@ -345,8 +380,14 @@ discard block |
||
345 | 380 | ?> |
346 | 381 | <div class="form-group"> |
347 | 382 | <div class="col-sm-offset-2 col-sm-10"> |
348 | - <!--<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>--> |
|
349 | - <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> |
|
383 | + <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) { |
|
384 | + if ($_GET['highlights'] == "true"){ print 'checked="checked"'; |
|
385 | +} |
|
386 | +} ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
387 | + <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) { |
|
388 | + if ($_GET['highlights'] == "true"){ print 'checked="checked"'; |
|
389 | +} |
|
390 | +} ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
350 | 391 | </div> |
351 | 392 | </div> |
352 | 393 | </fieldset> |
@@ -360,7 +401,10 @@ discard block |
||
360 | 401 | </select> |
361 | 402 | </div> |
362 | 403 | </div> |
363 | - <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script> |
|
404 | + <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) { |
|
405 | + print $airline; |
|
406 | +} |
|
407 | +?>');</script> |
|
364 | 408 | <div class="form-group"> |
365 | 409 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
366 | 410 | <div class="col-sm-10"> |
@@ -369,19 +413,34 @@ discard block |
||
369 | 413 | </select> |
370 | 414 | </div> |
371 | 415 | </div> |
372 | - <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script> |
|
416 | + <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) { |
|
417 | + print $airline_country; |
|
418 | +} |
|
419 | +?>');</script> |
|
373 | 420 | <div class="form-group"> |
374 | 421 | <label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> |
375 | 422 | <div class="col-sm-10"> |
376 | - <input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" /> |
|
423 | + <input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) { |
|
424 | + print $callsign; |
|
425 | +} |
|
426 | +?>" size="8" placeholder="<?php echo _("Callsign"); ?>" /> |
|
377 | 427 | </div> |
378 | 428 | </div> |
379 | 429 | <div class="form-group"> |
380 | 430 | <div class="col-sm-offset-2 col-sm-10"> |
381 | 431 | <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> |
382 | - <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> |
|
383 | - <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> |
|
384 | - <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> |
|
432 | + <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) { |
|
433 | + if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; |
|
434 | +} |
|
435 | +} ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
436 | + <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) { |
|
437 | + if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; |
|
438 | +} |
|
439 | +} ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
440 | + <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) { |
|
441 | + if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; |
|
442 | +} |
|
443 | +} ?>> <?php echo _("Only Military airlines"); ?></label> |
|
385 | 444 | </div> |
386 | 445 | </div> |
387 | 446 | </fieldset> |
@@ -395,7 +454,10 @@ discard block |
||
395 | 454 | </select> |
396 | 455 | </div> |
397 | 456 | </div> |
398 | - <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script> |
|
457 | + <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) { |
|
458 | + print $airport_icao; |
|
459 | +} |
|
460 | +?>');</script> |
|
399 | 461 | <div class="form-group"> |
400 | 462 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
401 | 463 | <div class="col-sm-10"> |
@@ -404,7 +466,10 @@ discard block |
||
404 | 466 | </select> |
405 | 467 | </div> |
406 | 468 | </div> |
407 | - <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script> |
|
469 | + <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) { |
|
470 | + print $airport_country; |
|
471 | +} |
|
472 | +?>');</script> |
|
408 | 473 | </fieldset> |
409 | 474 | <fieldset> |
410 | 475 | <legend><?php echo _("Route"); ?></legend> |
@@ -416,7 +481,10 @@ discard block |
||
416 | 481 | </select> |
417 | 482 | </div> |
418 | 483 | </div> |
419 | - <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script> |
|
484 | + <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) { |
|
485 | + print $departure_airport_route; |
|
486 | +} |
|
487 | +?>');</script> |
|
420 | 488 | <div class="form-group"> |
421 | 489 | <label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> |
422 | 490 | <div class="col-sm-10"> |
@@ -425,7 +493,10 @@ discard block |
||
425 | 493 | </select> |
426 | 494 | </div> |
427 | 495 | </div> |
428 | - <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script> |
|
496 | + <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) { |
|
497 | + print $arrival_airport_route; |
|
498 | +} |
|
499 | +?>');</script> |
|
429 | 500 | </fieldset> |
430 | 501 | <fieldset> |
431 | 502 | <legend><?php echo _("Date"); ?></legend> |
@@ -433,7 +504,10 @@ discard block |
||
433 | 504 | <label class="control-label col-sm-2"><?php echo _("Start Date"); ?></label> |
434 | 505 | <div class="col-sm-10"> |
435 | 506 | <div class='input-group date' id='datetimepicker1'> |
436 | - <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"); ?>" /> |
|
507 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) { |
|
508 | + print $start_date; |
|
509 | +} |
|
510 | +?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
437 | 511 | <span class="input-group-addon"> |
438 | 512 | <span class="glyphicon glyphicon-calendar"></span> |
439 | 513 | </span> |
@@ -444,7 +518,10 @@ discard block |
||
444 | 518 | <label class="control-label col-sm-2"><?php echo _("End Date"); ?></label> |
445 | 519 | <div class="col-sm-10"> |
446 | 520 | <div class='input-group date' id='datetimepicker2'> |
447 | - <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"); ?>" /> |
|
521 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) { |
|
522 | + print $end_date; |
|
523 | +} |
|
524 | +?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
448 | 525 | <span class="input-group-addon"> |
449 | 526 | <span class="glyphicon glyphicon-calendar"></span> |
450 | 527 | </span> |
@@ -517,19 +594,33 @@ discard block |
||
517 | 594 | <div class="form-group"> |
518 | 595 | <label class="control-label col-sm-2"><?php echo _("Latitude"); ?></label> |
519 | 596 | <div class="col-sm-10"> |
520 | - <input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) print $origlat; ?>" /> |
|
597 | + <input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) { |
|
598 | + print $origlat; |
|
599 | +} |
|
600 | +?>" /> |
|
521 | 601 | </div> |
522 | 602 | </div> |
523 | 603 | <div class="form-group"> |
524 | 604 | <label class="control-label col-sm-2"><?php echo _("Longitude"); ?></label> |
525 | 605 | <div class="col-sm-10"> |
526 | - <input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) print $origlon; ?>" /> |
|
606 | + <input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) { |
|
607 | + print $origlon; |
|
608 | +} |
|
609 | +?>" /> |
|
527 | 610 | </div> |
528 | 611 | </div> |
529 | 612 | <div class="form-group"> |
530 | - <label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label> |
|
613 | + <label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) { |
|
614 | + print $globalDistanceUnit; |
|
615 | +} else { |
|
616 | + print 'km'; |
|
617 | +} |
|
618 | +print ')'; ?></label> |
|
531 | 619 | <div class="col-sm-10"> |
532 | - <input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) print $distance; ?>" /> |
|
620 | + <input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) { |
|
621 | + print $distance; |
|
622 | +} |
|
623 | +?>" /> |
|
533 | 624 | </div> |
534 | 625 | </div> |
535 | 626 | </fieldset> |
@@ -23,8 +23,11 @@ discard block |
||
23 | 23 | echo $e->getMessage(); |
24 | 24 | } |
25 | 25 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
26 | - if (isset($result[0])) return $result[0]; |
|
27 | - else return array(); |
|
26 | + if (isset($result[0])) { |
|
27 | + return $result[0]; |
|
28 | + } else { |
|
29 | + return array(); |
|
30 | + } |
|
28 | 31 | } |
29 | 32 | public function get_tle_types() { |
30 | 33 | $query = 'SELECT DISTINCT tle_type FROM tle ORDER BY tle_type'; |
@@ -35,8 +38,11 @@ discard block |
||
35 | 38 | echo $e->getMessage(); |
36 | 39 | } |
37 | 40 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
38 | - if (isset($result[0])) return $result; |
|
39 | - else return array(); |
|
41 | + if (isset($result[0])) { |
|
42 | + return $result; |
|
43 | + } else { |
|
44 | + return array(); |
|
45 | + } |
|
40 | 46 | } |
41 | 47 | public function get_tle_names() { |
42 | 48 | $query = 'SELECT DISTINCT tle_name, tle_type FROM tle'; |
@@ -47,8 +53,11 @@ discard block |
||
47 | 53 | echo $e->getMessage(); |
48 | 54 | } |
49 | 55 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
50 | - if (isset($result[0])) return $result; |
|
51 | - else return array(); |
|
56 | + if (isset($result[0])) { |
|
57 | + return $result; |
|
58 | + } else { |
|
59 | + return array(); |
|
60 | + } |
|
52 | 61 | } |
53 | 62 | public function get_tle_names_type($type) { |
54 | 63 | $query = 'SELECT tle_name, tle_type FROM tle WHERE tle_type = :type ORDER BY tle_name'; |
@@ -59,8 +68,11 @@ discard block |
||
59 | 68 | echo $e->getMessage(); |
60 | 69 | } |
61 | 70 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
62 | - if (isset($result[0])) return $result; |
|
63 | - else return array(); |
|
71 | + if (isset($result[0])) { |
|
72 | + return $result; |
|
73 | + } else { |
|
74 | + return array(); |
|
75 | + } |
|
64 | 76 | } |
65 | 77 | |
66 | 78 | public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
@@ -94,7 +106,9 @@ discard block |
||
94 | 106 | $sat = new Predict_Sat($tle); |
95 | 107 | $predict = new Predict(); |
96 | 108 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
97 | - if ($timestamp_begin == '') $timestamp_begin = time(); |
|
109 | + if ($timestamp_begin == '') { |
|
110 | + $timestamp_begin = time(); |
|
111 | + } |
|
98 | 112 | if ($timestamp_end == '') { |
99 | 113 | $now = Predict_Time::unix2daynum($timestamp_begin); |
100 | 114 | $predict->predict_calc($sat,$qth,$now); |
@@ -119,8 +133,11 @@ discard block |
||
119 | 133 | echo $e->getMessage(); |
120 | 134 | } |
121 | 135 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
122 | - if (isset($result[0])) return $result[0]; |
|
123 | - else return array(); |
|
136 | + if (isset($result[0])) { |
|
137 | + return $result[0]; |
|
138 | + } else { |
|
139 | + return array(); |
|
140 | + } |
|
124 | 141 | } |
125 | 142 | |
126 | 143 | /** |
@@ -138,7 +155,9 @@ discard block |
||
138 | 155 | FROM satellite".$filter_query." satellite.launch_site <> '' AND satellite.launch_site IS NOT NULL"; |
139 | 156 | $query_values = array(); |
140 | 157 | $query .= " GROUP BY satellite.launch_site ORDER BY launch_site_count DESC"; |
141 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
158 | + if ($limit) { |
|
159 | + $query .= " LIMIT 10 OFFSET 0"; |
|
160 | + } |
|
142 | 161 | $sth = $this->db->prepare($query); |
143 | 162 | $sth->execute($query_values); |
144 | 163 | $launch_site_array = array(); |
@@ -167,7 +186,9 @@ discard block |
||
167 | 186 | FROM satellite".$filter_query." satellite.owner <> '' AND satellite.owner IS NOT NULL"; |
168 | 187 | $query_values = array(); |
169 | 188 | $query .= " GROUP BY satellite.owner ORDER BY owner_count DESC"; |
170 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
189 | + if ($limit) { |
|
190 | + $query .= " LIMIT 10 OFFSET 0"; |
|
191 | + } |
|
171 | 192 | $sth = $this->db->prepare($query); |
172 | 193 | $sth->execute($query_values); |
173 | 194 | $owner_array = array(); |
@@ -196,7 +217,9 @@ discard block |
||
196 | 217 | FROM satellite".$filter_query." satellite.country_owner <> '' AND satellite.country_owner IS NOT NULL"; |
197 | 218 | $query_values = array(); |
198 | 219 | $query .= " GROUP BY satellite.country_owner ORDER BY country_count DESC"; |
199 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
220 | + if ($limit) { |
|
221 | + $query .= " LIMIT 10 OFFSET 0"; |
|
222 | + } |
|
200 | 223 | $sth = $this->db->prepare($query); |
201 | 224 | $sth->execute($query_values); |
202 | 225 | $owner_array = array(); |
@@ -223,20 +246,26 @@ discard block |
||
223 | 246 | date_default_timezone_set($globalTimezone); |
224 | 247 | $datetime = new DateTime(); |
225 | 248 | $offset = $datetime->format('P'); |
226 | - } else $offset = '+00:00'; |
|
249 | + } else { |
|
250 | + $offset = '+00:00'; |
|
251 | + } |
|
227 | 252 | //$filter_query = $this->getFilter($filters,true,true); |
228 | 253 | $filter_query = ' WHERE'; |
229 | 254 | if ($globalDBdriver == 'mysql') { |
230 | 255 | $query = "SELECT MONTH(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
231 | 256 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR)"; |
232 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
257 | + if ($sincedate != '') { |
|
258 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
259 | + } |
|
233 | 260 | $query .= " GROUP BY year_name, month_name |
234 | 261 | ORDER BY year_name, month_name ASC"; |
235 | 262 | $query_data = array(':offset' => $offset); |
236 | 263 | } else { |
237 | 264 | $query = "SELECT EXTRACT(MONTH FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS month_name, EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
238 | 265 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 YEARS'"; |
239 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
266 | + if ($sincedate != '') { |
|
267 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
268 | + } |
|
240 | 269 | $query .= " GROUP BY year_name, month_name |
241 | 270 | ORDER BY year_name, month_name ASC"; |
242 | 271 | $query_data = array(':offset' => $offset); |
@@ -268,20 +297,26 @@ discard block |
||
268 | 297 | date_default_timezone_set($globalTimezone); |
269 | 298 | $datetime = new DateTime(); |
270 | 299 | $offset = $datetime->format('P'); |
271 | - } else $offset = '+00:00'; |
|
300 | + } else { |
|
301 | + $offset = '+00:00'; |
|
302 | + } |
|
272 | 303 | //$filter_query = $this->getFilter($filters,true,true); |
273 | 304 | $filter_query = ' WHERE'; |
274 | 305 | if ($globalDBdriver == 'mysql') { |
275 | 306 | $query = "SELECT YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
276 | 307 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 YEAR)"; |
277 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
308 | + if ($sincedate != '') { |
|
309 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
310 | + } |
|
278 | 311 | $query .= " GROUP BY year_name |
279 | 312 | ORDER BY year_name ASC"; |
280 | 313 | $query_data = array(':offset' => $offset); |
281 | 314 | } else { |
282 | 315 | $query = "SELECT EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
283 | 316 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '10 YEARS'"; |
284 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
317 | + if ($sincedate != '') { |
|
318 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
319 | + } |
|
285 | 320 | $query .= " GROUP BY year_name |
286 | 321 | ORDER BY year_name ASC"; |
287 | 322 | $query_data = array(':offset' => $offset); |
@@ -81,10 +81,15 @@ |
||
81 | 81 | // $launch_date = '15 November 1974'; |
82 | 82 | } else { |
83 | 83 | $ident = $sat; |
84 | - if (strpos($sat,'(')) $satname = $sat; |
|
85 | - else $satname = str_replace(array(' '),'-',$sat); |
|
84 | + if (strpos($sat,'(')) { |
|
85 | + $satname = $sat; |
|
86 | + } else { |
|
87 | + $satname = str_replace(array(' '),'-',$sat); |
|
88 | + } |
|
89 | + } |
|
90 | +if (!isset($satname)) { |
|
91 | + $satname = $sat; |
|
86 | 92 | } |
87 | -if (!isset($satname)) $satname = $sat; |
|
88 | 93 | $info = $Satellite->get_info(strtolower(trim($satname))); |
89 | 94 | $position = $Satellite->position($sat); |
90 | 95 | $ground_speed = $position['speed']; |