@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
| 12 | 12 | $schema = new Connection(); |
| 13 | 13 | if ($schema->latest() === false) { |
| 14 | - echo "You MUST update to latest schema. Run install/index.php"; |
|
| 15 | - exit(); |
|
| 14 | + echo "You MUST update to latest schema. Run install/index.php"; |
|
| 15 | + exit(); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | $debug = true; |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | date_default_timezone_set('UTC'); |
| 22 | 22 | // signal handler - playing nice with sockets and dump1090 |
| 23 | 23 | pcntl_signal(SIGINT, function($signo) { |
| 24 | - global $sock; |
|
| 25 | - echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
|
| 26 | - socket_shutdown($sock, 0); |
|
| 27 | - socket_close($sock); |
|
| 28 | - die("Bye!\n"); |
|
| 24 | + global $sock; |
|
| 25 | + echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
|
| 26 | + socket_shutdown($sock, 0); |
|
| 27 | + socket_close($sock); |
|
| 28 | + die("Bye!\n"); |
|
| 29 | 29 | }); |
| 30 | 30 | pcntl_signal_dispatch(); |
| 31 | 31 | |
@@ -38,24 +38,24 @@ discard block |
||
| 38 | 38 | // Bind the source address |
| 39 | 39 | if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) ) |
| 40 | 40 | { |
| 41 | - $errorcode = socket_last_error(); |
|
| 42 | - $errormsg = socket_strerror($errorcode); |
|
| 41 | + $errorcode = socket_last_error(); |
|
| 42 | + $errormsg = socket_strerror($errorcode); |
|
| 43 | 43 | |
| 44 | - die("Could not bind socket : [$errorcode] $errormsg \n"); |
|
| 44 | + die("Could not bind socket : [$errorcode] $errormsg \n"); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | echo "LISTEN UDP MODE \n\n"; |
| 48 | 48 | while(1) { |
| 49 | - $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
|
| 50 | - |
|
| 51 | - // lets play nice and handle signals such as ctrl-c/kill properly |
|
| 52 | - pcntl_signal_dispatch(); |
|
| 53 | - $dataFound = false; |
|
| 54 | - // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
|
| 55 | - echo $buffer."\n"; |
|
| 56 | - $ACARS->add(trim($buffer)); |
|
| 57 | - socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
| 58 | - $ACARS->deleteLiveAcarsData(); |
|
| 49 | + $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
|
| 50 | + |
|
| 51 | + // lets play nice and handle signals such as ctrl-c/kill properly |
|
| 52 | + pcntl_signal_dispatch(); |
|
| 53 | + $dataFound = false; |
|
| 54 | + // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
|
| 55 | + echo $buffer."\n"; |
|
| 56 | + $ACARS->add(trim($buffer)); |
|
| 57 | + socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
| 58 | + $ACARS->deleteLiveAcarsData(); |
|
| 59 | 59 | } |
| 60 | 60 | pcntl_exec($_,$argv); |
| 61 | 61 | ?> |
@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | $debug = true; |
| 19 | 19 | |
| 20 | -$ACARS=new ACARS(); |
|
| 20 | +$ACARS = new ACARS(); |
|
| 21 | 21 | date_default_timezone_set('UTC'); |
| 22 | 22 | // signal handler - playing nice with sockets and dump1090 |
| 23 | -pcntl_signal(SIGINT, function($signo) { |
|
| 23 | +pcntl_signal(SIGINT, function($signo) { |
|
| 24 | 24 | global $sock; |
| 25 | 25 | echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
| 26 | 26 | socket_shutdown($sock, 0); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $sock = socket_create(AF_INET, SOCK_DGRAM, 0) or die("Unable to create socket\n"); |
| 37 | 37 | |
| 38 | 38 | // Bind the source address |
| 39 | -if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) ) |
|
| 39 | +if (!socket_bind($sock, $globalACARSHost, $globalACARSPort)) |
|
| 40 | 40 | { |
| 41 | 41 | $errorcode = socket_last_error(); |
| 42 | 42 | $errormsg = socket_strerror($errorcode); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | echo "LISTEN UDP MODE \n\n"; |
| 48 | -while(1) { |
|
| 48 | +while (1) { |
|
| 49 | 49 | $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
| 50 | 50 | |
| 51 | 51 | // lets play nice and handle signals such as ctrl-c/kill properly |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
| 55 | 55 | echo $buffer."\n"; |
| 56 | 56 | $ACARS->add(trim($buffer)); |
| 57 | - socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
| 57 | + socket_sendto($sock, "OK ".$buffer, 100, 0, $remote_ip, $remote_port); |
|
| 58 | 58 | $ACARS->deleteLiveAcarsData(); |
| 59 | 59 | } |
| 60 | -pcntl_exec($_,$argv); |
|
| 60 | +pcntl_exec($_, $argv); |
|
| 61 | 61 | ?> |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | die(); |
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
| 10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
| 13 | 13 | |
| 14 | 14 | if (!empty($spotter_array)) |
| 15 | 15 | { |
| 16 | - $title = sprintf(_("Most Common Arrival Airports by Country of %s"),$spotter_array[0]['ident']); |
|
| 16 | + $title = sprintf(_("Most Common Arrival Airports by Country of %s"), $spotter_array[0]['ident']); |
|
| 17 | 17 | require_once('header.php'); |
| 18 | 18 | print '<div class="info column">'; |
| 19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | include('ident-sub-menu.php'); |
| 25 | 25 | print '<div class="column">'; |
| 26 | 26 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
| 27 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 27 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
| 28 | 28 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByIdent($ident); |
| 29 | 29 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
| 30 | 30 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | var data = google.visualization.arrayToDataTable([ |
| 36 | 36 | ["'._("Country").'", "'._("# of times").'"], '; |
| 37 | 37 | $country_data = ''; |
| 38 | - foreach($airport_country_array as $airport_item) |
|
| 38 | + foreach ($airport_country_array as $airport_item) |
|
| 39 | 39 | { |
| 40 | 40 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
| 41 | 41 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | print '</thead>'; |
| 70 | 70 | print '<tbody>'; |
| 71 | 71 | $i = 1; |
| 72 | - foreach($airport_country_array as $airport_item) |
|
| 72 | + foreach ($airport_country_array as $airport_item) |
|
| 73 | 73 | { |
| 74 | 74 | print '<tr>'; |
| 75 | 75 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['ident'])) { |
| 6 | - header('Location: '.$globalURL.'/ident'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/ident'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | die(); |
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
| 10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
| 13 | 13 | |
| 14 | 14 | if (!empty($spotter_array)) |
| 15 | 15 | { |
| 16 | - $title = sprintf(_("Most Common Arrival Airports of %s"),$spotter_array[0]['ident']); |
|
| 16 | + $title = sprintf(_("Most Common Arrival Airports of %s"), $spotter_array[0]['ident']); |
|
| 17 | 17 | require_once('header.php'); |
| 18 | 18 | print '<div class="info column">'; |
| 19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | include('ident-sub-menu.php'); |
| 25 | 25 | print '<div class="column">'; |
| 26 | 26 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
| 27 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 27 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
| 28 | 28 | $airport_airport_array = $Spotter->countAllArrivalAirportsByIdent($ident); |
| 29 | 29 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
| 30 | 30 | <script> |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 40 | 40 | |
| 41 | 41 | $airport_data = ''; |
| 42 | - foreach($airport_airport_array as $airport_item) |
|
| 42 | + foreach ($airport_airport_array as $airport_item) |
|
| 43 | 43 | { |
| 44 | 44 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
| 45 | 45 | $name = str_replace("'", "", $name); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | print '</thead>'; |
| 79 | 79 | print '<tbody>'; |
| 80 | 80 | $i = 1; |
| 81 | - foreach($airport_airport_array as $airport_item) |
|
| 81 | + foreach ($airport_airport_array as $airport_item) |
|
| 82 | 82 | { |
| 83 | 83 | print '<tr>'; |
| 84 | 84 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['ident'])) { |
| 6 | - header('Location: '.$globalURL.'/ident'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/ident'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | $page_url = $globalURL.'/acars-archive'; |
| 10 | 10 | |
| 11 | -if(!isset($_GET['limit'])) |
|
| 11 | +if (!isset($_GET['limit'])) |
|
| 12 | 12 | { |
| 13 | 13 | $limit_start = 0; |
| 14 | 14 | $limit_end = 25; |
@@ -36,8 +36,12 @@ |
||
| 36 | 36 | if (!empty($spotter_array)) { |
| 37 | 37 | include('table-output.php'); |
| 38 | 38 | print '<div class="pagination">'; |
| 39 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'/'.$_GET['sort'].'">«'._("Previous Page").'</a>'; |
|
| 40 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'/'.$_GET['sort'].'">'._("Next Page").'»</a>'; |
|
| 39 | + if ($limit_previous_1 >= 0) { |
|
| 40 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'/'.$_GET['sort'].'">«'._("Previous Page").'</a>'; |
|
| 41 | + } |
|
| 42 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
| 43 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'/'.$_GET['sort'].'">'._("Next Page").'»</a>'; |
|
| 44 | + } |
|
| 41 | 45 | print '</div>'; |
| 42 | 46 | } |
| 43 | 47 | print '</div>'; |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | $Spotter = new Spotter(); |
| 7 | 7 | |
| 8 | 8 | if (isset($_GET['airport_icao'])) { |
| 9 | - $icao = filter_input(INPUT_GET,'airport_icao',FILTER_SANITIZE_STRING); |
|
| 9 | + $icao = filter_input(INPUT_GET, 'airport_icao', FILTER_SANITIZE_STRING); |
|
| 10 | 10 | $spotter_array = $Spotter->getAllAirportInfo($icao); |
| 11 | 11 | if (isset($globalMETAR) && $globalMETAR) { |
| 12 | 12 | $METAR = new METAR(); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | print '</div>'; |
| 56 | 56 | print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
| 57 | -print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
|
| 57 | +print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 3).', '.round($spotter_item['longitude'], 3).'</div>'; |
|
| 58 | 58 | if (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '' && isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') { |
| 59 | 59 | print '<div><span>'._("Links").'</span>'; |
| 60 | 60 | print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>"; |
| 104 | 104 | } |
| 105 | 105 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
| 106 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
| 106 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
| 107 | 107 | print _("Humidity:").' '.$humidity.'%'."<br/>"; |
| 108 | 108 | } |
| 109 | 109 | if (isset($metar_parse['QNH'])) { |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | $METAR = new METAR(); |
| 13 | 13 | $metar_info = $METAR->getMETAR($icao); |
| 14 | 14 | //print_r($metar_info); |
| 15 | - if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
| 15 | + if (isset($metar_info[0]['metar'])) { |
|
| 16 | + $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
| 17 | + } |
|
| 16 | 18 | //print_r($metar_parse); |
| 17 | 19 | } |
| 18 | 20 | } |
@@ -47,79 +47,79 @@ |
||
| 47 | 47 | print '</div>'; |
| 48 | 48 | print '<div><span>'._("Altitude").'</span>'; |
| 49 | 49 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
| 50 | - print $spotter_item['altitude'].' feet'; |
|
| 50 | + print $spotter_item['altitude'].' feet'; |
|
| 51 | 51 | } else { |
| 52 | - print round($spotter_item['altitude']*0.3048).' m'; |
|
| 52 | + print round($spotter_item['altitude']*0.3048).' m'; |
|
| 53 | 53 | } |
| 54 | 54 | print '</div>'; |
| 55 | 55 | print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
| 56 | 56 | print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
| 57 | 57 | if (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '' && isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') { |
| 58 | - print '<div><span>'._("Links").'</span>'; |
|
| 59 | - print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
|
| 60 | - print ' - '; |
|
| 61 | - print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>'; |
|
| 62 | - print '</div>'; |
|
| 58 | + print '<div><span>'._("Links").'</span>'; |
|
| 59 | + print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
|
| 60 | + print ' - '; |
|
| 61 | + print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>'; |
|
| 62 | + print '</div>'; |
|
| 63 | 63 | } elseif (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '') { |
| 64 | - print '<div><span>'._("Links").'</span>'; |
|
| 65 | - print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
|
| 66 | - print '</div>'; |
|
| 64 | + print '<div><span>'._("Links").'</span>'; |
|
| 65 | + print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
|
| 66 | + print '</div>'; |
|
| 67 | 67 | } elseif (isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') { |
| 68 | - print '<div><span>'._("Links").'</span>'; |
|
| 69 | - print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>'; |
|
| 70 | - print '</div>'; |
|
| 68 | + print '<div><span>'._("Links").'</span>'; |
|
| 69 | + print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>'; |
|
| 70 | + print '</div>'; |
|
| 71 | 71 | } |
| 72 | 72 | if ($spotter_item['type'] == 'medium_airport' || $spotter_item['type'] == 'large_airport') { |
| 73 | - print '<div><span>'._("Live Air Traffic").'</span>'; |
|
| 74 | - print '<a href="http://www.liveatc.net/search/?icao='.$spotter_item['icao'].'">LiveATC</a>'; |
|
| 75 | - print '</div>'; |
|
| 73 | + print '<div><span>'._("Live Air Traffic").'</span>'; |
|
| 74 | + print '<a href="http://www.liveatc.net/search/?icao='.$spotter_item['icao'].'">LiveATC</a>'; |
|
| 75 | + print '</div>'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | print '</div>'; |
| 79 | 79 | |
| 80 | 80 | if (isset($metar_parse)) { |
| 81 | - print '<div class="waypoints">'; |
|
| 82 | - print '<div><span>METAR</span>'; |
|
| 83 | - print '<i>'.$metar_info[0]['metar'].'</i><br />'; |
|
| 84 | - print '<b>'.$metar_info[0]['metar_date'].'</b><br />'; |
|
| 81 | + print '<div class="waypoints">'; |
|
| 82 | + print '<div><span>METAR</span>'; |
|
| 83 | + print '<i>'.$metar_info[0]['metar'].'</i><br />'; |
|
| 84 | + print '<b>'.$metar_info[0]['metar_date'].'</b><br />'; |
|
| 85 | 85 | // print_r($metar_parse); |
| 86 | - if (isset($metar_parse['wind'])) { |
|
| 87 | - print _("Wind:").' '; |
|
| 86 | + if (isset($metar_parse['wind'])) { |
|
| 87 | + print _("Wind:").' '; |
|
| 88 | 88 | if (isset($metar_parse['wind']['direction'])) { |
| 89 | - $direction = $Spotter->parseDirection($metar_parse['wind']['direction']); |
|
| 90 | - print $direction[0]['direction_fullname']; |
|
| 91 | - print ' ('.$metar_parse['wind']['direction'].'°) '; |
|
| 92 | - } |
|
| 93 | - if (isset($metar_parse['wind']['speed'])) { |
|
| 94 | - print $metar_parse['wind']['speed'].' m/s'; |
|
| 95 | - } |
|
| 89 | + $direction = $Spotter->parseDirection($metar_parse['wind']['direction']); |
|
| 90 | + print $direction[0]['direction_fullname']; |
|
| 91 | + print ' ('.$metar_parse['wind']['direction'].'°) '; |
|
| 92 | + } |
|
| 93 | + if (isset($metar_parse['wind']['speed'])) { |
|
| 94 | + print $metar_parse['wind']['speed'].' m/s'; |
|
| 95 | + } |
|
| 96 | 96 | print '<br/>'; |
| 97 | - } |
|
| 98 | - if (isset($metar_parse['visibility'])) { |
|
| 99 | - print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>"; |
|
| 100 | - } |
|
| 101 | - if (isset($metar_parse['weather'])) { |
|
| 102 | - print _("Weather:").' '.$metar_parse['weather']."<br/>"; |
|
| 103 | - } |
|
| 104 | - if (isset($metar_parse['temperature'])) { |
|
| 105 | - print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>"; |
|
| 106 | - } |
|
| 107 | - if (isset($metar_parse['dew'])) { |
|
| 108 | - print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>"; |
|
| 109 | - } |
|
| 110 | - if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
|
| 97 | + } |
|
| 98 | + if (isset($metar_parse['visibility'])) { |
|
| 99 | + print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>"; |
|
| 100 | + } |
|
| 101 | + if (isset($metar_parse['weather'])) { |
|
| 102 | + print _("Weather:").' '.$metar_parse['weather']."<br/>"; |
|
| 103 | + } |
|
| 104 | + if (isset($metar_parse['temperature'])) { |
|
| 105 | + print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>"; |
|
| 106 | + } |
|
| 107 | + if (isset($metar_parse['dew'])) { |
|
| 108 | + print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>"; |
|
| 109 | + } |
|
| 110 | + if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
|
| 111 | 111 | $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
| 112 | 112 | print _("Humidity:").' '.$humidity.'%'."<br/>"; |
| 113 | - } |
|
| 114 | - if (isset($metar_parse['QNH'])) { |
|
| 115 | - print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>"; |
|
| 116 | - } |
|
| 113 | + } |
|
| 114 | + if (isset($metar_parse['QNH'])) { |
|
| 115 | + print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>"; |
|
| 116 | + } |
|
| 117 | 117 | /* |
| 118 | 118 | if (isset($metar_parse['QNH'])) { |
| 119 | 119 | print 'Pressure : '.$metar_parse['QNH'].' hPa'."<br/>"; |
| 120 | 120 | } |
| 121 | 121 | */ |
| 122 | - print '</div>'; |
|
| 122 | + print '</div>'; |
|
| 123 | 123 | /* |
| 124 | 124 | Wind: from the NNE (020 degrees) at 5 MPH (4 KT) (direction variable):0 |
| 125 | 125 | Visibility: greater than 7 mile(s):0 |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['airline'])) { |
| 6 | - header('Location: '.$globalURL.'/airline'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/airline'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 10 | 10 | $Spotter = new Spotter(); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | var data = google.visualization.arrayToDataTable([ |
| 74 | 74 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 75 | - $airport_data = ''; |
|
| 75 | + $airport_data = ''; |
|
| 76 | 76 | foreach($airport_airport_array as $airport_item) |
| 77 | 77 | { |
| 78 | 78 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
@@ -6,22 +6,22 @@ discard block |
||
| 6 | 6 | header('Location: '.$globalURL.'/airline'); |
| 7 | 7 | die(); |
| 8 | 8 | } |
| 9 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 9 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
| 11 | +$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
| 12 | 12 | |
| 13 | 13 | if (!empty($spotter_array)) |
| 14 | 14 | { |
| 15 | - $title = sprintf(_("Most Common Arrival Airports from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
| 15 | + $title = sprintf(_("Most Common Arrival Airports from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
| 16 | 16 | require_once('header.php'); |
| 17 | 17 | print '<div class="select-item">'; |
| 18 | 18 | print '<form action="'.$globalURL.'/airline" method="post">'; |
| 19 | 19 | print '<select name="airline" class="selectpicker" data-live-search="true">'; |
| 20 | 20 | print '<option></option>'; |
| 21 | 21 | $airline_names = $Spotter->getAllAirlineNames(); |
| 22 | - foreach($airline_names as $airline_name) |
|
| 22 | + foreach ($airline_names as $airline_name) |
|
| 23 | 23 | { |
| 24 | - if($_GET['airline'] == $airline_name['airline_icao']) |
|
| 24 | + if ($_GET['airline'] == $airline_name['airline_icao']) |
|
| 25 | 25 | { |
| 26 | 26 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
| 27 | 27 | } else { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | include('airline-sub-menu.php'); |
| 60 | 60 | print '<div class="column">'; |
| 61 | 61 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
| 62 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
| 62 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
| 63 | 63 | $airport_airport_array = $Spotter->countAllArrivalAirportsByAirline($airline); |
| 64 | 64 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
| 65 | 65 | <script> |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | var data = google.visualization.arrayToDataTable([ |
| 74 | 74 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 75 | 75 | $airport_data = ''; |
| 76 | - foreach($airport_airport_array as $airport_item) |
|
| 76 | + foreach ($airport_airport_array as $airport_item) |
|
| 77 | 77 | { |
| 78 | 78 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
| 79 | 79 | $name = str_replace("'", "", $name); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | print '</thead>'; |
| 113 | 113 | print '<tbody>'; |
| 114 | 114 | $i = 1; |
| 115 | - foreach($airport_airport_array as $airport_item) |
|
| 115 | + foreach ($airport_airport_array as $airport_item) |
|
| 116 | 116 | { |
| 117 | 117 | print '<tr>'; |
| 118 | 118 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | print '<option></option>'; |
| 22 | 22 | $Stats = new Stats(); |
| 23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
| 24 | - if (empty($ariline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
| 24 | + if (empty($ariline_names)) { |
|
| 25 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
| 26 | + } |
|
| 25 | 27 | foreach($airline_names as $airline_name) |
| 26 | 28 | { |
| 27 | 29 | if($_GET['airline'] == $airline_name['airline_icao']) |
@@ -43,8 +45,7 @@ discard block |
||
| 43 | 45 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
| 44 | 46 | { |
| 45 | 47 | 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" />'; |
| 46 | - } |
|
| 47 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
| 48 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
| 48 | 49 | { |
| 49 | 50 | 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" />'; |
| 50 | 51 | } |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['airline'])) { |
| 6 | - header('Location: '.$globalURL.'/airline'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/airline'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 10 | 10 | $Spotter = new Spotter(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
| 62 | 62 | print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
| 63 | 63 | $airport_airport_array = $Spotter->countAllDepartureAirportsByAirline($airline); |
| 64 | - print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
|
| 64 | + print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
|
| 65 | 65 | <script> |
| 66 | 66 | google.load("visualization", "1", {packages:["geochart"]}); |
| 67 | 67 | google.setOnLoadCallback(drawCharts); |
@@ -6,22 +6,22 @@ discard block |
||
| 6 | 6 | header('Location: '.$globalURL.'/airline'); |
| 7 | 7 | die(); |
| 8 | 8 | } |
| 9 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 9 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
| 11 | +$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
| 12 | 12 | |
| 13 | 13 | if (!empty($spotter_array)) |
| 14 | 14 | { |
| 15 | - $title = sprintf(_("Most Common Departure Airports from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
| 15 | + $title = sprintf(_("Most Common Departure Airports from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
| 16 | 16 | require_once('header.php'); |
| 17 | 17 | print '<div class="select-item">'; |
| 18 | 18 | print '<form action="'.$globalURL.'/airline" method="post">'; |
| 19 | 19 | print '<select name="airline" class="selectpicker" data-live-search="true">'; |
| 20 | 20 | print '<option></option>'; |
| 21 | 21 | $airline_names = $Spotter->getAllAirlineNames(); |
| 22 | - foreach($airline_names as $airline_name) |
|
| 22 | + foreach ($airline_names as $airline_name) |
|
| 23 | 23 | { |
| 24 | - if($airline == $airline_name['airline_icao']) |
|
| 24 | + if ($airline == $airline_name['airline_icao']) |
|
| 25 | 25 | { |
| 26 | 26 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
| 27 | 27 | } else { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | include('airline-sub-menu.php'); |
| 60 | 60 | print '<div class="column">'; |
| 61 | 61 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
| 62 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
| 62 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
| 63 | 63 | $airport_airport_array = $Spotter->countAllDepartureAirportsByAirline($airline); |
| 64 | 64 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
| 65 | 65 | <script> |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | var data = google.visualization.arrayToDataTable([ |
| 74 | 74 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 75 | 75 | $airport_data = ''; |
| 76 | - foreach($airport_airport_array as $airport_item) |
|
| 76 | + foreach ($airport_airport_array as $airport_item) |
|
| 77 | 77 | { |
| 78 | 78 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
| 79 | 79 | $name = str_replace("'", "", $name); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | print '</thead>'; |
| 113 | 113 | print '<tbody>'; |
| 114 | 114 | $i = 1; |
| 115 | - foreach($airport_airport_array as $airport_item) |
|
| 115 | + foreach ($airport_airport_array as $airport_item) |
|
| 116 | 116 | { |
| 117 | 117 | print '<tr>'; |
| 118 | 118 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -22,7 +22,9 @@ discard block |
||
| 22 | 22 | print '<option></option>'; |
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $airline_names = $Stats->getAllAirlineNames(); |
| 25 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
| 25 | + if (empty($airline_names)) { |
|
| 26 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
| 27 | + } |
|
| 26 | 28 | foreach($airline_names as $airline_name) |
| 27 | 29 | { |
| 28 | 30 | if($airline == $airline_name['airline_icao']) |
@@ -44,8 +46,7 @@ discard block |
||
| 44 | 46 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
| 45 | 47 | { |
| 46 | 48 | 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" />'; |
| 47 | - } |
|
| 48 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
| 49 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
| 49 | 50 | { |
| 50 | 51 | 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" />'; |
| 51 | 52 | } |
@@ -361,17 +361,17 @@ discard block |
||
| 361 | 361 | else { |
| 362 | 362 | $planespotter_url_array = explode("_", $spotter_item['image']); |
| 363 | 363 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 364 | - $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
| 364 | + $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
| 365 | 365 | } |
| 366 | 366 | if (isset($spotter_item['airline_name'])) { |
| 367 | 367 | print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 368 | 368 | } else { |
| 369 | 369 | print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 370 | 370 | } |
| 371 | - } else { |
|
| 372 | - if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
| 373 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 374 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 371 | + } else { |
|
| 372 | + if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
| 373 | + $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 374 | + } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 375 | 375 | if (isset($spotter_item['airline_name'])) { |
| 376 | 376 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 377 | 377 | } else { |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | } |
| 388 | 388 | if(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
| 389 | 389 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
| 390 | - $spotter_item['squawk'] = '-'; |
|
| 390 | + $spotter_item['squawk'] = '-'; |
|
| 391 | 391 | } |
| 392 | 392 | if ($spotter_item['image_thumbnail'] != "") |
| 393 | 393 | { |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | else { |
| 399 | 399 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
| 400 | 400 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 401 | - $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
| 401 | + $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
| 402 | 402 | } |
| 403 | 403 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
| 404 | 404 | print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -410,9 +410,9 @@ discard block |
||
| 410 | 410 | print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 411 | 411 | } |
| 412 | 412 | } else { |
| 413 | - if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
| 414 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 415 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 413 | + if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
| 414 | + $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 415 | + } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 416 | 416 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
| 417 | 417 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 418 | 418 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | print '</td>'."\n"; |
| 427 | 427 | } else { |
| 428 | 428 | print '<td class="aircraft_thumbnail">'."\n"; |
| 429 | - // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
| 429 | + // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
| 430 | 430 | //} |
| 431 | 431 | if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) { |
| 432 | 432 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n"; |
@@ -523,13 +523,13 @@ discard block |
||
| 523 | 523 | } |
| 524 | 524 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
| 525 | 525 | if ($distance != '') { |
| 526 | - if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
| 527 | - echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
| 528 | - } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
| 529 | - echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
| 530 | - } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
| 531 | - echo '<br/><i>'.$distance.' km</i>'; |
|
| 532 | - } |
|
| 526 | + if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
| 527 | + echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
| 528 | + } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
| 529 | + echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
| 530 | + } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
| 531 | + echo '<br/><i>'.$distance.' km</i>'; |
|
| 532 | + } |
|
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | print '</td>'."\n"; |
@@ -588,13 +588,13 @@ discard block |
||
| 588 | 588 | } |
| 589 | 589 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
| 590 | 590 | if ($distance != '') { |
| 591 | - if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
| 592 | - echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
| 593 | - } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
| 594 | - echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
| 595 | - } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
| 596 | - echo '<br/><i>'.$distance.' km</i>'; |
|
| 597 | - } |
|
| 591 | + if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
| 592 | + echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
| 593 | + } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
| 594 | + echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
| 595 | + } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
| 596 | + echo '<br/><i>'.$distance.' km</i>'; |
|
| 597 | + } |
|
| 598 | 598 | } |
| 599 | 599 | } |
| 600 | 600 | print '</td>'."\n"; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | print '<th class="more"></th>'; |
| 94 | 94 | print '</thead>'; |
| 95 | -} else if (strtolower($current_page) == "upcoming"){ |
|
| 95 | +} else if (strtolower($current_page) == "upcoming") { |
|
| 96 | 96 | print '<thead>'; |
| 97 | 97 | if ($_GET['sort'] == "airline_name_asc") |
| 98 | 98 | { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | */ |
| 144 | 144 | print '</thead>'; |
| 145 | -} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){ |
|
| 145 | +} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
|
| 146 | 146 | print '<thead>'; |
| 147 | 147 | print '<th class="aircraft_thumbnail"></th>'; |
| 148 | 148 | print '<th class="logo">'._("Airline").'</th>'; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | print '</thead>'; |
| 154 | 154 | } else { |
| 155 | 155 | |
| 156 | - if ($hide_th_links === true){ |
|
| 156 | + if ($hide_th_links === true) { |
|
| 157 | 157 | print '<thead>'; |
| 158 | 158 | print '<th class="aircraft_thumbnail"></th>'; |
| 159 | 159 | if ($_GET['sort'] == "airline_name_asc") |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | print '<tbody>'."\n"; |
| 337 | -foreach($spotter_array as $spotter_item) |
|
| 337 | +foreach ($spotter_array as $spotter_item) |
|
| 338 | 338 | { |
| 339 | 339 | if (isset($globalTimezone)) |
| 340 | 340 | { |
@@ -365,13 +365,13 @@ discard block |
||
| 365 | 365 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
| 366 | 366 | } |
| 367 | 367 | if (isset($spotter_item['airline_name'])) { |
| 368 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 368 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 369 | 369 | } else { |
| 370 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 370 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 371 | 371 | } |
| 372 | 372 | } else { |
| 373 | 373 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 374 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 374 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
| 375 | 375 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
| 376 | 376 | if (isset($spotter_item['airline_name'])) { |
| 377 | 377 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | print '</td>'."\n"; |
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | - if(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
|
| 389 | + if (strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") { |
|
| 390 | 390 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
| 391 | 391 | $spotter_item['squawk'] = '-'; |
| 392 | 392 | } |
@@ -402,17 +402,17 @@ discard block |
||
| 402 | 402 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
| 403 | 403 | } |
| 404 | 404 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
| 405 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 405 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 406 | 406 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
| 407 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 407 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 408 | 408 | } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) { |
| 409 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 409 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 410 | 410 | } else { |
| 411 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 411 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 412 | 412 | } |
| 413 | 413 | } else { |
| 414 | 414 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 415 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 415 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
| 416 | 416 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
| 417 | 417 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
| 418 | 418 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | } |
| 472 | 472 | print '</td>'."\n"; |
| 473 | 473 | // Aircraft type |
| 474 | - if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
|
| 474 | + if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") { |
|
| 475 | 475 | print '<td class="type">'."\n"; |
| 476 | 476 | if (!isset($spotter_item['aircraft_name'])) { |
| 477 | 477 | print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'._("Not available").'</a></span>'."\n"; |
@@ -493,22 +493,22 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
| 495 | 495 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 496 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
| 497 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 496 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
| 497 | + } else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
| 498 | 498 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 499 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
| 499 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
| 500 | 500 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
| 501 | 501 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
| 502 | 502 | } elseif (isset($spotter_item['real_departure_airport_time'])) { |
| 503 | 503 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 504 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
| 504 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
| 505 | 505 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
| 506 | 506 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
| 507 | 507 | } elseif (isset($spotter_item['departure_airport_time'])) { |
| 508 | 508 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 509 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
| 509 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
| 510 | 510 | } else { |
| 511 | - $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 511 | + $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
| 512 | 512 | } |
| 513 | 513 | print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n"; |
| 514 | 514 | } |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | $latitude = $spotter_item['latitude']; |
| 524 | 524 | $longitude = $spotter_item['longitude']; |
| 525 | 525 | } |
| 526 | - $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
|
| 526 | + $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude); |
|
| 527 | 527 | } else $distance = ''; |
| 528 | 528 | if ($distance != '') { |
| 529 | 529 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -564,20 +564,20 @@ discard block |
||
| 564 | 564 | } |
| 565 | 565 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
| 566 | 566 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 567 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
| 567 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
| 568 | 568 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
| 569 | 569 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 570 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
| 570 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
| 571 | 571 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
| 572 | 572 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
| 573 | 573 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
| 574 | 574 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 575 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
| 575 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
| 576 | 576 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
| 577 | 577 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
| 578 | 578 | } elseif (isset($spotter_item['arrival_airport_time'])) { |
| 579 | 579 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 580 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
| 580 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
| 581 | 581 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
| 582 | 582 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
| 583 | 583 | } |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | $latitude = $spotter_item['latitude']; |
| 591 | 591 | $longitude = $spotter_item['longitude']; |
| 592 | 592 | } |
| 593 | - $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
|
| 593 | + $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude); |
|
| 594 | 594 | } else $distance = ''; |
| 595 | 595 | if ($distance != '') { |
| 596 | 596 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | } |
| 605 | 605 | print '</td>'."\n"; |
| 606 | 606 | // Route stop |
| 607 | - if(strtolower($current_page) != "upcoming"){ |
|
| 607 | + if (strtolower($current_page) != "upcoming") { |
|
| 608 | 608 | print '<td class="route_stop">'."\n"; |
| 609 | 609 | if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '') { |
| 610 | 610 | print '<span class="nomobile">-</span>'."\n"; |
@@ -625,22 +625,22 @@ discard block |
||
| 625 | 625 | } else { |
| 626 | 626 | //if (!isset($globalUnitDistance) || $globalUnitDistance == 'km') { |
| 627 | 627 | if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
| 628 | - print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n"; |
|
| 629 | - print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n"; |
|
| 628 | + print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n"; |
|
| 629 | + print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n"; |
|
| 630 | 630 | //} elseif ($globalUnitDistance == 'mi') { |
| 631 | 631 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
| 632 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n"; |
|
| 633 | - print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n"; |
|
| 632 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n"; |
|
| 633 | + print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n"; |
|
| 634 | 634 | //} elseif ($globalUnitDistance == 'nm') { |
| 635 | 635 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 636 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n"; |
|
| 637 | - print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n"; |
|
| 636 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n"; |
|
| 637 | + print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n"; |
|
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | print '</td>'."\n"; |
| 642 | 642 | } |
| 643 | - if(strtolower($current_page) != "upcoming"){ |
|
| 643 | + if (strtolower($current_page) != "upcoming") { |
|
| 644 | 644 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 645 | 645 | print '<td class="pilot">'."\n"; |
| 646 | 646 | if ((!isset($spotter_item['pilot_id']) || $spotter_item['pilot_id'] == '') && (!isset($spotter_item['pilot_name']) || $spotter_item['pilot_name'] == '')) { |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
| 678 | 678 | if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') { |
| 679 | 679 | print '<td class="message"><p>'."\n"; |
| 680 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
| 680 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
| 681 | 681 | print '</p><p class="decode">'; |
| 682 | 682 | $decode_array = json_decode($spotter_item['decode']); |
| 683 | 683 | foreach ($decode_array as $key => $value) { |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | print '</td>'."\n"; |
| 688 | 688 | } else { |
| 689 | 689 | print '<td class="message">'."\n"; |
| 690 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
| 690 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
| 691 | 691 | print '</td>'."\n"; |
| 692 | 692 | } |
| 693 | 693 | } |
@@ -339,7 +339,9 @@ discard block |
||
| 339 | 339 | if (isset($globalTimezone)) |
| 340 | 340 | { |
| 341 | 341 | date_default_timezone_set($globalTimezone); |
| 342 | - } else date_default_timezone_set('UTC'); |
|
| 342 | + } else { |
|
| 343 | + date_default_timezone_set('UTC'); |
|
| 344 | + } |
|
| 343 | 345 | if ($showSpecial === true) |
| 344 | 346 | { |
| 345 | 347 | print '<tr class="special">'."\n"; |
@@ -358,8 +360,9 @@ discard block |
||
| 358 | 360 | print '<td class="aircraft_thumbnail">'."\n"; |
| 359 | 361 | |
| 360 | 362 | if ($spotter_item['image_source'] == 'planespotters') { |
| 361 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
| 362 | - else { |
|
| 363 | + if ($spotter_item['image_source_website'] != '') { |
|
| 364 | + $image_src = $spotter_item['image_source_website']; |
|
| 365 | + } else { |
|
| 363 | 366 | $planespotter_url_array = explode("_", $spotter_item['image']); |
| 364 | 367 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 365 | 368 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -372,7 +375,9 @@ discard block |
||
| 372 | 375 | } else { |
| 373 | 376 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 374 | 377 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 375 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 378 | + } else { |
|
| 379 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 380 | + } |
|
| 376 | 381 | if (isset($spotter_item['airline_name'])) { |
| 377 | 382 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 378 | 383 | } else { |
@@ -395,8 +400,9 @@ discard block |
||
| 395 | 400 | print '<td class="aircraft_thumbnail">'."\n"; |
| 396 | 401 | //print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
| 397 | 402 | if ($spotter_item['image_source'] == 'planespotters') { |
| 398 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
| 399 | - else { |
|
| 403 | + if ($spotter_item['image_source_website'] != '') { |
|
| 404 | + $image_src = $spotter_item['image_source_website']; |
|
| 405 | + } else { |
|
| 400 | 406 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
| 401 | 407 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 402 | 408 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -413,7 +419,9 @@ discard block |
||
| 413 | 419 | } else { |
| 414 | 420 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 415 | 421 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 416 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 422 | + } else { |
|
| 423 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 424 | + } |
|
| 417 | 425 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
| 418 | 426 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 419 | 427 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -494,15 +502,21 @@ discard block |
||
| 494 | 502 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
| 495 | 503 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 496 | 504 | $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
| 497 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 505 | + } else { |
|
| 506 | + $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 507 | + } |
|
| 498 | 508 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 499 | 509 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
| 500 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 510 | + } else { |
|
| 511 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 512 | + } |
|
| 501 | 513 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
| 502 | 514 | } elseif (isset($spotter_item['real_departure_airport_time'])) { |
| 503 | 515 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 504 | 516 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
| 505 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 517 | + } else { |
|
| 518 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 519 | + } |
|
| 506 | 520 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
| 507 | 521 | } elseif (isset($spotter_item['departure_airport_time'])) { |
| 508 | 522 | if ($spotter_item['departure_airport_time'] > 2460) { |
@@ -524,7 +538,9 @@ discard block |
||
| 524 | 538 | $longitude = $spotter_item['longitude']; |
| 525 | 539 | } |
| 526 | 540 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
| 527 | - } else $distance = ''; |
|
| 541 | + } else { |
|
| 542 | + $distance = ''; |
|
| 543 | + } |
|
| 528 | 544 | if ($distance != '') { |
| 529 | 545 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 530 | 546 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -549,7 +565,9 @@ discard block |
||
| 549 | 565 | } else { |
| 550 | 566 | if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) { |
| 551 | 567 | print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n"; |
| 552 | - if (!isset($Spotter)) $Spotter = new Spotter(); |
|
| 568 | + if (!isset($Spotter)) { |
|
| 569 | + $Spotter = new Spotter(); |
|
| 570 | + } |
|
| 553 | 571 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
| 554 | 572 | print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n"; |
| 555 | 573 | print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n"; |
@@ -565,20 +583,28 @@ discard block |
||
| 565 | 583 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
| 566 | 584 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 567 | 585 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
| 568 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 586 | + } else { |
|
| 587 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 588 | + } |
|
| 569 | 589 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 570 | 590 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
| 571 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 591 | + } else { |
|
| 592 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 593 | + } |
|
| 572 | 594 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
| 573 | 595 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
| 574 | 596 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 575 | 597 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
| 576 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 598 | + } else { |
|
| 599 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 600 | + } |
|
| 577 | 601 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
| 578 | 602 | } elseif (isset($spotter_item['arrival_airport_time'])) { |
| 579 | 603 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 580 | 604 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
| 581 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 605 | + } else { |
|
| 606 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 607 | + } |
|
| 582 | 608 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
| 583 | 609 | } |
| 584 | 610 | if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
@@ -591,7 +617,9 @@ discard block |
||
| 591 | 617 | $longitude = $spotter_item['longitude']; |
| 592 | 618 | } |
| 593 | 619 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
| 594 | - } else $distance = ''; |
|
| 620 | + } else { |
|
| 621 | + $distance = ''; |
|
| 622 | + } |
|
| 595 | 623 | if ($distance != '') { |
| 596 | 624 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 597 | 625 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -7,15 +7,15 @@ discard block |
||
| 7 | 7 | if (isset($_POST['airport'])) |
| 8 | 8 | { |
| 9 | 9 | header('Location: '.$globalURL.'/airport/'.$_POST['airport']); |
| 10 | -} else if (isset($_GET['airport'])){ |
|
| 10 | +} else if (isset($_GET['airport'])) { |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | 12 | //calculuation for the pagination |
| 13 | - if($_GET['limit'] == "") |
|
| 13 | + if ($_GET['limit'] == "") |
|
| 14 | 14 | { |
| 15 | 15 | $limit_start = 0; |
| 16 | 16 | $limit_end = 25; |
| 17 | 17 | $absolute_difference = 25; |
| 18 | - } else { |
|
| 18 | + } else { |
|
| 19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
| 20 | 20 | $limit_start = $limit_explode[0]; |
| 21 | 21 | $limit_end = $limit_explode[1]; |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
| 30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
| 31 | 31 | |
| 32 | - $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 33 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 32 | + $airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 33 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 34 | 34 | $page_url = $globalURL.'/airport/'.$airport; |
| 35 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport,$limit_start.",".$absolute_difference, $sort); |
|
| 35 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport, $limit_start.",".$absolute_difference, $sort); |
|
| 36 | 36 | $airport_array = $Spotter->getAllAirportInfo($airport); |
| 37 | 37 | |
| 38 | 38 | if (!empty($airport_array)) |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | print '<option></option>'; |
| 47 | 47 | $airport_names = $Spotter->getAllAirportNames(); |
| 48 | 48 | ksort($airport_names); |
| 49 | - foreach($airport_names as $airport_name) |
|
| 49 | + foreach ($airport_names as $airport_name) |
|
| 50 | 50 | { |
| 51 | - if($airport == $airport_name['airport_icao']) |
|
| 51 | + if ($airport == $airport_name['airport_icao']) |
|
| 52 | 52 | { |
| 53 | 53 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
| 54 | 54 | } else { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | print '<div class="table column">'; |
| 81 | 81 | if ($airport_array[0]['iata'] != "NA") |
| 82 | 82 | { |
| 83 | - print '<p>'.sprintf(_("The table below shows the route(s) aircrafts have used to/from <strong>%s</strong>, sorted by the most recent one."),$airport_array[0]['name']).'</p>'; |
|
| 83 | + print '<p>'.sprintf(_("The table below shows the route(s) aircrafts have used to/from <strong>%s</strong>, sorted by the most recent one."), $airport_array[0]['name']).'</p>'; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | include('table-output.php'); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | print '<p>'._("Sorry, the airport does not exist in this database. :(").'</p>'; |
| 103 | 103 | } |
| 104 | 104 | } else { |
| 105 | - $Spotter= new Spotter(); |
|
| 105 | + $Spotter = new Spotter(); |
|
| 106 | 106 | $Stats = new Stats(); |
| 107 | 107 | $title = _("Airports"); |
| 108 | 108 | require_once('header.php'); |
@@ -113,11 +113,11 @@ discard block |
||
| 113 | 113 | ksort($airport_names); |
| 114 | 114 | $previous = null; |
| 115 | 115 | print '<div class="alphabet-legend">'; |
| 116 | - foreach($airport_names as $value) { |
|
| 116 | + foreach ($airport_names as $value) { |
|
| 117 | 117 | $firstLetter = mb_strtoupper(mb_substr($value['airport_city'], 0, 1)); |
| 118 | - if($previous !== $firstLetter) |
|
| 118 | + if ($previous !== $firstLetter) |
|
| 119 | 119 | { |
| 120 | - if ($previous !== null){ |
|
| 120 | + if ($previous !== null) { |
|
| 121 | 121 | print ' | '; |
| 122 | 122 | } |
| 123 | 123 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
@@ -126,13 +126,13 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | print '</div>'; |
| 128 | 128 | $previous = null; |
| 129 | - foreach($airport_names as $value) { |
|
| 129 | + foreach ($airport_names as $value) { |
|
| 130 | 130 | $firstLetter = mb_strtoupper(mb_substr($value['airport_city'], 0, 1)); |
| 131 | 131 | if ($firstLetter != "") |
| 132 | 132 | { |
| 133 | - if($previous !== $firstLetter) |
|
| 133 | + if ($previous !== $firstLetter) |
|
| 134 | 134 | { |
| 135 | - if ($previous !== null){ |
|
| 135 | + if ($previous !== null) { |
|
| 136 | 136 | print '</div>'; |
| 137 | 137 | } |
| 138 | 138 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $limit_start = 0; |
| 14 | 14 | $limit_end = 25; |
| 15 | 15 | $absolute_difference = 25; |
| 16 | - } else { |
|
| 16 | + } else { |
|
| 17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
| 18 | 18 | $limit_start = $limit_explode[0]; |
| 19 | 19 | $limit_end = $limit_explode[1]; |