@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | } else { |
21 | 21 | print '<option value="all">All</option>'; |
22 | 22 | } |
23 | - foreach($airlines as $airline) { |
|
23 | + foreach ($airlines as $airline) { |
|
24 | 24 | if (isset($airline_icao) && $airline_icao == $airline['airline_icao']) { |
25 | 25 | print '<option value="'.$airline['airline_icao'].'" selected>'.$airline['airline_name'].'</option>'; |
26 | 26 | } else { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | <div class="sub-menu sub-menu-container"> |
38 | 38 | <ul class="nav"> |
39 | 39 | <li class="dropdown"> |
40 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
40 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
41 | 41 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
42 | 42 | </a> |
43 | 43 | <ul class="dropdown-menu"> |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | </ul> |
49 | 49 | </li> |
50 | 50 | <li class="dropdown"> |
51 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
51 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
52 | 52 | <?php echo _("Airline"); ?> <span class="caret"></span> |
53 | 53 | </a> |
54 | 54 | <ul class="dropdown-menu" role="menu"> |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | </ul> |
59 | 59 | </li> |
60 | 60 | <li class="dropdown"> |
61 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
61 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
62 | 62 | <?php echo _("Airport"); ?> <span class="caret"></span> |
63 | 63 | </a> |
64 | 64 | <ul class="dropdown-menu" role="menu"> |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | </ul> |
70 | 70 | </li> |
71 | 71 | <li class="dropdown"> |
72 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
72 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
73 | 73 | <?php echo _("Route"); ?> <span class="caret"></span> |
74 | 74 | </a> |
75 | 75 | <ul class="dropdown-menu" role="menu"> |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | </ul> |
79 | 79 | </li> |
80 | 80 | <li class="dropdown"> |
81 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
81 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
82 | 82 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
83 | 83 | </a> |
84 | 84 | <ul class="dropdown-menu" role="menu"> |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
91 | 91 | ?> |
92 | 92 | <li class="dropdown"> |
93 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
93 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
94 | 94 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
95 | 95 | </a> |
96 | 96 | <ul class="dropdown-menu" role="menu"> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | <div class="sub-menu sub-menu-container"> |
110 | 110 | <ul class="nav"> |
111 | 111 | <li class="dropdown"> |
112 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
112 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
113 | 113 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
114 | 114 | </a> |
115 | 115 | <ul class="dropdown-menu"> |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | </ul> |
121 | 121 | </li> |
122 | 122 | <li class="dropdown"> |
123 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
123 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
124 | 124 | <?php echo _("Airline"); ?> <span class="caret"></span> |
125 | 125 | </a> |
126 | 126 | <ul class="dropdown-menu" role="menu"> |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | </ul> |
131 | 131 | </li> |
132 | 132 | <li class="dropdown"> |
133 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
133 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
134 | 134 | <?php echo _("Airport"); ?> <span class="caret"></span> |
135 | 135 | </a> |
136 | 136 | <ul class="dropdown-menu" role="menu"> |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | </li> |
143 | 143 | <!-- |
144 | 144 | <li class="dropdown"> |
145 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
145 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
146 | 146 | <?php echo _("Route"); ?> <span class="caret"></span> |
147 | 147 | </a> |
148 | 148 | <ul class="dropdown-menu" role="menu"> |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | --> |
154 | 154 | <!-- |
155 | 155 | <li class="dropdown"> |
156 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
156 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
157 | 157 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
158 | 158 | </a> |
159 | 159 | <ul class="dropdown-menu" role="menu"> |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | ?> |
168 | 168 | <!-- |
169 | 169 | <li class="dropdown"> |
170 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
170 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
171 | 171 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
172 | 172 | </a> |
173 | 173 | <ul class="dropdown-menu" role="menu"> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $Connection = new Connection(); |
55 | 55 | $sth = $Connection->db->prepare($query); |
56 | 56 | $sth->execute(); |
57 | - } catch(PDOException $e) { |
|
57 | + } catch (PDOException $e) { |
|
58 | 58 | return "error : ".$e->getMessage(); |
59 | 59 | } |
60 | 60 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $Connection = new Connection(); |
71 | 71 | $sth = $Connection->db->prepare($query); |
72 | 72 | $sth->execute(); |
73 | - } catch(PDOException $e) { |
|
73 | + } catch (PDOException $e) { |
|
74 | 74 | return "error : ".$e->getMessage(); |
75 | 75 | } |
76 | 76 | } |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | public function parse($data) { |
81 | 81 | //$data = str_replace(array('\n','\r','\r','\n'),'',$data); |
82 | 82 | $codes = implode('|', array_keys($this->texts)); |
83 | - $regWeather = '#^(\+|\-|VC)?(' . $codes . ')(' . $codes . ')?$#'; |
|
83 | + $regWeather = '#^(\+|\-|VC)?('.$codes.')('.$codes.')?$#'; |
|
84 | 84 | //$pieces = explode(' ',$data); |
85 | - $pieces = preg_split('/\s/',$data); |
|
85 | + $pieces = preg_split('/\s/', $data); |
|
86 | 86 | $pos = 0; |
87 | 87 | if ($pieces[0] == 'METAR') $pos++; |
88 | 88 | elseif ($pieces[0] == 'SPECI') $pos++; |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | $result = array(); |
91 | 91 | $result['location'] = $pieces[$pos]; |
92 | 92 | $pos++; |
93 | - $result['dayofmonth'] = substr($pieces[$pos],0,2); |
|
94 | - $result['time'] = substr($pieces[$pos],2,4); |
|
93 | + $result['dayofmonth'] = substr($pieces[$pos], 0, 2); |
|
94 | + $result['time'] = substr($pieces[$pos], 2, 4); |
|
95 | 95 | $c = count($pieces); |
96 | - for($pos++; $pos < $c; $pos++) { |
|
96 | + for ($pos++; $pos < $c; $pos++) { |
|
97 | 97 | $piece = $pieces[$pos]; |
98 | 98 | if ($piece == 'RMK') break; |
99 | 99 | if ($piece == 'AUTO') $result['auto'] = true; |
100 | 100 | if ($piece == 'COR') $result['correction'] = true; |
101 | 101 | // Wind Speed |
102 | 102 | if (preg_match('#(VRB|\d\d\d)(\d\d)(?:G(\d\d))?(KT|MPS|KPH)(?: (\d{1,3})V(\d{1,3}))?$#', $piece, $matches)) { |
103 | - $result['wind']['direction'] = (float)$matches[1]; |
|
103 | + $result['wind']['direction'] = (float) $matches[1]; |
|
104 | 104 | $result['wind']['unit'] = $matches[4]; |
105 | - if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float)$matches[2])*0.51444444444,2); |
|
106 | - elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float)$matches[2])*1000,2); |
|
107 | - elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float)$matches[2]),2); |
|
108 | - $result['wind']['gust'] = (float)$matches[3]; |
|
105 | + if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float) $matches[2])*0.51444444444, 2); |
|
106 | + elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float) $matches[2])*1000, 2); |
|
107 | + elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float) $matches[2]), 2); |
|
108 | + $result['wind']['gust'] = (float) $matches[3]; |
|
109 | 109 | $result['wind']['unit'] = $matches[4]; |
110 | - $result['wind']['min_variation'] = array_key_exists(5,$matches) ? $matches[5] : 0; |
|
111 | - $result['wind']['max_variation'] = array_key_exists(6,$matches) ? $matches[6] : 0; |
|
110 | + $result['wind']['min_variation'] = array_key_exists(5, $matches) ? $matches[5] : 0; |
|
111 | + $result['wind']['max_variation'] = array_key_exists(6, $matches) ? $matches[6] : 0; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /* if (preg_match('#^([0-9]{3})([0-9]{2})(G([0-9]{2}))?(KT|MPS)$#', $piece, $matches)) { |
@@ -128,14 +128,14 @@ discard block |
||
128 | 128 | */ |
129 | 129 | // Temperature |
130 | 130 | if (preg_match('#^(M?[0-9]{2,})/(M?[0-9]{2,})$#', $piece, $matches)) { |
131 | - $temp = (float)$matches[1]; |
|
131 | + $temp = (float) $matches[1]; |
|
132 | 132 | if ($matches[1]{0} == 'M') { |
133 | - $temp = ((float)substr($matches[1], 1)) * -1; |
|
133 | + $temp = ((float) substr($matches[1], 1))*-1; |
|
134 | 134 | } |
135 | 135 | $result['temperature'] = $temp; |
136 | - $dew = (float)$matches[2]; |
|
136 | + $dew = (float) $matches[2]; |
|
137 | 137 | if ($matches[2]{0} == 'M') { |
138 | - $dew = ((float)substr($matches[2], 1)) * -1; |
|
138 | + $dew = ((float) substr($matches[2], 1))*-1; |
|
139 | 139 | } |
140 | 140 | $result['dew'] = $dew; |
141 | 141 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $result['QNH'] = $matches[2]; |
148 | 148 | } else { |
149 | 149 | // inHg |
150 | - $result['QNH'] = round(($matches[2] / 100)*33.86389,2); |
|
150 | + $result['QNH'] = round(($matches[2]/100)*33.86389, 2); |
|
151 | 151 | } |
152 | 152 | /* |
153 | 153 | $result['QNH'] = $matches[1] == 'Q' ? $matches[2] : ($matches[2] / 100); |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | // Visibility |
169 | 169 | if (preg_match('#^([0-9]{4})|(([0-9]{1,4})SM)$#', $piece, $matches)) { |
170 | 170 | if (isset($matches[3]) && strlen($matches[3]) > 0) { |
171 | - $result['visibility'] = (float)$matches[3] * 1609.34; |
|
171 | + $result['visibility'] = (float) $matches[3]*1609.34; |
|
172 | 172 | } else { |
173 | 173 | if ($matches[1] == '9999') { |
174 | 174 | $result['visibility'] = '> 10000'; |
175 | 175 | } else { |
176 | - $result['visibility'] = (float)$matches[1]; |
|
176 | + $result['visibility'] = (float) $matches[1]; |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | if (preg_match('#^CAVOK$#', $piece, $matches)) { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | elseif ($type == 'OVC') $cloud['type'] = 'Overcast/Full cloud coverage'; |
196 | 196 | elseif ($type == 'VV') $cloud['type'] = 'Vertical visibility'; |
197 | 197 | $cloud['type_code'] = $type; |
198 | - $cloud['level'] = round(((float)$matches[2]) * 100 * 0.3048); |
|
198 | + $cloud['level'] = round(((float) $matches[2])*100*0.3048); |
|
199 | 199 | $cloud['significant'] = isset($matches[3]) ? $matches[3] : ''; |
200 | 200 | $result['cloud'][] = $cloud; |
201 | 201 | } |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | $rvr['runway'] = $matches[1]; |
206 | 206 | $rvr['assessment'] = $matches[2]; |
207 | 207 | $rvr['rvr'] = $matches[3]; |
208 | - $rvr['rvr_max'] = array_key_exists(4,$matches) ? $matches[4] : 0; |
|
209 | - $rvr['unit'] = array_key_exists(5,$matches) ? $matches[5] : ''; |
|
208 | + $rvr['rvr_max'] = array_key_exists(4, $matches) ? $matches[4] : 0; |
|
209 | + $rvr['unit'] = array_key_exists(5, $matches) ? $matches[5] : ''; |
|
210 | 210 | $result['RVR'] = $rvr; |
211 | 211 | } |
212 | 212 | |
@@ -223,12 +223,12 @@ discard block |
||
223 | 223 | if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) { |
224 | 224 | //echo $piece; |
225 | 225 | //print_r($matches); |
226 | - if (isset($matches[5])) $range = array('exact' => (float)$matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
227 | - else $range = array('exact' => (float)$matches[2], 'unit' => 'M'); |
|
226 | + if (isset($matches[5])) $range = array('exact' => (float) $matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
227 | + else $range = array('exact' => (float) $matches[2], 'unit' => 'M'); |
|
228 | 228 | if (isset($matches[3])) { |
229 | 229 | $range = Array( |
230 | - 'from' => (float)$matches[2], |
|
231 | - 'to' => (float)$matches[4], |
|
230 | + 'from' => (float) $matches[2], |
|
231 | + 'to' => (float) $matches[4], |
|
232 | 232 | 'unit' => $matches[5] ? 'FT' : 'M' |
233 | 233 | ); |
234 | 234 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | try { |
278 | 278 | $sth = $this->db->prepare($query); |
279 | 279 | $sth->execute($query_values); |
280 | - } catch(PDOException $e) { |
|
280 | + } catch (PDOException $e) { |
|
281 | 281 | return "error : ".$e->getMessage(); |
282 | 282 | } |
283 | 283 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -287,19 +287,19 @@ discard block |
||
287 | 287 | return $all; |
288 | 288 | } |
289 | 289 | |
290 | - public function addMETAR($location,$metar,$date) { |
|
290 | + public function addMETAR($location, $metar, $date) { |
|
291 | 291 | global $globalDBdriver; |
292 | - $date = date('Y-m-d H:i:s',strtotime($date)); |
|
292 | + $date = date('Y-m-d H:i:s', strtotime($date)); |
|
293 | 293 | if ($globalDBdriver == 'mysql') { |
294 | 294 | $query = "INSERT INTO metar (metar_location,metar_date,metar) VALUES (:location,:date,:metar) ON DUPLICATE KEY UPDATE metar_date = :date, metar = :metar"; |
295 | 295 | } else { |
296 | 296 | $query = "UPDATE metar SET metar_date = :date, metar = metar WHERE metar_location = :location;INSERT INTO metar (metar_location,metar_date,metar) SELECT :location,:date,:metar WHERE NOT EXISTS (SELECT 1 FROM metar WHERE metar_location = :location);"; |
297 | 297 | } |
298 | - $query_values = array(':location' => $location,':date' => $date,':metar' => utf8_encode($metar)); |
|
298 | + $query_values = array(':location' => $location, ':date' => $date, ':metar' => utf8_encode($metar)); |
|
299 | 299 | try { |
300 | 300 | $sth = $this->db->prepare($query); |
301 | 301 | $sth->execute($query_values); |
302 | - } catch(PDOException $e) { |
|
302 | + } catch (PDOException $e) { |
|
303 | 303 | return "error : ".$e->getMessage(); |
304 | 304 | } |
305 | 305 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | try { |
311 | 311 | $sth = $this->db->prepare($query); |
312 | 312 | $sth->execute($query_values); |
313 | - } catch(PDOException $e) { |
|
313 | + } catch (PDOException $e) { |
|
314 | 314 | return "error : ".$e->getMessage(); |
315 | 315 | } |
316 | 316 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | try { |
320 | 320 | $sth = $this->db->prepare($query); |
321 | 321 | $sth->execute(); |
322 | - } catch(PDOException $e) { |
|
322 | + } catch (PDOException $e) { |
|
323 | 323 | return "error : ".$e->getMessage(); |
324 | 324 | } |
325 | 325 | } |
@@ -331,30 +331,30 @@ discard block |
||
331 | 331 | $Common = new Common(); |
332 | 332 | if (isset($globalIVAO) && $globalIVAO) { |
333 | 333 | //$cycle = $Common->getData('http://wx.ivao.aero/metar.php'); |
334 | - $Common->download('http://wx.ivao.aero/metar.php',dirname(__FILE__).'/../install/tmp/ivaometar.txt'); |
|
335 | - $handle = fopen(dirname(__FILE__).'/../install/tmp/ivaometar.txt',"r"); |
|
334 | + $Common->download('http://wx.ivao.aero/metar.php', dirname(__FILE__).'/../install/tmp/ivaometar.txt'); |
|
335 | + $handle = fopen(dirname(__FILE__).'/../install/tmp/ivaometar.txt', "r"); |
|
336 | 336 | } else { |
337 | 337 | //$cycle = $Common->getData('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT'); |
338 | - $Common->download('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT',dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT'); |
|
339 | - $handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT',"r"); |
|
338 | + $Common->download('http://tgftp.nws.noaa.gov/data/observations/metar/cycles/'.date('H').'Z.TXT', dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT'); |
|
339 | + $handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT', "r"); |
|
340 | 340 | } |
341 | 341 | if ($handle) { |
342 | 342 | if (isset($globalDebug) && $globalDebug) echo "Done - Updating DB..."; |
343 | 343 | $date = ''; |
344 | 344 | //foreach(explode("\n",$cycle) as $line) { |
345 | 345 | if ($globalTransaction) $this->db->beginTransaction(); |
346 | - while(($line = fgets($handle,4096)) !== false) { |
|
347 | - if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) { |
|
346 | + while (($line = fgets($handle, 4096)) !== false) { |
|
347 | + if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) { |
|
348 | 348 | $date = $line; |
349 | 349 | } elseif ($line != '') { |
350 | 350 | //$this->parse($line); |
351 | 351 | if ($date == '') $date = date('Y/m/d H:m'); |
352 | 352 | $pos = 0; |
353 | - $pieces = preg_split('/\s/',$line); |
|
353 | + $pieces = preg_split('/\s/', $line); |
|
354 | 354 | if ($pieces[0] == 'METAR') $pos++; |
355 | 355 | if (strlen($pieces[$pos]) != 4) $pos++; |
356 | 356 | $location = $pieces[$pos]; |
357 | - echo $this->addMETAR($location,$line,$date); |
|
357 | + echo $this->addMETAR($location, $line, $date); |
|
358 | 358 | } |
359 | 359 | } |
360 | 360 | fclose($handle); |
@@ -368,11 +368,11 @@ discard block |
||
368 | 368 | if ($globalMETARurl == '') return array(); |
369 | 369 | date_default_timezone_set("UTC"); |
370 | 370 | $Common = new Common(); |
371 | - $url = str_replace('{icao}',$icao,$globalMETARurl); |
|
371 | + $url = str_replace('{icao}', $icao, $globalMETARurl); |
|
372 | 372 | $cycle = $Common->getData($url); |
373 | 373 | $date = ''; |
374 | - foreach(explode("\n",$cycle) as $line) { |
|
375 | - if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) { |
|
374 | + foreach (explode("\n", $cycle) as $line) { |
|
375 | + if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) { |
|
376 | 376 | //echo "date : ".$line."\n"; |
377 | 377 | $date = $line; |
378 | 378 | } |
@@ -381,12 +381,12 @@ discard block |
||
381 | 381 | //echo $line; |
382 | 382 | if ($date == '') $date = date('Y/m/d H:m'); |
383 | 383 | $pos = 0; |
384 | - $pieces = preg_split('/\s/',$line); |
|
384 | + $pieces = preg_split('/\s/', $line); |
|
385 | 385 | if ($pieces[0] == 'METAR') $pos++; |
386 | 386 | if (strlen($pieces[$pos]) != 4) $pos++; |
387 | 387 | $location = $pieces[$pos]; |
388 | 388 | if (strlen($location == 4)) { |
389 | - $this->addMETAR($location,$line,$date); |
|
389 | + $this->addMETAR($location, $line, $date); |
|
390 | 390 | return array('0' => array('metar_date' => $date, 'metar_location' => $location, 'metar' => $line)); |
391 | 391 | } else return array(); |
392 | 392 | } |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | { |
11 | 11 | $date = date('Y-m-d'); |
12 | 12 | } else { |
13 | - $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
13 | + $date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
14 | 14 | } |
15 | 15 | |
16 | -if(!isset($_GET['limit'])) |
|
16 | +if (!isset($_GET['limit'])) |
|
17 | 17 | { |
18 | 18 | $limit_start = 0; |
19 | 19 | $limit_end = 25; |
@@ -48,25 +48,25 @@ discard block |
||
48 | 48 | print '<br />'; |
49 | 49 | |
50 | 50 | print '<div class="info column">'; |
51 | -if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$date)) { |
|
52 | - print '<h1>'.sprintf(_("Accidents from %s"),date("l F j, Y",strtotime($date))).'</h1>'; |
|
53 | -} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/',$date)) { |
|
54 | - print '<h1>'.sprintf(_("Accidents from %s"),date("F, Y",strtotime($date))).'</h1>'; |
|
55 | -} elseif (preg_match('/^[0-9]{4}$/',$date)) { |
|
56 | - print '<h1>'.sprintf(_("Accidents from %s"),$date).'</h1>'; |
|
51 | +if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date)) { |
|
52 | + print '<h1>'.sprintf(_("Accidents from %s"), date("l F j, Y", strtotime($date))).'</h1>'; |
|
53 | +} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/', $date)) { |
|
54 | + print '<h1>'.sprintf(_("Accidents from %s"), date("F, Y", strtotime($date))).'</h1>'; |
|
55 | +} elseif (preg_match('/^[0-9]{4}$/', $date)) { |
|
56 | + print '<h1>'.sprintf(_("Accidents from %s"), $date).'</h1>'; |
|
57 | 57 | } |
58 | 58 | print '</div>'; |
59 | 59 | |
60 | 60 | print '<div class="table column">'; |
61 | 61 | |
62 | -if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$date)) { |
|
63 | - print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),date("l M j, Y",strtotime($date))).'</p>'; |
|
64 | -} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/',$date)) { |
|
65 | - print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),date("M, Y",strtotime($date))).'</p>'; |
|
66 | -} elseif (preg_match('/^[0-9]{4}$/',$date)) { |
|
67 | - print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),$date).'</p>'; |
|
62 | +if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date)) { |
|
63 | + print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), date("l M j, Y", strtotime($date))).'</p>'; |
|
64 | +} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/', $date)) { |
|
65 | + print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), date("M, Y", strtotime($date))).'</p>'; |
|
66 | +} elseif (preg_match('/^[0-9]{4}$/', $date)) { |
|
67 | + print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), $date).'</p>'; |
|
68 | 68 | } |
69 | -$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference,'accident',$date); |
|
69 | +$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference, 'accident', $date); |
|
70 | 70 | //print_r($spotter_array); |
71 | 71 | if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) { |
72 | 72 | include('table-output.php'); |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | require_once(dirname(__FILE__).'/require/class.Common.php'); |
6 | 6 | $Common = new Common(); |
7 | -$showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop'); |
|
8 | -$showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
|
7 | +$showRouteStop = $Common->multiKeyExists($spotter_array, 'route_stop'); |
|
8 | +$showDuration = $Common->multiKeyExists($spotter_array, 'duration'); |
|
9 | 9 | |
10 | 10 | if (!isset($_GET['sort'])) |
11 | 11 | { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | print '<th class="more"></th>'; |
101 | 101 | print '</thead>'; |
102 | -} else if (strtolower($current_page) == "upcoming"){ |
|
102 | +} else if (strtolower($current_page) == "upcoming") { |
|
103 | 103 | print '<thead>'; |
104 | 104 | if ($_GET['sort'] == "airline_name_asc") |
105 | 105 | { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } |
150 | 150 | */ |
151 | 151 | print '</thead>'; |
152 | -} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){ |
|
152 | +} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
|
153 | 153 | print '<thead>'; |
154 | 154 | print '<th class="aircraft_thumbnail"></th>'; |
155 | 155 | print '<th class="logo">'._("Airline").'</th>'; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | print '</thead>'; |
187 | 187 | } else { |
188 | 188 | |
189 | - if ($hide_th_links === true){ |
|
189 | + if ($hide_th_links === true) { |
|
190 | 190 | print '<thead>'; |
191 | 191 | print '<th class="aircraft_thumbnail"></th>'; |
192 | 192 | if ($_GET['sort'] == "airline_name_asc") |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | } |
378 | 378 | |
379 | 379 | print '<tbody>'."\n"; |
380 | -foreach($spotter_array as $spotter_item) |
|
380 | +foreach ($spotter_array as $spotter_item) |
|
381 | 381 | { |
382 | 382 | if (isset($globalTimezone)) |
383 | 383 | { |
@@ -408,13 +408,13 @@ discard block |
||
408 | 408 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
409 | 409 | } |
410 | 410 | if (isset($spotter_item['airline_name'])) { |
411 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['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>'; |
|
411 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['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>'; |
|
412 | 412 | } else { |
413 | - 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>'; |
|
413 | + 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>'; |
|
414 | 414 | } |
415 | 415 | } else { |
416 | 416 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
417 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
417 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
418 | 418 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
419 | 419 | if (isset($spotter_item['airline_name'])) { |
420 | 420 | 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>'; |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | 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"; |
429 | 429 | print '</td>'."\n"; |
430 | 430 | } |
431 | - } 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"){ |
|
431 | + } 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") { |
|
432 | 432 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
433 | 433 | $spotter_item['squawk'] = '-'; |
434 | 434 | } |
@@ -444,17 +444,17 @@ discard block |
||
444 | 444 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
445 | 445 | } |
446 | 446 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
447 | - 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>'; |
|
447 | + 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>'; |
|
448 | 448 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
449 | - 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>'; |
|
449 | + 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>'; |
|
450 | 450 | } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) { |
451 | - 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>'; |
|
451 | + 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>'; |
|
452 | 452 | } else { |
453 | - 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>'; |
|
453 | + 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>'; |
|
454 | 454 | } |
455 | 455 | } else { |
456 | 456 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
457 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
457 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
458 | 458 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
459 | 459 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
460 | 460 | 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>'; |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | } |
518 | 518 | print '</td>'."\n"; |
519 | 519 | // Aircraft type |
520 | - if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
|
520 | + if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") { |
|
521 | 521 | print '<td class="type">'."\n"; |
522 | 522 | if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) { |
523 | 523 | print '<span class="nomobile">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</span>'."\n"; |
@@ -541,22 +541,22 @@ discard block |
||
541 | 541 | } |
542 | 542 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
543 | 543 | if ($spotter_item['departure_airport_time'] > 2460) { |
544 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
545 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
544 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
545 | + } else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
546 | 546 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
547 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
547 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
548 | 548 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
549 | 549 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
550 | 550 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
551 | 551 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
552 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
552 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
553 | 553 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
554 | 554 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
555 | 555 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
556 | 556 | if ($spotter_item['departure_airport_time'] > 2460) { |
557 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
557 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
558 | 558 | } else { |
559 | - $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
559 | + $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
560 | 560 | } |
561 | 561 | print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n"; |
562 | 562 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | $latitude = $spotter_item['latitude']; |
572 | 572 | $longitude = $spotter_item['longitude']; |
573 | 573 | } |
574 | - $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
|
574 | + $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude); |
|
575 | 575 | } else $distance = ''; |
576 | 576 | if ($distance != '') { |
577 | 577 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -612,20 +612,20 @@ discard block |
||
612 | 612 | } |
613 | 613 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
614 | 614 | if ($spotter_item['arrival_airport_time'] > 2460) { |
615 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
615 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
616 | 616 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
617 | 617 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
618 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
618 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
619 | 619 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
620 | 620 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
621 | 621 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
622 | 622 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
623 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
623 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
624 | 624 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
625 | 625 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
626 | 626 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
627 | 627 | if ($spotter_item['arrival_airport_time'] > 2460) { |
628 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
628 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
629 | 629 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
630 | 630 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
631 | 631 | } |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | $latitude = $spotter_item['latitude']; |
639 | 639 | $longitude = $spotter_item['longitude']; |
640 | 640 | } |
641 | - $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
|
641 | + $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude); |
|
642 | 642 | } else $distance = ''; |
643 | 643 | if ($distance != '') { |
644 | 644 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -659,21 +659,21 @@ discard block |
||
659 | 659 | } else { |
660 | 660 | //if (!isset($globalUnitDistance) || $globalUnitDistance == 'km') { |
661 | 661 | if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
662 | - print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n"; |
|
663 | - print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n"; |
|
662 | + print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n"; |
|
663 | + print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n"; |
|
664 | 664 | //} elseif ($globalUnitDistance == 'mi') { |
665 | 665 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
666 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n"; |
|
667 | - print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n"; |
|
666 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n"; |
|
667 | + print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n"; |
|
668 | 668 | //} elseif ($globalUnitDistance == 'nm') { |
669 | 669 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
670 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n"; |
|
671 | - print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n"; |
|
670 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n"; |
|
671 | + print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n"; |
|
672 | 672 | } |
673 | 673 | } |
674 | 674 | print '</td>'."\n"; |
675 | 675 | } |
676 | - if(strtolower($current_page) != "upcoming"){ |
|
676 | + if (strtolower($current_page) != "upcoming") { |
|
677 | 677 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
678 | 678 | print '<td class="pilot">'."\n"; |
679 | 679 | if ((!isset($spotter_item['pilot_id']) || $spotter_item['pilot_id'] == '') && (!isset($spotter_item['pilot_name']) || $spotter_item['pilot_name'] == '')) { |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | //if ((isset($globalIvAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)) { |
709 | 709 | if ($showRouteStop) { |
710 | 710 | // Route stop |
711 | - if(strtolower($current_page) != "upcoming"){ |
|
711 | + if (strtolower($current_page) != "upcoming") { |
|
712 | 712 | print '<td class="route_stop">'."\n"; |
713 | 713 | if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') { |
714 | 714 | print '<span class="nomobile">-</span>'."\n"; |
@@ -727,11 +727,11 @@ discard block |
||
727 | 727 | } |
728 | 728 | if ($showDuration) { |
729 | 729 | // Duration |
730 | - if(strtolower($current_page) != "upcoming"){ |
|
730 | + if (strtolower($current_page) != "upcoming") { |
|
731 | 731 | print '<td class="duration">'."\n"; |
732 | 732 | if (isset($spotter_item['duration'])) { |
733 | - print '<span class="nomobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n"; |
|
734 | - print '<span class="mobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n"; |
|
733 | + print '<span class="nomobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n"; |
|
734 | + print '<span class="mobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n"; |
|
735 | 735 | } else { |
736 | 736 | print '<span class="nomobile">-</span>'."\n"; |
737 | 737 | print '<span class="mobile">-</span>'."\n"; |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
745 | 745 | if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') { |
746 | 746 | print '<td class="message"><p>'."\n"; |
747 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
747 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
748 | 748 | print '</p><p class="decode">'; |
749 | 749 | $decode_array = json_decode($spotter_item['decode']); |
750 | 750 | foreach ($decode_array as $key => $value) { |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | print '</td>'."\n"; |
755 | 755 | } else { |
756 | 756 | print '<td class="message">'."\n"; |
757 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
757 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
758 | 758 | print '</td>'."\n"; |
759 | 759 | } |
760 | 760 | } |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | } |
780 | 780 | print '</td>'."\n"; |
781 | 781 | print '<td class="message">'."\n"; |
782 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
782 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
783 | 783 | print '</td>'."\n"; |
784 | 784 | } |
785 | 785 | if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") { |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | print '</td>'."\n"; |
806 | 806 | */ |
807 | 807 | print '<td class="message">'."\n"; |
808 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
808 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
809 | 809 | print '</td>'."\n"; |
810 | 810 | } |
811 | 811 |
@@ -7,12 +7,12 @@ discard block |
||
7 | 7 | require_once('header.php'); |
8 | 8 | |
9 | 9 | //calculuation for the pagination |
10 | -if(!isset($_GET['limit'])) |
|
10 | +if (!isset($_GET['limit'])) |
|
11 | 11 | { |
12 | 12 | $limit_start = 0; |
13 | 13 | $limit_end = 25; |
14 | 14 | $absolute_difference = 25; |
15 | -} else { |
|
15 | +} else { |
|
16 | 16 | $limit_explode = explode(",", $_GET['limit']); |
17 | 17 | $limit_start = $limit_explode[0]; |
18 | 18 | $limit_end = $limit_explode[1]; |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | print '<div class="table column">'; |
35 | 35 | print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; |
36 | 36 | |
37 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
37 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
38 | 38 | $sql_begin = microtime(true); |
39 | 39 | $spotter_array = $Spotter->getLatestSpotterData($limit_start.",".$absolute_difference, $sort); |
40 | -$sql_time = microtime(true)-$sql_begin; |
|
40 | +$sql_time = microtime(true) - $sql_begin; |
|
41 | 41 | $page_begin = microtime(true); |
42 | 42 | if (!empty($spotter_array)) |
43 | 43 | { |
@@ -54,6 +54,6 @@ discard block |
||
54 | 54 | print '</div>'; |
55 | 55 | print '</div>'; |
56 | 56 | } |
57 | -$page_time = microtime(true)-$page_begin; |
|
57 | +$page_time = microtime(true) - $page_begin; |
|
58 | 58 | require_once('footer.php'); |
59 | 59 | ?> |
60 | 60 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
|
2 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
|
3 | 3 | if ($id == "") |
4 | 4 | { |
5 | 5 | header('Location: /'); |
@@ -16,30 +16,30 @@ discard block |
||
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - if(isset($spotter_array[0]['flightaware_id'])) { |
|
19 | + if (isset($spotter_array[0]['flightaware_id'])) { |
|
20 | 20 | $flightaware_id = $spotter_array[0]['flightaware_id']; |
21 | 21 | } |
22 | - if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
22 | + if (isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
|
23 | 23 | $latitude = $spotter_array[0]['last_latitude']; |
24 | - } elseif(isset($spotter_array[0]['latitude'])) { |
|
24 | + } elseif (isset($spotter_array[0]['latitude'])) { |
|
25 | 25 | $latitude = $spotter_array[0]['latitude']; |
26 | 26 | } |
27 | - if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
27 | + if (isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
|
28 | 28 | $longitude = $spotter_array[0]['last_longitude']; |
29 | - } elseif(isset($spotter_array[0]['longitude'])) { |
|
29 | + } elseif (isset($spotter_array[0]['longitude'])) { |
|
30 | 30 | $longitude = $spotter_array[0]['longitude']; |
31 | 31 | } |
32 | 32 | $title = ''; |
33 | - if(isset($spotter_array[0]['ident'])) { |
|
33 | + if (isset($spotter_array[0]['ident'])) { |
|
34 | 34 | $title .= $spotter_array[0]['ident']; |
35 | 35 | } |
36 | - if(isset($spotter_array[0]['airline_name'])) { |
|
36 | + if (isset($spotter_array[0]['airline_name'])) { |
|
37 | 37 | $title .= ' - '.$spotter_array[0]['airline_name']; |
38 | 38 | } |
39 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
39 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
40 | 40 | $title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
41 | 41 | } |
42 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
42 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
|
43 | 43 | $title .= ' - '.$spotter_array[0]['registration']; |
44 | 44 | } |
45 | 45 | //$facebook_meta_image = $spotter_array[0]['image']; |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | var data = google.visualization.arrayToDataTable([ |
65 | 65 | ["Hour","Altitude","Speed"], '; |
66 | 66 | $altitude_data = ''; |
67 | - foreach($all_data as $data) |
|
67 | + foreach ($all_data as $data) |
|
68 | 68 | { |
69 | - $altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
|
69 | + $altitude_data .= '[ "'.date("G:i", strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
|
70 | 70 | } |
71 | 71 | $altitude_data = substr($altitude_data, 0, -1); |
72 | 72 | print $altitude_data.']); |
@@ -108,16 +108,16 @@ discard block |
||
108 | 108 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> '; |
109 | 109 | } |
110 | 110 | } |
111 | - if(isset($spotter_array[0]['ident'])) { |
|
111 | + if (isset($spotter_array[0]['ident'])) { |
|
112 | 112 | print $spotter_array[0]['ident']; |
113 | 113 | } |
114 | - if(isset($spotter_array[0]['airline_name'])) { |
|
114 | + if (isset($spotter_array[0]['airline_name'])) { |
|
115 | 115 | print ' - '.$spotter_array[0]['airline_name']; |
116 | 116 | } |
117 | - if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
117 | + if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
|
118 | 118 | print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
119 | 119 | } |
120 | - if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
120 | + if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
|
121 | 121 | print ' - '.$spotter_array[0]['registration']; |
122 | 122 | } |
123 | 123 | print '</h1>'; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | print '</div>'; |
272 | 272 | */ |
273 | 273 | |
274 | - foreach($spotter_array as $spotter_item) |
|
274 | + foreach ($spotter_array as $spotter_item) |
|
275 | 275 | { |
276 | 276 | print '<div class="details">'; |
277 | 277 | print '<h3>'._("Flight Information").'</h3>'; |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
372 | 372 | if ($spotter_item['departure_airport_time'] > 2460) { |
373 | 373 | print '<div class="time">'; |
374 | - print 'at '.date('H:m',$spotter_item['departure_airport_time']); |
|
374 | + print 'at '.date('H:m', $spotter_item['departure_airport_time']); |
|
375 | 375 | print '</div>'; |
376 | 376 | } else { |
377 | 377 | print '<div class="time">'; |
@@ -520,19 +520,19 @@ discard block |
||
520 | 520 | $departure_airport_info = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
521 | 521 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
522 | 522 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
523 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
523 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
524 | 524 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
525 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
525 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
526 | 526 | } else { |
527 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
527 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
528 | 528 | } |
529 | 529 | } else { |
530 | 530 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
531 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
|
531 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm'; |
|
532 | 532 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
533 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
|
533 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi'; |
|
534 | 534 | } else { |
535 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
|
535 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km'; |
|
536 | 536 | } |
537 | 537 | } |
538 | 538 | print '</div>'; |
@@ -546,19 +546,19 @@ discard block |
||
546 | 546 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
547 | 547 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
548 | 548 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
549 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
549 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
550 | 550 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
551 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
551 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
552 | 552 | } else { |
553 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
553 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
554 | 554 | } |
555 | 555 | } else { |
556 | 556 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
557 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
|
557 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm'; |
|
558 | 558 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
559 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
|
559 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi'; |
|
560 | 560 | } else { |
561 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
|
561 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km'; |
|
562 | 562 | } |
563 | 563 | } |
564 | 564 | print '</div>'; |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | print '<div class="last-flights">'; |
578 | 578 | print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$spotter_array[0]['registration'].')</h3>'; |
579 | 579 | $hide_th_links = true; |
580 | - $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'],"0,5", ""); |
|
580 | + $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'], "0,5", ""); |
|
581 | 581 | include('table-output.php'); |
582 | 582 | print '<div class="more">'; |
583 | 583 | print '<a href="'.$globalURL.'/registration/'.$spotter_array[0]['registration'].'" class="btn btn-default btn" role="button">See all Flights»</a>'; |
@@ -68,15 +68,15 @@ discard block |
||
68 | 68 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_create') { |
69 | 69 | $dbroot = $_SESSION['database_root']; |
70 | 70 | $dbrootpass = $_SESSION['database_rootpass']; |
71 | - $error .= create_db::create_database($dbroot,$dbrootpass,$globalDBuser,$globalDBpass,$globalDBname,$globalDBdriver,$globalDBhost); |
|
71 | + $error .= create_db::create_database($dbroot, $dbrootpass, $globalDBuser, $globalDBpass, $globalDBname, $globalDBdriver, $globalDBhost); |
|
72 | 72 | sleep(5); |
73 | 73 | if ($error != '') { |
74 | 74 | $_SESSION['error'] = $error; |
75 | 75 | } |
76 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Create database')); |
|
76 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Create database')); |
|
77 | 77 | $_SESSION['install'] = 'database_import'; |
78 | 78 | $_SESSION['next'] = 'Create and import tables'; |
79 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
79 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
80 | 80 | print json_encode($result); |
81 | 81 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') { |
82 | 82 | if (update_schema::check_version(false) == '0') { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | if ($error != '') { |
89 | 89 | $_SESSION['error'] = $error; |
90 | 90 | } |
91 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
|
91 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Create and import tables')); |
|
92 | 92 | if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
93 | 93 | $_SESSION['install'] = 'populate'; |
94 | 94 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B'; |
@@ -96,84 +96,84 @@ discard block |
||
96 | 96 | $_SESSION['install'] = 'sources'; |
97 | 97 | $_SESSION['next'] = 'Insert data in source table'; |
98 | 98 | } |
99 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
99 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
100 | 100 | print json_encode($result); |
101 | 101 | } else { |
102 | 102 | $error .= update_schema::check_version(true); |
103 | 103 | if ($error != '') { |
104 | 104 | $_SESSION['error'] = $error; |
105 | 105 | } |
106 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
|
106 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Update schema if needed')); |
|
107 | 107 | $_SESSION['install'] = 'sources'; |
108 | 108 | $_SESSION['next'] = 'Insert data in source table'; |
109 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
109 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
110 | 110 | print json_encode($result); |
111 | 111 | } |
112 | 112 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'waypoints') { |
113 | 113 | include_once('class.update_db.php'); |
114 | 114 | $error .= update_db::update_waypoints(); |
115 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate waypoints database')); |
|
115 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate waypoints database')); |
|
116 | 116 | |
117 | 117 | $_SESSION['install'] = 'airspace'; |
118 | 118 | $_SESSION['next'] = 'Populate airspace table'; |
119 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
119 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
120 | 120 | print json_encode($result); |
121 | 121 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'airspace') { |
122 | 122 | include_once('class.update_db.php'); |
123 | 123 | $error .= update_db::update_airspace_fam(); |
124 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate airspace database')); |
|
124 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate airspace database')); |
|
125 | 125 | $_SESSION['install'] = 'countries'; |
126 | 126 | $_SESSION['next'] = 'Populate countries table'; |
127 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
127 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
128 | 128 | print json_encode($result); |
129 | 129 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'countries') { |
130 | 130 | include_once('class.update_db.php'); |
131 | 131 | $error .= update_db::update_countries(); |
132 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
|
132 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate countries database')); |
|
133 | 133 | if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
134 | 134 | $_SESSION['install'] = 'notam'; |
135 | 135 | $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
136 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
136 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
137 | 137 | print json_encode($result); |
138 | 138 | } elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
139 | 139 | $_SESSION['install'] = 'owner'; |
140 | 140 | $_SESSION['next'] = 'Populate owner table with externals data'; |
141 | 141 | unset($_SESSION['owner']); |
142 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
142 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
143 | 143 | print json_encode($result); |
144 | 144 | } else { |
145 | 145 | $_SESSION['install'] = 'sources'; |
146 | 146 | $_SESSION['next'] = 'Insert data in source table'; |
147 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
147 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
148 | 148 | print json_encode($result); |
149 | 149 | } |
150 | 150 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') { |
151 | 151 | if (!is_writable('tmp')) { |
152 | 152 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
153 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
153 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
154 | 154 | print json_encode($result); |
155 | 155 | } else { |
156 | 156 | include_once('class.update_db.php'); |
157 | 157 | $globalDebug = FALSE; |
158 | 158 | $error .= update_db::update_ModeS_fam(); |
159 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for ADS-B')); |
|
159 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for ADS-B')); |
|
160 | 160 | |
161 | 161 | $_SESSION['install'] = 'populate_flarm'; |
162 | 162 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for FLARM'; |
163 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
163 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
164 | 164 | print json_encode($result); |
165 | 165 | } |
166 | 166 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') { |
167 | 167 | if (!is_writable('tmp')) { |
168 | 168 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
169 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
169 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
170 | 170 | print json_encode($result); |
171 | 171 | } else { |
172 | 172 | include_once('class.update_db.php'); |
173 | 173 | $globalDebug = FALSE; |
174 | 174 | //$error .= update_db::update_ModeS_flarm(); |
175 | 175 | $error .= update_db::update_ModeS_ogn(); |
176 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for FLARM')); |
|
176 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for FLARM')); |
|
177 | 177 | |
178 | 178 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
179 | 179 | $_SESSION['install'] = 'vatsim'; |
@@ -193,34 +193,34 @@ discard block |
||
193 | 193 | $_SESSION['install'] = 'routes'; |
194 | 194 | $_SESSION['next'] = 'Populate routes table with externals data'; |
195 | 195 | } |
196 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
196 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
197 | 197 | print json_encode($result); |
198 | 198 | } |
199 | 199 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') { |
200 | 200 | if (!is_writable('tmp')) { |
201 | 201 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
202 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
202 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
203 | 203 | print json_encode($result); |
204 | 204 | } else { |
205 | 205 | include_once('class.update_db.php'); |
206 | 206 | $globalDebug = FALSE; |
207 | 207 | $error .= update_db::update_routes(); |
208 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate routes table with externals data')); |
|
208 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate routes table with externals data')); |
|
209 | 209 | $_SESSION['install'] = 'translation'; |
210 | 210 | $_SESSION['next'] = 'Populate translation table with externals data'; |
211 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
211 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
212 | 212 | print json_encode($result); |
213 | 213 | } |
214 | 214 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') { |
215 | 215 | if (!is_writable('tmp')) { |
216 | 216 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
217 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
217 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
218 | 218 | print json_encode($result); |
219 | 219 | } else { |
220 | 220 | include_once('class.update_db.php'); |
221 | 221 | $globalDebug = FALSE; |
222 | 222 | $error .= update_db::update_translation(); |
223 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate translation table with externals data')); |
|
223 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate translation table with externals data')); |
|
224 | 224 | |
225 | 225 | if ($_SESSION['waypoints'] == 1) { |
226 | 226 | $_SESSION['install'] = 'waypoints'; |
@@ -237,48 +237,48 @@ discard block |
||
237 | 237 | $_SESSION['install'] = 'sources'; |
238 | 238 | $_SESSION['next'] = 'Insert data in source table'; |
239 | 239 | } |
240 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
240 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
241 | 241 | print json_encode($result); |
242 | 242 | } |
243 | 243 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') { |
244 | 244 | if (!is_writable('tmp')) { |
245 | 245 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
246 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
246 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
247 | 247 | print json_encode($result); |
248 | 248 | } else { |
249 | 249 | include_once('class.update_db.php'); |
250 | 250 | $globalDebug = FALSE; |
251 | 251 | $error = update_db::update_owner_fam(); |
252 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate owner table with externals data')); |
|
252 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate owner table with externals data')); |
|
253 | 253 | $_SESSION['install'] = 'sources'; |
254 | 254 | $_SESSION['next'] = 'Insert data in source table'; |
255 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
255 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
256 | 256 | print json_encode($result); |
257 | 257 | } |
258 | 258 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') { |
259 | 259 | if (!is_writable('tmp')) { |
260 | 260 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
261 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
261 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
262 | 262 | print json_encode($result); |
263 | 263 | } else { |
264 | 264 | include_once('class.update_db.php'); |
265 | 265 | $globalDebug = FALSE; |
266 | 266 | if (isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
267 | 267 | $error .= update_db::update_notam(); |
268 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data')); |
|
268 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data')); |
|
269 | 269 | } else { |
270 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data (no source defined)')); |
|
270 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data (no source defined)')); |
|
271 | 271 | } |
272 | 272 | if (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
273 | 273 | $_SESSION['install'] = 'owner'; |
274 | 274 | $_SESSION['next'] = 'Populate owner table'; |
275 | 275 | unset($_SESSION['owner']); |
276 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
276 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
277 | 277 | print json_encode($result); |
278 | 278 | } else { |
279 | 279 | $_SESSION['install'] = 'sources'; |
280 | 280 | $_SESSION['next'] = 'Insert data in source table'; |
281 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
281 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
282 | 282 | print json_encode($result); |
283 | 283 | } |
284 | 284 | } |
@@ -316,9 +316,9 @@ discard block |
||
316 | 316 | $Source = new Source(); |
317 | 317 | $Source->deleteAllLocation(); |
318 | 318 | foreach ($sources as $src) { |
319 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
319 | + if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'], $src['latitude'], $src['longitude'], $src['altitude'], $src['city'], $src['country'], $src['source'], 'antenna.png'); |
|
320 | 320 | } |
321 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
321 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert data in source table')); |
|
322 | 322 | unset($_SESSION['sources']); |
323 | 323 | } |
324 | 324 | /* |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $_SESSION['install'] = 'finish'; |
344 | 344 | $_SESSION['next'] = 'finish'; |
345 | 345 | } |
346 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
346 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
347 | 347 | print json_encode($result); |
348 | 348 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'vatsim') { |
349 | 349 | include_once('../install/class.create_db.php'); |
@@ -353,36 +353,36 @@ discard block |
||
353 | 353 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
354 | 354 | if (file_exists('tmp/ivae_feb2013.zip')) { |
355 | 355 | $error .= update_db::update_IVAO(); |
356 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
356 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data')); |
|
357 | 357 | } else { |
358 | 358 | $error .= update_db::update_vatsim(); |
359 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
359 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data')); |
|
360 | 360 | } |
361 | 361 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
362 | 362 | $error .= update_db::update_vatsim(); |
363 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
363 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data')); |
|
364 | 364 | } elseif (isset($globalIVAO) && $globalIVAO) { |
365 | 365 | if (file_exists('tmp/ivae_feb2013.zip')) { |
366 | 366 | $error .= update_db::update_IVAO(); |
367 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
367 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data')); |
|
368 | 368 | } else { |
369 | 369 | $error .= update_db::update_vatsim(); |
370 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data (IVAO not found)')); |
|
370 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data (IVAO not found)')); |
|
371 | 371 | } |
372 | 372 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
373 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert phpVMS data')); |
|
373 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert phpVMS data')); |
|
374 | 374 | } |
375 | 375 | //$_SESSION['install'] = 'routes'; |
376 | 376 | //$_SESSION['next'] = 'Populate routes table with externals data'; |
377 | 377 | $_SESSION['install'] = 'finish'; |
378 | 378 | $_SESSION['next'] = 'finish'; |
379 | 379 | |
380 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
380 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
381 | 381 | print json_encode($result); |
382 | 382 | } else { |
383 | 383 | //unset($_SESSION['install']); |
384 | 384 | $_SESSION['error'] = 'Unknwon task : '.$_SESSION['install']; |
385 | - $result = array('error' => 'Unknwon task : '.$_SESSION['install'],'done' => $_SESSION['done'],'next' => 'finish','install' => 'finish'); |
|
385 | + $result = array('error' => 'Unknwon task : '.$_SESSION['install'], 'done' => $_SESSION['done'], 'next' => 'finish', 'install' => 'finish'); |
|
386 | 386 | print json_encode($result); |
387 | 387 | } |
388 | 388 | ?> |
389 | 389 | \ No newline at end of file |
@@ -7,22 +7,22 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
12 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
13 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
12 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
13 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
14 | 14 | $filter = array(); |
15 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
16 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
15 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
16 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
17 | 17 | if ($sort != '') { |
18 | - $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
18 | + $spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
19 | 19 | } else { |
20 | - $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", '',$filter); |
|
20 | + $spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", '', $filter); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | if (!empty($spotter_array)) |
24 | 24 | { |
25 | - $title = sprintf(_("Most Common Aircraft of %s"),$spotter_array[0]['aircraft_owner']); |
|
25 | + $title = sprintf(_("Most Common Aircraft of %s"), $spotter_array[0]['aircraft_owner']); |
|
26 | 26 | require_once('header.php'); |
27 | 27 | print '<div class="info column">'; |
28 | 28 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | include('owner-sub-menu.php'); |
34 | 34 | print '<div class="column">'; |
35 | 35 | print '<h2>'._("Most Common Aircraft").'</h2>'; |
36 | - print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
36 | + print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
37 | 37 | |
38 | - $aircraft_array = $Spotter->countAllAircraftTypesByOwner($owner,$filter); |
|
38 | + $aircraft_array = $Spotter->countAllAircraftTypesByOwner($owner, $filter); |
|
39 | 39 | if (!empty($aircraft_array)) |
40 | 40 | { |
41 | 41 | print '<div class="table-responsive">'; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | print '</thead>'; |
48 | 48 | print '<tbody>'; |
49 | 49 | $i = 1; |
50 | - foreach($aircraft_array as $aircraft_item) |
|
50 | + foreach ($aircraft_array as $aircraft_item) |
|
51 | 51 | { |
52 | 52 | print '<tr>'; |
53 | 53 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
12 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
13 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
12 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
13 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
14 | 14 | $filter = array(); |
15 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
16 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
15 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
16 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
17 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Time of Day of %s"),$spotter_array[0]['aircraft_owner']); |
|
21 | + $title = sprintf(_("Most Common Time of Day of %s"), $spotter_array[0]['aircraft_owner']); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="info column">'; |
24 | 24 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | include('owner-sub-menu.php'); |
30 | 30 | print '<div class="column">'; |
31 | 31 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
32 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
32 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
33 | 33 | |
34 | - $hour_array = $Spotter->countAllHoursByOwner($owner,$filter); |
|
34 | + $hour_array = $Spotter->countAllHoursByOwner($owner, $filter); |
|
35 | 35 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
36 | 36 | print '<div id="chartHour" class="chart" width="100%"></div> |
37 | 37 | <script> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | var data = google.visualization.arrayToDataTable([ |
42 | 42 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
43 | 43 | $hour_data = ''; |
44 | - foreach($hour_array as $hour_item) |
|
44 | + foreach ($hour_array as $hour_item) |
|
45 | 45 | { |
46 | 46 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
47 | 47 | } |