@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $globalLongitudeMin = '1.0'; //the minimum longitude (east) |
40 | 40 | |
41 | 41 | $globalCenterLatitude = '46.38'; //the latitude center of your coverage area |
42 | -$globalCenterLongitude = '5.29';//the longitude center of your coverage area |
|
42 | +$globalCenterLongitude = '5.29'; //the longitude center of your coverage area |
|
43 | 43 | |
44 | 44 | $globalLiveZoom = '9'; //default zoom on Live Map |
45 | 45 | $globalAirportZoom = '7'; //default zoom to begin to display airports icons |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $globalACARS = FALSE; |
141 | 141 | $globalACARSHost = '0.0.0.0'; // Local IP to listen |
142 | 142 | $globalACARSPort = '9999'; |
143 | -$globalACARSArchive = array('10','80','81','82','3F'); // labels of messages to archive |
|
143 | +$globalACARSArchive = array('10', '80', '81', '82', '3F'); // labels of messages to archive |
|
144 | 144 | $globalACARSArchiveKeepMonths = '0'; |
145 | 145 | |
146 | 146 | //APRS configuration (for glidernet) |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | //Retrieve Image from externals sources |
230 | 230 | $globalAircraftImageFetch = TRUE; |
231 | 231 | //Sources for Aircraft image |
232 | -$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters','customsources'); |
|
232 | +$globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters', 'customsources'); |
|
233 | 233 | // Custom source configuration {registration} will be replaced by aircraft registration (exif get copyright from exif data for each pic) |
234 | 234 | // example of config : $globalAircraftImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{registration}.jpg','original' => 'http://myurl/original/{registration}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'exif' => true); |
235 | 235 | // ************************ |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | //Retrieve schedules from externals sources (set to FALSE for IVAO or if $globalFork = FALSE) |
238 | 238 | $globalSchedulesFetch = TRUE; |
239 | 239 | //Sources for airline schedule if not official airline site |
240 | -$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
240 | +$globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
241 | 241 | |
242 | 242 | //Retrieve translation from external sources (set to FALSE for IVAO) |
243 | 243 | $globalTranslationFetch = TRUE; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | try { |
20 | 20 | $sth = $this->db->prepare($query); |
21 | 21 | $sth->execute(array(':name' => $name)); |
22 | - } catch(PDOException $e) { |
|
22 | + } catch (PDOException $e) { |
|
23 | 23 | echo $e->getMessage(); |
24 | 24 | } |
25 | 25 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | try { |
32 | 32 | $sth = $this->db->prepare($query); |
33 | 33 | $sth->execute(); |
34 | - } catch(PDOException $e) { |
|
34 | + } catch (PDOException $e) { |
|
35 | 35 | echo $e->getMessage(); |
36 | 36 | } |
37 | 37 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | try { |
44 | 44 | $sth = $this->db->prepare($query); |
45 | 45 | $sth->execute(); |
46 | - } catch(PDOException $e) { |
|
46 | + } catch (PDOException $e) { |
|
47 | 47 | echo $e->getMessage(); |
48 | 48 | } |
49 | 49 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | try { |
56 | 56 | $sth = $this->db->prepare($query); |
57 | 57 | $sth->execute(array(':type' => $type)); |
58 | - } catch(PDOException $e) { |
|
58 | + } catch (PDOException $e) { |
|
59 | 59 | echo $e->getMessage(); |
60 | 60 | } |
61 | 61 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -63,27 +63,27 @@ discard block |
||
63 | 63 | else return array(); |
64 | 64 | } |
65 | 65 | |
66 | - public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
66 | + public function position_all($timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
67 | 67 | $all_sat = $this->get_tle_names(); |
68 | 68 | $result = array(); |
69 | 69 | foreach ($all_sat as $sat) { |
70 | - $position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second); |
|
71 | - $result = array_merge($position,$result); |
|
70 | + $position = $this->position($sat['tle_name'], $timestamp_begin, $timestamp_end, $second); |
|
71 | + $result = array_merge($position, $result); |
|
72 | 72 | } |
73 | 73 | return $result; |
74 | 74 | } |
75 | 75 | |
76 | - public function position_all_type($type,$timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
76 | + public function position_all_type($type, $timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
77 | 77 | $all_sat = $this->get_tle_names_type($type); |
78 | 78 | $result = array(); |
79 | 79 | foreach ($all_sat as $sat) { |
80 | - $position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second); |
|
81 | - $result = array_merge($position,$result); |
|
80 | + $position = $this->position($sat['tle_name'], $timestamp_begin, $timestamp_end, $second); |
|
81 | + $result = array_merge($position, $result); |
|
82 | 82 | } |
83 | 83 | return $result; |
84 | 84 | } |
85 | 85 | |
86 | - public function position($name,$timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
86 | + public function position($name, $timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
87 | 87 | $qth = new Predict_QTH(); |
88 | 88 | $qth->lat = floatval(37.790252); |
89 | 89 | $qth->lon = floatval(-122.419968); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $tle_file = $this->get_tle($name); |
92 | 92 | //print_r($tle_file); |
93 | 93 | $type = $tle_file['tle_type']; |
94 | - $tle = new Predict_TLE($tle_file['tle_name'],$tle_file['tle_tle1'],$tle_file['tle_tle2']); |
|
94 | + $tle = new Predict_TLE($tle_file['tle_name'], $tle_file['tle_tle1'], $tle_file['tle_tle2']); |
|
95 | 95 | $sat = new Predict_Sat($tle); |
96 | 96 | $predict = new Predict(); |
97 | 97 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
@@ -99,16 +99,16 @@ discard block |
||
99 | 99 | if ($timestamp_end == '') { |
100 | 100 | $now = Predict_Time::unix2daynum($timestamp_begin); |
101 | 101 | //echo $now; |
102 | - $predict->predict_calc($sat,$qth,$now); |
|
103 | - return array('name' => $name, 'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp_begin,'type' => $type); |
|
102 | + $predict->predict_calc($sat, $qth, $now); |
|
103 | + return array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp_begin, 'type' => $type); |
|
104 | 104 | } else { |
105 | 105 | $result = array(); |
106 | - for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp=$timestamp+$second) { |
|
106 | + for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp = $timestamp + $second) { |
|
107 | 107 | //echo $timestamp."\n"; |
108 | 108 | $now = Predict_Time::unix2daynum($timestamp); |
109 | 109 | //echo $now; |
110 | - $predict->predict_calc($sat,$qth,$now); |
|
111 | - $result[] = array('name' => $name,'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp,'type' => $type); |
|
110 | + $predict->predict_calc($sat, $qth, $now); |
|
111 | + $result[] = array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp, 'type' => $type); |
|
112 | 112 | } |
113 | 113 | return $result; |
114 | 114 | } |
@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | * @return Array the images list |
18 | 18 | * |
19 | 19 | */ |
20 | - public function getSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
|
20 | + public function getSpotterImage($registration, $aircraft_icao = '', $airline_icao = '') |
|
21 | 21 | { |
22 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
23 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
24 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
22 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
23 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
24 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
25 | 25 | if ($registration == '' && $aircraft_icao != '') $registration = $aircraft_icao.$airline_icao; |
26 | 26 | $registration = trim($registration); |
27 | - $query = "SELECT spotter_image.image, spotter_image.image_thumbnail, spotter_image.image_source, spotter_image.image_source_website,spotter_image.image_copyright, spotter_image.registration |
|
27 | + $query = "SELECT spotter_image.image, spotter_image.image_thumbnail, spotter_image.image_source, spotter_image.image_source_website,spotter_image.image_copyright, spotter_image.registration |
|
28 | 28 | FROM spotter_image |
29 | 29 | WHERE spotter_image.registration = :registration"; |
30 | 30 | $sth = $this->db->prepare($query); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | if (isset($exif['COMPUTED']['copyright'])) $copyright = $exif['COMPUTED']['copyright']; |
64 | 64 | elseif (isset($exif['copyright'])) $copyright = $exif['copyright']; |
65 | 65 | if ($copyright != '') { |
66 | - $copyright = str_replace('Copyright ','',$copyright); |
|
67 | - $copyright = str_replace('© ','',$copyright); |
|
68 | - $copyright = str_replace('(c) ','',$copyright); |
|
66 | + $copyright = str_replace('Copyright ', '', $copyright); |
|
67 | + $copyright = str_replace('© ', '', $copyright); |
|
68 | + $copyright = str_replace('(c) ', '', $copyright); |
|
69 | 69 | } |
70 | 70 | return $copyright; |
71 | 71 | } |
@@ -76,26 +76,26 @@ discard block |
||
76 | 76 | * @return String either success or error |
77 | 77 | * |
78 | 78 | */ |
79 | - public function addSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
|
79 | + public function addSpotterImage($registration, $aircraft_icao = '', $airline_icao = '') |
|
80 | 80 | { |
81 | - global $globalDebug,$globalAircraftImageFetch; |
|
81 | + global $globalDebug, $globalAircraftImageFetch; |
|
82 | 82 | if (isset($globalAircraftImageFetch) && !$globalAircraftImageFetch) return ''; |
83 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
83 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
84 | 84 | $registration = trim($registration); |
85 | 85 | //getting the aircraft image |
86 | 86 | if ($globalDebug && $registration != '') echo 'Try to find an aircraft image for '.$registration.'...'; |
87 | 87 | elseif ($globalDebug && $aircraft_icao != '') echo 'Try to find an aircraft image for '.$aircraft_icao.'...'; |
88 | 88 | elseif ($globalDebug && $airline_icao != '') echo 'Try to find an aircraft image for '.$airline_icao.'...'; |
89 | 89 | else return "success"; |
90 | - $image_url = $this->findAircraftImage($registration,$aircraft_icao,$airline_icao); |
|
90 | + $image_url = $this->findAircraftImage($registration, $aircraft_icao, $airline_icao); |
|
91 | 91 | if ($registration == '' && $aircraft_icao != '') $registration = $aircraft_icao.$airline_icao; |
92 | 92 | if ($image_url['original'] != '') { |
93 | 93 | if ($globalDebug) echo 'Found !'."\n"; |
94 | - $query = "INSERT INTO spotter_image (registration, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:registration,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
94 | + $query = "INSERT INTO spotter_image (registration, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:registration,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
95 | 95 | try { |
96 | 96 | $sth = $this->db->prepare($query); |
97 | - $sth->execute(array(':registration' => $registration,':image' => $image_url['original'],':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'],':source' => $image_url['source'],':source_website' => $image_url['source_website'])); |
|
98 | - } catch(PDOException $e) { |
|
97 | + $sth->execute(array(':registration' => $registration, ':image' => $image_url['original'], ':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'], ':source' => $image_url['source'], ':source_website' => $image_url['source_website'])); |
|
98 | + } catch (PDOException $e) { |
|
99 | 99 | echo $e->getMessage()."\n"; |
100 | 100 | return "error"; |
101 | 101 | } |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | global $globalAircraftImageSources, $globalIVAO; |
116 | 116 | $Spotter = new Spotter($this->db); |
117 | 117 | if (!isset($globalIVAO)) $globalIVAO = FALSE; |
118 | - $aircraft_registration = filter_var($aircraft_registration,FILTER_SANITIZE_STRING); |
|
118 | + $aircraft_registration = filter_var($aircraft_registration, FILTER_SANITIZE_STRING); |
|
119 | 119 | if ($aircraft_registration != '') { |
120 | - if (strpos($aircraft_registration,'/') !== false) return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
120 | + if (strpos($aircraft_registration, '/') !== false) return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
121 | 121 | $aircraft_registration = urlencode(trim($aircraft_registration)); |
122 | 122 | $aircraft_info = $Spotter->getAircraftInfoByRegistration($aircraft_registration); |
123 | 123 | if (isset($aircraft_info[0]['aircraft_name'])) $aircraft_name = $aircraft_info[0]['aircraft_name']; |
@@ -129,23 +129,23 @@ discard block |
||
129 | 129 | } elseif ($aircraft_icao != '') { |
130 | 130 | $aircraft_registration = $aircraft_icao; |
131 | 131 | $aircraft_name = ''; |
132 | - } else return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
133 | - if (!isset($globalAircraftImageSources)) $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
132 | + } else return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
133 | + if (!isset($globalAircraftImageSources)) $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
134 | 134 | foreach ($globalAircraftImageSources as $source) { |
135 | 135 | $source = strtolower($source); |
136 | - if ($source == 'ivaomtl' && $globalIVAO && $aircraft_icao != '' && $airline_icao != '') $images_array = $this->fromIvaoMtl($aircraft_icao,$airline_icao); |
|
137 | - if ($source == 'planespotters' && !$globalIVAO) $images_array = $this->fromPlanespotters($aircraft_registration,$aircraft_name); |
|
138 | - if ($source == 'flickr') $images_array = $this->fromFlickr($aircraft_registration,$aircraft_name); |
|
139 | - if ($source == 'bing') $images_array = $this->fromBing($aircraft_registration,$aircraft_name); |
|
140 | - if ($source == 'deviantart') $images_array = $this->fromDeviantart($aircraft_registration,$aircraft_name); |
|
141 | - if ($source == 'wikimedia') $images_array = $this->fromWikimedia($aircraft_registration,$aircraft_name); |
|
142 | - if ($source == 'jetphotos' && !$globalIVAO) $images_array = $this->fromJetPhotos($aircraft_registration,$aircraft_name); |
|
143 | - if ($source == 'planepictures' && !$globalIVAO) $images_array = $this->fromPlanePictures($aircraft_registration,$aircraft_name); |
|
144 | - if ($source == 'airportdata' && !$globalIVAO) $images_array = $this->fromAirportData($aircraft_registration,$aircraft_name); |
|
145 | - if ($source == 'customsources') $images_array = $this->fromCustomSource($aircraft_registration,$aircraft_name); |
|
136 | + if ($source == 'ivaomtl' && $globalIVAO && $aircraft_icao != '' && $airline_icao != '') $images_array = $this->fromIvaoMtl($aircraft_icao, $airline_icao); |
|
137 | + if ($source == 'planespotters' && !$globalIVAO) $images_array = $this->fromPlanespotters($aircraft_registration, $aircraft_name); |
|
138 | + if ($source == 'flickr') $images_array = $this->fromFlickr($aircraft_registration, $aircraft_name); |
|
139 | + if ($source == 'bing') $images_array = $this->fromBing($aircraft_registration, $aircraft_name); |
|
140 | + if ($source == 'deviantart') $images_array = $this->fromDeviantart($aircraft_registration, $aircraft_name); |
|
141 | + if ($source == 'wikimedia') $images_array = $this->fromWikimedia($aircraft_registration, $aircraft_name); |
|
142 | + if ($source == 'jetphotos' && !$globalIVAO) $images_array = $this->fromJetPhotos($aircraft_registration, $aircraft_name); |
|
143 | + if ($source == 'planepictures' && !$globalIVAO) $images_array = $this->fromPlanePictures($aircraft_registration, $aircraft_name); |
|
144 | + if ($source == 'airportdata' && !$globalIVAO) $images_array = $this->fromAirportData($aircraft_registration, $aircraft_name); |
|
145 | + if ($source == 'customsources') $images_array = $this->fromCustomSource($aircraft_registration, $aircraft_name); |
|
146 | 146 | if (isset($images_array) && $images_array['original'] != '') return $images_array; |
147 | 147 | } |
148 | - return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
148 | + return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -156,24 +156,24 @@ discard block |
||
156 | 156 | * @return Array the aircraft thumbnail, orignal url and copyright |
157 | 157 | * |
158 | 158 | */ |
159 | - public function fromPlanespotters($aircraft_registration, $aircraft_name='') { |
|
159 | + public function fromPlanespotters($aircraft_registration, $aircraft_name = '') { |
|
160 | 160 | $Common = new Common(); |
161 | 161 | // If aircraft registration is only number, also check with aircraft model |
162 | - if (preg_match('/^[[:digit]]+$/',$aircraft_registration) && $aircraft_name != '') { |
|
163 | - $url= 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$aircraft_registration.'&actype=s_'.urlencode($aircraft_name).'&output=rss'; |
|
162 | + if (preg_match('/^[[:digit]]+$/', $aircraft_registration) && $aircraft_name != '') { |
|
163 | + $url = 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$aircraft_registration.'&actype=s_'.urlencode($aircraft_name).'&output=rss'; |
|
164 | 164 | } else { |
165 | 165 | //$url= 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$airline_aircraft_type.'&output=rss'; |
166 | - $url= 'http://www.planespotters.net/Aviation_Photos/search.php?reg='.$aircraft_registration.'&output=rss'; |
|
166 | + $url = 'http://www.planespotters.net/Aviation_Photos/search.php?reg='.$aircraft_registration.'&output=rss'; |
|
167 | 167 | } |
168 | 168 | $data = $Common->getData($url); |
169 | 169 | if ($xml = simplexml_load_string($data)) { |
170 | 170 | if (isset($xml->channel->item)) { |
171 | 171 | $image_url = array(); |
172 | - $thumbnail_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
172 | + $thumbnail_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
173 | 173 | $image_url['thumbnail'] = $thumbnail_url; |
174 | - $image_url['original'] = str_replace('thumbnail','original',$thumbnail_url); |
|
175 | - $image_url['copyright'] = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright); |
|
176 | - $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
174 | + $image_url['original'] = str_replace('thumbnail', 'original', $thumbnail_url); |
|
175 | + $image_url['copyright'] = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright); |
|
176 | + $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
177 | 177 | $image_url['source'] = 'planespotters'; |
178 | 178 | return $image_url; |
179 | 179 | } |
@@ -189,25 +189,25 @@ discard block |
||
189 | 189 | * @return Array the aircraft thumbnail, orignal url and copyright |
190 | 190 | * |
191 | 191 | */ |
192 | - public function fromDeviantart($aircraft_registration, $aircraft_name='') { |
|
192 | + public function fromDeviantart($aircraft_registration, $aircraft_name = '') { |
|
193 | 193 | $Common = new Common(); |
194 | 194 | // If aircraft registration is only number, also check with aircraft model |
195 | - if (preg_match('/^[[:digit]]+$/',$aircraft_registration) && $aircraft_name != '') { |
|
196 | - $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q='.$aircraft_registration.'%20'.urlencode($aircraft_name); |
|
195 | + if (preg_match('/^[[:digit]]+$/', $aircraft_registration) && $aircraft_name != '') { |
|
196 | + $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q='.$aircraft_registration.'%20'.urlencode($aircraft_name); |
|
197 | 197 | } else { |
198 | - $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q=aircraft%20'.$aircraft_registration; |
|
198 | + $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q=aircraft%20'.$aircraft_registration; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | $data = $Common->getData($url); |
202 | 202 | if ($xml = simplexml_load_string($data)) { |
203 | 203 | if (isset($xml->channel->item->link)) { |
204 | 204 | $image_url = array(); |
205 | - $thumbnail_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
205 | + $thumbnail_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
206 | 206 | $image_url['thumbnail'] = $thumbnail_url; |
207 | - $original_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->content->attributes()->url); |
|
207 | + $original_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->content->attributes()->url); |
|
208 | 208 | $image_url['original'] = $original_url; |
209 | - $image_url['copyright'] = str_replace('Copyright ','',trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright)); |
|
210 | - $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
209 | + $image_url['copyright'] = str_replace('Copyright ', '', trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright)); |
|
210 | + $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
211 | 211 | $image_url['source'] = 'deviantart'; |
212 | 212 | return $image_url; |
213 | 213 | } |
@@ -223,32 +223,32 @@ discard block |
||
223 | 223 | * @return Array the aircraft thumbnail, orignal url and copyright |
224 | 224 | * |
225 | 225 | */ |
226 | - public function fromJetPhotos($aircraft_registration, $aircraft_name='') { |
|
226 | + public function fromJetPhotos($aircraft_registration, $aircraft_name = '') { |
|
227 | 227 | $Common = new Common(); |
228 | - $url= 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
|
228 | + $url = 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
|
229 | 229 | $data = $Common->getData($url); |
230 | 230 | $dom = new DOMDocument(); |
231 | 231 | @$dom->loadHTML($data); |
232 | 232 | $all_pics = array(); |
233 | - foreach($dom->getElementsByTagName('img') as $image) { |
|
233 | + foreach ($dom->getElementsByTagName('img') as $image) { |
|
234 | 234 | if ($image->getAttribute('itemprop') == "http://schema.org/image") { |
235 | 235 | $all_pics[] = $image->getAttribute('src'); |
236 | 236 | } |
237 | 237 | } |
238 | 238 | $all_authors = array(); |
239 | - foreach($dom->getElementsByTagName('meta') as $author) { |
|
239 | + foreach ($dom->getElementsByTagName('meta') as $author) { |
|
240 | 240 | if ($author->getAttribute('itemprop') == "http://schema.org/author") { |
241 | 241 | $all_authors[] = $author->getAttribute('content'); |
242 | 242 | } |
243 | 243 | } |
244 | 244 | $all_ref = array(); |
245 | - foreach($dom->getElementsByTagName('a') as $link) { |
|
245 | + foreach ($dom->getElementsByTagName('a') as $link) { |
|
246 | 246 | $all_ref[] = $link->getAttribute('href'); |
247 | 247 | } |
248 | 248 | if (isset($all_pics[0])) { |
249 | 249 | $image_url = array(); |
250 | 250 | $image_url['thumbnail'] = $all_pics[0]; |
251 | - $image_url['original'] = str_replace('_tb','',$all_pics[0]); |
|
251 | + $image_url['original'] = str_replace('_tb', '', $all_pics[0]); |
|
252 | 252 | $image_url['copyright'] = $all_authors[0]; |
253 | 253 | $image_url['source_website'] = 'http://jetphotos.net'.$all_ref[8]; |
254 | 254 | $image_url['source'] = 'JetPhotos'; |
@@ -265,24 +265,24 @@ discard block |
||
265 | 265 | * @return Array the aircraft thumbnail, orignal url and copyright |
266 | 266 | * |
267 | 267 | */ |
268 | - public function fromPlanePictures($aircraft_registration, $aircraft_name='') { |
|
268 | + public function fromPlanePictures($aircraft_registration, $aircraft_name = '') { |
|
269 | 269 | $Common = new Common(); |
270 | - $url= 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
|
270 | + $url = 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
|
271 | 271 | $data = $Common->getData($url); |
272 | 272 | $dom = new DOMDocument(); |
273 | 273 | @$dom->loadHTML($data); |
274 | 274 | $all_pics = array(); |
275 | - foreach($dom->getElementsByTagName('img') as $image) { |
|
275 | + foreach ($dom->getElementsByTagName('img') as $image) { |
|
276 | 276 | $all_pics[] = $image->getAttribute('src'); |
277 | 277 | } |
278 | 278 | $all_links = array(); |
279 | - foreach($dom->getElementsByTagName('a') as $link) { |
|
280 | - $all_links[] = array('text' => $link->textContent,'href' => $link->getAttribute('href')); |
|
279 | + foreach ($dom->getElementsByTagName('a') as $link) { |
|
280 | + $all_links[] = array('text' => $link->textContent, 'href' => $link->getAttribute('href')); |
|
281 | 281 | } |
282 | - if (isset($all_pics[1]) && !preg_match('/bit.ly/',$all_pics[1])) { |
|
282 | + if (isset($all_pics[1]) && !preg_match('/bit.ly/', $all_pics[1])) { |
|
283 | 283 | $image_url = array(); |
284 | 284 | $image_url['thumbnail'] = 'http://www.planepictures.net'.$all_pics[1]; |
285 | - $image_url['original'] = 'http://www.planepictures.net'.str_replace('_TN','',$all_pics[1]); |
|
285 | + $image_url['original'] = 'http://www.planepictures.net'.str_replace('_TN', '', $all_pics[1]); |
|
286 | 286 | $image_url['copyright'] = $all_links[6]['text']; |
287 | 287 | $image_url['source_website'] = 'http://www.planepictures.net/'.$all_links[2]['href']; |
288 | 288 | $image_url['source'] = 'PlanePictures'; |
@@ -299,19 +299,19 @@ discard block |
||
299 | 299 | * @return Array the aircraft thumbnail, orignal url and copyright |
300 | 300 | * |
301 | 301 | */ |
302 | - public function fromFlickr($aircraft_registration,$aircraft_name='') { |
|
302 | + public function fromFlickr($aircraft_registration, $aircraft_name = '') { |
|
303 | 303 | $Common = new Common(); |
304 | 304 | if ($aircraft_name != '') $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$aircraft_registration.','.urlencode($aircraft_name); |
305 | 305 | else $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$aircraft_registration.',aircraft'; |
306 | 306 | $data = $Common->getData($url); |
307 | 307 | if ($xml = simplexml_load_string($data)) { |
308 | 308 | if (isset($xml->channel->item)) { |
309 | - $original_url = trim((string)$xml->channel->item->enclosure->attributes()->url); |
|
309 | + $original_url = trim((string) $xml->channel->item->enclosure->attributes()->url); |
|
310 | 310 | $image_url = array(); |
311 | 311 | $image_url['thumbnail'] = $original_url; |
312 | 312 | $image_url['original'] = $original_url; |
313 | - $image_url['copyright'] = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->credit); |
|
314 | - $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
313 | + $image_url['copyright'] = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->credit); |
|
314 | + $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
315 | 315 | $image_url['source'] = 'flickr'; |
316 | 316 | return $image_url; |
317 | 317 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | return false; |
320 | 320 | } |
321 | 321 | |
322 | - public function fromIvaoMtl($aircraft_icao,$airline_icao) { |
|
322 | + public function fromIvaoMtl($aircraft_icao, $airline_icao) { |
|
323 | 323 | $Common = new Common(); |
324 | 324 | //echo "\n".'SEARCH IMAGE : http://mtlcatalog.ivao.aero/images/aircraft/'.$aircraft_icao.$airline_icao.'.jpg'; |
325 | 325 | if ($Common->urlexist('http://mtlcatalog.ivao.aero/images/aircraft/'.$aircraft_icao.$airline_icao.'.jpg')) { |
@@ -343,14 +343,14 @@ discard block |
||
343 | 343 | * @return Array the aircraft thumbnail, orignal url and copyright |
344 | 344 | * |
345 | 345 | */ |
346 | - public function fromBing($aircraft_registration,$aircraft_name='') { |
|
346 | + public function fromBing($aircraft_registration, $aircraft_name = '') { |
|
347 | 347 | global $globalImageBingKey; |
348 | 348 | $Common = new Common(); |
349 | 349 | if (!isset($globalImageBingKey) || $globalImageBingKey == '') return false; |
350 | 350 | if ($aircraft_name != '') $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27'.$aircraft_registration.'%20'.urlencode($aircraft_name).'%20-site:planespotters.com%20-site:flickr.com%27'; |
351 | 351 | else $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27%2B'.$aircraft_registration.'%20%2Baircraft%20-site:planespotters.com%20-site:flickr.com%27'; |
352 | - $headers = array("Authorization: Basic " . base64_encode("ignored:".$globalImageBingKey)); |
|
353 | - $data = $Common->getData($url,'get','',$headers); |
|
352 | + $headers = array("Authorization: Basic ".base64_encode("ignored:".$globalImageBingKey)); |
|
353 | + $data = $Common->getData($url, 'get', '', $headers); |
|
354 | 354 | $result = json_decode($data); |
355 | 355 | if (isset($result->d->results[0]->MediaUrl)) { |
356 | 356 | $image_url = array(); |
@@ -375,14 +375,14 @@ discard block |
||
375 | 375 | * @return Array the aircraft thumbnail, orignal url and copyright |
376 | 376 | * |
377 | 377 | */ |
378 | - public function fromAirportData($aircraft_registration,$aircraft_name='') { |
|
378 | + public function fromAirportData($aircraft_registration, $aircraft_name = '') { |
|
379 | 379 | $Common = new Common(); |
380 | 380 | $url = 'http://www.airport-data.com/api/ac_thumb.json?&n=1&r='.$aircraft_registration; |
381 | 381 | $data = $Common->getData($url); |
382 | 382 | $result = json_decode($data); |
383 | 383 | if (isset($result->count) && $result->count > 0) { |
384 | 384 | $image_url = array(); |
385 | - $image_url['original'] = str_replace('thumbnails','large',$result->data[0]->image); |
|
385 | + $image_url['original'] = str_replace('thumbnails', 'large', $result->data[0]->image); |
|
386 | 386 | $image_url['source_website'] = $result->data[0]->link; |
387 | 387 | $image_url['thumbnail'] = $result->data[0]->image; |
388 | 388 | $image_url['copyright'] = $result->data[0]->photographer; |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | * @return Array the aircraft thumbnail, orignal url and copyright |
401 | 401 | * |
402 | 402 | */ |
403 | - public function fromWikimedia($aircraft_registration,$aircraft_name='') { |
|
403 | + public function fromWikimedia($aircraft_registration, $aircraft_name = '') { |
|
404 | 404 | $Common = new Common(); |
405 | 405 | if ($aircraft_name != '') $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$aircraft_registration.'"%20'.urlencode($aircraft_name); |
406 | 406 | else $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$aircraft_registration.'"%20aircraft'; |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | $result = json_decode($data); |
409 | 409 | if (isset($result->query->search[0]->title)) { |
410 | 410 | $fileo = $result->query->search[0]->title; |
411 | - if (substr($fileo,-3) == 'pdf') return false; |
|
411 | + if (substr($fileo, -3) == 'pdf') return false; |
|
412 | 412 | $file = urlencode($fileo); |
413 | 413 | $url2 = 'https://commons.wikimedia.org/w/api.php?action=query&format=json&continue&iilimit=500&prop=imageinfo&iiprop=user|url|size|mime|sha1|timestamp&iiurlwidth=200%27&titles='.$file; |
414 | 414 | $data2 = $Common->getData($url2); |
@@ -433,11 +433,11 @@ discard block |
||
433 | 433 | if (isset($result2->query->pages)) { |
434 | 434 | foreach ($result2->query->pages as $page) { |
435 | 435 | if (isset($page->imageinfo[0]->extmetadata->Artist)) { |
436 | - $image_url['copyright'] = preg_replace('/ from(.*)/','',strip_tags($page->imageinfo[0]->extmetadata->Artist->value)); |
|
436 | + $image_url['copyright'] = preg_replace('/ from(.*)/', '', strip_tags($page->imageinfo[0]->extmetadata->Artist->value)); |
|
437 | 437 | if (isset($page->imageinfo[0]->extmetadata->License->value)) { |
438 | 438 | $image_url['copyright'] = $image_url['copyright'].' (under '.$page->imageinfo[0]->extmetadata->License->value.')'; |
439 | 439 | } |
440 | - $image_url['copyright'] = trim(str_replace('\n','',$image_url['copyright'])); |
|
440 | + $image_url['copyright'] = trim(str_replace('\n', '', $image_url['copyright'])); |
|
441 | 441 | return $image_url; |
442 | 442 | } |
443 | 443 | } |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @return Array the aircraft thumbnail, orignal url and copyright |
457 | 457 | * |
458 | 458 | */ |
459 | - public function fromCustomSource($aircraft_registration,$aircraft_name='') { |
|
459 | + public function fromCustomSource($aircraft_registration, $aircraft_name = '') { |
|
460 | 460 | global $globalAircraftImageCustomSources, $globalDebug; |
461 | 461 | //$globalAircraftImageCustomSource[] = array('thumbnail' => '','original' => '', 'copyright' => '', 'source_website' => '', 'source' => '','exif' => true); |
462 | 462 | if (!empty($globalAircraftImageCustomSources)) { |
@@ -473,15 +473,15 @@ discard block |
||
473 | 473 | print_r($source); |
474 | 474 | print_r($customsources); |
475 | 475 | } |
476 | - $url = str_replace('{registration}',$aircraft_registration,$source['original']); |
|
477 | - $url_thumbnail = str_replace('{registration}',$aircraft_registration,$source['thumbnail']); |
|
476 | + $url = str_replace('{registration}', $aircraft_registration, $source['original']); |
|
477 | + $url_thumbnail = str_replace('{registration}', $aircraft_registration, $source['thumbnail']); |
|
478 | 478 | if ($Common->urlexist($url)) { |
479 | 479 | $image_url = array(); |
480 | 480 | $image_url['thumbnail'] = $url_thumbnail; |
481 | 481 | $image_url['original'] = $url; |
482 | 482 | if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) $exifCopyright = $this->getExifCopyright($url); |
483 | 483 | else $exifCopyright = ''; |
484 | - if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
484 | + if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
485 | 485 | else $image_url['copyright'] = $source['copyright']; |
486 | 486 | $image_url['source_website'] = $source['source_website']; |
487 | 487 | $image_url['source'] = $source['source']; |
@@ -7,15 +7,15 @@ discard block |
||
7 | 7 | if (isset($_POST['airport'])) |
8 | 8 | { |
9 | 9 | header('Location: '.$globalURL.'/airport/'.$_POST['airport']); |
10 | -} else if (isset($_GET['airport'])){ |
|
10 | +} else if (isset($_GET['airport'])) { |
|
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | //calculuation for the pagination |
13 | - if($_GET['limit'] == "") |
|
13 | + if ($_GET['limit'] == "") |
|
14 | 14 | { |
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
31 | 31 | |
32 | - $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
33 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
32 | + $airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
33 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
34 | 34 | $page_url = $globalURL.'/airport/'.$airport; |
35 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport,$limit_start.",".$absolute_difference, $sort); |
|
35 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport, $limit_start.",".$absolute_difference, $sort); |
|
36 | 36 | $airport_array = $Spotter->getAllAirportInfo($airport); |
37 | 37 | |
38 | 38 | if (!empty($airport_array)) |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | $airport_names = $Spotter->getAllAirportNames(); |
52 | 52 | } |
53 | 53 | ksort($airport_names); |
54 | - foreach($airport_names as $airport_name) |
|
54 | + foreach ($airport_names as $airport_name) |
|
55 | 55 | { |
56 | - if($airport == $airport_name['airport_icao']) |
|
56 | + if ($airport == $airport_name['airport_icao']) |
|
57 | 57 | { |
58 | 58 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
59 | 59 | } else { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | print '<div class="table column">'; |
87 | 87 | if ($airport_array[0]['iata'] != "NA") |
88 | 88 | { |
89 | - print '<p>'.sprintf(_("The table below shows the route(s) aircrafts have used to/from <strong>%s</strong>, sorted by the most recent one."),$airport_array[0]['name']).'</p>'; |
|
89 | + print '<p>'.sprintf(_("The table below shows the route(s) aircrafts have used to/from <strong>%s</strong>, sorted by the most recent one."), $airport_array[0]['name']).'</p>'; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | include('table-output.php'); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | print '<p>'._("Sorry, the airport does not exist in this database. :(").'</p>'; |
109 | 109 | } |
110 | 110 | } else { |
111 | - $Spotter= new Spotter(); |
|
111 | + $Spotter = new Spotter(); |
|
112 | 112 | $Stats = new Stats(); |
113 | 113 | $title = _("Airports"); |
114 | 114 | require_once('header.php'); |
@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | ksort($airport_names); |
122 | 122 | $previous = null; |
123 | 123 | print '<div class="alphabet-legend">'; |
124 | - foreach($airport_names as $value) { |
|
124 | + foreach ($airport_names as $value) { |
|
125 | 125 | $firstLetter = mb_strtoupper(mb_substr($value['airport_city'], 0, 1)); |
126 | - if($previous !== $firstLetter) |
|
126 | + if ($previous !== $firstLetter) |
|
127 | 127 | { |
128 | - if ($previous !== null){ |
|
128 | + if ($previous !== null) { |
|
129 | 129 | print ' | '; |
130 | 130 | } |
131 | 131 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
@@ -134,13 +134,13 @@ discard block |
||
134 | 134 | } |
135 | 135 | print '</div>'; |
136 | 136 | $previous = null; |
137 | - foreach($airport_names as $value) { |
|
137 | + foreach ($airport_names as $value) { |
|
138 | 138 | $firstLetter = mb_strtoupper(mb_substr($value['airport_city'], 0, 1)); |
139 | 139 | if ($firstLetter != "") |
140 | 140 | { |
141 | - if($previous !== $firstLetter) |
|
141 | + if ($previous !== $firstLetter) |
|
142 | 142 | { |
143 | - if ($previous !== null){ |
|
143 | + if ($previous !== null) { |
|
144 | 144 | print '</div>'; |
145 | 145 | } |
146 | 146 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airport'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
10 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
13 | 13 | $airport_array = $Spotter->getAllAirportInfo($airport); |
14 | 14 | |
15 | 15 | if (!empty($airport_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Arrival Airports by Country from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
17 | + $title = sprintf(_("Most Common Arrival Airports by Country from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
20 | 20 | print '<form action="'.$globalURL.'/airport" method="post">'; |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | $airport_names = $Stats->getAllAirportNames(); |
25 | 25 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
26 | 26 | ksort($airport_names); |
27 | - foreach($airport_names as $airport_name) |
|
27 | + foreach ($airport_names as $airport_name) |
|
28 | 28 | { |
29 | - if($airport == $airport_name['airport_icao']) |
|
29 | + if ($airport == $airport_name['airport_icao']) |
|
30 | 30 | { |
31 | 31 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
32 | 32 | } else { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | include('airport-sub-menu.php'); |
58 | 58 | print '<div class="column">'; |
59 | 59 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
60 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
60 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
61 | 61 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByAirport($airport); |
62 | 62 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
63 | 63 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | var data = google.visualization.arrayToDataTable([ |
69 | 69 | ["'._("Country").'", "'._("# of times").'"], '; |
70 | 70 | $country_data = ''; |
71 | - foreach($airport_country_array as $airport_item) |
|
71 | + foreach ($airport_country_array as $airport_item) |
|
72 | 72 | { |
73 | 73 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
74 | 74 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | print '</thead>'; |
103 | 103 | print '<tbody>'; |
104 | 104 | $i = 1; |
105 | - foreach($airport_country_array as $airport_item) |
|
105 | + foreach ($airport_country_array as $airport_item) |
|
106 | 106 | { |
107 | 107 | print '<tr>'; |
108 | 108 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airline'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
10 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Time of Day from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
17 | + $title = sprintf(_("Most Common Time of Day from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
20 | 20 | print '<form action="'.$globalURL.'/airline" method="post">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $airline_names = $Stats->getAllAirlineNames(); |
25 | 25 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
26 | - foreach($airline_names as $airline_name) |
|
26 | + foreach ($airline_names as $airline_name) |
|
27 | 27 | { |
28 | - if($airline == $airline_name['airline_icao']) |
|
28 | + if ($airline == $airline_name['airline_icao']) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
31 | 31 | } else { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | include('airline-sub-menu.php'); |
64 | 64 | print '<div class="column">'; |
65 | 65 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
66 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
66 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
67 | 67 | $hour_array = $Spotter->countAllHoursByAirline($airline); |
68 | 68 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
69 | 69 | print '<div id="chartHour" class="chart" width="100%"></div> |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | var data = google.visualization.arrayToDataTable([ |
75 | 75 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
76 | 76 | $hour_data = ''; |
77 | - foreach($hour_array as $hour_item) |
|
77 | + foreach ($hour_array as $hour_item) |
|
78 | 78 | { |
79 | 79 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
80 | 80 | } |
@@ -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 Aircraft from %s"),$manufacturer); |
|
17 | + $title = sprintf(_("Most Common Aircraft 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 Aircraft").'</h2>'; |
47 | - print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
47 | + print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
48 | 48 | |
49 | 49 | $aircraft_array = $Spotter->countAllAircraftTypesByManufacturer($manufacturer); |
50 | 50 | if (!empty($aircraft_array)) |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | print '</thead>'; |
60 | 60 | print '<tbody>'; |
61 | 61 | $i = 1; |
62 | - foreach($aircraft_array as $aircraft_item) |
|
62 | + foreach ($aircraft_array as $aircraft_item) |
|
63 | 63 | { |
64 | 64 | print '<tr>'; |
65 | 65 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | require_once('require/class.Connection.php'); |
3 | -require_once('require/class.Spotter.php');; |
|
3 | +require_once('require/class.Spotter.php'); ; |
|
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['date'])){ |
|
6 | +if (!isset($_GET['date'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | |
11 | 11 | //calculuation for the pagination |
12 | - if(!isset($_GET['limit'])) |
|
12 | + if (!isset($_GET['limit'])) |
|
13 | 13 | { |
14 | 14 | $limit_start = 0; |
15 | 15 | $limit_end = 25; |
16 | 16 | $absolute_difference = 25; |
17 | - } else { |
|
17 | + } else { |
|
18 | 18 | $limit_explode = explode(",", $_GET['limit']); |
19 | 19 | $limit_start = $limit_explode[0]; |
20 | 20 | $limit_end = $limit_explode[1]; |
@@ -28,22 +28,22 @@ discard block |
||
28 | 28 | $limit_previous_1 = $limit_start - $absolute_difference; |
29 | 29 | $limit_previous_2 = $limit_end - $absolute_difference; |
30 | 30 | |
31 | - $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
31 | + $date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/date/'.$date; |
33 | 33 | |
34 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
34 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
35 | 35 | if ($sort != '') |
36 | 36 | { |
37 | - $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
37 | + $spotter_array = $Spotter->getSpotterDataByDate($date, $limit_start.",".$absolute_difference, $sort); |
|
38 | 38 | } else { |
39 | - $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference); |
|
39 | + $spotter_array = $Spotter->getSpotterDataByDate($date, $limit_start.",".$absolute_difference); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | if (!empty($spotter_array)) |
44 | 44 | { |
45 | 45 | date_default_timezone_set($globalTimezone); |
46 | - $title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
46 | + $title = sprintf(_("Detailed View for flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
47 | 47 | |
48 | 48 | require_once('header.php'); |
49 | 49 | print '<div class="select-item">'; |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
62 | 62 | print '<br />'; |
63 | 63 | print '<div class="info column">'; |
64 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
64 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
65 | 65 | print '</div>'; |
66 | 66 | |
67 | 67 | include('date-sub-menu.php'); |
68 | 68 | print '<div class="table column">'; |
69 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
69 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."), date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
70 | 70 | |
71 | 71 | include('table-output.php'); |
72 | 72 | print '<div class="pagination">'; |
@@ -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 by Country from %s"),$manufacturer); |
|
17 | + $title = sprintf(_("'Most Common Departure Airports 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 Departure Airports by Country").'</h2>'; |
47 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
47 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
48 | 48 | |
49 | 49 | $airport_country_array = $Spotter->countAllDepartureAirportCountriesByManufacturer($manufacturer); |
50 | 50 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ["'._("Country").'", "'._("# of times").'"], '; |
58 | 58 | |
59 | 59 | $country_data = ''; |
60 | - foreach($airport_country_array as $airport_item) |
|
60 | + foreach ($airport_country_array as $airport_item) |
|
61 | 61 | { |
62 | 62 | $country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],'; |
63 | 63 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | print '</thead>'; |
92 | 92 | print '<tbody>'; |
93 | 93 | $i = 1; |
94 | - foreach($airport_country_array as $airport_item) |
|
94 | + foreach ($airport_country_array as $airport_item) |
|
95 | 95 | { |
96 | 96 | print '<tr>'; |
97 | 97 | print '<td><strong>'.$i.'</strong></td>'; |