@@ -59,8 +59,11 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 61 | 61 | $sth->closeCursor(); |
| 62 | - if ($row['nb'] > 0) return false; |
|
| 63 | - else return true; |
|
| 62 | + if ($row['nb'] > 0) { |
|
| 63 | + return false; |
|
| 64 | + } else { |
|
| 65 | + return true; |
|
| 66 | + } |
|
| 64 | 67 | } |
| 65 | 68 | |
| 66 | 69 | public static function insert_last_update() { |
@@ -84,9 +87,14 @@ discard block |
||
| 84 | 87 | //$pieces = explode(' ',$data); |
| 85 | 88 | $pieces = preg_split('/\s/',$data); |
| 86 | 89 | $pos = 0; |
| 87 | - if ($pieces[0] == 'METAR') $pos++; |
|
| 88 | - elseif ($pieces[0] == 'SPECI') $pos++; |
|
| 89 | - if (strlen($pieces[$pos]) != 4) $pos++; |
|
| 90 | + if ($pieces[0] == 'METAR') { |
|
| 91 | + $pos++; |
|
| 92 | + } elseif ($pieces[0] == 'SPECI') { |
|
| 93 | + $pos++; |
|
| 94 | + } |
|
| 95 | + if (strlen($pieces[$pos]) != 4) { |
|
| 96 | + $pos++; |
|
| 97 | + } |
|
| 90 | 98 | $result = array(); |
| 91 | 99 | $result['location'] = $pieces[$pos]; |
| 92 | 100 | $pos++; |
@@ -95,16 +103,26 @@ discard block |
||
| 95 | 103 | $c = count($pieces); |
| 96 | 104 | for($pos++; $pos < $c; $pos++) { |
| 97 | 105 | $piece = $pieces[$pos]; |
| 98 | - if ($piece == 'RMK') break; |
|
| 99 | - if ($piece == 'AUTO') $result['auto'] = true; |
|
| 100 | - if ($piece == 'COR') $result['correction'] = true; |
|
| 106 | + if ($piece == 'RMK') { |
|
| 107 | + break; |
|
| 108 | + } |
|
| 109 | + if ($piece == 'AUTO') { |
|
| 110 | + $result['auto'] = true; |
|
| 111 | + } |
|
| 112 | + if ($piece == 'COR') { |
|
| 113 | + $result['correction'] = true; |
|
| 114 | + } |
|
| 101 | 115 | // Wind Speed |
| 102 | 116 | 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 | 117 | $result['wind']['direction'] = (float)$matches[1]; |
| 104 | 118 | $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); |
|
| 119 | + if ($result['wind']['unit'] == 'KT') { |
|
| 120 | + $result['wind']['speed'] = round(((float)$matches[2])*0.51444444444,2); |
|
| 121 | + } elseif ($result['wind']['unit'] == 'KPH') { |
|
| 122 | + $result['wind']['speed'] = round(((float)$matches[2])*1000,2); |
|
| 123 | + } elseif ($result['wind']['unit'] == 'MPS') { |
|
| 124 | + $result['wind']['speed'] = round(((float)$matches[2]),2); |
|
| 125 | + } |
|
| 108 | 126 | $result['wind']['gust'] = (float)$matches[3]; |
| 109 | 127 | $result['wind']['unit'] = $matches[4]; |
| 110 | 128 | $result['wind']['min_variation'] = array_key_exists(5,$matches) ? $matches[5] : 0; |
@@ -186,14 +204,23 @@ discard block |
||
| 186 | 204 | //$this->addCloudCover($matches[1], ((float)$matches[2]) * 100, isset($matches[3]) ? $matches[3] : ''); |
| 187 | 205 | $type = $matches[1]; |
| 188 | 206 | $cloud = array(); |
| 189 | - if ($type == 'SKC') $cloud['type'] = 'No cloud/Sky clear'; |
|
| 190 | - elseif ($type == 'CLR') $cloud['type'] = 'No cloud below 12,000ft (3700m)'; |
|
| 191 | - elseif ($type == 'NSC') $cloud['type'] = 'No significant cloud'; |
|
| 192 | - elseif ($type == 'FEW') $cloud['type'] = 'Few'; |
|
| 193 | - elseif ($type == 'SCT') $cloud['type'] = 'Scattered'; |
|
| 194 | - elseif ($type == 'BKN') $cloud['type'] = 'Broken'; |
|
| 195 | - elseif ($type == 'OVC') $cloud['type'] = 'Overcast/Full cloud coverage'; |
|
| 196 | - elseif ($type == 'VV') $cloud['type'] = 'Vertical visibility'; |
|
| 207 | + if ($type == 'SKC') { |
|
| 208 | + $cloud['type'] = 'No cloud/Sky clear'; |
|
| 209 | + } elseif ($type == 'CLR') { |
|
| 210 | + $cloud['type'] = 'No cloud below 12,000ft (3700m)'; |
|
| 211 | + } elseif ($type == 'NSC') { |
|
| 212 | + $cloud['type'] = 'No significant cloud'; |
|
| 213 | + } elseif ($type == 'FEW') { |
|
| 214 | + $cloud['type'] = 'Few'; |
|
| 215 | + } elseif ($type == 'SCT') { |
|
| 216 | + $cloud['type'] = 'Scattered'; |
|
| 217 | + } elseif ($type == 'BKN') { |
|
| 218 | + $cloud['type'] = 'Broken'; |
|
| 219 | + } elseif ($type == 'OVC') { |
|
| 220 | + $cloud['type'] = 'Overcast/Full cloud coverage'; |
|
| 221 | + } elseif ($type == 'VV') { |
|
| 222 | + $cloud['type'] = 'Vertical visibility'; |
|
| 223 | + } |
|
| 197 | 224 | $cloud['type_code'] = $type; |
| 198 | 225 | $cloud['level'] = round(((float)$matches[2]) * 100 * 0.3048); |
| 199 | 226 | $cloud['significant'] = isset($matches[3]) ? $matches[3] : ''; |
@@ -223,8 +250,11 @@ discard block |
||
| 223 | 250 | if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) { |
| 224 | 251 | //echo $piece; |
| 225 | 252 | //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'); |
|
| 253 | + if (isset($matches[5])) { |
|
| 254 | + $range = array('exact' => (float)$matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
| 255 | + } else { |
|
| 256 | + $range = array('exact' => (float)$matches[2], 'unit' => 'M'); |
|
| 257 | + } |
|
| 228 | 258 | if (isset($matches[3])) { |
| 229 | 259 | $range = Array( |
| 230 | 260 | 'from' => (float)$matches[2], |
@@ -257,8 +287,11 @@ discard block |
||
| 257 | 287 | if (isset($matches[3])) { |
| 258 | 288 | $text[] = $this->texts[$matches[3]]; |
| 259 | 289 | } |
| 260 | - if (!isset($result['weather'])) $result['weather'] = implode(' ', $text); |
|
| 261 | - else $result['weather'] = $result['weather'].' / '.implode(' ', $text); |
|
| 290 | + if (!isset($result['weather'])) { |
|
| 291 | + $result['weather'] = implode(' ', $text); |
|
| 292 | + } else { |
|
| 293 | + $result['weather'] = $result['weather'].' / '.implode(' ', $text); |
|
| 294 | + } |
|
| 262 | 295 | } |
| 263 | 296 | } |
| 264 | 297 | return $result; |
@@ -270,8 +303,11 @@ discard block |
||
| 270 | 303 | if (isset($globalMETARcycle) && $globalMETARcycle) { |
| 271 | 304 | $query = "SELECT * FROM metar WHERE metar_location = :icao"; |
| 272 | 305 | } else { |
| 273 | - if ($globalDBdriver == 'mysql') $query = "SELECT * FROM metar WHERE metar_location = :icao AND metar_date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 10 HOUR) LIMIT 1"; |
|
| 274 | - else $query = "SELECT * FROM metar WHERE metar_location = :icao AND metar_date >= now() AT TIMEZONE 'UTC' - '10 HOUR'->INTERVAL LIMIT 0,1"; |
|
| 306 | + if ($globalDBdriver == 'mysql') { |
|
| 307 | + $query = "SELECT * FROM metar WHERE metar_location = :icao AND metar_date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 10 HOUR) LIMIT 1"; |
|
| 308 | + } else { |
|
| 309 | + $query = "SELECT * FROM metar WHERE metar_location = :icao AND metar_date >= now() AT TIMEZONE 'UTC' - '10 HOUR'->INTERVAL LIMIT 0,1"; |
|
| 310 | + } |
|
| 275 | 311 | } |
| 276 | 312 | $query_values = array(':icao' => $icao); |
| 277 | 313 | try { |
@@ -326,7 +362,9 @@ discard block |
||
| 326 | 362 | |
| 327 | 363 | public function addMETARCycle() { |
| 328 | 364 | global $globalDebug, $globalIVAO, $globalTransaction; |
| 329 | - if (isset($globalDebug) && $globalDebug) echo "Downloading METAR cycle..."; |
|
| 365 | + if (isset($globalDebug) && $globalDebug) { |
|
| 366 | + echo "Downloading METAR cycle..."; |
|
| 367 | + } |
|
| 330 | 368 | date_default_timezone_set("UTC"); |
| 331 | 369 | $Common = new Common(); |
| 332 | 370 | if (isset($globalIVAO) && $globalIVAO) { |
@@ -339,33 +377,49 @@ discard block |
||
| 339 | 377 | $handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT',"r"); |
| 340 | 378 | } |
| 341 | 379 | if ($handle) { |
| 342 | - if (isset($globalDebug) && $globalDebug) echo "Done - Updating DB..."; |
|
| 380 | + if (isset($globalDebug) && $globalDebug) { |
|
| 381 | + echo "Done - Updating DB..."; |
|
| 382 | + } |
|
| 343 | 383 | $date = ''; |
| 344 | 384 | //foreach(explode("\n",$cycle) as $line) { |
| 345 | - if ($globalTransaction) $this->db->beginTransaction(); |
|
| 385 | + if ($globalTransaction) { |
|
| 386 | + $this->db->beginTransaction(); |
|
| 387 | + } |
|
| 346 | 388 | while(($line = fgets($handle,4096)) !== false) { |
| 347 | 389 | if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) { |
| 348 | 390 | $date = $line; |
| 349 | 391 | } elseif ($line != '') { |
| 350 | 392 | //$this->parse($line); |
| 351 | - if ($date == '') $date = date('Y/m/d H:m'); |
|
| 393 | + if ($date == '') { |
|
| 394 | + $date = date('Y/m/d H:m'); |
|
| 395 | + } |
|
| 352 | 396 | $pos = 0; |
| 353 | 397 | $pieces = preg_split('/\s/',$line); |
| 354 | - if ($pieces[0] == 'METAR') $pos++; |
|
| 355 | - if (strlen($pieces[$pos]) != 4) $pos++; |
|
| 398 | + if ($pieces[0] == 'METAR') { |
|
| 399 | + $pos++; |
|
| 400 | + } |
|
| 401 | + if (strlen($pieces[$pos]) != 4) { |
|
| 402 | + $pos++; |
|
| 403 | + } |
|
| 356 | 404 | $location = $pieces[$pos]; |
| 357 | 405 | echo $this->addMETAR($location,$line,$date); |
| 358 | 406 | } |
| 359 | 407 | } |
| 360 | 408 | fclose($handle); |
| 361 | - if ($globalTransaction) $this->db->commit(); |
|
| 409 | + if ($globalTransaction) { |
|
| 410 | + $this->db->commit(); |
|
| 411 | + } |
|
| 412 | + } |
|
| 413 | + if (isset($globalDebug) && $globalDebug) { |
|
| 414 | + echo "Done\n"; |
|
| 362 | 415 | } |
| 363 | - if (isset($globalDebug) && $globalDebug) echo "Done\n"; |
|
| 364 | 416 | |
| 365 | 417 | } |
| 366 | 418 | public function downloadMETAR($icao) { |
| 367 | 419 | global $globalMETARurl; |
| 368 | - if ($globalMETARurl == '') return array(); |
|
| 420 | + if ($globalMETARurl == '') { |
|
| 421 | + return array(); |
|
| 422 | + } |
|
| 369 | 423 | date_default_timezone_set("UTC"); |
| 370 | 424 | $Common = new Common(); |
| 371 | 425 | $url = str_replace('{icao}',$icao,$globalMETARurl); |
@@ -379,16 +433,24 @@ discard block |
||
| 379 | 433 | if ($line != '') { |
| 380 | 434 | //$this->parse($line); |
| 381 | 435 | //echo $line; |
| 382 | - if ($date == '') $date = date('Y/m/d H:m'); |
|
| 436 | + if ($date == '') { |
|
| 437 | + $date = date('Y/m/d H:m'); |
|
| 438 | + } |
|
| 383 | 439 | $pos = 0; |
| 384 | 440 | $pieces = preg_split('/\s/',$line); |
| 385 | - if ($pieces[0] == 'METAR') $pos++; |
|
| 386 | - if (strlen($pieces[$pos]) != 4) $pos++; |
|
| 441 | + if ($pieces[0] == 'METAR') { |
|
| 442 | + $pos++; |
|
| 443 | + } |
|
| 444 | + if (strlen($pieces[$pos]) != 4) { |
|
| 445 | + $pos++; |
|
| 446 | + } |
|
| 387 | 447 | $location = $pieces[$pos]; |
| 388 | 448 | if (strlen($location == 4)) { |
| 389 | 449 | $this->addMETAR($location,$line,$date); |
| 390 | 450 | return array('0' => array('metar_date' => $date, 'metar_location' => $location, 'metar' => $line)); |
| 391 | - } else return array(); |
|
| 451 | + } else { |
|
| 452 | + return array(); |
|
| 453 | + } |
|
| 392 | 454 | } |
| 393 | 455 | //echo $line."\n"; |
| 394 | 456 | } |
@@ -382,7 +382,9 @@ discard block |
||
| 382 | 382 | if (isset($globalTimezone)) |
| 383 | 383 | { |
| 384 | 384 | date_default_timezone_set($globalTimezone); |
| 385 | - } else date_default_timezone_set('UTC'); |
|
| 385 | + } else { |
|
| 386 | + date_default_timezone_set('UTC'); |
|
| 387 | + } |
|
| 386 | 388 | if ($showSpecial === true) |
| 387 | 389 | { |
| 388 | 390 | print '<tr class="special">'."\n"; |
@@ -397,7 +399,9 @@ discard block |
||
| 397 | 399 | print '<tr class="active">'; |
| 398 | 400 | } elseif (isset($spotter_item['spotted_registration'])) { |
| 399 | 401 | print '<tr class="info">'; |
| 400 | - } else print '<tr>'; |
|
| 402 | + } else { |
|
| 403 | + print '<tr>'; |
|
| 404 | + } |
|
| 401 | 405 | } |
| 402 | 406 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive" || strtolower($current_page) == "currently" || strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") { |
| 403 | 407 | if ($spotter_item['image_thumbnail'] != "") |
@@ -405,8 +409,9 @@ discard block |
||
| 405 | 409 | print '<td class="aircraft_thumbnail">'."\n"; |
| 406 | 410 | |
| 407 | 411 | if ($spotter_item['image_source'] == 'planespotters') { |
| 408 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
| 409 | - else { |
|
| 412 | + if ($spotter_item['image_source_website'] != '') { |
|
| 413 | + $image_src = $spotter_item['image_source_website']; |
|
| 414 | + } else { |
|
| 410 | 415 | $planespotter_url_array = explode("_", $spotter_item['image']); |
| 411 | 416 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 412 | 417 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -419,7 +424,9 @@ discard block |
||
| 419 | 424 | } else { |
| 420 | 425 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 421 | 426 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 422 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 427 | + } else { |
|
| 428 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 429 | + } |
|
| 423 | 430 | if (isset($spotter_item['airline_name'])) { |
| 424 | 431 | 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>'; |
| 425 | 432 | } else { |
@@ -441,8 +448,9 @@ discard block |
||
| 441 | 448 | print '<td class="aircraft_thumbnail">'."\n"; |
| 442 | 449 | //print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
| 443 | 450 | if ($spotter_item['image_source'] == 'planespotters') { |
| 444 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
| 445 | - else { |
|
| 451 | + if ($spotter_item['image_source_website'] != '') { |
|
| 452 | + $image_src = $spotter_item['image_source_website']; |
|
| 453 | + } else { |
|
| 446 | 454 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
| 447 | 455 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 448 | 456 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -459,7 +467,9 @@ discard block |
||
| 459 | 467 | } else { |
| 460 | 468 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 461 | 469 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 462 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 470 | + } else { |
|
| 471 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 472 | + } |
|
| 463 | 473 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
| 464 | 474 | 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>'; |
| 465 | 475 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -546,15 +556,21 @@ discard block |
||
| 546 | 556 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
| 547 | 557 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 548 | 558 | $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
| 549 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 559 | + } else { |
|
| 560 | + $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 561 | + } |
|
| 550 | 562 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 551 | 563 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
| 552 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 564 | + } else { |
|
| 565 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 566 | + } |
|
| 553 | 567 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
| 554 | 568 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
| 555 | 569 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 556 | 570 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
| 557 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 571 | + } else { |
|
| 572 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 573 | + } |
|
| 558 | 574 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
| 559 | 575 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
| 560 | 576 | if ($spotter_item['departure_airport_time'] > 2460) { |
@@ -576,7 +592,9 @@ discard block |
||
| 576 | 592 | $longitude = $spotter_item['longitude']; |
| 577 | 593 | } |
| 578 | 594 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
| 579 | - } else $distance = ''; |
|
| 595 | + } else { |
|
| 596 | + $distance = ''; |
|
| 597 | + } |
|
| 580 | 598 | if ($distance != '') { |
| 581 | 599 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 582 | 600 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -601,7 +619,9 @@ discard block |
||
| 601 | 619 | } else { |
| 602 | 620 | if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) { |
| 603 | 621 | print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n"; |
| 604 | - if (!isset($Spotter)) $Spotter = new Spotter(); |
|
| 622 | + if (!isset($Spotter)) { |
|
| 623 | + $Spotter = new Spotter(); |
|
| 624 | + } |
|
| 605 | 625 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']); |
| 606 | 626 | print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n"; |
| 607 | 627 | print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n"; |
@@ -617,20 +637,28 @@ discard block |
||
| 617 | 637 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
| 618 | 638 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 619 | 639 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
| 620 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 640 | + } else { |
|
| 641 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 642 | + } |
|
| 621 | 643 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 622 | 644 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
| 623 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 645 | + } else { |
|
| 646 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 647 | + } |
|
| 624 | 648 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
| 625 | 649 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
| 626 | 650 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 627 | 651 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
| 628 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 652 | + } else { |
|
| 653 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 654 | + } |
|
| 629 | 655 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
| 630 | 656 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
| 631 | 657 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 632 | 658 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
| 633 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 659 | + } else { |
|
| 660 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 661 | + } |
|
| 634 | 662 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
| 635 | 663 | } |
| 636 | 664 | if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
@@ -643,7 +671,9 @@ discard block |
||
| 643 | 671 | $longitude = $spotter_item['longitude']; |
| 644 | 672 | } |
| 645 | 673 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
| 646 | - } else $distance = ''; |
|
| 674 | + } else { |
|
| 675 | + $distance = ''; |
|
| 676 | + } |
|
| 647 | 677 | if ($distance != '') { |
| 648 | 678 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 649 | 679 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -12,8 +12,12 @@ |
||
| 12 | 12 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 13 | 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 != '') { |
|
| 16 | + $filter = array_merge($filter,array('year' => $year)); |
|
| 17 | +} |
|
| 18 | +if ($month != '') { |
|
| 19 | + $filter = array_merge($filter,array('month' => $month)); |
|
| 20 | +} |
|
| 17 | 21 | if ($sort != '') { |
| 18 | 22 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
| 19 | 23 | } else { |
@@ -12,8 +12,12 @@ |
||
| 12 | 12 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 13 | 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 != '') { |
|
| 16 | + $filter = array_merge($filter,array('year' => $year)); |
|
| 17 | +} |
|
| 18 | +if ($month != '') { |
|
| 19 | + $filter = array_merge($filter,array('month' => $month)); |
|
| 20 | +} |
|
| 17 | 21 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
| 18 | 22 | |
| 19 | 23 | if (!empty($spotter_array)) |
@@ -12,8 +12,12 @@ |
||
| 12 | 12 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 13 | 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 != '') { |
|
| 16 | + $filter = array_merge($filter,array('year' => $year)); |
|
| 17 | +} |
|
| 18 | +if ($month != '') { |
|
| 19 | + $filter = array_merge($filter,array('month' => $month)); |
|
| 20 | +} |
|
| 17 | 21 | $spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", $sort,$filter); |
| 18 | 22 | |
| 19 | 23 | if (!empty($spotter_array)) |
@@ -12,8 +12,12 @@ |
||
| 12 | 12 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 13 | 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 != '') { |
|
| 16 | + $filter = array_merge($filter,array('year' => $year)); |
|
| 17 | +} |
|
| 18 | +if ($month != '') { |
|
| 19 | + $filter = array_merge($filter,array('month' => $month)); |
|
| 20 | +} |
|
| 17 | 21 | |
| 18 | 22 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
| 19 | 23 | |
@@ -12,8 +12,12 @@ |
||
| 12 | 12 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 13 | 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 != '') { |
|
| 16 | + $filter = array_merge($filter,array('year' => $year)); |
|
| 17 | +} |
|
| 18 | +if ($month != '') { |
|
| 19 | + $filter = array_merge($filter,array('month' => $month)); |
|
| 20 | +} |
|
| 17 | 21 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort, $filter); |
| 18 | 22 | |
| 19 | 23 | if (!empty($spotter_array)) |
@@ -12,8 +12,12 @@ |
||
| 12 | 12 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 13 | 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 != '') { |
|
| 16 | + $filter = array_merge($filter,array('year' => $year)); |
|
| 17 | +} |
|
| 18 | +if ($month != '') { |
|
| 19 | + $filter = array_merge($filter,array('month' => $month)); |
|
| 20 | +} |
|
| 17 | 21 | if ($sort != '') { |
| 18 | 22 | $spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", $sort,$filter); |
| 19 | 23 | } else { |
@@ -12,8 +12,12 @@ |
||
| 12 | 12 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 13 | 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 != '') { |
|
| 16 | + $filter = array_merge($filter,array('year' => $year)); |
|
| 17 | +} |
|
| 18 | +if ($month != '') { |
|
| 19 | + $filter = array_merge($filter,array('month' => $month)); |
|
| 20 | +} |
|
| 17 | 21 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
| 18 | 22 | |
| 19 | 23 | if (!empty($spotter_array)) |