@@ -9,22 +9,22 @@ discard block |
||
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
14 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
15 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
14 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
15 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
18 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
19 | 19 | $archive = false; |
20 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort, $filter); |
|
20 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
21 | 21 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
22 | 22 | $archive = true; |
23 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort, $filter); |
|
23 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
24 | 24 | } |
25 | 25 | if (!empty($spotter_array)) |
26 | 26 | { |
27 | - $title = sprintf(_("Most Common Arrival Airports by Country of %s"),$spotter_array[0]['aircraft_owner']); |
|
27 | + $title = sprintf(_("Most Common Arrival Airports by Country of %s"), $spotter_array[0]['aircraft_owner']); |
|
28 | 28 | require_once('header.php'); |
29 | 29 | print '<div class="info column">'; |
30 | 30 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | include('owner-sub-menu.php'); |
36 | 36 | print '<div class="column">'; |
37 | 37 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
38 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
38 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
39 | 39 | if ($archive === false) { |
40 | - $airport_country_array = $Spotter->countAllArrivalAirportCountriesByOwner($owner,$filter); |
|
40 | + $airport_country_array = $Spotter->countAllArrivalAirportCountriesByOwner($owner, $filter); |
|
41 | 41 | } else { |
42 | - $airport_country_array = $SpotterArchive->countAllArrivalAirportCountriesByOwner($owner,$filter); |
|
42 | + $airport_country_array = $SpotterArchive->countAllArrivalAirportCountriesByOwner($owner, $filter); |
|
43 | 43 | } |
44 | 44 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
45 | 45 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
48 | 48 | print 'var series = ['; |
49 | 49 | $country_data = ''; |
50 | - foreach($airport_country_array as $airport_item) |
|
50 | + foreach ($airport_country_array as $airport_item) |
|
51 | 51 | { |
52 | 52 | $country_data .= '[ "'.$airport_item['airport_arrival_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
53 | 53 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | print '</thead>'; |
95 | 95 | print '<tbody>'; |
96 | 96 | $i = 1; |
97 | - foreach($airport_country_array as $airport_item) |
|
97 | + foreach ($airport_country_array as $airport_item) |
|
98 | 98 | { |
99 | 99 | print '<tr>'; |
100 | 100 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -14,8 +14,12 @@ |
||
14 | 14 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
15 | 15 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') { |
|
18 | + $filter = array_merge($filter,array('year' => $year)); |
|
19 | +} |
|
20 | +if ($month != '') { |
|
21 | + $filter = array_merge($filter,array('month' => $month)); |
|
22 | +} |
|
19 | 23 | $archive = false; |
20 | 24 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort, $filter); |
21 | 25 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.SpotterArchive.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['owner'])) { |
7 | - header('Location: '.$globalURL.'/owner'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/owner'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
@@ -9,23 +9,23 @@ discard block |
||
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
14 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
15 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
14 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
15 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
18 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
19 | 19 | $archive = false; |
20 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
20 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
21 | 21 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
22 | 22 | $archive = true; |
23 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
23 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | if (!empty($spotter_array)) |
27 | 27 | { |
28 | - $title = sprintf(_("Most Common Aircraft of %s"),$spotter_array[0]['aircraft_owner']); |
|
28 | + $title = sprintf(_("Most Common Aircraft of %s"), $spotter_array[0]['aircraft_owner']); |
|
29 | 29 | require_once('header.php'); |
30 | 30 | print '<div class="info column">'; |
31 | 31 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | include('owner-sub-menu.php'); |
37 | 37 | print '<div class="column">'; |
38 | 38 | print '<h2>'._("Most Common Aircraft").'</h2>'; |
39 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
39 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
40 | 40 | |
41 | 41 | if ($archive === false) { |
42 | - $aircraft_array = $Spotter->countAllAircraftTypesByOwner($owner,$filter); |
|
42 | + $aircraft_array = $Spotter->countAllAircraftTypesByOwner($owner, $filter); |
|
43 | 43 | } else { |
44 | - $aircraft_array = $SpotterArchive->countAllAircraftTypesByOwner($owner,$filter); |
|
44 | + $aircraft_array = $SpotterArchive->countAllAircraftTypesByOwner($owner, $filter); |
|
45 | 45 | } |
46 | 46 | if (!empty($aircraft_array)) |
47 | 47 | { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | print '</thead>'; |
55 | 55 | print '<tbody>'; |
56 | 56 | $i = 1; |
57 | - foreach($aircraft_array as $aircraft_item) |
|
57 | + foreach ($aircraft_array as $aircraft_item) |
|
58 | 58 | { |
59 | 59 | print '<tr>'; |
60 | 60 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.SpotterArchive.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['owner'])) { |
7 | - header('Location: '.$globalURL.'/owner'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/owner'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
@@ -14,8 +14,12 @@ |
||
14 | 14 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
15 | 15 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') { |
|
18 | + $filter = array_merge($filter,array('year' => $year)); |
|
19 | +} |
|
20 | +if ($month != '') { |
|
21 | + $filter = array_merge($filter,array('month' => $month)); |
|
22 | +} |
|
19 | 23 | $archive = false; |
20 | 24 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
21 | 25 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | //require_once('require/class.SpotterLive.php'); |
8 | 8 | require_once('require/class.SpotterArchive.php'); |
9 | 9 | |
10 | -if (!isset($_GET['owner'])){ |
|
10 | +if (!isset($_GET['owner'])) { |
|
11 | 11 | header('Location: '.$globalURL.''); |
12 | 12 | } else { |
13 | 13 | $Spotter = new Spotter(); |
14 | 14 | $SpotterArchive = new SpotterArchive(); |
15 | 15 | //$Translation = new Translation(); |
16 | 16 | //calculuation for the pagination |
17 | - if(!isset($_GET['limit'])) |
|
17 | + if (!isset($_GET['limit'])) |
|
18 | 18 | { |
19 | 19 | $limit_start = 0; |
20 | 20 | $limit_end = 25; |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | } else { |
23 | 23 | $limit_explode = explode(",", $_GET['limit']); |
24 | 24 | if (isset($limit_explode[1])) { |
25 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
26 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
25 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
26 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
27 | 27 | } else { |
28 | 28 | $limit_start = 0; |
29 | 29 | $limit_end = 25; |
@@ -40,21 +40,21 @@ discard block |
||
40 | 40 | |
41 | 41 | $page_url = $globalURL.'/owner/'.$_GET['owner']; |
42 | 42 | |
43 | - $owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
44 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
45 | - $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
46 | - $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
43 | + $owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
44 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
45 | + $year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
46 | + $month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
47 | 47 | $filter = array(); |
48 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
49 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
50 | - $spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter); |
|
48 | + if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
49 | + if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
50 | + $spotter_array = $Spotter->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort, $filter); |
|
51 | 51 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
52 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter); |
|
52 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, $limit_start.",".$absolute_difference, $sort, $filter); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | if (!empty($spotter_array)) |
56 | 56 | { |
57 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']); |
|
57 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['aircraft_owner']); |
|
58 | 58 | //$ident = $spotter_array[0]['ident']; |
59 | 59 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
60 | 60 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -65,23 +65,23 @@ discard block |
||
65 | 65 | $Stats = new Stats(); |
66 | 66 | if ($year == '' && $month == '') $flights = $Stats->getStatsOwner($owner); |
67 | 67 | else $flights = 0; |
68 | - if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner,$filter); |
|
68 | + if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner, $filter); |
|
69 | 69 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
70 | - $aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner,$filter)); |
|
70 | + $aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner, $filter)); |
|
71 | 71 | print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>'; |
72 | - $aircraft_registration = count($Spotter->countAllAircraftRegistrationByOwner($owner,$filter)); |
|
72 | + $aircraft_registration = count($Spotter->countAllAircraftRegistrationByOwner($owner, $filter)); |
|
73 | 73 | print '<div><span class="label">'._("Aircraft").'</span>'.$aircraft_registration.'</div>'; |
74 | - $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByOwner($owner,$filter)); |
|
74 | + $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByOwner($owner, $filter)); |
|
75 | 75 | print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>'; |
76 | - $airlines = count($Spotter->countAllAirlinesByOwner($owner,$filter)); |
|
76 | + $airlines = count($Spotter->countAllAirlinesByOwner($owner, $filter)); |
|
77 | 77 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
78 | - $duration = $Spotter->getFlightDurationByOwner($owner,$filter); |
|
78 | + $duration = $Spotter->getFlightDurationByOwner($owner, $filter); |
|
79 | 79 | if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
80 | 80 | print '</div>'; |
81 | 81 | |
82 | 82 | include('owner-sub-menu.php'); |
83 | 83 | print '<div class="table column">'; |
84 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
84 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the owner <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
85 | 85 | |
86 | 86 | include('table-output.php'); |
87 | 87 | print '<div class="pagination">'; |
@@ -45,8 +45,12 @@ discard block |
||
45 | 45 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
46 | 46 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
47 | 47 | $filter = array(); |
48 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
49 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
48 | + if ($year != '') { |
|
49 | + $filter = array_merge($filter,array('year' => $year)); |
|
50 | + } |
|
51 | + if ($month != '') { |
|
52 | + $filter = array_merge($filter,array('month' => $month)); |
|
53 | + } |
|
50 | 54 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter); |
51 | 55 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
52 | 56 | $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter); |
@@ -56,16 +60,25 @@ discard block |
||
56 | 60 | { |
57 | 61 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']); |
58 | 62 | //$ident = $spotter_array[0]['ident']; |
59 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
60 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
63 | + if (isset($spotter_array[0]['latitude'])) { |
|
64 | + $latitude = $spotter_array[0]['latitude']; |
|
65 | + } |
|
66 | + if (isset($spotter_array[0]['longitude'])) { |
|
67 | + $longitude = $spotter_array[0]['longitude']; |
|
68 | + } |
|
61 | 69 | require_once('header.php'); |
62 | 70 | print '<div class="info column">'; |
63 | 71 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
64 | 72 | //print '<div><span class="label">'._("Owner").'</span>'.$spotter_array[0]['aircraft_owner'].'</div>'; |
65 | 73 | $Stats = new Stats(); |
66 | - if ($year == '' && $month == '') $flights = $Stats->getStatsOwner($owner); |
|
67 | - else $flights = 0; |
|
68 | - if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner,$filter); |
|
74 | + if ($year == '' && $month == '') { |
|
75 | + $flights = $Stats->getStatsOwner($owner); |
|
76 | + } else { |
|
77 | + $flights = 0; |
|
78 | + } |
|
79 | + if ($flights == 0) { |
|
80 | + $flights = $Spotter->countFlightsByOwner($owner,$filter); |
|
81 | + } |
|
69 | 82 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
70 | 83 | $aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner,$filter)); |
71 | 84 | print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>'; |
@@ -76,7 +89,9 @@ discard block |
||
76 | 89 | $airlines = count($Spotter->countAllAirlinesByOwner($owner,$filter)); |
77 | 90 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
78 | 91 | $duration = $Spotter->getFlightDurationByOwner($owner,$filter); |
79 | - if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
92 | + if ($duration != '0') { |
|
93 | + print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
94 | + } |
|
80 | 95 | print '</div>'; |
81 | 96 | |
82 | 97 | include('owner-sub-menu.php'); |
@@ -9,22 +9,22 @@ discard block |
||
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
14 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
15 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
14 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
15 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
18 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
19 | 19 | $archive = false; |
20 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
20 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
21 | 21 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
22 | 22 | $archive = true; |
23 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
23 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
24 | 24 | } |
25 | 25 | if (!empty($spotter_array)) |
26 | 26 | { |
27 | - $title = sprintf(_("Most Common Arrival Airports of %s"),$spotter_array[0]['aircraft_owner']); |
|
27 | + $title = sprintf(_("Most Common Arrival Airports of %s"), $spotter_array[0]['aircraft_owner']); |
|
28 | 28 | require_once('header.php'); |
29 | 29 | print '<div class="info column">'; |
30 | 30 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | include('owner-sub-menu.php'); |
36 | 36 | print '<div class="column">'; |
37 | 37 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
38 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
38 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
39 | 39 | if ($archive === false) { |
40 | - $airport_airport_array = $Spotter->countAllArrivalAirportsByOwner($owner,$filter); |
|
40 | + $airport_airport_array = $Spotter->countAllArrivalAirportsByOwner($owner, $filter); |
|
41 | 41 | } else { |
42 | - $airport_airport_array = $SpotterArchive->countAllArrivalAirportsByOwner($owner,$filter); |
|
42 | + $airport_airport_array = $SpotterArchive->countAllArrivalAirportsByOwner($owner, $filter); |
|
43 | 43 | } |
44 | 44 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
45 | 45 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | print '<script>'; |
49 | 49 | print 'var series = ['; |
50 | 50 | $airport_data = ''; |
51 | - foreach($airport_airport_array as $airport_item) |
|
51 | + foreach ($airport_airport_array as $airport_item) |
|
52 | 52 | { |
53 | 53 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_name'].' ('.$airport_item['airport_arrival_icao'].')",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
54 | 54 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | print '</thead>'; |
104 | 104 | print '<tbody>'; |
105 | 105 | $i = 1; |
106 | - foreach($airport_airport_array as $airport_item) |
|
106 | + foreach ($airport_airport_array as $airport_item) |
|
107 | 107 | { |
108 | 108 | print '<tr>'; |
109 | 109 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.SpotterArchive.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['owner'])) { |
7 | - header('Location: '.$globalURL.'/owner'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/owner'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
@@ -14,8 +14,12 @@ |
||
14 | 14 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
15 | 15 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') { |
|
18 | + $filter = array_merge($filter,array('year' => $year)); |
|
19 | +} |
|
20 | +if ($month != '') { |
|
21 | + $filter = array_merge($filter,array('month' => $month)); |
|
22 | +} |
|
19 | 23 | $archive = false; |
20 | 24 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
21 | 25 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
@@ -9,22 +9,22 @@ discard block |
||
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
14 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
15 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
14 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
15 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
18 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
19 | 19 | $archive = false; |
20 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
20 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
21 | 21 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
22 | 22 | $archive = true; |
23 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
23 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
24 | 24 | } |
25 | 25 | if (!empty($spotter_array)) |
26 | 26 | { |
27 | - $title = sprintf(_("Most Common Routes of %s"),$spotter_array[0]['aircraft_owner']); |
|
27 | + $title = sprintf(_("Most Common Routes of %s"), $spotter_array[0]['aircraft_owner']); |
|
28 | 28 | require_once('header.php'); |
29 | 29 | print '<div class="info column">'; |
30 | 30 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | include('owner-sub-menu.php'); |
36 | 36 | print '<div class="column">'; |
37 | 37 | print '<h2>'._("Most Common Routes").'</h2>'; |
38 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from flights owner by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
38 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from flights owner by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
39 | 39 | if ($archive === false) { |
40 | - $route_array = $Spotter->countAllRoutesByOwner($owner,$filter); |
|
40 | + $route_array = $Spotter->countAllRoutesByOwner($owner, $filter); |
|
41 | 41 | } else { |
42 | - $route_array = $SpotterArchive->countAllRoutesByOwner($owner,$filter); |
|
42 | + $route_array = $SpotterArchive->countAllRoutesByOwner($owner, $filter); |
|
43 | 43 | } |
44 | 44 | if (!empty($route_array)) |
45 | 45 | { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | print '</thead>'; |
56 | 56 | print '<tbody>'; |
57 | 57 | $i = 1; |
58 | - foreach($route_array as $route_item) |
|
58 | + foreach ($route_array as $route_item) |
|
59 | 59 | { |
60 | 60 | print '<tr>'; |
61 | 61 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.SpotterArchive.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['owner'])) { |
7 | - header('Location: '.$globalURL.'/owner'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/owner'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
@@ -14,8 +14,12 @@ |
||
14 | 14 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
15 | 15 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') { |
|
18 | + $filter = array_merge($filter,array('year' => $year)); |
|
19 | +} |
|
20 | +if ($month != '') { |
|
21 | + $filter = array_merge($filter,array('month' => $month)); |
|
22 | +} |
|
19 | 23 | $archive = false; |
20 | 24 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
21 | 25 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
@@ -9,21 +9,21 @@ discard block |
||
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
14 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
15 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
14 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
15 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
18 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
19 | 19 | $archive = false; |
20 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
20 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
21 | 21 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
22 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
22 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
23 | 23 | } |
24 | 24 | if (!empty($spotter_array)) |
25 | 25 | { |
26 | - $title = sprintf(_("Most Common Aircraft Manufacturer of %s"),$spotter_array[0]['aircraft_owner']); |
|
26 | + $title = sprintf(_("Most Common Aircraft Manufacturer of %s"), $spotter_array[0]['aircraft_owner']); |
|
27 | 27 | require_once('header.php'); |
28 | 28 | print '<div class="info column">'; |
29 | 29 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | include('owner-sub-menu.php'); |
35 | 35 | print '<div class="column">'; |
36 | 36 | print '<h2>'._("Most Common Aircraft Manufacturer").'</h2>'; |
37 | - print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
37 | + print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
38 | 38 | |
39 | 39 | if ($archive === false) { |
40 | - $manufacturers_array = $Spotter->countAllAircraftManufacturerByOwner($owner,$filter); |
|
40 | + $manufacturers_array = $Spotter->countAllAircraftManufacturerByOwner($owner, $filter); |
|
41 | 41 | } else { |
42 | - $manufacturers_array = $SpotterArchive->countAllAircraftManufacturerByOwner($owner,$filter); |
|
42 | + $manufacturers_array = $SpotterArchive->countAllAircraftManufacturerByOwner($owner, $filter); |
|
43 | 43 | } |
44 | 44 | if (!empty($manufacturers_array)) |
45 | 45 | { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | print '</thead>'; |
54 | 54 | print '<tbody>'; |
55 | 55 | $i = 1; |
56 | - foreach($manufacturers_array as $manufacturer_item) |
|
56 | + foreach ($manufacturers_array as $manufacturer_item) |
|
57 | 57 | { |
58 | 58 | print '<tr>'; |
59 | 59 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.SpotterArchive.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['owner'])) { |
7 | - header('Location: '.$globalURL.'/owner'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/owner'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
@@ -14,8 +14,12 @@ |
||
14 | 14 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
15 | 15 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') { |
|
18 | + $filter = array_merge($filter,array('year' => $year)); |
|
19 | +} |
|
20 | +if ($month != '') { |
|
21 | + $filter = array_merge($filter,array('month' => $month)); |
|
22 | +} |
|
19 | 23 | $archive = false; |
20 | 24 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
21 | 25 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
@@ -9,22 +9,22 @@ discard block |
||
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
14 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
15 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
14 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
15 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
18 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
19 | 19 | $archive = false; |
20 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
20 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
21 | 21 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
22 | 22 | $archive = true; |
23 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
23 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
24 | 24 | } |
25 | 25 | if (!empty($spotter_array)) |
26 | 26 | { |
27 | - $title = sprintf(_("Most Common Departure Airports by Owner of %s"),$spotter_array[0]['aircraft_owner']); |
|
27 | + $title = sprintf(_("Most Common Departure Airports by Owner of %s"), $spotter_array[0]['aircraft_owner']); |
|
28 | 28 | require_once('header.php'); |
29 | 29 | print '<div class="info column">'; |
30 | 30 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | include('owner-sub-menu.php'); |
35 | 35 | print '<div class="column">'; |
36 | 36 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
37 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
37 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
38 | 38 | if ($archive === false) { |
39 | - $airport_country_array = $Spotter->countAllDepartureAirportCountriesByOwner($owner,$filter); |
|
39 | + $airport_country_array = $Spotter->countAllDepartureAirportCountriesByOwner($owner, $filter); |
|
40 | 40 | } else { |
41 | - $airport_country_array = $SpotterArchive->countAllDepartureAirportCountriesByOwner($owner,$filter); |
|
41 | + $airport_country_array = $SpotterArchive->countAllDepartureAirportCountriesByOwner($owner, $filter); |
|
42 | 42 | } |
43 | 43 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
44 | 44 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
47 | 47 | print 'var series = ['; |
48 | 48 | $country_data = ''; |
49 | - foreach($airport_country_array as $airport_item) |
|
49 | + foreach ($airport_country_array as $airport_item) |
|
50 | 50 | { |
51 | 51 | $country_data .= '[ "'.$airport_item['airport_departure_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],'; |
52 | 52 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | print '</thead>'; |
94 | 94 | print '<tbody>'; |
95 | 95 | $i = 1; |
96 | - foreach($airport_country_array as $airport_item) |
|
96 | + foreach ($airport_country_array as $airport_item) |
|
97 | 97 | { |
98 | 98 | print '<tr>'; |
99 | 99 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.SpotterArchive.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['owner'])) { |
7 | - header('Location: '.$globalURL.'/owner'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/owner'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
@@ -14,8 +14,12 @@ |
||
14 | 14 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
15 | 15 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') { |
|
18 | + $filter = array_merge($filter,array('year' => $year)); |
|
19 | +} |
|
20 | +if ($month != '') { |
|
21 | + $filter = array_merge($filter,array('month' => $month)); |
|
22 | +} |
|
19 | 23 | $archive = false; |
20 | 24 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
21 | 25 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
@@ -9,22 +9,22 @@ discard block |
||
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
13 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
14 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
15 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
14 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
15 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
18 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
19 | 19 | $archive = false; |
20 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
20 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
21 | 21 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
22 | 22 | $archive = true; |
23 | - $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
23 | + $spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
24 | 24 | } |
25 | 25 | if (!empty($spotter_array)) |
26 | 26 | { |
27 | - $title = sprintf(_("Most Common Airlines of %s"),$spotter_array[0]['aircraft_owner']); |
|
27 | + $title = sprintf(_("Most Common Airlines of %s"), $spotter_array[0]['aircraft_owner']); |
|
28 | 28 | require_once('header.php'); |
29 | 29 | print '<div class="info column">'; |
30 | 30 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | include('owner-sub-menu.php'); |
36 | 36 | print '<div class="column">'; |
37 | 37 | print '<h2>'._("Most Common Airlines").'</h2>'; |
38 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
38 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
39 | 39 | |
40 | 40 | if ($archive === false) { |
41 | - $airline_array = $Spotter->countAllAirlinesByOwner($owner,$filter); |
|
41 | + $airline_array = $Spotter->countAllAirlinesByOwner($owner, $filter); |
|
42 | 42 | } else { |
43 | - $airline_array = $SpotterArchive->countAllAirlinesByOwner($owner,$filter); |
|
43 | + $airline_array = $SpotterArchive->countAllAirlinesByOwner($owner, $filter); |
|
44 | 44 | } |
45 | 45 | if (!empty($airline_array)) |
46 | 46 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | print '</thead>'; |
57 | 57 | print '<tbody>'; |
58 | 58 | $i = 1; |
59 | - foreach($airline_array as $airline_item) |
|
59 | + foreach ($airline_array as $airline_item) |
|
60 | 60 | { |
61 | 61 | print '<tr>'; |
62 | 62 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.SpotterArchive.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['owner'])) { |
7 | - header('Location: '.$globalURL.'/owner'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/owner'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $Spotter = new Spotter(); |
11 | 11 | $SpotterArchive = new SpotterArchive(); |
@@ -14,8 +14,12 @@ |
||
14 | 14 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
15 | 15 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
16 | 16 | $filter = array(); |
17 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
18 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | +if ($year != '') { |
|
18 | + $filter = array_merge($filter,array('year' => $year)); |
|
19 | +} |
|
20 | +if ($month != '') { |
|
21 | + $filter = array_merge($filter,array('month' => $month)); |
|
22 | +} |
|
19 | 23 | $archive = false; |
20 | 24 | $spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
21 | 25 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | public function buildcloudlayer($metar) { |
12 | 12 | //print_r($metar); |
13 | 13 | $result = array(); |
14 | - foreach($metar['cloud'] as $key => $data) { |
|
14 | + foreach ($metar['cloud'] as $key => $data) { |
|
15 | 15 | $alt_m = $metar['cloud'][$key]['level']; |
16 | 16 | $alt_ft = $alt_m*3.28084; |
17 | 17 | $pressure = $metar['QNH']; |
18 | - $cumulus_base = 122.0 * ($metar['temperature'] - $metar['dew']); |
|
19 | - $stratus_base = 100.0 * (100.0 * $metar['rh'])*0.3048; |
|
18 | + $cumulus_base = 122.0*($metar['temperature'] - $metar['dew']); |
|
19 | + $stratus_base = 100.0*(100.0*$metar['rh'])*0.3048; |
|
20 | 20 | $coverage_norm = 0.0; |
21 | 21 | if ($metar['cloud'][$key]['type'] == 'Few') { |
22 | 22 | $coverage_norm = 2.0/8.0; |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $layer_type = 'ns'; |
39 | 39 | } |
40 | 40 | } else { |
41 | - if ($cumulus_base * 0.80 < $alt_m && $cumulus_base * 1.20 > $alt_m) { |
|
41 | + if ($cumulus_base*0.80 < $alt_m && $cumulus_base*1.20 > $alt_m) { |
|
42 | 42 | $layer_type = 'cu'; |
43 | - } elseif ($stratus_base * 0.80 < $alt_m && $stratus_base * 1.40 > $alt_m) { |
|
43 | + } elseif ($stratus_base*0.80 < $alt_m && $stratus_base*1.40 > $alt_m) { |
|
44 | 44 | $layer_type = 'st'; |
45 | 45 | } else { |
46 | 46 | if ($alt_ft < 2000) { |
@@ -53,25 +53,25 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | //echo 'coverage norm : '.$coverage_norm.' - layer_type: '.$layer_type."\n"; |
56 | - $result[] = array('cov' => $coverage_norm, 'type' => $layer_type,'alt' => $alt_m,'rh' => $metar['rh']); |
|
56 | + $result[] = array('cov' => $coverage_norm, 'type' => $layer_type, 'alt' => $alt_m, 'rh' => $metar['rh']); |
|
57 | 57 | } |
58 | 58 | if (count($result) < 2 && $metar['rh'] > 60) { |
59 | - $result[] = array('cov' => 0.75, 'type' => 'ci','alt' => 4000,'rh' => $metar['rh']); |
|
59 | + $result[] = array('cov' => 0.75, 'type' => 'ci', 'alt' => 4000, 'rh' => $metar['rh']); |
|
60 | 60 | } |
61 | 61 | return $result; |
62 | 62 | } |
63 | 63 | |
64 | - public function openweathermap($latitude,$longitude) { |
|
64 | + public function openweathermap($latitude, $longitude) { |
|
65 | 65 | global $globalOpenWeatherMapKey; |
66 | 66 | if ($globalOpenWeatherMapKey == '') return array(); |
67 | 67 | $Common = new Common(); |
68 | 68 | $url = 'http://api.openweathermap.org/data/2.5/weather?lat='.$latitude.'&lon='.$longitude.'&units=metric&appid='.$globalOpenWeatherMapKey; |
69 | 69 | //echo $url."\n"; |
70 | - $weatherdata = json_decode($Common->getData($url),true); |
|
71 | - if (!isset($weatherdata['main']['temp']) || !isset($weatherdata['weather'][0]['id'])) return array('clouds' => array(),'rain' => array()); |
|
72 | - $dew = $weatherdata['main']['temp'] - ((100-$weatherdata['main']['humidity'])/5); |
|
73 | - $cumulus_base = 122.0 * ($weatherdata['main']['temp'] - $dew); |
|
74 | - $stratus_base = 100.0 * (100.0 * $weatherdata['main']['humidity'])*0.3048; |
|
70 | + $weatherdata = json_decode($Common->getData($url), true); |
|
71 | + if (!isset($weatherdata['main']['temp']) || !isset($weatherdata['weather'][0]['id'])) return array('clouds' => array(), 'rain' => array()); |
|
72 | + $dew = $weatherdata['main']['temp'] - ((100 - $weatherdata['main']['humidity'])/5); |
|
73 | + $cumulus_base = 122.0*($weatherdata['main']['temp'] - $dew); |
|
74 | + $stratus_base = 100.0*(100.0*$weatherdata['main']['humidity'])*0.3048; |
|
75 | 75 | $coverage_norm = 0.0; |
76 | 76 | if ($weatherdata['weather'][0]['id'] == 801) { |
77 | 77 | // few clouds |
@@ -87,19 +87,19 @@ discard block |
||
87 | 87 | $coverage_norm = 8.0/8.0; |
88 | 88 | } |
89 | 89 | $alt_m = 1000; |
90 | - if ($cumulus_base * 0.80 < $alt_m && $cumulus_base * 1.20 > $alt_m) { |
|
90 | + if ($cumulus_base*0.80 < $alt_m && $cumulus_base*1.20 > $alt_m) { |
|
91 | 91 | $layer_type = 'cu'; |
92 | - } elseif ($stratus_base * 0.80 < $alt_m && $stratus_base * 1.40 > $alt_m) { |
|
92 | + } elseif ($stratus_base*0.80 < $alt_m && $stratus_base*1.40 > $alt_m) { |
|
93 | 93 | $layer_type = 'st'; |
94 | 94 | } else { |
95 | 95 | $layer_type = 'st'; |
96 | 96 | } |
97 | 97 | $result = array(); |
98 | - $result[] = array('cov' => $coverage_norm, 'type' => $layer_type,'alt' => $alt_m,'rh' => $weatherdata['main']['humidity']); |
|
98 | + $result[] = array('cov' => $coverage_norm, 'type' => $layer_type, 'alt' => $alt_m, 'rh' => $weatherdata['main']['humidity']); |
|
99 | 99 | if ($weatherdata['main']['humidity'] > 60) { |
100 | - $result[] = array('cov' => 0.75, 'type' => 'ci','alt' => 4000,'rh' => $weatherdata['main']['humidity']); |
|
100 | + $result[] = array('cov' => 0.75, 'type' => 'ci', 'alt' => 4000, 'rh' => $weatherdata['main']['humidity']); |
|
101 | 101 | } |
102 | - return array('clouds' => $result,'rain' => array('tmp' => $weatherdata['main']['temp'],'rh' => $weatherdata['main']['humidity'])); |
|
102 | + return array('clouds' => $result, 'rain' => array('tmp' => $weatherdata['main']['temp'], 'rh' => $weatherdata['main']['humidity'])); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | public function nomad_wind($hour = '') { |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | |
118 | 118 | // http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p50.pl?file=gfs.t05z.pgrb2full.0p50.f000&lev_10_m_above_ground=on&lev_surface=on&var_TMP=on&var_UGRD=on&var_VGRD=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=/gfs.2017111717 |
119 | 119 | $resolution = '0.5'; |
120 | - $baseurl = 'http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_'.($resolution === '1' ? '1p00':'0p50').'.pl'; |
|
121 | - $get = array('file' => 'gfs.t'.sprintf('%02d',(6*floor($hour/6))).($resolution === '1' ? 'z.pgrb2.1p00.f000' : 'z.pgrb2full.0p50.f000'), |
|
120 | + $baseurl = 'http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_'.($resolution === '1' ? '1p00' : '0p50').'.pl'; |
|
121 | + $get = array('file' => 'gfs.t'.sprintf('%02d', (6*floor($hour/6))).($resolution === '1' ? 'z.pgrb2.1p00.f000' : 'z.pgrb2full.0p50.f000'), |
|
122 | 122 | 'lev_10_m_above_ground' => 'on', |
123 | 123 | 'lev_surface' => 'on', |
124 | 124 | 'var_TMP' => 'on', |
@@ -128,21 +128,21 @@ discard block |
||
128 | 128 | 'rightlon' => 360, |
129 | 129 | 'toplat' => 90, |
130 | 130 | 'bottomlat' => -90, |
131 | - 'dir' => '/gfs.'.date('Ymd').sprintf('%02d',(6*floor($hour/6))) |
|
131 | + 'dir' => '/gfs.'.date('Ymd').sprintf('%02d', (6*floor($hour/6))) |
|
132 | 132 | ); |
133 | 133 | $url = $baseurl.'?'.http_build_query($get); |
134 | 134 | //echo $url; |
135 | 135 | $Common = new Common(); |
136 | - $Common->download($url,$windpathsrc); |
|
136 | + $Common->download($url, $windpathsrc); |
|
137 | 137 | // Check if the downloaded file is in GRIB format |
138 | - $file = fopen($windpathsrc,"r"); |
|
138 | + $file = fopen($windpathsrc, "r"); |
|
139 | 139 | $firc = fgetc($file); |
140 | 140 | fclose($file); |
141 | 141 | if ($firc == 'G') { |
142 | 142 | system($grib2json.' --data --output '.$windpathdest.' --names --compact '.$windpathsrc); |
143 | 143 | } else { |
144 | 144 | // if not try previous run |
145 | - if ($hour == date('G')) $this->nomad_wind(date('G')-6); |
|
145 | + if ($hour == date('G')) $this->nomad_wind(date('G') - 6); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | $url = 'https://podaac.jpl.nasa.gov/ws/search/granule/?datasetId=PODAAC-OSCAR-03D01&itemsPerPage=1&sortBy=timeDesc&format=atom&pretty=false'; |
162 | 162 | $Common = new Common(); |
163 | 163 | $oscarlst = $Common->getData($url); |
164 | - $oscarlst_xml = json_decode(json_encode(simplexml_load_string($oscarlst)),true); |
|
164 | + $oscarlst_xml = json_decode(json_encode(simplexml_load_string($oscarlst)), true); |
|
165 | 165 | foreach ($oscarlst_xml['entry']['link'] as $oscarlnk) { |
166 | 166 | if ($oscarlnk['@attributes']['type'] == 'application/x-netcdf') { |
167 | - $Common->download($oscarlnk['@attributes']['href'],$wavepathsrc.'.gz'); |
|
167 | + $Common->download($oscarlnk['@attributes']['href'], $wavepathsrc.'.gz'); |
|
168 | 168 | break; |
169 | 169 | } |
170 | 170 | } |
@@ -63,12 +63,16 @@ discard block |
||
63 | 63 | |
64 | 64 | public function openweathermap($latitude,$longitude) { |
65 | 65 | global $globalOpenWeatherMapKey; |
66 | - if ($globalOpenWeatherMapKey == '') return array(); |
|
66 | + if ($globalOpenWeatherMapKey == '') { |
|
67 | + return array(); |
|
68 | + } |
|
67 | 69 | $Common = new Common(); |
68 | 70 | $url = 'http://api.openweathermap.org/data/2.5/weather?lat='.$latitude.'&lon='.$longitude.'&units=metric&appid='.$globalOpenWeatherMapKey; |
69 | 71 | //echo $url."\n"; |
70 | 72 | $weatherdata = json_decode($Common->getData($url),true); |
71 | - if (!isset($weatherdata['main']['temp']) || !isset($weatherdata['weather'][0]['id'])) return array('clouds' => array(),'rain' => array()); |
|
73 | + if (!isset($weatherdata['main']['temp']) || !isset($weatherdata['weather'][0]['id'])) { |
|
74 | + return array('clouds' => array(),'rain' => array()); |
|
75 | + } |
|
72 | 76 | $dew = $weatherdata['main']['temp'] - ((100-$weatherdata['main']['humidity'])/5); |
73 | 77 | $cumulus_base = 122.0 * ($weatherdata['main']['temp'] - $dew); |
74 | 78 | $stratus_base = 100.0 * (100.0 * $weatherdata['main']['humidity'])*0.3048; |
@@ -104,7 +108,9 @@ discard block |
||
104 | 108 | |
105 | 109 | public function nomad_wind($hour = '') { |
106 | 110 | global $globalWindsPath; |
107 | - if ($hour == '') $hour = date('G'); |
|
111 | + if ($hour == '') { |
|
112 | + $hour = date('G'); |
|
113 | + } |
|
108 | 114 | if (isset($globalWindsPath) && $globalWindsPath != '') { |
109 | 115 | $grib2json = $globalWindsPath['grib2json']; |
110 | 116 | $windpathsrc = $globalWindsPath['source']; |
@@ -142,7 +148,9 @@ discard block |
||
142 | 148 | system($grib2json.' --data --output '.$windpathdest.' --names --compact '.$windpathsrc); |
143 | 149 | } else { |
144 | 150 | // if not try previous run |
145 | - if ($hour == date('G')) $this->nomad_wind(date('G')-6); |
|
151 | + if ($hour == date('G')) { |
|
152 | + $this->nomad_wind(date('G')-6); |
|
153 | + } |
|
146 | 154 | } |
147 | 155 | } |
148 | 156 |