@@ -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 on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Arrival Airports 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">'; |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
28 | 28 | print '<br />'; |
29 | 29 | print '<div class="info column">'; |
30 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
30 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
31 | 31 | print '</div>'; |
32 | 32 | |
33 | 33 | include('date-sub-menu.php'); |
34 | 34 | print '<div class="column">'; |
35 | 35 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
36 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
36 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
37 | 37 | $airport_airport_array = $Spotter->countAllArrivalAirportsByDate($date); |
38 | 38 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
39 | 39 | <script> |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ["'._("Airport").'", "'._("# of times").'"],'; |
49 | 49 | |
50 | 50 | $airport_data = ''; |
51 | - foreach($airport_airport_array as $airport_item) |
|
51 | + foreach ($airport_airport_array as $airport_item) |
|
52 | 52 | { |
53 | 53 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
54 | 54 | $name = str_replace("'", "", $name); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | print '</thead>'; |
88 | 88 | print '<tbody>'; |
89 | 89 | $i = 1; |
90 | - foreach($airport_airport_array as $airport_item) |
|
90 | + foreach ($airport_airport_array as $airport_item) |
|
91 | 91 | { |
92 | 92 | print '<tr>'; |
93 | 93 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $title = _("Unknown Date"); |
113 | 113 | require_once('header.php'); |
114 | 114 | print '<h1>'._("Error").'</h1>'; |
115 | - print '<p>'._("Sorry, this date does not exist in this database. :(");'</p>'; |
|
115 | + print '<p>'._("Sorry, this date does not exist in this database. :("); '</p>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | require_once('footer.php'); |
@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | header('Location: '.$globalURL.'/aircraft'); |
9 | 9 | die(); |
10 | 10 | } |
11 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
11 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
12 | 12 | $Spotter = new Spotter(); |
13 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
13 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
14 | 14 | |
15 | 15 | |
16 | 16 | if (!empty($spotter_array)) |
17 | 17 | { |
18 | - $title = sprintf(_("Most Common Airlines from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
18 | + $title = sprintf(_("Most Common Airlines from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
21 | 21 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | $Stats = new Stats(); |
25 | 25 | $aircraft_types = $Stats->getAllAircraftTypes(); |
26 | 26 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
27 | - foreach($aircraft_types as $aircrafttype) |
|
27 | + foreach ($aircraft_types as $aircrafttype) |
|
28 | 28 | { |
29 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
29 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
30 | 30 | { |
31 | 31 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
32 | 32 | } else { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | include('aircraft-sub-menu.php'); |
53 | 53 | print '<div class="column">'; |
54 | 54 | print '<h2>'._("Most Common Airlines").'</h2>'; |
55 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
55 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
56 | 56 | |
57 | 57 | $airline_array = $Spotter->countAllAirlinesByAircraft($aircraft_type); |
58 | 58 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | print '</thead>'; |
71 | 71 | print '<tbody>'; |
72 | 72 | $i = 1; |
73 | - foreach($airline_array as $airline_item) |
|
73 | + foreach ($airline_array as $airline_item) |
|
74 | 74 | { |
75 | 75 | print '<tr>'; |
76 | 76 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | die(); |
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
11 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort); |
|
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Departure Airports from %s"),$manufacturer); |
|
17 | + $title = sprintf(_("Most Common Departure Airports from %s"), $manufacturer); |
|
18 | 18 | |
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
25 | 25 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
26 | - foreach($all_manufacturers as $all_manufacturer) |
|
26 | + foreach ($all_manufacturers as $all_manufacturer) |
|
27 | 27 | { |
28 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
28 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
31 | 31 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | include('manufacturer-sub-menu.php'); |
45 | 45 | print '<div class="column">'; |
46 | 46 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
47 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
47 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
48 | 48 | $airport_airport_array = $Spotter->countAllDepartureAirportsByManufacturer($manufacturer); |
49 | 49 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
50 | 50 | <script> |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | ["'._("Airport").'", "'._("# of times").'"],'; |
60 | 60 | |
61 | 61 | $airport_data = ''; |
62 | - foreach($airport_airport_array as $airport_item) |
|
62 | + foreach ($airport_airport_array as $airport_item) |
|
63 | 63 | { |
64 | 64 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
65 | 65 | $name = str_replace("'", "", $name); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | print '</thead>'; |
99 | 99 | print '<tbody>'; |
100 | 100 | $i = 1; |
101 | - foreach($airport_airport_array as $airport_item) |
|
101 | + foreach ($airport_airport_array as $airport_item) |
|
102 | 102 | { |
103 | 103 | print '<tr>'; |
104 | 104 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | die(); |
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
11 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort); |
|
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Airlines by Country from %s"),$manufacturer); |
|
17 | + $title = sprintf(_("Most Common Airlines by Country from %s"), $manufacturer); |
|
18 | 18 | |
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
25 | 25 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
26 | - foreach($all_manufacturers as $all_manufacturer) |
|
26 | + foreach ($all_manufacturers as $all_manufacturer) |
|
27 | 27 | { |
28 | - if($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
28 | + if ($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
31 | 31 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | include('manufacturer-sub-menu.php'); |
45 | 45 | print '<div class="column">'; |
46 | 46 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
47 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
47 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
48 | 48 | $airline_array = $Spotter->countAllAirlineCountriesByManufacturer($manufacturer); |
49 | 49 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
50 | 50 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | ["'._("Country").'", "'._("# of times").'"], '; |
57 | 57 | |
58 | 58 | $country_data = ''; |
59 | - foreach($airline_array as $airline_item) |
|
59 | + foreach ($airline_array as $airline_item) |
|
60 | 60 | { |
61 | 61 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
62 | 62 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | print '</thead>'; |
91 | 91 | print '<tbody>'; |
92 | 92 | $i = 1; |
93 | - foreach($airline_array as $airline_item) |
|
93 | + foreach ($airline_array as $airline_item) |
|
94 | 94 | { |
95 | 95 | print '<tr>'; |
96 | 96 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') $aircraft_types = $Spotter->getAllAircraftTypes(); |
20 | 20 | $previous = null; |
21 | 21 | print '<div class="alphabet-legend">'; |
22 | - foreach($aircraft_types as $value) { |
|
22 | + foreach ($aircraft_types as $value) { |
|
23 | 23 | //$firstLetter = substr($value['aircraft_name'], 0, 1); |
24 | 24 | $firstLetter = substr($value['aircraft_manufacturer'], 0, 1); |
25 | - if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')') |
|
25 | + if ($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')') |
|
26 | 26 | { |
27 | 27 | if ($previous !== null) print ' | '; |
28 | 28 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | } |
32 | 32 | print '</div>'; |
33 | 33 | $previous = null; |
34 | - foreach($aircraft_types as $value) { |
|
34 | + foreach ($aircraft_types as $value) { |
|
35 | 35 | //$firstLetter = substr($value['aircraft_name'], 0, 1); |
36 | 36 | $firstLetter = substr($value['aircraft_manufacturer'], 0, 1); |
37 | 37 | if ($firstLetter != "") |
38 | 38 | { |
39 | - if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')') |
|
39 | + if ($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')') |
|
40 | 40 | { |
41 | 41 | if ($previous !== null) print '</div>'; |
42 | 42 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | ["'._("Month").'", "'._("# of Fatalities").'"], '; |
24 | 24 | |
25 | 25 | $date_data = ''; |
26 | -foreach($date_array as $date_item) |
|
26 | +foreach ($date_array as $date_item) |
|
27 | 27 | { |
28 | - $date_data .= '[ "'.date('F, Y',strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'",'.$date_item['count'].'],'; |
|
28 | + $date_data .= '[ "'.date('F, Y', strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'",'.$date_item['count'].'],'; |
|
29 | 29 | } |
30 | 30 | $date_data = substr($date_data, 0, -1); |
31 | 31 | print $date_data; |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | |
51 | 51 | if (!empty($date_array)) |
52 | 52 | { |
53 | - foreach($date_array as $key => $row) { |
|
53 | + foreach ($date_array as $key => $row) { |
|
54 | 54 | $years[$key] = $row['year']; |
55 | 55 | $months[$key] = $row['month']; |
56 | 56 | $counts[$key] = $row['count']; |
57 | 57 | } |
58 | 58 | // array_multisort($years,SORT_DESC,$months,SORT_DESC,$date_array); |
59 | - array_multisort($counts,SORT_DESC,$date_array); |
|
59 | + array_multisort($counts, SORT_DESC, $date_array); |
|
60 | 60 | print '<div class="table-responsive">'; |
61 | 61 | print '<table class="common-date table-striped">'; |
62 | 62 | print '<thead>'; |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | print '</thead>'; |
67 | 67 | print '<tbody>'; |
68 | 68 | $i = 1; |
69 | - foreach($date_array as $date_item) |
|
69 | + foreach ($date_array as $date_item) |
|
70 | 70 | { |
71 | 71 | print '<tr>'; |
72 | 72 | print '<td><strong>'.$i.'</strong></td>'; |
73 | 73 | print '<td>'; |
74 | - print '<a href="'.$globalURL.'/accident/'.$date_item['year'].'-'.$date_item['month'].'">'.date('F, Y',strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'</a>'; |
|
74 | + print '<a href="'.$globalURL.'/accident/'.$date_item['year'].'-'.$date_item['month'].'">'.date('F, Y', strtotime($date_item['year'].'-'.$date_item['month'].'-01')).'</a>'; |
|
75 | 75 | print '</td>'; |
76 | 76 | print '<td>'; |
77 | 77 | print $date_item['count']; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | ["'._("Year").'", "'._("# of Fatalities").'"], '; |
24 | 24 | |
25 | 25 | $date_data = ''; |
26 | -foreach($date_array as $date_item) |
|
26 | +foreach ($date_array as $date_item) |
|
27 | 27 | { |
28 | 28 | $date_data .= '[ "'.$date_item['year'].'",'.$date_item['count'].'],'; |
29 | 29 | } |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | |
51 | 51 | if (!empty($date_array)) |
52 | 52 | { |
53 | - foreach($date_array as $key => $row) { |
|
53 | + foreach ($date_array as $key => $row) { |
|
54 | 54 | $years[$key] = $row['year']; |
55 | 55 | $counts[$key] = $row['count']; |
56 | 56 | } |
57 | 57 | //array_multisort($years,SORT_DESC,$date_array); |
58 | - array_multisort($counts,SORT_DESC,$date_array); |
|
58 | + array_multisort($counts, SORT_DESC, $date_array); |
|
59 | 59 | print '<div class="table-responsive">'; |
60 | 60 | print '<table class="common-date table-striped">'; |
61 | 61 | print '<thead>'; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | print '</thead>'; |
66 | 66 | print '<tbody>'; |
67 | 67 | $i = 1; |
68 | - foreach($date_array as $date_item) |
|
68 | + foreach ($date_array as $date_item) |
|
69 | 69 | { |
70 | 70 | print '<tr>'; |
71 | 71 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | print '<th class="more"></th>'; |
96 | 96 | print '</thead>'; |
97 | -} else if (strtolower($current_page) == "upcoming"){ |
|
97 | +} else if (strtolower($current_page) == "upcoming") { |
|
98 | 98 | print '<thead>'; |
99 | 99 | if ($_GET['sort'] == "airline_name_asc") |
100 | 100 | { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | */ |
146 | 146 | print '</thead>'; |
147 | -} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){ |
|
147 | +} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
|
148 | 148 | print '<thead>'; |
149 | 149 | print '<th class="aircraft_thumbnail"></th>'; |
150 | 150 | print '<th class="logo">'._("Airline").'</th>'; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | print '</thead>'; |
182 | 182 | } else { |
183 | 183 | |
184 | - if ($hide_th_links === true){ |
|
184 | + if ($hide_th_links === true) { |
|
185 | 185 | print '<thead>'; |
186 | 186 | print '<th class="aircraft_thumbnail"></th>'; |
187 | 187 | if ($_GET['sort'] == "airline_name_asc") |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | } |
363 | 363 | |
364 | 364 | print '<tbody>'."\n"; |
365 | -foreach($spotter_array as $spotter_item) |
|
365 | +foreach ($spotter_array as $spotter_item) |
|
366 | 366 | { |
367 | 367 | if (isset($globalTimezone)) |
368 | 368 | { |
@@ -393,13 +393,13 @@ discard block |
||
393 | 393 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
394 | 394 | } |
395 | 395 | if (isset($spotter_item['airline_name'])) { |
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'].' - '.$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>'; |
|
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'].' - '.$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>'; |
|
397 | 397 | } else { |
398 | - 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>'; |
|
398 | + 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>'; |
|
399 | 399 | } |
400 | 400 | } else { |
401 | 401 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
402 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
402 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
403 | 403 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
404 | 404 | if (isset($spotter_item['airline_name'])) { |
405 | 405 | 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>'; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | 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"; |
414 | 414 | print '</td>'."\n"; |
415 | 415 | } |
416 | - } 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" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){ |
|
416 | + } 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" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed") { |
|
417 | 417 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
418 | 418 | $spotter_item['squawk'] = '-'; |
419 | 419 | } |
@@ -429,17 +429,17 @@ discard block |
||
429 | 429 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
430 | 430 | } |
431 | 431 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_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'].' - '._("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>'; |
|
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'].' - '._("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>'; |
|
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'].' - '.$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>'; |
|
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'].' - '.$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>'; |
|
435 | 435 | } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) { |
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'].' - '._("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>'; |
|
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'].' - '._("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>'; |
|
437 | 437 | } else { |
438 | - 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>'; |
|
438 | + 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>'; |
|
439 | 439 | } |
440 | 440 | } else { |
441 | 441 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
442 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
442 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
443 | 443 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
444 | 444 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
445 | 445 | 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>'; |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | } |
503 | 503 | print '</td>'."\n"; |
504 | 504 | // Aircraft type |
505 | - if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
|
505 | + if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") { |
|
506 | 506 | print '<td class="type">'."\n"; |
507 | 507 | if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) { |
508 | 508 | print '<span class="nomobile">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</span>'."\n"; |
@@ -526,22 +526,22 @@ discard block |
||
526 | 526 | } |
527 | 527 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
528 | 528 | if ($spotter_item['departure_airport_time'] > 2460) { |
529 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
530 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
529 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
530 | + } else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
531 | 531 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
532 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
532 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
533 | 533 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
534 | 534 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
535 | 535 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
536 | 536 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
537 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
537 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
538 | 538 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
539 | 539 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
540 | 540 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
541 | 541 | if ($spotter_item['departure_airport_time'] > 2460) { |
542 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
542 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
543 | 543 | } else { |
544 | - $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
544 | + $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
545 | 545 | } |
546 | 546 | print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n"; |
547 | 547 | } |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | $latitude = $spotter_item['latitude']; |
557 | 557 | $longitude = $spotter_item['longitude']; |
558 | 558 | } |
559 | - $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
|
559 | + $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude); |
|
560 | 560 | } else $distance = ''; |
561 | 561 | if ($distance != '') { |
562 | 562 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -597,20 +597,20 @@ discard block |
||
597 | 597 | } |
598 | 598 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
599 | 599 | if ($spotter_item['arrival_airport_time'] > 2460) { |
600 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
600 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
601 | 601 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
602 | 602 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
603 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
603 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
604 | 604 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
605 | 605 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
606 | 606 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
607 | 607 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
608 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
608 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
609 | 609 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
610 | 610 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
611 | 611 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
612 | 612 | if ($spotter_item['arrival_airport_time'] > 2460) { |
613 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
613 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
614 | 614 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
615 | 615 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
616 | 616 | } |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | $latitude = $spotter_item['latitude']; |
624 | 624 | $longitude = $spotter_item['longitude']; |
625 | 625 | } |
626 | - $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
|
626 | + $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude); |
|
627 | 627 | } else $distance = ''; |
628 | 628 | if ($distance != '') { |
629 | 629 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | print '</td>'."\n"; |
639 | 639 | if ((isset($globalIvAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)) { |
640 | 640 | // Route stop |
641 | - if(strtolower($current_page) != "upcoming"){ |
|
641 | + if (strtolower($current_page) != "upcoming") { |
|
642 | 642 | print '<td class="route_stop">'."\n"; |
643 | 643 | if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') { |
644 | 644 | print '<span class="nomobile">-</span>'."\n"; |
@@ -663,21 +663,21 @@ discard block |
||
663 | 663 | } else { |
664 | 664 | //if (!isset($globalUnitDistance) || $globalUnitDistance == 'km') { |
665 | 665 | if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
666 | - print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n"; |
|
667 | - print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n"; |
|
666 | + print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n"; |
|
667 | + print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n"; |
|
668 | 668 | //} elseif ($globalUnitDistance == 'mi') { |
669 | 669 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
670 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n"; |
|
671 | - print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n"; |
|
670 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n"; |
|
671 | + print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n"; |
|
672 | 672 | //} elseif ($globalUnitDistance == 'nm') { |
673 | 673 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
674 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n"; |
|
675 | - print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n"; |
|
674 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n"; |
|
675 | + print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n"; |
|
676 | 676 | } |
677 | 677 | } |
678 | 678 | print '</td>'."\n"; |
679 | 679 | } |
680 | - if(strtolower($current_page) != "upcoming"){ |
|
680 | + if (strtolower($current_page) != "upcoming") { |
|
681 | 681 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
682 | 682 | print '<td class="pilot">'."\n"; |
683 | 683 | if ((!isset($spotter_item['pilot_id']) || $spotter_item['pilot_id'] == '') && (!isset($spotter_item['pilot_name']) || $spotter_item['pilot_name'] == '')) { |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
713 | 713 | if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') { |
714 | 714 | print '<td class="message"><p>'."\n"; |
715 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
715 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
716 | 716 | print '</p><p class="decode">'; |
717 | 717 | $decode_array = json_decode($spotter_item['decode']); |
718 | 718 | foreach ($decode_array as $key => $value) { |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | print '</td>'."\n"; |
723 | 723 | } else { |
724 | 724 | print '<td class="message">'."\n"; |
725 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
725 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
726 | 726 | print '</td>'."\n"; |
727 | 727 | } |
728 | 728 | } |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | } |
748 | 748 | print '</td>'."\n"; |
749 | 749 | print '<td class="message">'."\n"; |
750 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
750 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
751 | 751 | print '</td>'."\n"; |
752 | 752 | } |
753 | 753 | if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") { |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | print '</td>'."\n"; |
774 | 774 | */ |
775 | 775 | print '<td class="message">'."\n"; |
776 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
776 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
777 | 777 | print '</td>'."\n"; |
778 | 778 | } |
779 | 779 | // Date |
@@ -29,20 +29,20 @@ discard block |
||
29 | 29 | * @param String $date get data for a date |
30 | 30 | * @return Array Return Accidents data in array |
31 | 31 | */ |
32 | - public function getAccidentData($limit = '',$type = '',$date = '') { |
|
32 | + public function getAccidentData($limit = '', $type = '', $date = '') { |
|
33 | 33 | global $globalURL, $globalDBdriver; |
34 | 34 | $Image = new Image($this->db); |
35 | 35 | $Spotter = new Spotter($this->db); |
36 | 36 | $Translation = new Translation($this->db); |
37 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
37 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
38 | 38 | date_default_timezone_set('UTC'); |
39 | 39 | $result = array(); |
40 | 40 | $limit_query = ''; |
41 | 41 | if ($limit != "") |
42 | 42 | { |
43 | 43 | $limit_array = explode(",", $limit); |
44 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
45 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
44 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
45 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
46 | 46 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
47 | 47 | { |
48 | 48 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | if ($type != '') { |
53 | 53 | if ($date != '') { |
54 | - if (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/",$date)) { |
|
54 | + if (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $date)) { |
|
55 | 55 | $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND date = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query; |
56 | 56 | //$query = "SELECT accidents.registration, accidents.ident, accidents.date, accidents.url, accidents.country, accidents.place, accidents.title, accidents.fatalities, accidents.type, accidents.ident, accidents.aircraft_manufacturer, accidents.aircraft_name, accidents.airline_name, accidents.airline_icao, spotter_output.flightaware_id FROM accidents LEFT OUTER JOIN spotter_output ON accidents.registration = spotter_output.registration WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND date = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query; |
57 | 57 | } else { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND to_char(date,'YYYY-MM-DD') LIKE :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query; |
60 | 60 | //$query = "SELECT accidents.registration, accidents.ident, accidents.date, accidents.url, accidents.country, accidents.place, accidents.title, accidents.fatalities, accidents.type, accidents.ident, accidents.aircraft_manufacturer, accidents.aircraft_name, accidents.airline_name, accidents.airline_icao, spotter_output.flightaware_id FROM accidents LEFT OUTER JOIN spotter_output ON accidents.registration = spotter_output.registration WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type AND to_char(date,'YYYY-MM-DD') LIKE :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query; |
61 | 61 | } |
62 | - $query_values = array(':type' => $type,':date' => $date); |
|
62 | + $query_values = array(':type' => $type, ':date' => $date); |
|
63 | 63 | } else { |
64 | 64 | $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type GROUP BY registration) ORDER BY accidents.date DESC".$limit_query; |
65 | 65 | //$query = "SELECT accidents.registration, accidents.ident, accidents.date, accidents.url, accidents.country, accidents.place, accidents.title, accidents.fatalities, accidents.type, accidents.ident, accidents.aircraft_manufacturer, accidents.aircraft_name, accidents.airline_name, accidents.airline_icao, spotter_output.flightaware_id FROM accidents LEFT OUTER JOIN spotter_output ON accidents.registration = spotter_output.registration WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type GROUP BY registration) ORDER BY accidents.date DESC".$limit_query; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | } else { |
69 | 69 | if ($date != '') { |
70 | - if (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/",$date)) { |
|
70 | + if (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $date)) { |
|
71 | 71 | $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE date = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query; |
72 | 72 | //$query = "SELECT accidents.registration, accidents.ident, accidents.date, accidents.url, accidents.country, accidents.place, accidents.title, accidents.fatalities, accidents.type, accidents.ident, accidents.aircraft_manufacturer, accidents.aircraft_name, accidents.airline_name, accidents.airline_icao, spotter_output.flightaware_id FROM accidents LEFT OUTER JOIN spotter_output ON accidents.registration = spotter_output.registration WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE date = :date GROUP BY registration) ORDER BY accidents.date DESC".$limit_query; |
73 | 73 | } else { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | try { |
87 | 87 | $sth = $this->db->prepare($query); |
88 | 88 | $sth->execute($query_values); |
89 | - } catch(PDOException $e) { |
|
89 | + } catch (PDOException $e) { |
|
90 | 90 | echo "error : ".$e->getMessage(); |
91 | 91 | } |
92 | 92 | $i = 0; |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | $data = array(); |
97 | 97 | if ($row['registration'] != '') { |
98 | 98 | $image_array = $Image->getSpotterImage($row['registration']); |
99 | - 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'])); |
|
100 | - else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
99 | + 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'])); |
|
100 | + else $data = array_merge($data, array('image' => '', 'image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => '')); |
|
101 | 101 | $aircraft_type = $Spotter->getAllAircraftTypeByRegistration($row['registration']); |
102 | 102 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_type); |
103 | 103 | if (!empty($aircraft_info)) { |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $data['aircraft_name'] = $aircraft_info[0]['type']; |
106 | 106 | $data['aircraft_manufacturer'] = $aircraft_info[0]['manufacturer']; |
107 | 107 | } else { |
108 | - $data = array_merge($data,array('aircraft_type' => 'NA')); |
|
108 | + $data = array_merge($data, array('aircraft_type' => 'NA')); |
|
109 | 109 | } |
110 | 110 | $owner_data = $Spotter->getAircraftOwnerByRegistration($row['registration']); |
111 | 111 | if (!empty($owner_data)) { |
@@ -113,18 +113,18 @@ discard block |
||
113 | 113 | $data['aircraft_base'] = $owner_data['base']; |
114 | 114 | $data['aircraft_date_first_reg'] = $owner_data['date_first_reg']; |
115 | 115 | } |
116 | - } else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
116 | + } else $data = array_merge($data, array('image' => '', 'image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => '')); |
|
117 | 117 | if ($row['registration'] == '') $row['registration'] = 'NA'; |
118 | 118 | if ($row['ident'] == '') $row['ident'] = 'NA'; |
119 | - $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,3)); |
|
119 | + $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'], 0, 3)); |
|
120 | 120 | if (isset($identicao[0])) { |
121 | - if (substr($row['ident'],0,2) == 'AF') { |
|
122 | - if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
123 | - else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0'); |
|
124 | - } else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0'); |
|
125 | - $data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name'])); |
|
121 | + if (substr($row['ident'], 0, 2) == 'AF') { |
|
122 | + if (filter_var(substr($row['ident'], 2), FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
123 | + else $icao = 'AFR'.ltrim(substr($row['ident'], 2), '0'); |
|
124 | + } else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'], 2), '0'); |
|
125 | + $data = array_merge($data, array('airline_icao' => $identicao[0]['icao'], 'airline_name' => $identicao[0]['name'])); |
|
126 | 126 | } else $icao = $row['ident']; |
127 | - $icao = $Translation->checkTranslation($icao,false); |
|
127 | + $icao = $Translation->checkTranslation($icao, false); |
|
128 | 128 | //$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url'])); |
129 | 129 | if ($row['airline_name'] != '' && !isset($data['airline_name'])) { |
130 | 130 | //echo 'Check airline info... for '.$row['airline_name'].' '; |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | if (!empty($airline_info)) { |
134 | 134 | //echo 'data found !'."\n"; |
135 | 135 | //print_r($airline_info); |
136 | - $data = array_merge($data,$airline_info); |
|
136 | + $data = array_merge($data, $airline_info); |
|
137 | 137 | } |
138 | 138 | //else echo 'No data...'."\n"; |
139 | 139 | } |
140 | - $data = array_merge($row,$data); |
|
140 | + $data = array_merge($row, $data); |
|
141 | 141 | if ($data['ident'] == null) $data['ident'] = $icao; |
142 | 142 | if ($data['title'] == null) { |
143 | 143 | $data['message'] = $row['type'].' of '.$row['registration'].' at '.$row['place'].','.$row['country']; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | try { |
172 | 172 | $sth = $this->db->prepare($query); |
173 | 173 | $sth->execute(); |
174 | - } catch(PDOException $e) { |
|
174 | + } catch (PDOException $e) { |
|
175 | 175 | echo "Error : ".$e->getMessage(); |
176 | 176 | } |
177 | 177 | return $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | try { |
187 | 187 | $sth = $this->db->prepare($query); |
188 | 188 | $sth->execute(); |
189 | - } catch(PDOException $e) { |
|
189 | + } catch (PDOException $e) { |
|
190 | 190 | echo "Error : ".$e->getMessage(); |
191 | 191 | } |
192 | 192 | return $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -201,15 +201,15 @@ discard block |
||
201 | 201 | if ($globalDebug) echo 'Import '.$file."\n"; |
202 | 202 | $result = array(); |
203 | 203 | if (file_exists($file)) { |
204 | - if (($handle = fopen($file,'r')) !== FALSE) { |
|
205 | - while (($data = fgetcsv($handle,2000,",")) !== FALSE) { |
|
204 | + if (($handle = fopen($file, 'r')) !== FALSE) { |
|
205 | + while (($data = fgetcsv($handle, 2000, ",")) !== FALSE) { |
|
206 | 206 | if (isset($data[1]) && $data[1] != '0000-00-00 00:00:00') { |
207 | - $result[] = array('registration' => $data[0],'date' => strtotime($data[1]),'url' => $data[2],'country' => $data[3],'place' => $data[4],'title' => $data[5],'fatalities' => $data[6],'latitude' => $data[7],'longitude' => $data[8],'type' => $data[9],'ident' => $data[10],'aircraft_manufacturer' => $data[11],'aircraft_name' => $data[12],'operator' => $data[13],'source' => 'website_fam'); |
|
207 | + $result[] = array('registration' => $data[0], 'date' => strtotime($data[1]), 'url' => $data[2], 'country' => $data[3], 'place' => $data[4], 'title' => $data[5], 'fatalities' => $data[6], 'latitude' => $data[7], 'longitude' => $data[8], 'type' => $data[9], 'ident' => $data[10], 'aircraft_manufacturer' => $data[11], 'aircraft_name' => $data[12], 'operator' => $data[13], 'source' => 'website_fam'); |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 | fclose($handle); |
211 | 211 | } |
212 | - if (!empty($result)) $this->add($result,true); |
|
212 | + if (!empty($result)) $this->add($result, true); |
|
213 | 213 | elseif ($globalDebug) echo 'Nothing to import'; |
214 | 214 | } |
215 | 215 | } |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | $all_md5_new = array(); |
226 | 226 | if (file_exists(dirname(__FILE__).'/../install/tmp/cr-all.md5')) { |
227 | 227 | if ($this->check_accidents_nb() > 0) { |
228 | - if (($handle = fopen(dirname(__FILE__).'/../install/tmp/cr-all.md5','r')) !== FALSE) { |
|
229 | - while (($data = fgetcsv($handle,2000,"\t")) !== FALSE) { |
|
228 | + if (($handle = fopen(dirname(__FILE__).'/../install/tmp/cr-all.md5', 'r')) !== FALSE) { |
|
229 | + while (($data = fgetcsv($handle, 2000, "\t")) !== FALSE) { |
|
230 | 230 | if (isset($data[1])) { |
231 | 231 | $year = $data[0]; |
232 | 232 | $all_md5[$year] = $data[1]; |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | } |
237 | 237 | } |
238 | 238 | } |
239 | - $Common->download('http://data.flightairmap.fr/data/cr/cr-all.md5',dirname(__FILE__).'/../install/tmp/cr-all.md5'); |
|
239 | + $Common->download('http://data.flightairmap.fr/data/cr/cr-all.md5', dirname(__FILE__).'/../install/tmp/cr-all.md5'); |
|
240 | 240 | if (file_exists(dirname(__FILE__).'/../install/tmp/cr-all.md5')) { |
241 | - if (($handle = fopen(dirname(__FILE__).'/../install/tmp/cr-all.md5','r')) !== FALSE) { |
|
242 | - while (($data = fgetcsv($handle,2000,"\t")) !== FALSE) { |
|
241 | + if (($handle = fopen(dirname(__FILE__).'/../install/tmp/cr-all.md5', 'r')) !== FALSE) { |
|
242 | + while (($data = fgetcsv($handle, 2000, "\t")) !== FALSE) { |
|
243 | 243 | if (isset($data[1])) { |
244 | 244 | $year = $data[0]; |
245 | 245 | $all_md5_new[$year] = $data[1]; |
@@ -248,10 +248,10 @@ discard block |
||
248 | 248 | fclose($handle); |
249 | 249 | } elseif ($globalDebug) echo "Can't open ".dirname(__FILE__).'/../install/tmp/cr-all.md5'; |
250 | 250 | } elseif ($globalDebug) echo 'Download cr-all.md5 failed. '.dirname(__FILE__).'/../install/tmp/cr-all.md5 not here.'; |
251 | - $result = $Common->arr_diff($all_md5_new,$all_md5); |
|
251 | + $result = $Common->arr_diff($all_md5_new, $all_md5); |
|
252 | 252 | if (empty($result) && $globalDebug) echo 'Nothing to update'; |
253 | 253 | foreach ($result as $file => $md5) { |
254 | - $Common->download('http://data.flightairmap.fr/data/cr/'.$file,dirname(__FILE__).'/../install/tmp/'.$file); |
|
254 | + $Common->download('http://data.flightairmap.fr/data/cr/'.$file, dirname(__FILE__).'/../install/tmp/'.$file); |
|
255 | 255 | if (file_exists(dirname(__FILE__).'/../install/tmp/'.$file)) $this->import(dirname(__FILE__).'/../install/tmp/'.$file); |
256 | 256 | elseif ($globalDebug) echo 'Download '.$file.' failed'; |
257 | 257 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * Add data to DB |
262 | 262 | * @param Array $crash An array with accidents/incidents data |
263 | 263 | */ |
264 | - public function add($crash,$new = false) { |
|
264 | + public function add($crash, $new = false) { |
|
265 | 265 | global $globalTransaction, $globalDebug; |
266 | 266 | require_once('class.Connection.php'); |
267 | 267 | require_once('class.Image.php'); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $sthd->execute(array(':source' => $crash[0]['source'])); |
278 | 278 | } |
279 | 279 | if ($globalTransaction) $Connection->db->beginTransaction(); |
280 | - $initial_array = array('ident' => null,'type' => 'accident','url' => null,'registration' => null, 'date' => null, 'place' => null,'country' => null, 'latitude' => null, 'longitude' => null, 'fatalities' => null, 'title' => '','source' => '','aircraft_manufacturer' => null,'aircraft_name' => null,'operator' => null); |
|
280 | + $initial_array = array('ident' => null, 'type' => 'accident', 'url' => null, 'registration' => null, 'date' => null, 'place' => null, 'country' => null, 'latitude' => null, 'longitude' => null, 'fatalities' => null, 'title' => '', 'source' => '', 'aircraft_manufacturer' => null, 'aircraft_name' => null, 'operator' => null); |
|
281 | 281 | $query_check = 'SELECT COUNT(*) as nb FROM accidents WHERE registration = :registration AND date = :date AND type = :type AND source = :source'; |
282 | 282 | $sth_check = $Connection->db->prepare($query_check); |
283 | 283 | $query = 'INSERT INTO accidents (aircraft_manufacturer,aircraft_name,ident,registration,date,url,country,place,title,fatalities,latitude,longitude,type,airline_name,source) VALUES (:aircraft_manufacturer,:aircraft_name,:ident,:registration,:date,:url,:country,:place,:title,:fatalities,:latitude,:longitude,:type,:airline_name,:source)'; |
@@ -290,31 +290,31 @@ discard block |
||
290 | 290 | $cr = array_map(function($value) { |
291 | 291 | return $value === "" ? NULL : $value; |
292 | 292 | }, $cr); |
293 | - if ($cr['date'] != '' && $cr['registration'] != null && $cr['registration'] != '' && $cr['registration'] != '?' && $cr['registration'] != '-' && strtolower($cr['registration']) != 'unknown' && $cr['date'] < time() && !preg_match('/\s/',$cr['registration'])) { |
|
294 | - if (strpos($cr['registration'],'-') === FALSE) $cr['registration'] = $Spotter->convertAircraftRegistration($cr['registration']); |
|
295 | - $query_check_values = array(':registration' => $cr['registration'],':date' => date('Y-m-d',$cr['date']),':type' => $cr['type'],':source' => $cr['source']); |
|
293 | + if ($cr['date'] != '' && $cr['registration'] != null && $cr['registration'] != '' && $cr['registration'] != '?' && $cr['registration'] != '-' && strtolower($cr['registration']) != 'unknown' && $cr['date'] < time() && !preg_match('/\s/', $cr['registration'])) { |
|
294 | + if (strpos($cr['registration'], '-') === FALSE) $cr['registration'] = $Spotter->convertAircraftRegistration($cr['registration']); |
|
295 | + $query_check_values = array(':registration' => $cr['registration'], ':date' => date('Y-m-d', $cr['date']), ':type' => $cr['type'], ':source' => $cr['source']); |
|
296 | 296 | $sth_check->execute($query_check_values); |
297 | 297 | $result_check = $sth_check->fetch(PDO::FETCH_ASSOC); |
298 | 298 | if ($result_check['nb'] == 0) { |
299 | - $query_values = array(':registration' => trim($cr['registration']),':date' => date('Y-m-d',$cr['date']),':url' => $cr['url'],':country' => $cr['country'],':place' => $cr['place'],':title' => $cr['title'],':fatalities' => $cr['fatalities'],':latitude' => $cr['latitude'],':longitude' => $cr['longitude'],':type' => $cr['type'],':source' => $cr['source'],':ident' => $cr['ident'],':aircraft_manufacturer' => $cr['aircraft_manufacturer'],':aircraft_name' => $cr['aircraft_name'],':airline_name' => $cr['operator']); |
|
299 | + $query_values = array(':registration' => trim($cr['registration']), ':date' => date('Y-m-d', $cr['date']), ':url' => $cr['url'], ':country' => $cr['country'], ':place' => $cr['place'], ':title' => $cr['title'], ':fatalities' => $cr['fatalities'], ':latitude' => $cr['latitude'], ':longitude' => $cr['longitude'], ':type' => $cr['type'], ':source' => $cr['source'], ':ident' => $cr['ident'], ':aircraft_manufacturer' => $cr['aircraft_manufacturer'], ':aircraft_name' => $cr['aircraft_name'], ':airline_name' => $cr['operator']); |
|
300 | 300 | $sth->execute($query_values); |
301 | - if ($cr['date'] > time()-(30*86400)) { |
|
301 | + if ($cr['date'] > time() - (30*86400)) { |
|
302 | 302 | if (empty($Image->getSpotterImage($cr['registration']))) { |
303 | 303 | //if ($globalDebug) echo 'Get image...'."\n"; |
304 | 304 | $Image->addSpotterImage($cr['registration']); |
305 | 305 | } |
306 | 306 | // elseif ($globalDebug) echo 'Image already in DB'."\n"; |
307 | 307 | } |
308 | - $Spotter->setHighlightFlightByRegistration($cr['registration'],$cr['title'],date('Y-m-d',$cr['date'])); |
|
308 | + $Spotter->setHighlightFlightByRegistration($cr['registration'], $cr['title'], date('Y-m-d', $cr['date'])); |
|
309 | 309 | } |
310 | 310 | } |
311 | - if ($globalTransaction && $j % 1000 == 0) { |
|
311 | + if ($globalTransaction && $j%1000 == 0) { |
|
312 | 312 | $Connection->db->commit(); |
313 | 313 | $Connection->db->beginTransaction(); |
314 | 314 | } |
315 | 315 | } |
316 | 316 | if ($globalTransaction) $Connection->db->commit(); |
317 | - } catch(PDOException $e) { |
|
317 | + } catch (PDOException $e) { |
|
318 | 318 | if ($globalTransaction) $Connection->db->rollBack(); |
319 | 319 | echo $e->getMessage(); |
320 | 320 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $Connection = new Connection(); |
333 | 333 | $sth = $Connection->db->prepare($query); |
334 | 334 | $sth->execute(); |
335 | - } catch(PDOException $e) { |
|
335 | + } catch (PDOException $e) { |
|
336 | 336 | return "error : ".$e->getMessage(); |
337 | 337 | } |
338 | 338 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $Connection = new Connection(); |
351 | 351 | $sth = $Connection->db->prepare($query); |
352 | 352 | $sth->execute(); |
353 | - } catch(PDOException $e) { |
|
353 | + } catch (PDOException $e) { |
|
354 | 354 | return "error : ".$e->getMessage(); |
355 | 355 | } |
356 | 356 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $Connection = new Connection(); |
366 | 366 | $sth = $Connection->db->prepare($query); |
367 | 367 | $sth->execute(); |
368 | - } catch(PDOException $e) { |
|
368 | + } catch (PDOException $e) { |
|
369 | 369 | return "error : ".$e->getMessage(); |
370 | 370 | } |
371 | 371 | } |