|
@@ 2077-2100 (lines=24) @@
|
| 2074 |
|
* @return Array aircraft information |
| 2075 |
|
* |
| 2076 |
|
*/ |
| 2077 |
|
public function getAircraftInfoByRegistration($registration) |
| 2078 |
|
{ |
| 2079 |
|
$registration = filter_var($registration,FILTER_SANITIZE_STRING); |
| 2080 |
|
|
| 2081 |
|
$query = "SELECT spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer, spotter_output.airline_icao FROM spotter_output WHERE spotter_output.registration = :registration"; |
| 2082 |
|
|
| 2083 |
|
$sth = $this->db->prepare($query); |
| 2084 |
|
$sth->execute(array(':registration' => $registration)); |
| 2085 |
|
|
| 2086 |
|
$aircraft_array = array(); |
| 2087 |
|
$temp_array = array(); |
| 2088 |
|
|
| 2089 |
|
while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 2090 |
|
{ |
| 2091 |
|
$temp_array['airline_icao'] = $row['airline_icao']; |
| 2092 |
|
$temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 2093 |
|
$temp_array['aircraft_name'] = $row['aircraft_name']; |
| 2094 |
|
$temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 2095 |
|
|
| 2096 |
|
$aircraft_array[] = $temp_array; |
| 2097 |
|
} |
| 2098 |
|
|
| 2099 |
|
return $aircraft_array; |
| 2100 |
|
} |
| 2101 |
|
|
| 2102 |
|
/** |
| 2103 |
|
* Gets the aircraft owner & base based on the aircraft registration |
|
@@ 3422-3450 (lines=29) @@
|
| 3419 |
|
* @return Array the airline list |
| 3420 |
|
* |
| 3421 |
|
*/ |
| 3422 |
|
public function countAllAirlinesByAircraft($aircraft_icao) |
| 3423 |
|
{ |
| 3424 |
|
$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
| 3425 |
|
|
| 3426 |
|
$query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
| 3427 |
|
FROM spotter_output |
| 3428 |
|
WHERE spotter_output.airline_name <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 3429 |
|
GROUP BY spotter_output.airline_name |
| 3430 |
|
ORDER BY airline_count DESC"; |
| 3431 |
|
|
| 3432 |
|
|
| 3433 |
|
$sth = $this->db->prepare($query); |
| 3434 |
|
$sth->execute(array(':aircraft_icao' => $aircraft_icao)); |
| 3435 |
|
|
| 3436 |
|
$airline_array = array(); |
| 3437 |
|
$temp_array = array(); |
| 3438 |
|
|
| 3439 |
|
while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3440 |
|
{ |
| 3441 |
|
$temp_array['airline_name'] = $row['airline_name']; |
| 3442 |
|
$temp_array['airline_icao'] = $row['airline_icao']; |
| 3443 |
|
$temp_array['airline_count'] = $row['airline_count']; |
| 3444 |
|
$temp_array['airline_country'] = $row['airline_country']; |
| 3445 |
|
|
| 3446 |
|
$airline_array[] = $temp_array; |
| 3447 |
|
} |
| 3448 |
|
|
| 3449 |
|
return $airline_array; |
| 3450 |
|
} |
| 3451 |
|
|
| 3452 |
|
|
| 3453 |
|
/** |
|
@@ 3496-3523 (lines=28) @@
|
| 3493 |
|
* @return Array the airline list |
| 3494 |
|
* |
| 3495 |
|
*/ |
| 3496 |
|
public function countAllAirlinesByAirport($airport_icao) |
| 3497 |
|
{ |
| 3498 |
|
$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
| 3499 |
|
|
| 3500 |
|
$query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
| 3501 |
|
FROM spotter_output |
| 3502 |
|
WHERE spotter_output.airline_name <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao ) |
| 3503 |
|
GROUP BY spotter_output.airline_name |
| 3504 |
|
ORDER BY airline_count DESC"; |
| 3505 |
|
|
| 3506 |
|
|
| 3507 |
|
$sth = $this->db->prepare($query); |
| 3508 |
|
$sth->execute(array(':airport_icao' => $airport_icao)); |
| 3509 |
|
|
| 3510 |
|
$airline_array = array(); |
| 3511 |
|
$temp_array = array(); |
| 3512 |
|
|
| 3513 |
|
while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3514 |
|
{ |
| 3515 |
|
$temp_array['airline_name'] = $row['airline_name']; |
| 3516 |
|
$temp_array['airline_icao'] = $row['airline_icao']; |
| 3517 |
|
$temp_array['airline_count'] = $row['airline_count']; |
| 3518 |
|
$temp_array['airline_country'] = $row['airline_country']; |
| 3519 |
|
|
| 3520 |
|
$airline_array[] = $temp_array; |
| 3521 |
|
} |
| 3522 |
|
return $airline_array; |
| 3523 |
|
} |
| 3524 |
|
|
| 3525 |
|
|
| 3526 |
|
/** |
|
@@ 3567-3593 (lines=27) @@
|
| 3564 |
|
* @return Array the airline list |
| 3565 |
|
* |
| 3566 |
|
*/ |
| 3567 |
|
public function countAllAirlinesByManufacturer($aircraft_manufacturer) |
| 3568 |
|
{ |
| 3569 |
|
$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
| 3570 |
|
|
| 3571 |
|
$query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
| 3572 |
|
FROM spotter_output |
| 3573 |
|
WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 3574 |
|
GROUP BY spotter_output.airline_name |
| 3575 |
|
ORDER BY airline_count DESC"; |
| 3576 |
|
|
| 3577 |
|
$sth = $this->db->prepare($query); |
| 3578 |
|
$sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
| 3579 |
|
|
| 3580 |
|
$airline_array = array(); |
| 3581 |
|
$temp_array = array(); |
| 3582 |
|
|
| 3583 |
|
while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3584 |
|
{ |
| 3585 |
|
$temp_array['airline_name'] = $row['airline_name']; |
| 3586 |
|
$temp_array['airline_icao'] = $row['airline_icao']; |
| 3587 |
|
$temp_array['airline_count'] = $row['airline_count']; |
| 3588 |
|
$temp_array['airline_country'] = $row['airline_country']; |
| 3589 |
|
|
| 3590 |
|
$airline_array[] = $temp_array; |
| 3591 |
|
} |
| 3592 |
|
return $airline_array; |
| 3593 |
|
} |
| 3594 |
|
|
| 3595 |
|
|
| 3596 |
|
|
|
@@ 3735-3762 (lines=28) @@
|
| 3732 |
|
* @return Array the airline list |
| 3733 |
|
* |
| 3734 |
|
*/ |
| 3735 |
|
public function countAllAirlinesByIdent($ident) |
| 3736 |
|
{ |
| 3737 |
|
$ident = filter_var($ident,FILTER_SANITIZE_STRING); |
| 3738 |
|
|
| 3739 |
|
$query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
| 3740 |
|
FROM spotter_output |
| 3741 |
|
WHERE spotter_output.ident = :ident |
| 3742 |
|
GROUP BY spotter_output.airline_name |
| 3743 |
|
ORDER BY airline_count DESC"; |
| 3744 |
|
|
| 3745 |
|
|
| 3746 |
|
$sth = $this->db->prepare($query); |
| 3747 |
|
$sth->execute(array(':ident' => $ident)); |
| 3748 |
|
|
| 3749 |
|
$airline_array = array(); |
| 3750 |
|
$temp_array = array(); |
| 3751 |
|
|
| 3752 |
|
while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3753 |
|
{ |
| 3754 |
|
$temp_array['airline_name'] = $row['airline_name']; |
| 3755 |
|
$temp_array['airline_icao'] = $row['airline_icao']; |
| 3756 |
|
$temp_array['airline_count'] = $row['airline_count']; |
| 3757 |
|
$temp_array['airline_country'] = $row['airline_country']; |
| 3758 |
|
|
| 3759 |
|
$airline_array[] = $temp_array; |
| 3760 |
|
} |
| 3761 |
|
return $airline_array; |
| 3762 |
|
} |
| 3763 |
|
|
| 3764 |
|
/** |
| 3765 |
|
* Gets all airlines that have flown over by route |
|
@@ 3842-3868 (lines=27) @@
|
| 3839 |
|
* @return Array the airline list |
| 3840 |
|
* |
| 3841 |
|
*/ |
| 3842 |
|
public function countAllAirlinesByCountry($country) |
| 3843 |
|
{ |
| 3844 |
|
$country = filter_var($country,FILTER_SANITIZE_STRING); |
| 3845 |
|
|
| 3846 |
|
$query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
| 3847 |
|
FROM spotter_output |
| 3848 |
|
WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 3849 |
|
GROUP BY spotter_output.airline_name |
| 3850 |
|
ORDER BY airline_count DESC"; |
| 3851 |
|
|
| 3852 |
|
|
| 3853 |
|
$sth = $this->db->prepare($query); |
| 3854 |
|
$sth->execute(array(':country' => $country)); |
| 3855 |
|
|
| 3856 |
|
$airline_array = array(); |
| 3857 |
|
$temp_array = array(); |
| 3858 |
|
while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3859 |
|
{ |
| 3860 |
|
$temp_array['airline_name'] = $row['airline_name']; |
| 3861 |
|
$temp_array['airline_icao'] = $row['airline_icao']; |
| 3862 |
|
$temp_array['airline_count'] = $row['airline_count']; |
| 3863 |
|
$temp_array['airline_country'] = $row['airline_country']; |
| 3864 |
|
|
| 3865 |
|
$airline_array[] = $temp_array; |
| 3866 |
|
} |
| 3867 |
|
return $airline_array; |
| 3868 |
|
} |
| 3869 |
|
|
| 3870 |
|
|
| 3871 |
|
/** |