@@ -4,14 +4,14 @@ discard block |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | 6 | $Spotter = new Spotter(); |
7 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
8 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
9 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
7 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
8 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
9 | +if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
10 | 10 | else $spotter_array = ''; |
11 | 11 | |
12 | 12 | if (!empty($spotter_array)) |
13 | 13 | { |
14 | - $title = sprintf(_("Most Common Airlines on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
14 | + $title = sprintf(_("Most Common Airlines on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
15 | 15 | |
16 | 16 | require_once('header.php'); |
17 | 17 | print '<div class="select-item">'; |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | print '</div>'; |
24 | 24 | |
25 | 25 | print '<div class="info column">'; |
26 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
26 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
27 | 27 | print '</div>'; |
28 | 28 | |
29 | 29 | include('date-sub-menu.php'); |
30 | 30 | print '<div class="column">'; |
31 | 31 | print '<h2>'._("Most Common Airlines").'</h2>'; |
32 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
32 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
33 | 33 | |
34 | 34 | $airline_array = $Spotter->countAllAirlinesByDate($date); |
35 | 35 | if (!empty($airline_array)) |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | print '</thead>'; |
47 | 47 | print '<tbody>'; |
48 | 48 | $i = 1; |
49 | - foreach($airline_array as $airline_item) |
|
49 | + foreach ($airline_array as $airline_item) |
|
50 | 50 | { |
51 | 51 | print '<tr>'; |
52 | 52 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -6,8 +6,11 @@ |
||
6 | 6 | $Spotter = new Spotter(); |
7 | 7 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
8 | 8 | $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
9 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
10 | -else $spotter_array = ''; |
|
9 | +if (isset($_GET['date'])) { |
|
10 | + $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
11 | +} else { |
|
12 | + $spotter_array = ''; |
|
13 | +} |
|
11 | 14 | |
12 | 15 | if (!empty($spotter_array)) |
13 | 16 | { |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Arrival Airports by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Arrival Airports by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | require_once('header.php'); |
14 | 14 | print '<div class="select-item">'; |
15 | 15 | print '<form action="'.$globalURL.'/date" method="post">'; |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | print '</form>'; |
20 | 20 | print '</div>'; |
21 | 21 | print '<div class="info column">'; |
22 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
22 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
23 | 23 | print '</div>'; |
24 | 24 | |
25 | 25 | include('date-sub-menu.php'); |
26 | 26 | print '<div class="column">'; |
27 | 27 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
28 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
28 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
29 | 29 | |
30 | 30 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByDate($date); |
31 | 31 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | ["'._("Country").'", "'._("# of times").'"], '; |
39 | 39 | |
40 | 40 | $country_data = ''; |
41 | - foreach($airport_country_array as $airport_item) |
|
41 | + foreach ($airport_country_array as $airport_item) |
|
42 | 42 | { |
43 | 43 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
44 | 44 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | print '</thead>'; |
73 | 73 | print '<tbody>'; |
74 | 74 | $i = 1; |
75 | - foreach($airport_country_array as $airport_item) |
|
75 | + foreach ($airport_country_array as $airport_item) |
|
76 | 76 | { |
77 | 77 | print '<tr>'; |
78 | 78 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,16 +3,16 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | 8 | |
9 | 9 | $Spotter = new Spotter(); |
10 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
10 | +if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
11 | 11 | else $spotter_array = array(); |
12 | 12 | |
13 | 13 | if (!empty($spotter_array)) |
14 | 14 | { |
15 | - $title = sprintf(_("Most Common Airlines by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
15 | + $title = sprintf(_("Most Common Airlines by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
16 | 16 | require_once('header.php'); |
17 | 17 | print '<div class="select-item">'; |
18 | 18 | print '<form action="'.$globalURL.'/date" method="post">'; |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | print '</div>'; |
24 | 24 | |
25 | 25 | print '<div class="info column">'; |
26 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
26 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
27 | 27 | print '</div>'; |
28 | 28 | |
29 | 29 | include('date-sub-menu.php'); |
30 | 30 | print '<div class="column">'; |
31 | 31 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
32 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
32 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
33 | 33 | |
34 | 34 | $airline_array = $Spotter->countAllAirlineCountriesByDate($date); |
35 | 35 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | var data = google.visualization.arrayToDataTable([ |
42 | 42 | ["'._("Country").'", "'._("# of times").'"], '; |
43 | 43 | $country_data = ''; |
44 | - foreach($airline_array as $airline_item) |
|
44 | + foreach ($airline_array as $airline_item) |
|
45 | 45 | { |
46 | 46 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
47 | 47 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | print '</thead>'; |
76 | 76 | print '<tbody>'; |
77 | 77 | $i = 1; |
78 | - foreach($airline_array as $airline_item) |
|
78 | + foreach ($airline_array as $airline_item) |
|
79 | 79 | { |
80 | 80 | print '<tr>'; |
81 | 81 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -8,8 +8,11 @@ |
||
8 | 8 | $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
9 | 9 | |
10 | 10 | $Spotter = new Spotter(); |
11 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
12 | -else $spotter_array = array(); |
|
11 | +if (isset($_GET['date'])) { |
|
12 | + $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
13 | +} else { |
|
14 | + $spotter_array = array(); |
|
15 | +} |
|
13 | 16 | |
14 | 17 | if (!empty($spotter_array)) |
15 | 18 | { |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Departure Airports by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Departure Airports by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | |
14 | 14 | require_once('header.php'); |
15 | 15 | print '<div class="select-item">'; |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | print '</div>'; |
22 | 22 | |
23 | 23 | print '<div class="info column">'; |
24 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
24 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
25 | 25 | print '</div>'; |
26 | 26 | |
27 | 27 | include('date-sub-menu.php'); |
28 | 28 | print '<div class="column">'; |
29 | 29 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
30 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
30 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
31 | 31 | $airport_country_array = $Spotter->countAllDepartureAirportCountriesByDate($date); |
32 | 32 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
33 | 33 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | var data = google.visualization.arrayToDataTable([ |
39 | 39 | ["'._("Country").'", "'._("# of times").'"], '; |
40 | 40 | $country_data = ''; |
41 | - foreach($airport_country_array as $airport_item) |
|
41 | + foreach ($airport_country_array as $airport_item) |
|
42 | 42 | { |
43 | 43 | $country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],'; |
44 | 44 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | print '</thead>'; |
73 | 73 | print '<tbody>'; |
74 | 74 | $i = 1; |
75 | - foreach($airport_country_array as $airport_item) |
|
75 | + foreach ($airport_country_array as $airport_item) |
|
76 | 76 | { |
77 | 77 | print '<tr>'; |
78 | 78 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Routes on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Routes on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | |
14 | 14 | require_once('header.php'); |
15 | 15 | print '<div class="select-item">'; |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | print '</div>'; |
22 | 22 | |
23 | 23 | print '<div class="info column">'; |
24 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
24 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
25 | 25 | print '</div>'; |
26 | 26 | |
27 | 27 | include('date-sub-menu.php'); |
28 | 28 | print '<div class="column">'; |
29 | 29 | print '<h2>'._("Most Common Routes").'</h2>'; |
30 | - print '<p>'.sprintf(_("The statistic below shows the most common routes on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
30 | + print '<p>'.sprintf(_("The statistic below shows the most common routes on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
31 | 31 | |
32 | 32 | $route_array = $Spotter->countAllRoutesByDate($date); |
33 | 33 | if (!empty($route_array)) |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | print '</thead>'; |
45 | 45 | print '<tbody>'; |
46 | 46 | $i = 1; |
47 | - foreach($route_array as $route_item) |
|
47 | + foreach ($route_array as $route_item) |
|
48 | 48 | { |
49 | 49 | print '<tr>'; |
50 | 50 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Aircraft Manufacturer on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Aircraft Manufacturer on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | |
14 | 14 | require_once('header.php'); |
15 | 15 | print '<div class="select-item">'; |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | print '</div>'; |
22 | 22 | |
23 | 23 | print '<div class="info column">'; |
24 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
24 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
25 | 25 | print '</div>'; |
26 | 26 | |
27 | 27 | include('date-sub-menu.php'); |
28 | 28 | print '<div class="column">'; |
29 | 29 | print '<h2>'._("Most Common Aircraft Manufacturer").'</h2>'; |
30 | - print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
30 | + print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
31 | 31 | |
32 | 32 | $manufacturers_array = $Spotter->countAllAircraftManufacturerByDate($date); |
33 | 33 | if (!empty($manufacturers_array)) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | print '</thead>'; |
43 | 43 | print '<tbody>'; |
44 | 44 | $i = 1; |
45 | - foreach($manufacturers_array as $manufacturer_item) |
|
45 | + foreach ($manufacturers_array as $manufacturer_item) |
|
46 | 46 | { |
47 | 47 | print '<tr>'; |
48 | 48 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | - * Get Latest ACARS data from DB |
|
27 | - * |
|
28 | - * @return Array Return ACARS data in array |
|
29 | - */ |
|
26 | + * Get Latest ACARS data from DB |
|
27 | + * |
|
28 | + * @return Array Return ACARS data in array |
|
29 | + */ |
|
30 | 30 | public function getLatestAccidentData($limit = '',$type = '') { |
31 | 31 | global $globalURL, $globalDBdriver; |
32 | 32 | $Image = new Image($this->db); |
@@ -37,36 +37,36 @@ discard block |
||
37 | 37 | $limit_query = ''; |
38 | 38 | if ($limit != "") |
39 | 39 | { |
40 | - $limit_array = explode(",", $limit); |
|
40 | + $limit_array = explode(",", $limit); |
|
41 | 41 | |
42 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
43 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
42 | + $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
43 | + $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
44 | 44 | |
45 | - if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
46 | - { |
|
45 | + if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
46 | + { |
|
47 | 47 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
48 | - } |
|
48 | + } |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if ($type != '') { |
52 | - $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type GROUP BY registration) ORDER BY date DESC".$limit_query; |
|
53 | - $query_values = array(':type' => $type); |
|
52 | + $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type GROUP BY registration) ORDER BY date DESC".$limit_query; |
|
53 | + $query_values = array(':type' => $type); |
|
54 | 54 | } else { |
55 | - //$query = "SELECT * FROM accidents GROUP BY registration ORDER BY date DESC".$limit_query; |
|
56 | - $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents GROUP BY registration) ORDER BY date DESC".$limit_query; |
|
57 | - $query_values = array(); |
|
55 | + //$query = "SELECT * FROM accidents GROUP BY registration ORDER BY date DESC".$limit_query; |
|
56 | + $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents GROUP BY registration) ORDER BY date DESC".$limit_query; |
|
57 | + $query_values = array(); |
|
58 | 58 | } |
59 | 59 | try { |
60 | 60 | |
61 | - $sth = $this->db->prepare($query); |
|
62 | - $sth->execute($query_values); |
|
61 | + $sth = $this->db->prepare($query); |
|
62 | + $sth->execute($query_values); |
|
63 | 63 | } catch(PDOException $e) { |
64 | - return "error : ".$e->getMessage(); |
|
64 | + return "error : ".$e->getMessage(); |
|
65 | 65 | } |
66 | 66 | $i = 0; |
67 | 67 | while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
68 | - $data = array(); |
|
69 | - if ($row['registration'] != '') { |
|
68 | + $data = array(); |
|
69 | + if ($row['registration'] != '') { |
|
70 | 70 | // $row['registration'] = str_replace('.','',$row['registration']); |
71 | 71 | $image_array = $Image->getSpotterImage($row['registration']); |
72 | 72 | if (count($image_array) > 0) $data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website'])); |
@@ -89,33 +89,33 @@ discard block |
||
89 | 89 | $data['aircraft_base'] = $owner_data['base']; |
90 | 90 | $data['aircraft_date_first_reg'] = $owner_data['date_first_reg']; |
91 | 91 | } |
92 | - } else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
93 | - if ($row['registration'] == '') $row['registration'] = 'NA'; |
|
94 | - if ($row['ident'] == '') $row['ident'] = 'NA'; |
|
95 | - $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,2)); |
|
96 | - if (isset($identicao[0])) { |
|
92 | + } else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
93 | + if ($row['registration'] == '') $row['registration'] = 'NA'; |
|
94 | + if ($row['ident'] == '') $row['ident'] = 'NA'; |
|
95 | + $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,2)); |
|
96 | + if (isset($identicao[0])) { |
|
97 | 97 | if (substr($row['ident'],0,2) == 'AF') { |
98 | - if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
99 | - else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0'); |
|
98 | + if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
99 | + else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0'); |
|
100 | 100 | } else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0'); |
101 | 101 | |
102 | 102 | $data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name'])); |
103 | - } else $icao = $row['ident']; |
|
104 | - $icao = $Translation->checkTranslation($icao,false); |
|
105 | - //$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url'])); |
|
106 | - $data = array_merge($row,$data); |
|
107 | - if ($data['ident'] == null) $data['ident'] = $icao; |
|
108 | - if ($data['title'] == null) { |
|
103 | + } else $icao = $row['ident']; |
|
104 | + $icao = $Translation->checkTranslation($icao,false); |
|
105 | + //$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url'])); |
|
106 | + $data = array_merge($row,$data); |
|
107 | + if ($data['ident'] == null) $data['ident'] = $icao; |
|
108 | + if ($data['title'] == null) { |
|
109 | 109 | $data['message'] = $row['type'].' of '.$row['registration'].' at '.$row['place'].','.$row['country']; |
110 | - } else $data['message'] = strtolower($data['title']); |
|
111 | - $result[] = $data; |
|
112 | - $i++; |
|
110 | + } else $data['message'] = strtolower($data['title']); |
|
111 | + $result[] = $data; |
|
112 | + $i++; |
|
113 | 113 | } |
114 | 114 | if (isset($result)) { |
115 | - $result[0]['query_number_rows'] = $i; |
|
116 | - return $result; |
|
115 | + $result[0]['query_number_rows'] = $i; |
|
116 | + return $result; |
|
117 | 117 | } |
118 | 118 | else return array(); |
119 | - } |
|
119 | + } |
|
120 | 120 | } |
121 | 121 | ?> |
122 | 122 | \ No newline at end of file |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return Array Return ACARS data in array |
29 | 29 | */ |
30 | - public function getLatestAccidentData($limit = '',$type = '') { |
|
30 | + public function getLatestAccidentData($limit = '', $type = '') { |
|
31 | 31 | global $globalURL, $globalDBdriver; |
32 | 32 | $Image = new Image($this->db); |
33 | 33 | $Spotter = new Spotter($this->db); |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | { |
40 | 40 | $limit_array = explode(",", $limit); |
41 | 41 | |
42 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
43 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
42 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
43 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
44 | 44 | |
45 | 45 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
46 | 46 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $sth = $this->db->prepare($query); |
62 | 62 | $sth->execute($query_values); |
63 | - } catch(PDOException $e) { |
|
63 | + } catch (PDOException $e) { |
|
64 | 64 | return "error : ".$e->getMessage(); |
65 | 65 | } |
66 | 66 | $i = 0; |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | if ($row['registration'] != '') { |
70 | 70 | // $row['registration'] = str_replace('.','',$row['registration']); |
71 | 71 | $image_array = $Image->getSpotterImage($row['registration']); |
72 | - if (count($image_array) > 0) $data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website'])); |
|
73 | - else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
72 | + if (count($image_array) > 0) $data = array_merge($data, array('image' => $image_array[0]['image'], 'image_thumbnail' => $image_array[0]['image_thumbnail'], 'image_copyright' => $image_array[0]['image_copyright'], 'image_source' => $image_array[0]['image_source'], 'image_source_website' => $image_array[0]['image_source_website'])); |
|
73 | + else $data = array_merge($data, array('image' => '', 'image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => '')); |
|
74 | 74 | $aircraft_type = $Spotter->getAllAircraftTypeByRegistration($row['registration']); |
75 | 75 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_type); |
76 | 76 | //echo $row['registration']; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $data['aircraft_name'] = $aircraft_info[0]['type']; |
82 | 82 | $data['aircraft_manufacturer'] = $aircraft_info[0]['manufacturer']; |
83 | 83 | } else { |
84 | - $data = array_merge($data,array('aircraft_type' => 'NA')); |
|
84 | + $data = array_merge($data, array('aircraft_type' => 'NA')); |
|
85 | 85 | } |
86 | 86 | $owner_data = $Spotter->getAircraftOwnerByRegistration($row['registration']); |
87 | 87 | if (!empty($owner_data)) { |
@@ -89,21 +89,21 @@ discard block |
||
89 | 89 | $data['aircraft_base'] = $owner_data['base']; |
90 | 90 | $data['aircraft_date_first_reg'] = $owner_data['date_first_reg']; |
91 | 91 | } |
92 | - } else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
92 | + } else $data = array_merge($data, array('image' => '', 'image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => '')); |
|
93 | 93 | if ($row['registration'] == '') $row['registration'] = 'NA'; |
94 | 94 | if ($row['ident'] == '') $row['ident'] = 'NA'; |
95 | - $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,2)); |
|
95 | + $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'], 0, 2)); |
|
96 | 96 | if (isset($identicao[0])) { |
97 | - if (substr($row['ident'],0,2) == 'AF') { |
|
98 | - if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
99 | - else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0'); |
|
100 | - } else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0'); |
|
97 | + if (substr($row['ident'], 0, 2) == 'AF') { |
|
98 | + if (filter_var(substr($row['ident'], 2), FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
99 | + else $icao = 'AFR'.ltrim(substr($row['ident'], 2), '0'); |
|
100 | + } else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'], 2), '0'); |
|
101 | 101 | |
102 | - $data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name'])); |
|
102 | + $data = array_merge($data, array('airline_icao' => $identicao[0]['icao'], 'airline_name' => $identicao[0]['name'])); |
|
103 | 103 | } else $icao = $row['ident']; |
104 | - $icao = $Translation->checkTranslation($icao,false); |
|
104 | + $icao = $Translation->checkTranslation($icao, false); |
|
105 | 105 | //$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url'])); |
106 | - $data = array_merge($row,$data); |
|
106 | + $data = array_merge($row, $data); |
|
107 | 107 | if ($data['ident'] == null) $data['ident'] = $icao; |
108 | 108 | if ($data['title'] == null) { |
109 | 109 | $data['message'] = $row['type'].' of '.$row['registration'].' at '.$row['place'].','.$row['country']; |
@@ -69,8 +69,11 @@ discard block |
||
69 | 69 | if ($row['registration'] != '') { |
70 | 70 | // $row['registration'] = str_replace('.','',$row['registration']); |
71 | 71 | $image_array = $Image->getSpotterImage($row['registration']); |
72 | - if (count($image_array) > 0) $data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website'])); |
|
73 | - else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
72 | + if (count($image_array) > 0) { |
|
73 | + $data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website'])); |
|
74 | + } else { |
|
75 | + $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
76 | + } |
|
74 | 77 | $aircraft_type = $Spotter->getAllAircraftTypeByRegistration($row['registration']); |
75 | 78 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_type); |
76 | 79 | //echo $row['registration']; |
@@ -89,33 +92,51 @@ discard block |
||
89 | 92 | $data['aircraft_base'] = $owner_data['base']; |
90 | 93 | $data['aircraft_date_first_reg'] = $owner_data['date_first_reg']; |
91 | 94 | } |
92 | - } else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
93 | - if ($row['registration'] == '') $row['registration'] = 'NA'; |
|
94 | - if ($row['ident'] == '') $row['ident'] = 'NA'; |
|
95 | + } else { |
|
96 | + $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
97 | + } |
|
98 | + if ($row['registration'] == '') { |
|
99 | + $row['registration'] = 'NA'; |
|
100 | + } |
|
101 | + if ($row['ident'] == '') { |
|
102 | + $row['ident'] = 'NA'; |
|
103 | + } |
|
95 | 104 | $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,2)); |
96 | 105 | if (isset($identicao[0])) { |
97 | 106 | if (substr($row['ident'],0,2) == 'AF') { |
98 | - if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
99 | - else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0'); |
|
100 | - } else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0'); |
|
107 | + if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) { |
|
108 | + $icao = $row['ident']; |
|
109 | + } else { |
|
110 | + $icao = 'AFR'.ltrim(substr($row['ident'],2),'0'); |
|
111 | + } |
|
112 | + } else { |
|
113 | + $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0'); |
|
114 | + } |
|
101 | 115 | |
102 | 116 | $data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name'])); |
103 | - } else $icao = $row['ident']; |
|
117 | + } else { |
|
118 | + $icao = $row['ident']; |
|
119 | + } |
|
104 | 120 | $icao = $Translation->checkTranslation($icao,false); |
105 | 121 | //$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url'])); |
106 | 122 | $data = array_merge($row,$data); |
107 | - if ($data['ident'] == null) $data['ident'] = $icao; |
|
123 | + if ($data['ident'] == null) { |
|
124 | + $data['ident'] = $icao; |
|
125 | + } |
|
108 | 126 | if ($data['title'] == null) { |
109 | 127 | $data['message'] = $row['type'].' of '.$row['registration'].' at '.$row['place'].','.$row['country']; |
110 | - } else $data['message'] = strtolower($data['title']); |
|
128 | + } else { |
|
129 | + $data['message'] = strtolower($data['title']); |
|
130 | + } |
|
111 | 131 | $result[] = $data; |
112 | 132 | $i++; |
113 | 133 | } |
114 | 134 | if (isset($result)) { |
115 | 135 | $result[0]['query_number_rows'] = $i; |
116 | 136 | return $result; |
137 | + } else { |
|
138 | + return array(); |
|
117 | 139 | } |
118 | - else return array(); |
|
119 | 140 | } |
120 | 141 | } |
121 | 142 | ?> |
122 | 143 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | $page_url = $globalURL.'/accident-latest'; |
10 | 10 | |
11 | -if(!isset($_GET['limit'])) |
|
11 | +if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | print '<div class="table column">'; |
36 | 36 | print '<p>'._("The table below shows the latest Accidents.").'</p>'; |
37 | -$spotter_array = $Accident->getLatestAccidentData($limit_start.",".$absolute_difference,'accident'); |
|
37 | +$spotter_array = $Accident->getLatestAccidentData($limit_start.",".$absolute_difference, 'accident'); |
|
38 | 38 | //print_r($spotter_array); |
39 | 39 | if (!empty($spotter_array) && $spotter_array[0]['query_number_rows'] != 0) { |
40 | 40 | include('table-output.php'); |
@@ -38,8 +38,12 @@ |
||
38 | 38 | if (!empty($spotter_array) && $spotter_array[0]['query_number_rows'] != 0) { |
39 | 39 | include('table-output.php'); |
40 | 40 | print '<div class="pagination">'; |
41 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
42 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
41 | + if ($limit_previous_1 >= 0) { |
|
42 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
43 | + } |
|
44 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
45 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
46 | + } |
|
43 | 47 | print '</div>'; |
44 | 48 | } |
45 | 49 | print '</div>'; |
@@ -388,17 +388,17 @@ discard block |
||
388 | 388 | else { |
389 | 389 | $planespotter_url_array = explode("_", $spotter_item['image']); |
390 | 390 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
391 | - $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
391 | + $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
392 | 392 | } |
393 | 393 | if (isset($spotter_item['airline_name'])) { |
394 | 394 | 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>'; |
395 | 395 | } else { |
396 | 396 | 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>'; |
397 | 397 | } |
398 | - } else { |
|
399 | - if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
400 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
401 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
398 | + } else { |
|
399 | + if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
400 | + $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
401 | + } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
402 | 402 | if (isset($spotter_item['airline_name'])) { |
403 | 403 | 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>'; |
404 | 404 | } else { |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | } |
414 | 414 | } elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest"){ |
415 | 415 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
416 | - $spotter_item['squawk'] = '-'; |
|
416 | + $spotter_item['squawk'] = '-'; |
|
417 | 417 | } |
418 | 418 | if ($spotter_item['image_thumbnail'] != "") |
419 | 419 | { |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | else { |
425 | 425 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
426 | 426 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
427 | - $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
427 | + $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
428 | 428 | } |
429 | 429 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
430 | 430 | 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>'; |
@@ -436,9 +436,9 @@ discard block |
||
436 | 436 | 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>'; |
437 | 437 | } |
438 | 438 | } else { |
439 | - if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
440 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
441 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
439 | + if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
440 | + $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
441 | + } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
442 | 442 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
443 | 443 | 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>'; |
444 | 444 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | print '</td>'."\n"; |
453 | 453 | } else { |
454 | 454 | print '<td class="aircraft_thumbnail">'."\n"; |
455 | - // 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>'; |
|
455 | + // 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>'; |
|
456 | 456 | //} |
457 | 457 | if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) { |
458 | 458 | 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"; |
@@ -557,13 +557,13 @@ discard block |
||
557 | 557 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
558 | 558 | } else $distance = ''; |
559 | 559 | if ($distance != '') { |
560 | - if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
561 | - echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
562 | - } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
563 | - echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
564 | - } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
565 | - echo '<br/><i>'.$distance.' km</i>'; |
|
566 | - } |
|
560 | + if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
561 | + echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
562 | + } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
563 | + echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
564 | + } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
565 | + echo '<br/><i>'.$distance.' km</i>'; |
|
566 | + } |
|
567 | 567 | } |
568 | 568 | } |
569 | 569 | print '</td>'."\n"; |
@@ -624,13 +624,13 @@ discard block |
||
624 | 624 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
625 | 625 | } else $distance = ''; |
626 | 626 | if ($distance != '') { |
627 | - if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
628 | - echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
629 | - } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
630 | - echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
631 | - } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
632 | - echo '<br/><i>'.$distance.' km</i>'; |
|
633 | - } |
|
627 | + if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
628 | + echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
629 | + } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
630 | + echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
631 | + } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
632 | + echo '<br/><i>'.$distance.' km</i>'; |
|
633 | + } |
|
634 | 634 | } |
635 | 635 | } |
636 | 636 | 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>'; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | print '</thead>'; |
180 | 180 | } else { |
181 | 181 | |
182 | - if ($hide_th_links === true){ |
|
182 | + if ($hide_th_links === true) { |
|
183 | 183 | print '<thead>'; |
184 | 184 | print '<th class="aircraft_thumbnail"></th>'; |
185 | 185 | if ($_GET['sort'] == "airline_name_asc") |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | } |
361 | 361 | |
362 | 362 | print '<tbody>'."\n"; |
363 | -foreach($spotter_array as $spotter_item) |
|
363 | +foreach ($spotter_array as $spotter_item) |
|
364 | 364 | { |
365 | 365 | if (isset($globalTimezone)) |
366 | 366 | { |
@@ -391,13 +391,13 @@ discard block |
||
391 | 391 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
392 | 392 | } |
393 | 393 | if (isset($spotter_item['airline_name'])) { |
394 | - 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>'; |
|
394 | + 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>'; |
|
395 | 395 | } else { |
396 | - 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>'; |
|
396 | + 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>'; |
|
397 | 397 | } |
398 | 398 | } else { |
399 | 399 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
400 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
400 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
401 | 401 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
402 | 402 | if (isset($spotter_item['airline_name'])) { |
403 | 403 | 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>'; |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | print '<img src="'.$globalURL.'/images/placeholder_thumb.png" 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" />'."\n"; |
412 | 412 | print '</td>'."\n"; |
413 | 413 | } |
414 | - } elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest"){ |
|
414 | + } elseif (strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest") { |
|
415 | 415 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
416 | 416 | $spotter_item['squawk'] = '-'; |
417 | 417 | } |
@@ -427,17 +427,17 @@ discard block |
||
427 | 427 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
428 | 428 | } |
429 | 429 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
430 | - 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>'; |
|
430 | + 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>'; |
|
431 | 431 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
432 | - 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>'; |
|
432 | + 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>'; |
|
433 | 433 | } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) { |
434 | - 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>'; |
|
434 | + 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>'; |
|
435 | 435 | } else { |
436 | - 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>'; |
|
436 | + 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>'; |
|
437 | 437 | } |
438 | 438 | } else { |
439 | 439 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
440 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
440 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
441 | 441 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
442 | 442 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
443 | 443 | 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>'; |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | } |
501 | 501 | print '</td>'."\n"; |
502 | 502 | // Aircraft type |
503 | - if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
|
503 | + if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") { |
|
504 | 504 | print '<td class="type">'."\n"; |
505 | 505 | if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) { |
506 | 506 | print '<span class="nomobile">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</span>'."\n"; |
@@ -524,22 +524,22 @@ discard block |
||
524 | 524 | } |
525 | 525 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
526 | 526 | if ($spotter_item['departure_airport_time'] > 2460) { |
527 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
528 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
527 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
528 | + } else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
529 | 529 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
530 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
530 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
531 | 531 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
532 | 532 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
533 | 533 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
534 | 534 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
535 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
535 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
536 | 536 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
537 | 537 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
538 | 538 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
539 | 539 | if ($spotter_item['departure_airport_time'] > 2460) { |
540 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
540 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
541 | 541 | } else { |
542 | - $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
542 | + $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
543 | 543 | } |
544 | 544 | print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n"; |
545 | 545 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $latitude = $spotter_item['latitude']; |
555 | 555 | $longitude = $spotter_item['longitude']; |
556 | 556 | } |
557 | - $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
|
557 | + $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude); |
|
558 | 558 | } else $distance = ''; |
559 | 559 | if ($distance != '') { |
560 | 560 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -595,20 +595,20 @@ discard block |
||
595 | 595 | } |
596 | 596 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
597 | 597 | if ($spotter_item['arrival_airport_time'] > 2460) { |
598 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
598 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
599 | 599 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
600 | 600 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
601 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
601 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
602 | 602 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
603 | 603 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
604 | 604 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
605 | 605 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
606 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
606 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
607 | 607 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
608 | 608 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
609 | 609 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
610 | 610 | if ($spotter_item['arrival_airport_time'] > 2460) { |
611 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
611 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
612 | 612 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
613 | 613 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
614 | 614 | } |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | $latitude = $spotter_item['latitude']; |
622 | 622 | $longitude = $spotter_item['longitude']; |
623 | 623 | } |
624 | - $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
|
624 | + $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude); |
|
625 | 625 | } else $distance = ''; |
626 | 626 | if ($distance != '') { |
627 | 627 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | } |
636 | 636 | print '</td>'."\n"; |
637 | 637 | // Route stop |
638 | - if(strtolower($current_page) != "upcoming"){ |
|
638 | + if (strtolower($current_page) != "upcoming") { |
|
639 | 639 | print '<td class="route_stop">'."\n"; |
640 | 640 | if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') { |
641 | 641 | print '<span class="nomobile">-</span>'."\n"; |
@@ -659,21 +659,21 @@ discard block |
||
659 | 659 | } else { |
660 | 660 | //if (!isset($globalUnitDistance) || $globalUnitDistance == 'km') { |
661 | 661 | if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
662 | - print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n"; |
|
663 | - print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n"; |
|
662 | + print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n"; |
|
663 | + print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n"; |
|
664 | 664 | //} elseif ($globalUnitDistance == 'mi') { |
665 | 665 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
666 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n"; |
|
667 | - print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n"; |
|
666 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n"; |
|
667 | + print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n"; |
|
668 | 668 | //} elseif ($globalUnitDistance == 'nm') { |
669 | 669 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
670 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n"; |
|
671 | - print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n"; |
|
670 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n"; |
|
671 | + print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n"; |
|
672 | 672 | } |
673 | 673 | } |
674 | 674 | print '</td>'."\n"; |
675 | 675 | } |
676 | - if(strtolower($current_page) != "upcoming"){ |
|
676 | + if (strtolower($current_page) != "upcoming") { |
|
677 | 677 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
678 | 678 | print '<td class="pilot">'."\n"; |
679 | 679 | if ((!isset($spotter_item['pilot_id']) || $spotter_item['pilot_id'] == '') && (!isset($spotter_item['pilot_name']) || $spotter_item['pilot_name'] == '')) { |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
709 | 709 | if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') { |
710 | 710 | print '<td class="message"><p>'."\n"; |
711 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
711 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
712 | 712 | print '</p><p class="decode">'; |
713 | 713 | $decode_array = json_decode($spotter_item['decode']); |
714 | 714 | foreach ($decode_array as $key => $value) { |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | print '</td>'."\n"; |
719 | 719 | } else { |
720 | 720 | print '<td class="message">'."\n"; |
721 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
721 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
722 | 722 | print '</td>'."\n"; |
723 | 723 | } |
724 | 724 | } |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | } |
744 | 744 | print '</td>'."\n"; |
745 | 745 | print '<td class="message">'."\n"; |
746 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
746 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
747 | 747 | print '</td>'."\n"; |
748 | 748 | } |
749 | 749 | if (strtolower($current_page) == "incident-latest") { |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | print '</td>'."\n"; |
770 | 770 | */ |
771 | 771 | print '<td class="message">'."\n"; |
772 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
772 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
773 | 773 | print '</td>'."\n"; |
774 | 774 | } |
775 | 775 | // Date |
@@ -365,7 +365,9 @@ discard block |
||
365 | 365 | if (isset($globalTimezone)) |
366 | 366 | { |
367 | 367 | date_default_timezone_set($globalTimezone); |
368 | - } else date_default_timezone_set('UTC'); |
|
368 | + } else { |
|
369 | + date_default_timezone_set('UTC'); |
|
370 | + } |
|
369 | 371 | if ($showSpecial === true) |
370 | 372 | { |
371 | 373 | print '<tr class="special">'."\n"; |
@@ -384,8 +386,9 @@ discard block |
||
384 | 386 | print '<td class="aircraft_thumbnail">'."\n"; |
385 | 387 | |
386 | 388 | if ($spotter_item['image_source'] == 'planespotters') { |
387 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
388 | - else { |
|
389 | + if ($spotter_item['image_source_website'] != '') { |
|
390 | + $image_src = $spotter_item['image_source_website']; |
|
391 | + } else { |
|
389 | 392 | $planespotter_url_array = explode("_", $spotter_item['image']); |
390 | 393 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
391 | 394 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -398,7 +401,9 @@ discard block |
||
398 | 401 | } else { |
399 | 402 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
400 | 403 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
401 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
404 | + } else { |
|
405 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
406 | + } |
|
402 | 407 | if (isset($spotter_item['airline_name'])) { |
403 | 408 | 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>'; |
404 | 409 | } else { |
@@ -420,8 +425,9 @@ discard block |
||
420 | 425 | print '<td class="aircraft_thumbnail">'."\n"; |
421 | 426 | //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>'; |
422 | 427 | if ($spotter_item['image_source'] == 'planespotters') { |
423 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
424 | - else { |
|
428 | + if ($spotter_item['image_source_website'] != '') { |
|
429 | + $image_src = $spotter_item['image_source_website']; |
|
430 | + } else { |
|
425 | 431 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
426 | 432 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
427 | 433 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -438,7 +444,9 @@ discard block |
||
438 | 444 | } else { |
439 | 445 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
440 | 446 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
441 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
447 | + } else { |
|
448 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
449 | + } |
|
442 | 450 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
443 | 451 | 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>'; |
444 | 452 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -525,15 +533,21 @@ discard block |
||
525 | 533 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
526 | 534 | if ($spotter_item['departure_airport_time'] > 2460) { |
527 | 535 | $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
528 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
536 | + } else { |
|
537 | + $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
538 | + } |
|
529 | 539 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
530 | 540 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
531 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
541 | + } else { |
|
542 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
543 | + } |
|
532 | 544 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
533 | 545 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
534 | 546 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
535 | 547 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
536 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
548 | + } else { |
|
549 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
550 | + } |
|
537 | 551 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
538 | 552 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
539 | 553 | if ($spotter_item['departure_airport_time'] > 2460) { |
@@ -555,7 +569,9 @@ discard block |
||
555 | 569 | $longitude = $spotter_item['longitude']; |
556 | 570 | } |
557 | 571 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
558 | - } else $distance = ''; |
|
572 | + } else { |
|
573 | + $distance = ''; |
|
574 | + } |
|
559 | 575 | if ($distance != '') { |
560 | 576 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
561 | 577 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -580,7 +596,9 @@ discard block |
||
580 | 596 | } else { |
581 | 597 | if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) { |
582 | 598 | 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"; |
583 | - if (!isset($Spotter)) $Spotter = new Spotter(); |
|
599 | + if (!isset($Spotter)) { |
|
600 | + $Spotter = new Spotter(); |
|
601 | + } |
|
584 | 602 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']); |
585 | 603 | 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"; |
586 | 604 | print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n"; |
@@ -596,20 +614,28 @@ discard block |
||
596 | 614 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
597 | 615 | if ($spotter_item['arrival_airport_time'] > 2460) { |
598 | 616 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
599 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
617 | + } else { |
|
618 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
619 | + } |
|
600 | 620 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
601 | 621 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
602 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
622 | + } else { |
|
623 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
624 | + } |
|
603 | 625 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
604 | 626 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
605 | 627 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
606 | 628 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
607 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
629 | + } else { |
|
630 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
631 | + } |
|
608 | 632 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
609 | 633 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
610 | 634 | if ($spotter_item['arrival_airport_time'] > 2460) { |
611 | 635 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
612 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
636 | + } else { |
|
637 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
638 | + } |
|
613 | 639 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
614 | 640 | } |
615 | 641 | if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
@@ -622,7 +648,9 @@ discard block |
||
622 | 648 | $longitude = $spotter_item['longitude']; |
623 | 649 | } |
624 | 650 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
625 | - } else $distance = ''; |
|
651 | + } else { |
|
652 | + $distance = ''; |
|
653 | + } |
|
626 | 654 | if ($distance != '') { |
627 | 655 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
628 | 656 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |