@@ -8,13 +8,13 @@ |
||
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | 9 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 10 | if ($airline_icao == 'all') { |
11 | - unset($_COOKIE['stats_airline_icao']); |
|
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
13 | - $airline_icao = ''; |
|
11 | + unset($_COOKIE['stats_airline_icao']); |
|
12 | + setcookie('stats_airline_icao', '', time()-3600); |
|
13 | + $airline_icao = ''; |
|
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
15 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
17 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | 18 | } |
19 | 19 | setcookie('stats_airline_icao',$airline_icao); |
20 | 20 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
@@ -6,19 +6,19 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Departure Airport"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
20 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
21 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
21 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | |
24 | 24 | include('statistics-sub-menu.php'); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | </div> |
29 | 29 | <p>'._("Below are the <strong>Top 10</strong> most common departure airports.").'</p>'; |
30 | 30 | |
31 | -$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
31 | +$airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month); |
|
32 | 32 | print '<script> |
33 | 33 | google.load("visualization", "1", {packages:["geochart"]}); |
34 | 34 | google.setOnLoadCallback(drawCharts); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ["'._("Airport").'", "'._("# of times").'"],'; |
42 | 42 | |
43 | 43 | $airport_data = ''; |
44 | -foreach($airport_airport_array as $airport_item) |
|
44 | +foreach ($airport_airport_array as $airport_item) |
|
45 | 45 | { |
46 | 46 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
47 | 47 | $name = str_replace("'", "", $name); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | print '</thead>'; |
80 | 80 | print '<tbody>'; |
81 | 81 | $i = 1; |
82 | -foreach($airport_airport_array as $airport_item) |
|
82 | +foreach ($airport_airport_array as $airport_item) |
|
83 | 83 | { |
84 | 84 | print '<tr>'; |
85 | 85 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Departure Airport"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
21 | 25 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
@@ -6,20 +6,20 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft Manufacturer"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | 20 | |
21 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
22 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
21 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
22 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
23 | 23 | |
24 | 24 | require_once('header.php'); |
25 | 25 | include('statistics-sub-menu.php'); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | </div> |
31 | 31 | <p>'._("Below are the <strong>Top 10</strong> most common aircraft manufacturers.").'</p>'; |
32 | 32 | |
33 | -$manufacturers_array = $Stats->countAllAircraftManufacturers(true,$airline_icao,$filter_name,$year,$month); |
|
33 | +$manufacturers_array = $Stats->countAllAircraftManufacturers(true, $airline_icao, $filter_name, $year, $month); |
|
34 | 34 | print '<div id="chart" class="chart" width="100%"></div> |
35 | 35 | <script> |
36 | 36 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | var data = google.visualization.arrayToDataTable([ |
40 | 40 | ["'._("Aircraft Manufacturer").'", "'._("# of times").'"], '; |
41 | 41 | $manufacturer_data = ''; |
42 | -foreach($manufacturers_array as $manufacturer_item) |
|
42 | +foreach ($manufacturers_array as $manufacturer_item) |
|
43 | 43 | { |
44 | 44 | $manufacturer_data .= '[ "'.$manufacturer_item['aircraft_manufacturer'].'",'.$manufacturer_item['aircraft_manufacturer_count'].'],'; |
45 | 45 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | print '</thead>'; |
73 | 73 | print '<tbody>'; |
74 | 74 | $i = 1; |
75 | - foreach($manufacturers_array as $manufacturer_item) |
|
75 | + foreach ($manufacturers_array as $manufacturer_item) |
|
76 | 76 | { |
77 | 77 | print '<tr>'; |
78 | 78 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft Manufacturer"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | </form> |
32 | 32 | </div> |
33 | 33 | <?php |
34 | - if (isset($year) && $year == '' && isset($month) && $month == '') { |
|
34 | + if (isset($year) && $year == '' && isset($month) && $month == '') { |
|
35 | 35 | ?> |
36 | 36 | <div class="sub-menu sub-menu-container"> |
37 | 37 | <ul class="nav"> |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | </ul> |
87 | 87 | </li> |
88 | 88 | <?php |
89 | - if (isset($globalAccidents) && $globalAccidents) { |
|
89 | + if (isset($globalAccidents) && $globalAccidents) { |
|
90 | 90 | ?> |
91 | 91 | <li class="dropdown"> |
92 | 92 | <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | </ul> |
99 | 99 | </li> |
100 | 100 | <?php |
101 | - } |
|
101 | + } |
|
102 | 102 | ?> |
103 | 103 | </ul> |
104 | 104 | </div> |
105 | 105 | <?php |
106 | - } else { |
|
106 | + } else { |
|
107 | 107 | ?> |
108 | 108 | <div class="sub-menu sub-menu-container"> |
109 | 109 | <ul class="nav"> |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | </li> |
163 | 163 | --> |
164 | 164 | <?php |
165 | - if (isset($globalAccidents) && $globalAccidents) { |
|
165 | + if (isset($globalAccidents) && $globalAccidents) { |
|
166 | 166 | ?> |
167 | 167 | <!-- |
168 | 168 | <li class="dropdown"> |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | </li> |
177 | 177 | --> |
178 | 178 | <?php |
179 | - } |
|
179 | + } |
|
180 | 180 | ?> |
181 | 181 | </ul> |
182 | 182 | </div> |
183 | 183 | <?php |
184 | - } |
|
184 | + } |
|
185 | 185 | ?> |
186 | 186 | \ No newline at end of file |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | } else { |
20 | 20 | print '<option value="all">All</option>'; |
21 | 21 | } |
22 | - foreach($airlines as $airline) { |
|
22 | + foreach ($airlines as $airline) { |
|
23 | 23 | if (isset($airline_icao) && $airline_icao == $airline['airline_icao']) { |
24 | 24 | print '<option value="'.$airline['airline_icao'].'" selected>'.$airline['airline_name'].'</option>'; |
25 | 25 | } else { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | <div class="sub-menu sub-menu-container"> |
37 | 37 | <ul class="nav"> |
38 | 38 | <li class="dropdown"> |
39 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
39 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
40 | 40 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
41 | 41 | </a> |
42 | 42 | <ul class="dropdown-menu"> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | </ul> |
48 | 48 | </li> |
49 | 49 | <li class="dropdown"> |
50 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
50 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
51 | 51 | <?php echo _("Airline"); ?> <span class="caret"></span> |
52 | 52 | </a> |
53 | 53 | <ul class="dropdown-menu" role="menu"> |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | </ul> |
58 | 58 | </li> |
59 | 59 | <li class="dropdown"> |
60 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
60 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
61 | 61 | <?php echo _("Airport"); ?> <span class="caret"></span> |
62 | 62 | </a> |
63 | 63 | <ul class="dropdown-menu" role="menu"> |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | </ul> |
69 | 69 | </li> |
70 | 70 | <li class="dropdown"> |
71 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
71 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
72 | 72 | <?php echo _("Route"); ?> <span class="caret"></span> |
73 | 73 | </a> |
74 | 74 | <ul class="dropdown-menu" role="menu"> |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | </ul> |
78 | 78 | </li> |
79 | 79 | <li class="dropdown"> |
80 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
80 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
81 | 81 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
82 | 82 | </a> |
83 | 83 | <ul class="dropdown-menu" role="menu"> |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if (isset($globalAccidents) && $globalAccidents) { |
90 | 90 | ?> |
91 | 91 | <li class="dropdown"> |
92 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
92 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
93 | 93 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
94 | 94 | </a> |
95 | 95 | <ul class="dropdown-menu" role="menu"> |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | <div class="sub-menu sub-menu-container"> |
109 | 109 | <ul class="nav"> |
110 | 110 | <li class="dropdown"> |
111 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
111 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
112 | 112 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
113 | 113 | </a> |
114 | 114 | <ul class="dropdown-menu"> |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | </ul> |
120 | 120 | </li> |
121 | 121 | <li class="dropdown"> |
122 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
122 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
123 | 123 | <?php echo _("Airline"); ?> <span class="caret"></span> |
124 | 124 | </a> |
125 | 125 | <ul class="dropdown-menu" role="menu"> |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | </ul> |
130 | 130 | </li> |
131 | 131 | <li class="dropdown"> |
132 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
132 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
133 | 133 | <?php echo _("Airport"); ?> <span class="caret"></span> |
134 | 134 | </a> |
135 | 135 | <ul class="dropdown-menu" role="menu"> |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | </li> |
142 | 142 | <!-- |
143 | 143 | <li class="dropdown"> |
144 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
144 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
145 | 145 | <?php echo _("Route"); ?> <span class="caret"></span> |
146 | 146 | </a> |
147 | 147 | <ul class="dropdown-menu" role="menu"> |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | --> |
153 | 153 | <!-- |
154 | 154 | <li class="dropdown"> |
155 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
155 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
156 | 156 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
157 | 157 | </a> |
158 | 158 | <ul class="dropdown-menu" role="menu"> |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | ?> |
167 | 167 | <!-- |
168 | 168 | <li class="dropdown"> |
169 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
169 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
170 | 170 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
171 | 171 | </a> |
172 | 172 | <ul class="dropdown-menu" role="menu"> |
@@ -4,7 +4,13 @@ discard block |
||
4 | 4 | <div class="stats_airline"> |
5 | 5 | |
6 | 6 | <form id="changedate" method="post"> |
7 | - <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') echo $year.'-'; ?><?php if (isset($month) && $month != '') echo $month; ?>" /> |
|
7 | + <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') { |
|
8 | + echo $year.'-'; |
|
9 | +} |
|
10 | +?><?php if (isset($month) && $month != '') { |
|
11 | + echo $month; |
|
12 | +} |
|
13 | +?>" /> |
|
8 | 14 | </form> |
9 | 15 | |
10 | 16 | <form> |
@@ -12,7 +18,9 @@ discard block |
||
12 | 18 | <?php |
13 | 19 | require_once('require/class.Stats.php'); |
14 | 20 | $Stats = new Stats(); |
15 | - if (!isset($filter_name)) $filter_name = ''; |
|
21 | + if (!isset($filter_name)) { |
|
22 | + $filter_name = ''; |
|
23 | + } |
|
16 | 24 | $airlines = $Stats->getAllAirlineNames($filter_name); |
17 | 25 | if (isset($airline_icao) && ($airline_icao == '' || $airline_icao == 'all')) { |
18 | 26 | print '<option value="all" selected>All</option>'; |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Airline"); |
7 | 7 | require_once('header.php'); |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
10 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
9 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
11 | 11 | include('statistics-sub-menu.php'); |
12 | 12 | |
13 | 13 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | </div> |
17 | 17 | <p>'._("Below are the <strong>Top 10</strong> most common airlines.").'</p>'; |
18 | 18 | |
19 | -$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month); |
|
19 | +$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month); |
|
20 | 20 | print '<div id="chart" class="chart" width="100%"></div> |
21 | 21 | <script> |
22 | 22 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | var data = google.visualization.arrayToDataTable([ |
26 | 26 | ["'._("Airline").'", "'._("# of times").'"], '; |
27 | 27 | $airline_data = ''; |
28 | -foreach($airline_array as $airline_item) |
|
28 | +foreach ($airline_array as $airline_item) |
|
29 | 29 | { |
30 | 30 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
31 | 31 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | print '</thead>'; |
61 | 61 | print '<tbody>'; |
62 | 62 | $i = 1; |
63 | - foreach($airline_array as $airline_item) |
|
63 | + foreach ($airline_array as $airline_item) |
|
64 | 64 | { |
65 | 65 | print '<tr>'; |
66 | 66 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Airline"); |
7 | 7 | require_once('header.php'); |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
10 | 12 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
11 | 13 | include('statistics-sub-menu.php'); |
@@ -8,13 +8,13 @@ |
||
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | 9 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 10 | if ($airline_icao == 'all') { |
11 | - unset($_COOKIE['stats_airline_icao']); |
|
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
13 | - $airline_icao = ''; |
|
11 | + unset($_COOKIE['stats_airline_icao']); |
|
12 | + setcookie('stats_airline_icao', '', time()-3600); |
|
13 | + $airline_icao = ''; |
|
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
15 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
17 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | 18 | } |
19 | 19 | setcookie('stats_airline_icao',$airline_icao); |
20 | 20 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
@@ -6,19 +6,19 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Arrival Airport by Country"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
20 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
21 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
21 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | include('statistics-sub-menu.php'); |
24 | 24 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | </div> |
29 | 29 | <p>'._("Below are the <strong>Top 10</strong> most common countries of all the arrival airports.").'</p>'; |
30 | 30 | |
31 | -$airport_country_array = $Stats->countAllArrivalCountries(true,$airline_icao,$filter_name,$year,$month); |
|
31 | +$airport_country_array = $Stats->countAllArrivalCountries(true, $airline_icao, $filter_name, $year, $month); |
|
32 | 32 | |
33 | 33 | print '<script> |
34 | 34 | google.load("visualization", "1", {packages:["geochart"]}); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ["'._("Country").'", "'._("# of times").'"],'; |
43 | 43 | |
44 | 44 | $country_data = ''; |
45 | -foreach($airport_country_array as $airport_item) |
|
45 | +foreach ($airport_country_array as $airport_item) |
|
46 | 46 | { |
47 | 47 | $country_data .= '[ "'.$airport_item['airport_arrival_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
48 | 48 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | print '</thead>'; |
78 | 78 | print '<tbody>'; |
79 | 79 | $i = 1; |
80 | -foreach($airport_country_array as $airport_item) |
|
80 | +foreach ($airport_country_array as $airport_item) |
|
81 | 81 | { |
82 | 82 | print '<tr>'; |
83 | 83 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Arrival Airport by Country"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
21 | 25 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
44 | 44 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
45 | 45 | } |
46 | - ?> |
|
46 | + ?> |
|
47 | 47 | </div> |
48 | 48 | <?php include('statistics-sub-menu.php'); ?> |
49 | 49 | <p class="global-stats"> |
@@ -52,23 +52,23 @@ discard block |
||
52 | 52 | <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
53 | 53 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
54 | 54 | <?php |
55 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
55 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
56 | 56 | ?> |
57 | 57 | <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span> |
58 | 58 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
59 | 59 | <?php |
60 | - } else { |
|
61 | - ?> |
|
60 | + } else { |
|
61 | + ?> |
|
62 | 62 | <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span> |
63 | 63 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
64 | 64 | <?php |
65 | - } |
|
66 | - ?> |
|
65 | + } |
|
66 | + ?> |
|
67 | 67 | <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span> |
68 | 68 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
69 | 69 | <?php |
70 | - if ($airline_icao == '') { |
|
71 | - ?> |
|
70 | + if ($airline_icao == '') { |
|
71 | + ?> |
|
72 | 72 | <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span> |
73 | 73 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
74 | 74 | <?php |
@@ -89,25 +89,25 @@ discard block |
||
89 | 89 | <div class="col-md-6"> |
90 | 90 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
91 | 91 | <?php |
92 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
93 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
94 | - else { |
|
92 | + $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
93 | + if (count($aircraft_array) == 0) print _("No data available"); |
|
94 | + else { |
|
95 | 95 | |
96 | - print '<div id="chart1" class="chart" width="100%"></div> |
|
96 | + print '<div id="chart1" class="chart" width="100%"></div> |
|
97 | 97 | <script> |
98 | 98 | google.load("visualization", "1", {packages:["corechart"]}); |
99 | 99 | google.setOnLoadCallback(drawChart1); |
100 | 100 | function drawChart1() { |
101 | 101 | var data = google.visualization.arrayToDataTable([ |
102 | 102 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
103 | - $aircraft_data = ''; |
|
104 | - foreach($aircraft_array as $aircraft_item) |
|
105 | - { |
|
106 | - $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
107 | - } |
|
108 | - $aircraft_data = substr($aircraft_data, 0, -1); |
|
109 | - print $aircraft_data; |
|
110 | - print ']); |
|
103 | + $aircraft_data = ''; |
|
104 | + foreach($aircraft_array as $aircraft_item) |
|
105 | + { |
|
106 | + $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
107 | + } |
|
108 | + $aircraft_data = substr($aircraft_data, 0, -1); |
|
109 | + print $aircraft_data; |
|
110 | + print ']); |
|
111 | 111 | |
112 | 112 | var options = { |
113 | 113 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -122,45 +122,45 @@ discard block |
||
122 | 122 | drawChart1(); |
123 | 123 | }); |
124 | 124 | </script>'; |
125 | - } |
|
126 | - ?> |
|
125 | + } |
|
126 | + ?> |
|
127 | 127 | <div class="more"> |
128 | 128 | <?php |
129 | - if ($year != '' && $month != '') { |
|
130 | - ?> |
|
129 | + if ($year != '' && $month != '') { |
|
130 | + ?> |
|
131 | 131 | <a href="<?php print $globalURL; ?>/statistics/aircraft/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
132 | 132 | <?php |
133 | - } else { |
|
134 | - ?> |
|
133 | + } else { |
|
134 | + ?> |
|
135 | 135 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
136 | 136 | <?php |
137 | - } |
|
138 | - ?> |
|
137 | + } |
|
138 | + ?> |
|
139 | 139 | </div> |
140 | 140 | </div> |
141 | 141 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
142 | 142 | <?php |
143 | 143 | // echo $airline_icao; |
144 | - if ($airline_icao == '' || $airline_icao == 'all') { |
|
144 | + if ($airline_icao == '' || $airline_icao == 'all') { |
|
145 | 145 | $airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month); |
146 | 146 | if (count($airline_array) > 0) { |
147 | - print '<div class="col-md-6">'; |
|
148 | - print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
149 | - print '<div id="chart2" class="chart" width="100%"></div> |
|
147 | + print '<div class="col-md-6">'; |
|
148 | + print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
149 | + print '<div id="chart2" class="chart" width="100%"></div> |
|
150 | 150 | <script> |
151 | 151 | google.load("visualization", "1", {packages:["corechart"]}); |
152 | 152 | google.setOnLoadCallback(drawChart2); |
153 | 153 | function drawChart2() { |
154 | 154 | var data = google.visualization.arrayToDataTable([ |
155 | 155 | ["'._("Airline").'", "'._("# of times").'"], '; |
156 | - $airline_data = ''; |
|
157 | - foreach($airline_array as $airline_item) |
|
158 | - { |
|
156 | + $airline_data = ''; |
|
157 | + foreach($airline_array as $airline_item) |
|
158 | + { |
|
159 | 159 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
160 | - } |
|
161 | - $airline_data = substr($airline_data, 0, -1); |
|
162 | - print $airline_data; |
|
163 | - print ']); |
|
160 | + } |
|
161 | + $airline_data = substr($airline_data, 0, -1); |
|
162 | + print $airline_data; |
|
163 | + print ']); |
|
164 | 164 | |
165 | 165 | var options = { |
166 | 166 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -175,27 +175,27 @@ discard block |
||
175 | 175 | drawChart2(); |
176 | 176 | }); |
177 | 177 | </script>'; |
178 | - if ($year != '' && $month != '') { |
|
178 | + if ($year != '' && $month != '') { |
|
179 | 179 | print '<div class="more"><a href="'.$globalURL.'/statistics/airline/'.$year.'/'.$month.'/" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
180 | - } else { |
|
180 | + } else { |
|
181 | 181 | print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
182 | - } |
|
183 | - print '</div>'; |
|
182 | + } |
|
183 | + print '</div>'; |
|
184 | 184 | } |
185 | 185 | ?> |
186 | 186 | </div> |
187 | 187 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
188 | 188 | <?php |
189 | - } |
|
189 | + } |
|
190 | 190 | ?> |
191 | 191 | <div class="row column"> |
192 | 192 | <?php |
193 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name,$year,$month); |
|
194 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
193 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name,$year,$month); |
|
194 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
195 | 195 | if (empty($flightover_array)) { |
196 | - print '<div class="col-md-12">'; |
|
196 | + print '<div class="col-md-12">'; |
|
197 | 197 | } else { |
198 | - print '<div class="col-md-6">'; |
|
198 | + print '<div class="col-md-6">'; |
|
199 | 199 | } |
200 | 200 | ?> |
201 | 201 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
@@ -203,21 +203,21 @@ discard block |
||
203 | 203 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month); |
204 | 204 | if (count($pilot_array) == 0) print _("No data available"); |
205 | 205 | else { |
206 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
206 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
207 | 207 | <script> |
208 | 208 | google.load("visualization", "1", {packages:["corechart"]}); |
209 | 209 | google.setOnLoadCallback(drawChart7); |
210 | 210 | function drawChart7() { |
211 | 211 | var data = google.visualization.arrayToDataTable([ |
212 | 212 | ["'._("Pilots").'", "'._("# of times").'"], '; |
213 | - $pilot_data = ''; |
|
214 | - foreach($pilot_array as $pilot_item) |
|
215 | - { |
|
213 | + $pilot_data = ''; |
|
214 | + foreach($pilot_array as $pilot_item) |
|
215 | + { |
|
216 | 216 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
217 | - } |
|
218 | - $pilot_data = substr($pilot_data, 0, -1); |
|
219 | - print $pilot_data; |
|
220 | - print ']); |
|
217 | + } |
|
218 | + $pilot_data = substr($pilot_data, 0, -1); |
|
219 | + print $pilot_data; |
|
220 | + print ']); |
|
221 | 221 | |
222 | 222 | var options = { |
223 | 223 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | drawChart7(); |
233 | 233 | }); |
234 | 234 | </script>'; |
235 | - } |
|
236 | - print '<div class="more">'; |
|
235 | + } |
|
236 | + print '<div class="more">'; |
|
237 | 237 | print '<a href="'.$globalURL.'/statistics/pilot" class="btn btn-default btn" role="button">'._("See full statistic").'»</a>'; |
238 | 238 | print '</div>'; |
239 | 239 | ?> |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | |
242 | 242 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
243 | 243 | <?php |
244 | - } else { |
|
244 | + } else { |
|
245 | 245 | ?> |
246 | 246 | <div class="col-md-6"> |
247 | 247 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
@@ -249,21 +249,21 @@ discard block |
||
249 | 249 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month); |
250 | 250 | if (count($owner_array) == 0) print _("No data available"); |
251 | 251 | else { |
252 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
252 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
253 | 253 | <script> |
254 | 254 | google.load("visualization", "1", {packages:["corechart"]}); |
255 | 255 | google.setOnLoadCallback(drawChart7); |
256 | 256 | function drawChart7() { |
257 | 257 | var data = google.visualization.arrayToDataTable([ |
258 | 258 | ["'._("Owner").'", "'._("# of times").'"], '; |
259 | - $owner_data = ''; |
|
260 | - foreach($owner_array as $owner_item) |
|
261 | - { |
|
259 | + $owner_data = ''; |
|
260 | + foreach($owner_array as $owner_item) |
|
261 | + { |
|
262 | 262 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
263 | - } |
|
264 | - $owner_data = substr($owner_data, 0, -1); |
|
265 | - print $owner_data; |
|
266 | - print ']); |
|
263 | + } |
|
264 | + $owner_data = substr($owner_data, 0, -1); |
|
265 | + print $owner_data; |
|
266 | + print ']); |
|
267 | 267 | |
268 | 268 | var options = { |
269 | 269 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -287,8 +287,8 @@ discard block |
||
287 | 287 | |
288 | 288 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
289 | 289 | <?php |
290 | - } |
|
291 | - if (!empty($flightover_array)) { |
|
290 | + } |
|
291 | + if (!empty($flightover_array)) { |
|
292 | 292 | ?> |
293 | 293 | <div class="col-md-6"> |
294 | 294 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
@@ -296,21 +296,21 @@ discard block |
||
296 | 296 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
297 | 297 | if (count($flightover_array) == 0) print _("No data available"); |
298 | 298 | else { |
299 | - print '<div id="chart10" class="chart" width="100%"></div> |
|
299 | + print '<div id="chart10" class="chart" width="100%"></div> |
|
300 | 300 | <script> |
301 | 301 | google.load("visualization", "1", {packages:["corechart"]}); |
302 | 302 | google.setOnLoadCallback(drawChart10); |
303 | 303 | function drawChart10() { |
304 | 304 | var data = google.visualization.arrayToDataTable([ |
305 | 305 | ["'._("Country").'", "'._("# of times").'"], '; |
306 | - $flightover_data = ''; |
|
307 | - foreach($flightover_array as $flightover_item) |
|
308 | - { |
|
306 | + $flightover_data = ''; |
|
307 | + foreach($flightover_array as $flightover_item) |
|
308 | + { |
|
309 | 309 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
310 | - } |
|
311 | - $flightover_data = substr($flightover_data, 0, -1); |
|
312 | - print $flightover_data; |
|
313 | - print ']); |
|
310 | + } |
|
311 | + $flightover_data = substr($flightover_data, 0, -1); |
|
312 | + print $flightover_data; |
|
313 | + print ']); |
|
314 | 314 | |
315 | 315 | var options = { |
316 | 316 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | </div> |
335 | 335 | </div> |
336 | 336 | <?php |
337 | - } |
|
337 | + } |
|
338 | 338 | ?> |
339 | 339 | </div> |
340 | 340 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | <div class="row column"> |
345 | 345 | <div class="col-md-6"> |
346 | 346 | <?php |
347 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
348 | - if (count($airport_airport_array) > 0) { |
|
347 | + $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
348 | + if (count($airport_airport_array) > 0) { |
|
349 | 349 | print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>'; |
350 | 350 | print '<div id="chart3" class="chart" width="100%"></div> |
351 | 351 | <script> |
@@ -358,13 +358,13 @@ discard block |
||
358 | 358 | |
359 | 359 | var data = google.visualization.arrayToDataTable([ |
360 | 360 | ["'._("Airport").'", "'._("# of times").'"],'; |
361 | - $airport_data = ''; |
|
361 | + $airport_data = ''; |
|
362 | 362 | foreach($airport_airport_array as $airport_item) |
363 | 363 | { |
364 | - $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
365 | - $name = str_replace("'", "", $name); |
|
366 | - $name = str_replace('"', "", $name); |
|
367 | - $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
364 | + $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
365 | + $name = str_replace("'", "", $name); |
|
366 | + $name = str_replace('"', "", $name); |
|
367 | + $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
368 | 368 | } |
369 | 369 | $airport_data = substr($airport_data, 0, -1); |
370 | 370 | print $airport_data; |
@@ -383,15 +383,15 @@ discard block |
||
383 | 383 | } |
384 | 384 | </script>'; |
385 | 385 | print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
386 | - } |
|
386 | + } |
|
387 | 387 | ?> |
388 | 388 | </div> |
389 | 389 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
390 | 390 | |
391 | 391 | <div class="col-md-6"> |
392 | 392 | <?php |
393 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month); |
|
394 | - if (count($airport_airport_array2) > 0) { |
|
393 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month); |
|
394 | + if (count($airport_airport_array2) > 0) { |
|
395 | 395 | print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>'; |
396 | 396 | print '<div id="chart4" class="chart" width="100%"></div> |
397 | 397 | <script> |
@@ -407,9 +407,9 @@ discard block |
||
407 | 407 | $airport_data2 = ''; |
408 | 408 | foreach($airport_airport_array2 as $airport_item2) |
409 | 409 | { |
410 | - $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
411 | - $name2 = str_replace(array("'",'"'), '', $name2); |
|
412 | - $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
410 | + $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
411 | + $name2 = str_replace(array("'",'"'), '', $name2); |
|
412 | + $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
413 | 413 | } |
414 | 414 | $airport_data2 = substr($airport_data2, 0, -1); |
415 | 415 | print $airport_data2; |
@@ -428,36 +428,36 @@ discard block |
||
428 | 428 | } |
429 | 429 | </script>'; |
430 | 430 | print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
431 | - } |
|
431 | + } |
|
432 | 432 | ?> |
433 | 433 | </div> |
434 | 434 | </div> |
435 | 435 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
436 | 436 | <?php |
437 | - if ($year == '' && $month == '') { |
|
437 | + if ($year == '' && $month == '') { |
|
438 | 438 | ?> |
439 | 439 | <div class="row column"> |
440 | 440 | <div class="col-md-6"> |
441 | 441 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
442 | 442 | <?php |
443 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
444 | - if (count($year_array) == 0) print _("No data available"); |
|
445 | - else { |
|
446 | - print '<div id="chart8" class="chart" width="100%"></div> |
|
443 | + $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
444 | + if (count($year_array) == 0) print _("No data available"); |
|
445 | + else { |
|
446 | + print '<div id="chart8" class="chart" width="100%"></div> |
|
447 | 447 | <script> |
448 | 448 | google.load("visualization", "1", {packages:["corechart"]}); |
449 | 449 | google.setOnLoadCallback(drawChart8); |
450 | 450 | function drawChart8() { |
451 | 451 | var data = google.visualization.arrayToDataTable([ |
452 | 452 | ["'._("Month").'", "'._("# of Flights").'"], '; |
453 | - $year_data = ''; |
|
454 | - foreach($year_array as $year_item) |
|
455 | - { |
|
456 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
457 | - } |
|
458 | - $year_data = substr($year_data, 0, -1); |
|
459 | - print $year_data; |
|
460 | - print ']); |
|
453 | + $year_data = ''; |
|
454 | + foreach($year_array as $year_item) |
|
455 | + { |
|
456 | + $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
457 | + } |
|
458 | + $year_data = substr($year_data, 0, -1); |
|
459 | + print $year_data; |
|
460 | + print ']); |
|
461 | 461 | |
462 | 462 | var options = { |
463 | 463 | legend: {position: "none"}, |
@@ -475,8 +475,8 @@ discard block |
||
475 | 475 | drawChart8(); |
476 | 476 | }); |
477 | 477 | </script>'; |
478 | - } |
|
479 | - ?> |
|
478 | + } |
|
479 | + ?> |
|
480 | 480 | <div class="more"> |
481 | 481 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
482 | 482 | </div> |
@@ -485,24 +485,24 @@ discard block |
||
485 | 485 | <div class="col-md-6"> |
486 | 486 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
487 | 487 | <?php |
488 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
489 | - if (count($month_array) == 0) print _("No data available"); |
|
490 | - else { |
|
491 | - print '<div id="chart9" class="chart" width="100%"></div> |
|
488 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
489 | + if (count($month_array) == 0) print _("No data available"); |
|
490 | + else { |
|
491 | + print '<div id="chart9" class="chart" width="100%"></div> |
|
492 | 492 | <script> |
493 | 493 | google.load("visualization", "1", {packages:["corechart"]}); |
494 | 494 | google.setOnLoadCallback(drawChart9); |
495 | 495 | function drawChart9() { |
496 | 496 | var data = google.visualization.arrayToDataTable([ |
497 | 497 | ["'._("Day").'", "'._("# of Flights").'"], '; |
498 | - $month_data = ''; |
|
499 | - foreach($month_array as $month_item) |
|
500 | - { |
|
501 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
502 | - } |
|
503 | - $month_data = substr($month_data, 0, -1); |
|
504 | - print $month_data; |
|
505 | - print ']); |
|
498 | + $month_data = ''; |
|
499 | + foreach($month_array as $month_item) |
|
500 | + { |
|
501 | + $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
502 | + } |
|
503 | + $month_data = substr($month_data, 0, -1); |
|
504 | + print $month_data; |
|
505 | + print ']); |
|
506 | 506 | |
507 | 507 | var options = { |
508 | 508 | legend: {position: "none"}, |
@@ -520,8 +520,8 @@ discard block |
||
520 | 520 | drawChart9(); |
521 | 521 | }); |
522 | 522 | </script>'; |
523 | - } |
|
524 | - ?> |
|
523 | + } |
|
524 | + ?> |
|
525 | 525 | <div class="more"> |
526 | 526 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
527 | 527 | </div> |
@@ -531,25 +531,25 @@ discard block |
||
531 | 531 | <div class="col-md-6"> |
532 | 532 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
533 | 533 | <?php |
534 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
535 | - if (empty($date_array)) print _("No data available"); |
|
536 | - else { |
|
537 | - print '<div id="chart5" class="chart" width="100%"></div> |
|
534 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
535 | + if (empty($date_array)) print _("No data available"); |
|
536 | + else { |
|
537 | + print '<div id="chart5" class="chart" width="100%"></div> |
|
538 | 538 | <script> |
539 | 539 | google.load("visualization", "1", {packages:["corechart"]}); |
540 | 540 | google.setOnLoadCallback(drawChart5); |
541 | 541 | function drawChart5() { |
542 | 542 | var data = google.visualization.arrayToDataTable([ |
543 | 543 | ["'._("Date").'", "'._("# of Flights").'"], '; |
544 | - $date_data = ''; |
|
544 | + $date_data = ''; |
|
545 | 545 | |
546 | - foreach($date_array as $date_item) |
|
547 | - { |
|
548 | - $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
549 | - } |
|
550 | - $date_data = substr($date_data, 0, -1); |
|
551 | - print $date_data; |
|
552 | - print ']); |
|
546 | + foreach($date_array as $date_item) |
|
547 | + { |
|
548 | + $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
549 | + } |
|
550 | + $date_data = substr($date_data, 0, -1); |
|
551 | + print $date_data; |
|
552 | + print ']); |
|
553 | 553 | |
554 | 554 | var options = { |
555 | 555 | legend: {position: "none"}, |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | drawChart5(); |
568 | 568 | }); |
569 | 569 | </script>'; |
570 | - } |
|
571 | - ?> |
|
570 | + } |
|
571 | + ?> |
|
572 | 572 | <div class="more"> |
573 | 573 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
574 | 574 | </div> |
@@ -577,25 +577,25 @@ discard block |
||
577 | 577 | <div class="col-md-6"> |
578 | 578 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
579 | 579 | <?php |
580 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
581 | - if (empty($hour_array)) print _("No data available"); |
|
582 | - else { |
|
580 | + $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
581 | + if (empty($hour_array)) print _("No data available"); |
|
582 | + else { |
|
583 | 583 | |
584 | - print '<div id="chart6" class="chart" width="100%"></div> |
|
584 | + print '<div id="chart6" class="chart" width="100%"></div> |
|
585 | 585 | <script> |
586 | 586 | google.load("visualization", "1", {packages:["corechart"]}); |
587 | 587 | google.setOnLoadCallback(drawChart6); |
588 | 588 | function drawChart6() { |
589 | 589 | var data = google.visualization.arrayToDataTable([ |
590 | 590 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
591 | - $hour_data = ''; |
|
592 | - foreach($hour_array as $hour_item) |
|
593 | - { |
|
594 | - $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
595 | - } |
|
596 | - $hour_data = substr($hour_data, 0, -1); |
|
597 | - print $hour_data; |
|
598 | - print ']); |
|
591 | + $hour_data = ''; |
|
592 | + foreach($hour_array as $hour_item) |
|
593 | + { |
|
594 | + $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
595 | + } |
|
596 | + $hour_data = substr($hour_data, 0, -1); |
|
597 | + print $hour_data; |
|
598 | + print ']); |
|
599 | 599 | |
600 | 600 | var options = { |
601 | 601 | legend: {position: "none"}, |
@@ -613,8 +613,8 @@ discard block |
||
613 | 613 | drawChart6(); |
614 | 614 | }); |
615 | 615 | </script>'; |
616 | - } |
|
617 | - ?> |
|
616 | + } |
|
617 | + ?> |
|
618 | 618 | <div class="more"> |
619 | 619 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
620 | 620 | </div> |
@@ -622,36 +622,36 @@ discard block |
||
622 | 622 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
623 | 623 | </div> |
624 | 624 | <?php |
625 | - } |
|
625 | + } |
|
626 | 626 | ?> |
627 | 627 | |
628 | 628 | <?php |
629 | - if ($year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) { |
|
629 | + if ($year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) { |
|
630 | 630 | ?> |
631 | 631 | <div class="row column"> |
632 | 632 | <div class="col-md-6"> |
633 | 633 | <h2><?php echo _("Fatalities by Years"); ?></h2> |
634 | 634 | <?php |
635 | - require_once('require/class.Accident.php'); |
|
636 | - $Accident = new Accident(); |
|
637 | - $year_array = $Accident->countFatalitiesByYear($filter_name); |
|
638 | - if (count($year_array) == 0) print _("No data available"); |
|
639 | - else { |
|
640 | - print '<div id="chart32" class="chart" width="100%"></div> |
|
635 | + require_once('require/class.Accident.php'); |
|
636 | + $Accident = new Accident(); |
|
637 | + $year_array = $Accident->countFatalitiesByYear($filter_name); |
|
638 | + if (count($year_array) == 0) print _("No data available"); |
|
639 | + else { |
|
640 | + print '<div id="chart32" class="chart" width="100%"></div> |
|
641 | 641 | <script> |
642 | 642 | google.load("visualization", "1", {packages:["corechart"]}); |
643 | 643 | google.setOnLoadCallback(drawChart32); |
644 | 644 | function drawChart32() { |
645 | 645 | var data = google.visualization.arrayToDataTable([ |
646 | 646 | ["'._("Year").'", "'._("# of Fatalities").'"], '; |
647 | - $year_data = ''; |
|
648 | - foreach($year_array as $year_item) |
|
649 | - { |
|
650 | - $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],'; |
|
651 | - } |
|
652 | - $year_data = substr($year_data, 0, -1); |
|
653 | - print $year_data; |
|
654 | - print ']); |
|
647 | + $year_data = ''; |
|
648 | + foreach($year_array as $year_item) |
|
649 | + { |
|
650 | + $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],'; |
|
651 | + } |
|
652 | + $year_data = substr($year_data, 0, -1); |
|
653 | + print $year_data; |
|
654 | + print ']); |
|
655 | 655 | |
656 | 656 | var options = { |
657 | 657 | legend: {position: "none"}, |
@@ -669,8 +669,8 @@ discard block |
||
669 | 669 | drawChart32(); |
670 | 670 | }); |
671 | 671 | </script>'; |
672 | - } |
|
673 | - ?> |
|
672 | + } |
|
673 | + ?> |
|
674 | 674 | <div class="more"> |
675 | 675 | <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
676 | 676 | </div> |
@@ -681,26 +681,26 @@ discard block |
||
681 | 681 | <div class="col-md-6"> |
682 | 682 | <h2><?php echo _("Fatalities last 12 Months"); ?></h2> |
683 | 683 | <?php |
684 | - require_once('require/class.Accident.php'); |
|
685 | - $Accident = new Accident(); |
|
686 | - $year_array = $Accident->countFatalitiesLast12Months($filter_name); |
|
687 | - if (count($year_array) == 0) print _("No data available"); |
|
688 | - else { |
|
689 | - print '<div id="chart33" class="chart" width="100%"></div> |
|
684 | + require_once('require/class.Accident.php'); |
|
685 | + $Accident = new Accident(); |
|
686 | + $year_array = $Accident->countFatalitiesLast12Months($filter_name); |
|
687 | + if (count($year_array) == 0) print _("No data available"); |
|
688 | + else { |
|
689 | + print '<div id="chart33" class="chart" width="100%"></div> |
|
690 | 690 | <script> |
691 | 691 | google.load("visualization", "1", {packages:["corechart"]}); |
692 | 692 | google.setOnLoadCallback(drawChart33); |
693 | 693 | function drawChart33() { |
694 | 694 | var data = google.visualization.arrayToDataTable([ |
695 | 695 | ["'._("Month").'", "'._("# of Fatalities").'"], '; |
696 | - $year_data = ''; |
|
697 | - foreach($year_array as $year_item) |
|
698 | - { |
|
699 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],'; |
|
700 | - } |
|
701 | - $year_data = substr($year_data, 0, -1); |
|
702 | - print $year_data; |
|
703 | - print ']); |
|
696 | + $year_data = ''; |
|
697 | + foreach($year_array as $year_item) |
|
698 | + { |
|
699 | + $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],'; |
|
700 | + } |
|
701 | + $year_data = substr($year_data, 0, -1); |
|
702 | + print $year_data; |
|
703 | + print ']); |
|
704 | 704 | |
705 | 705 | var options = { |
706 | 706 | legend: {position: "none"}, |
@@ -718,8 +718,8 @@ discard block |
||
718 | 718 | drawChart33(); |
719 | 719 | }); |
720 | 720 | </script>'; |
721 | - } |
|
722 | - ?> |
|
721 | + } |
|
722 | + ?> |
|
723 | 723 | <div class="more"> |
724 | 724 | <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
725 | 725 | </div> |
@@ -727,30 +727,30 @@ discard block |
||
727 | 727 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
728 | 728 | <br/> |
729 | 729 | <?php |
730 | - } |
|
730 | + } |
|
731 | 731 | ?> |
732 | 732 | |
733 | 733 | <?php |
734 | - if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') { |
|
734 | + if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') { |
|
735 | 735 | ?> |
736 | 736 | <div class="row column"> |
737 | 737 | <?php |
738 | - //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
739 | - if ($year == '' && $month == '') { |
|
740 | - $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d')); |
|
741 | - } else { |
|
742 | - $polar = $Stats->getStatsSource('polar',$year,$month); |
|
743 | - } |
|
744 | - if (!empty($polar)) { |
|
745 | - print '<h2>'._("Coverage pattern").'</h2>'; |
|
746 | - foreach ($polar as $eachpolar) { |
|
747 | - unset($polar_data); |
|
748 | - $Spotter = new Spotter(); |
|
749 | - $data = json_decode($eachpolar['source_data']); |
|
750 | - foreach($data as $value => $key) { |
|
751 | - $direction = $Spotter->parseDirection(($value*22.5)); |
|
752 | - $distance = $key; |
|
753 | - $unit = 'km'; |
|
738 | + //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
739 | + if ($year == '' && $month == '') { |
|
740 | + $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d')); |
|
741 | + } else { |
|
742 | + $polar = $Stats->getStatsSource('polar',$year,$month); |
|
743 | + } |
|
744 | + if (!empty($polar)) { |
|
745 | + print '<h2>'._("Coverage pattern").'</h2>'; |
|
746 | + foreach ($polar as $eachpolar) { |
|
747 | + unset($polar_data); |
|
748 | + $Spotter = new Spotter(); |
|
749 | + $data = json_decode($eachpolar['source_data']); |
|
750 | + foreach($data as $value => $key) { |
|
751 | + $direction = $Spotter->parseDirection(($value*22.5)); |
|
752 | + $distance = $key; |
|
753 | + $unit = 'km'; |
|
754 | 754 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
755 | 755 | $distance = round($distance*0.539957); |
756 | 756 | $unit = 'nm'; |
@@ -761,10 +761,10 @@ discard block |
||
761 | 761 | $distance = $distance; |
762 | 762 | $unit = 'km'; |
763 | 763 | } |
764 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
765 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
766 | - } |
|
767 | - ?> |
|
764 | + if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
765 | + else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
766 | + } |
|
767 | + ?> |
|
768 | 768 | <div class="col-md-6"> |
769 | 769 | <h4><?php print $eachpolar['source_name']; ?></h4> |
770 | 770 | <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
@@ -796,27 +796,27 @@ discard block |
||
796 | 796 | </script> |
797 | 797 | </div> |
798 | 798 | <?php |
799 | - } |
|
800 | - } |
|
801 | - ?> |
|
799 | + } |
|
800 | + } |
|
801 | + ?> |
|
802 | 802 | </div> |
803 | 803 | <div class="row column"> |
804 | 804 | <div class="col-md-6"> |
805 | 805 | <?php |
806 | - //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
807 | - if ($year == '' && $month == '') { |
|
808 | - $msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d')); |
|
809 | - } else { |
|
810 | - $msg = $Stats->getStatsSource('msg',$year,$month); |
|
811 | - } |
|
812 | - if (!empty($msg)) { |
|
813 | - print '<h2>'._("Messages received").'</h2>'; |
|
814 | - foreach ($msg as $eachmsg) { |
|
815 | - //$eachmsg = $msg[0]; |
|
816 | - $data = $eachmsg['source_data']; |
|
817 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
818 | - else $max = 500; |
|
819 | - ?> |
|
806 | + //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
807 | + if ($year == '' && $month == '') { |
|
808 | + $msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d')); |
|
809 | + } else { |
|
810 | + $msg = $Stats->getStatsSource('msg',$year,$month); |
|
811 | + } |
|
812 | + if (!empty($msg)) { |
|
813 | + print '<h2>'._("Messages received").'</h2>'; |
|
814 | + foreach ($msg as $eachmsg) { |
|
815 | + //$eachmsg = $msg[0]; |
|
816 | + $data = $eachmsg['source_data']; |
|
817 | + if ($data > 500) $max = (round(($data+100)/100))*100; |
|
818 | + else $max = 500; |
|
819 | + ?> |
|
820 | 820 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
821 | 821 | <script> |
822 | 822 | var g = new JustGage({ |
@@ -832,9 +832,9 @@ discard block |
||
832 | 832 | }); |
833 | 833 | </script> |
834 | 834 | <?php |
835 | - } |
|
836 | - } |
|
837 | - ?> |
|
835 | + } |
|
836 | + } |
|
837 | + ?> |
|
838 | 838 | </div> |
839 | 839 | </div> |
840 | 840 | <div class="row column"> |
@@ -866,19 +866,19 @@ discard block |
||
866 | 866 | $hist_data .= '[ "'.$distance.'",'.$nb.'],'; |
867 | 867 | } |
868 | 868 | $hist_data = substr($hist_data, 0, -1); |
869 | - ?> |
|
869 | + ?> |
|
870 | 870 | <div class="col-md-6"> |
871 | 871 | <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
872 | 872 | <?php |
873 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
873 | + print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
874 | 874 | <script> |
875 | 875 | google.load("visualization", "1", {packages:["corechart"]}); |
876 | 876 | google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
877 | 877 | function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
878 | 878 | var data = google.visualization.arrayToDataTable([ |
879 | 879 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
880 | - print $hist_data; |
|
881 | - print ']); |
|
880 | + print $hist_data; |
|
881 | + print ']); |
|
882 | 882 | |
883 | 883 | var options = { |
884 | 884 | legend: {position: "none"}, |
@@ -896,15 +896,15 @@ discard block |
||
896 | 896 | drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
897 | 897 | }); |
898 | 898 | </script>'; |
899 | - ?> |
|
899 | + ?> |
|
900 | 900 | </div> |
901 | 901 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
902 | 902 | <?php |
903 | - } |
|
904 | - ?> |
|
903 | + } |
|
904 | + ?> |
|
905 | 905 | </div> |
906 | 906 | <?php |
907 | - } |
|
907 | + } |
|
908 | 908 | ?> |
909 | 909 | </div> |
910 | 910 | </div> |
@@ -7,20 +7,20 @@ discard block |
||
7 | 7 | $title = _("Statistics"); |
8 | 8 | |
9 | 9 | if (!isset($filter_name)) $filter_name = ''; |
10 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
10 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
11 | 11 | if ($airline_icao == 'all') { |
12 | 12 | unset($_COOKIE['stats_airline_icao']); |
13 | - setcookie('stats_airline_icao', '', time()-3600); |
|
13 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
14 | 14 | $airline_icao = ''; |
15 | 15 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
16 | 16 | $airline_icao = $_COOKIE['stats_airline_icao']; |
17 | 17 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
18 | 18 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
19 | 19 | } |
20 | -setcookie('stats_airline_icao',$airline_icao); |
|
20 | +setcookie('stats_airline_icao', $airline_icao); |
|
21 | 21 | |
22 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
23 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
22 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
23 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
24 | 24 | |
25 | 25 | require_once('header.php'); |
26 | 26 | |
@@ -41,55 +41,55 @@ discard block |
||
41 | 41 | date_default_timezone_set('UTC'); |
42 | 42 | $lastupdate = strtotime($last_update[0]['value']); |
43 | 43 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
44 | - print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
|
44 | + print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>'; |
|
45 | 45 | } |
46 | 46 | ?> |
47 | 47 | </div> |
48 | 48 | <?php include('statistics-sub-menu.php'); ?> |
49 | 49 | <p class="global-stats"> |
50 | - <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span> |
|
51 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
52 | - <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
|
53 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
50 | + <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span> |
|
51 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
52 | + <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
|
53 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
54 | 54 | <?php |
55 | 55 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
56 | 56 | ?> |
57 | - <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span> |
|
58 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
57 | + <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span> |
|
58 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
59 | 59 | <?php |
60 | 60 | } else { |
61 | 61 | ?> |
62 | - <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span> |
|
63 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
62 | + <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span> |
|
63 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
64 | 64 | <?php |
65 | 65 | } |
66 | 66 | ?> |
67 | - <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span> |
|
68 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
67 | + <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircrafts types"); ?></span> |
|
68 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
69 | 69 | <?php |
70 | 70 | if ($airline_icao == '') { |
71 | 71 | ?> |
72 | - <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span> |
|
73 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
72 | + <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span> |
|
73 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
74 | 74 | <?php |
75 | 75 | } |
76 | 76 | ?> |
77 | 77 | <?php |
78 | 78 | if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) { |
79 | 79 | ?> |
80 | - <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span> |
|
81 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
80 | + <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span> |
|
81 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
82 | 82 | <?php |
83 | 83 | } |
84 | 84 | ?> |
85 | 85 | </p> |
86 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
86 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
87 | 87 | <div class="specific-stats"> |
88 | 88 | <div class="row column"> |
89 | 89 | <div class="col-md-6"> |
90 | 90 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
91 | 91 | <?php |
92 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
92 | + $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month); |
|
93 | 93 | if (count($aircraft_array) == 0) print _("No data available"); |
94 | 94 | else { |
95 | 95 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | var data = google.visualization.arrayToDataTable([ |
102 | 102 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
103 | 103 | $aircraft_data = ''; |
104 | - foreach($aircraft_array as $aircraft_item) |
|
104 | + foreach ($aircraft_array as $aircraft_item) |
|
105 | 105 | { |
106 | 106 | $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
107 | 107 | } |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | ?> |
139 | 139 | </div> |
140 | 140 | </div> |
141 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
141 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
142 | 142 | <?php |
143 | 143 | // echo $airline_icao; |
144 | 144 | if ($airline_icao == '' || $airline_icao == 'all') { |
145 | - $airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month); |
|
145 | + $airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month); |
|
146 | 146 | if (count($airline_array) > 0) { |
147 | 147 | print '<div class="col-md-6">'; |
148 | 148 | print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | var data = google.visualization.arrayToDataTable([ |
155 | 155 | ["'._("Airline").'", "'._("# of times").'"], '; |
156 | 156 | $airline_data = ''; |
157 | - foreach($airline_array as $airline_item) |
|
157 | + foreach ($airline_array as $airline_item) |
|
158 | 158 | { |
159 | 159 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
160 | 160 | } |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | } |
185 | 185 | ?> |
186 | 186 | </div> |
187 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
187 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
188 | 188 | <?php |
189 | 189 | } |
190 | 190 | ?> |
191 | 191 | <div class="row column"> |
192 | 192 | <?php |
193 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name,$year,$month); |
|
193 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao, $filter_name, $year, $month); |
|
194 | 194 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
195 | 195 | if (empty($flightover_array)) { |
196 | 196 | print '<div class="col-md-12">'; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | ?> |
201 | 201 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
202 | 202 | <?php |
203 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month); |
|
203 | + $pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month); |
|
204 | 204 | if (count($pilot_array) == 0) print _("No data available"); |
205 | 205 | else { |
206 | 206 | print '<div id="chart7" class="chart" width="100%"></div> |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | var data = google.visualization.arrayToDataTable([ |
212 | 212 | ["'._("Pilots").'", "'._("# of times").'"], '; |
213 | 213 | $pilot_data = ''; |
214 | - foreach($pilot_array as $pilot_item) |
|
214 | + foreach ($pilot_array as $pilot_item) |
|
215 | 215 | { |
216 | 216 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
217 | 217 | } |
@@ -239,14 +239,14 @@ discard block |
||
239 | 239 | ?> |
240 | 240 | </div> |
241 | 241 | |
242 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
242 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
243 | 243 | <?php |
244 | 244 | } else { |
245 | 245 | ?> |
246 | 246 | <div class="col-md-6"> |
247 | 247 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
248 | 248 | <?php |
249 | - $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month); |
|
249 | + $owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month); |
|
250 | 250 | if (count($owner_array) == 0) print _("No data available"); |
251 | 251 | else { |
252 | 252 | print '<div id="chart7" class="chart" width="100%"></div> |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | var data = google.visualization.arrayToDataTable([ |
258 | 258 | ["'._("Owner").'", "'._("# of times").'"], '; |
259 | 259 | $owner_data = ''; |
260 | - foreach($owner_array as $owner_item) |
|
260 | + foreach ($owner_array as $owner_item) |
|
261 | 261 | { |
262 | 262 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
263 | 263 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | </div> |
286 | 286 | </div> |
287 | 287 | |
288 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
288 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
289 | 289 | <?php |
290 | 290 | } |
291 | 291 | if (!empty($flightover_array)) { |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | var data = google.visualization.arrayToDataTable([ |
305 | 305 | ["'._("Country").'", "'._("# of times").'"], '; |
306 | 306 | $flightover_data = ''; |
307 | - foreach($flightover_array as $flightover_item) |
|
307 | + foreach ($flightover_array as $flightover_item) |
|
308 | 308 | { |
309 | 309 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
310 | 310 | } |
@@ -337,14 +337,14 @@ discard block |
||
337 | 337 | } |
338 | 338 | ?> |
339 | 339 | </div> |
340 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
340 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
341 | 341 | |
342 | 342 | |
343 | 343 | </div> |
344 | 344 | <div class="row column"> |
345 | 345 | <div class="col-md-6"> |
346 | 346 | <?php |
347 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
347 | + $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month); |
|
348 | 348 | if (count($airport_airport_array) > 0) { |
349 | 349 | print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>'; |
350 | 350 | print '<div id="chart3" class="chart" width="100%"></div> |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | var data = google.visualization.arrayToDataTable([ |
360 | 360 | ["'._("Airport").'", "'._("# of times").'"],'; |
361 | 361 | $airport_data = ''; |
362 | - foreach($airport_airport_array as $airport_item) |
|
362 | + foreach ($airport_airport_array as $airport_item) |
|
363 | 363 | { |
364 | 364 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
365 | 365 | $name = str_replace("'", "", $name); |
@@ -386,11 +386,11 @@ discard block |
||
386 | 386 | } |
387 | 387 | ?> |
388 | 388 | </div> |
389 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
389 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
390 | 390 | |
391 | 391 | <div class="col-md-6"> |
392 | 392 | <?php |
393 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month); |
|
393 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month); |
|
394 | 394 | if (count($airport_airport_array2) > 0) { |
395 | 395 | print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>'; |
396 | 396 | print '<div id="chart4" class="chart" width="100%"></div> |
@@ -405,10 +405,10 @@ discard block |
||
405 | 405 | var data = google.visualization.arrayToDataTable([ |
406 | 406 | ["'._("Airport").'", "'._("# of times").'"],'; |
407 | 407 | $airport_data2 = ''; |
408 | - foreach($airport_airport_array2 as $airport_item2) |
|
408 | + foreach ($airport_airport_array2 as $airport_item2) |
|
409 | 409 | { |
410 | 410 | $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
411 | - $name2 = str_replace(array("'",'"'), '', $name2); |
|
411 | + $name2 = str_replace(array("'", '"'), '', $name2); |
|
412 | 412 | $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
413 | 413 | } |
414 | 414 | $airport_data2 = substr($airport_data2, 0, -1); |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | ?> |
433 | 433 | </div> |
434 | 434 | </div> |
435 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
435 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
436 | 436 | <?php |
437 | 437 | if ($year == '' && $month == '') { |
438 | 438 | ?> |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | <div class="col-md-6"> |
441 | 441 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
442 | 442 | <?php |
443 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
443 | + $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
444 | 444 | if (count($year_array) == 0) print _("No data available"); |
445 | 445 | else { |
446 | 446 | print '<div id="chart8" class="chart" width="100%"></div> |
@@ -451,9 +451,9 @@ discard block |
||
451 | 451 | var data = google.visualization.arrayToDataTable([ |
452 | 452 | ["'._("Month").'", "'._("# of Flights").'"], '; |
453 | 453 | $year_data = ''; |
454 | - foreach($year_array as $year_item) |
|
454 | + foreach ($year_array as $year_item) |
|
455 | 455 | { |
456 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
456 | + $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
457 | 457 | } |
458 | 458 | $year_data = substr($year_data, 0, -1); |
459 | 459 | print $year_data; |
@@ -481,11 +481,11 @@ discard block |
||
481 | 481 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
482 | 482 | </div> |
483 | 483 | </div> |
484 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
484 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
485 | 485 | <div class="col-md-6"> |
486 | 486 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
487 | 487 | <?php |
488 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
488 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name); |
|
489 | 489 | if (count($month_array) == 0) print _("No data available"); |
490 | 490 | else { |
491 | 491 | print '<div id="chart9" class="chart" width="100%"></div> |
@@ -496,9 +496,9 @@ discard block |
||
496 | 496 | var data = google.visualization.arrayToDataTable([ |
497 | 497 | ["'._("Day").'", "'._("# of Flights").'"], '; |
498 | 498 | $month_data = ''; |
499 | - foreach($month_array as $month_item) |
|
499 | + foreach ($month_array as $month_item) |
|
500 | 500 | { |
501 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
501 | + $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
502 | 502 | } |
503 | 503 | $month_data = substr($month_data, 0, -1); |
504 | 504 | print $month_data; |
@@ -526,12 +526,12 @@ discard block |
||
526 | 526 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
527 | 527 | </div> |
528 | 528 | </div> |
529 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
529 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
530 | 530 | |
531 | 531 | <div class="col-md-6"> |
532 | 532 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
533 | 533 | <?php |
534 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
534 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name); |
|
535 | 535 | if (empty($date_array)) print _("No data available"); |
536 | 536 | else { |
537 | 537 | print '<div id="chart5" class="chart" width="100%"></div> |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | ["'._("Date").'", "'._("# of Flights").'"], '; |
544 | 544 | $date_data = ''; |
545 | 545 | |
546 | - foreach($date_array as $date_item) |
|
546 | + foreach ($date_array as $date_item) |
|
547 | 547 | { |
548 | 548 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
549 | 549 | } |
@@ -573,11 +573,11 @@ discard block |
||
573 | 573 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
574 | 574 | </div> |
575 | 575 | </div> |
576 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
576 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
577 | 577 | <div class="col-md-6"> |
578 | 578 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
579 | 579 | <?php |
580 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
580 | + $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name); |
|
581 | 581 | if (empty($hour_array)) print _("No data available"); |
582 | 582 | else { |
583 | 583 | |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | var data = google.visualization.arrayToDataTable([ |
590 | 590 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
591 | 591 | $hour_data = ''; |
592 | - foreach($hour_array as $hour_item) |
|
592 | + foreach ($hour_array as $hour_item) |
|
593 | 593 | { |
594 | 594 | $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
595 | 595 | } |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
620 | 620 | </div> |
621 | 621 | </div> |
622 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
622 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
623 | 623 | </div> |
624 | 624 | <?php |
625 | 625 | } |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | var data = google.visualization.arrayToDataTable([ |
646 | 646 | ["'._("Year").'", "'._("# of Fatalities").'"], '; |
647 | 647 | $year_data = ''; |
648 | - foreach($year_array as $year_item) |
|
648 | + foreach ($year_array as $year_item) |
|
649 | 649 | { |
650 | 650 | $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],'; |
651 | 651 | } |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
676 | 676 | </div> |
677 | 677 | </div> |
678 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
678 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
679 | 679 | |
680 | 680 | <div class="row column"> |
681 | 681 | <div class="col-md-6"> |
@@ -694,9 +694,9 @@ discard block |
||
694 | 694 | var data = google.visualization.arrayToDataTable([ |
695 | 695 | ["'._("Month").'", "'._("# of Fatalities").'"], '; |
696 | 696 | $year_data = ''; |
697 | - foreach($year_array as $year_item) |
|
697 | + foreach ($year_array as $year_item) |
|
698 | 698 | { |
699 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],'; |
|
699 | + $year_data .= '[ "'.date('F, Y', strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],'; |
|
700 | 700 | } |
701 | 701 | $year_data = substr($year_data, 0, -1); |
702 | 702 | print $year_data; |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
725 | 725 | </div> |
726 | 726 | </div> |
727 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
727 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
728 | 728 | <br/> |
729 | 729 | <?php |
730 | 730 | } |
@@ -737,9 +737,9 @@ discard block |
||
737 | 737 | <?php |
738 | 738 | //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
739 | 739 | if ($year == '' && $month == '') { |
740 | - $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d')); |
|
740 | + $polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d')); |
|
741 | 741 | } else { |
742 | - $polar = $Stats->getStatsSource('polar',$year,$month); |
|
742 | + $polar = $Stats->getStatsSource('polar', $year, $month); |
|
743 | 743 | } |
744 | 744 | if (!empty($polar)) { |
745 | 745 | print '<h2>'._("Coverage pattern").'</h2>'; |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | unset($polar_data); |
748 | 748 | $Spotter = new Spotter(); |
749 | 749 | $data = json_decode($eachpolar['source_data']); |
750 | - foreach($data as $value => $key) { |
|
750 | + foreach ($data as $value => $key) { |
|
751 | 751 | $direction = $Spotter->parseDirection(($value*22.5)); |
752 | 752 | $distance = $key; |
753 | 753 | $unit = 'km'; |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | ?> |
768 | 768 | <div class="col-md-6"> |
769 | 769 | <h4><?php print $eachpolar['source_name']; ?></h4> |
770 | - <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
770 | + <div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
771 | 771 | <script> |
772 | 772 | (function() { |
773 | 773 | var margin = {top: 100, right: 100, bottom: 100, left: 100}, |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | color: color, |
792 | 792 | unit: '<?php echo $unit; ?>' |
793 | 793 | }; |
794 | - RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
794 | + RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
795 | 795 | })(); |
796 | 796 | </script> |
797 | 797 | </div> |
@@ -805,22 +805,22 @@ discard block |
||
805 | 805 | <?php |
806 | 806 | //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
807 | 807 | if ($year == '' && $month == '') { |
808 | - $msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d')); |
|
808 | + $msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d')); |
|
809 | 809 | } else { |
810 | - $msg = $Stats->getStatsSource('msg',$year,$month); |
|
810 | + $msg = $Stats->getStatsSource('msg', $year, $month); |
|
811 | 811 | } |
812 | 812 | if (!empty($msg)) { |
813 | 813 | print '<h2>'._("Messages received").'</h2>'; |
814 | 814 | foreach ($msg as $eachmsg) { |
815 | 815 | //$eachmsg = $msg[0]; |
816 | 816 | $data = $eachmsg['source_data']; |
817 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
817 | + if ($data > 500) $max = (round(($data + 100)/100))*100; |
|
818 | 818 | else $max = 500; |
819 | 819 | ?> |
820 | - <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
820 | + <div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
821 | 821 | <script> |
822 | 822 | var g = new JustGage({ |
823 | - id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>", |
|
823 | + id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>", |
|
824 | 824 | value: <?php echo $data; ?>, |
825 | 825 | min: 0, |
826 | 826 | max: <?php print $max; ?>, |
@@ -842,15 +842,15 @@ discard block |
||
842 | 842 | <?php |
843 | 843 | //$hist = $Stats->getStatsSource(date('Y-m-d'),'hist'); |
844 | 844 | if ($year == '' && $month == '') { |
845 | - $hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d')); |
|
845 | + $hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d')); |
|
846 | 846 | } else { |
847 | - $hist = $Stats->getStatsSource('hist',$year,$month); |
|
847 | + $hist = $Stats->getStatsSource('hist', $year, $month); |
|
848 | 848 | } |
849 | 849 | foreach ($hist as $hists) { |
850 | 850 | $hist_data = ''; |
851 | 851 | $source = $hists['source_name']; |
852 | 852 | $hist_array = json_decode($hists['source_data']); |
853 | - foreach($hist_array as $distance => $nb) |
|
853 | + foreach ($hist_array as $distance => $nb) |
|
854 | 854 | { |
855 | 855 | $unit = 'km'; |
856 | 856 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -868,13 +868,13 @@ discard block |
||
868 | 868 | $hist_data = substr($hist_data, 0, -1); |
869 | 869 | ?> |
870 | 870 | <div class="col-md-6"> |
871 | - <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
|
871 | + <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2> |
|
872 | 872 | <?php |
873 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
873 | + print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div> |
|
874 | 874 | <script> |
875 | 875 | google.load("visualization", "1", {packages:["corechart"]}); |
876 | - google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
|
877 | - function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
|
876 | + google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).'); |
|
877 | + function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() { |
|
878 | 878 | var data = google.visualization.arrayToDataTable([ |
879 | 879 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
880 | 880 | print $hist_data; |
@@ -889,16 +889,16 @@ discard block |
||
889 | 889 | colors: ["#1a3151"] |
890 | 890 | }; |
891 | 891 | |
892 | - var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'")); |
|
892 | + var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'")); |
|
893 | 893 | chart.draw(data, options); |
894 | 894 | } |
895 | 895 | $(window).resize(function(){ |
896 | - drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
|
896 | + drawCharthist_'.str_replace(' ', '_', strtolower($source)).'(); |
|
897 | 897 | }); |
898 | 898 | </script>'; |
899 | 899 | ?> |
900 | 900 | </div> |
901 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
901 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
902 | 902 | <?php |
903 | 903 | } |
904 | 904 | ?> |
@@ -6,7 +6,9 @@ discard block |
||
6 | 6 | $Stats = new Stats(); |
7 | 7 | $title = _("Statistics"); |
8 | 8 | |
9 | -if (!isset($filter_name)) $filter_name = ''; |
|
9 | +if (!isset($filter_name)) { |
|
10 | + $filter_name = ''; |
|
11 | +} |
|
10 | 12 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
11 | 13 | if ($airline_icao == 'all') { |
12 | 14 | unset($_COOKIE['stats_airline_icao']); |
@@ -15,8 +17,10 @@ discard block |
||
15 | 17 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
16 | 18 | $airline_icao = $_COOKIE['stats_airline_icao']; |
17 | 19 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
18 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
19 | -} |
|
20 | + if (isset($globalFilter['airline'])) { |
|
21 | + $airline_icao = $globalFilter['airline'][0]; |
|
22 | + } |
|
23 | + } |
|
20 | 24 | setcookie('stats_airline_icao',$airline_icao); |
21 | 25 | |
22 | 26 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
@@ -40,7 +44,9 @@ discard block |
||
40 | 44 | if (isset($last_update[0]['value'])) { |
41 | 45 | date_default_timezone_set('UTC'); |
42 | 46 | $lastupdate = strtotime($last_update[0]['value']); |
43 | - if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
|
47 | + if (isset($globalTimezone) && $globalTimezone != '') { |
|
48 | + date_default_timezone_set($globalTimezone); |
|
49 | + } |
|
44 | 50 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
45 | 51 | } |
46 | 52 | ?> |
@@ -90,8 +96,9 @@ discard block |
||
90 | 96 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
91 | 97 | <?php |
92 | 98 | $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
93 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
94 | - else { |
|
99 | + if (count($aircraft_array) == 0) { |
|
100 | + print _("No data available"); |
|
101 | + } else { |
|
95 | 102 | |
96 | 103 | print '<div id="chart1" class="chart" width="100%"></div> |
97 | 104 | <script> |
@@ -201,8 +208,9 @@ discard block |
||
201 | 208 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
202 | 209 | <?php |
203 | 210 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month); |
204 | - if (count($pilot_array) == 0) print _("No data available"); |
|
205 | - else { |
|
211 | + if (count($pilot_array) == 0) { |
|
212 | + print _("No data available"); |
|
213 | + } else { |
|
206 | 214 | print '<div id="chart7" class="chart" width="100%"></div> |
207 | 215 | <script> |
208 | 216 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -247,8 +255,9 @@ discard block |
||
247 | 255 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
248 | 256 | <?php |
249 | 257 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month); |
250 | - if (count($owner_array) == 0) print _("No data available"); |
|
251 | - else { |
|
258 | + if (count($owner_array) == 0) { |
|
259 | + print _("No data available"); |
|
260 | + } else { |
|
252 | 261 | print '<div id="chart7" class="chart" width="100%"></div> |
253 | 262 | <script> |
254 | 263 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -294,8 +303,9 @@ discard block |
||
294 | 303 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
295 | 304 | <?php |
296 | 305 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
297 | - if (count($flightover_array) == 0) print _("No data available"); |
|
298 | - else { |
|
306 | + if (count($flightover_array) == 0) { |
|
307 | + print _("No data available"); |
|
308 | + } else { |
|
299 | 309 | print '<div id="chart10" class="chart" width="100%"></div> |
300 | 310 | <script> |
301 | 311 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -441,8 +451,9 @@ discard block |
||
441 | 451 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
442 | 452 | <?php |
443 | 453 | $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
444 | - if (count($year_array) == 0) print _("No data available"); |
|
445 | - else { |
|
454 | + if (count($year_array) == 0) { |
|
455 | + print _("No data available"); |
|
456 | + } else { |
|
446 | 457 | print '<div id="chart8" class="chart" width="100%"></div> |
447 | 458 | <script> |
448 | 459 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -486,8 +497,9 @@ discard block |
||
486 | 497 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
487 | 498 | <?php |
488 | 499 | $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
489 | - if (count($month_array) == 0) print _("No data available"); |
|
490 | - else { |
|
500 | + if (count($month_array) == 0) { |
|
501 | + print _("No data available"); |
|
502 | + } else { |
|
491 | 503 | print '<div id="chart9" class="chart" width="100%"></div> |
492 | 504 | <script> |
493 | 505 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -532,8 +544,9 @@ discard block |
||
532 | 544 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
533 | 545 | <?php |
534 | 546 | $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
535 | - if (empty($date_array)) print _("No data available"); |
|
536 | - else { |
|
547 | + if (empty($date_array)) { |
|
548 | + print _("No data available"); |
|
549 | + } else { |
|
537 | 550 | print '<div id="chart5" class="chart" width="100%"></div> |
538 | 551 | <script> |
539 | 552 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -578,8 +591,9 @@ discard block |
||
578 | 591 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
579 | 592 | <?php |
580 | 593 | $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
581 | - if (empty($hour_array)) print _("No data available"); |
|
582 | - else { |
|
594 | + if (empty($hour_array)) { |
|
595 | + print _("No data available"); |
|
596 | + } else { |
|
583 | 597 | |
584 | 598 | print '<div id="chart6" class="chart" width="100%"></div> |
585 | 599 | <script> |
@@ -635,8 +649,9 @@ discard block |
||
635 | 649 | require_once('require/class.Accident.php'); |
636 | 650 | $Accident = new Accident(); |
637 | 651 | $year_array = $Accident->countFatalitiesByYear($filter_name); |
638 | - if (count($year_array) == 0) print _("No data available"); |
|
639 | - else { |
|
652 | + if (count($year_array) == 0) { |
|
653 | + print _("No data available"); |
|
654 | + } else { |
|
640 | 655 | print '<div id="chart32" class="chart" width="100%"></div> |
641 | 656 | <script> |
642 | 657 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -684,8 +699,9 @@ discard block |
||
684 | 699 | require_once('require/class.Accident.php'); |
685 | 700 | $Accident = new Accident(); |
686 | 701 | $year_array = $Accident->countFatalitiesLast12Months($filter_name); |
687 | - if (count($year_array) == 0) print _("No data available"); |
|
688 | - else { |
|
702 | + if (count($year_array) == 0) { |
|
703 | + print _("No data available"); |
|
704 | + } else { |
|
689 | 705 | print '<div id="chart33" class="chart" width="100%"></div> |
690 | 706 | <script> |
691 | 707 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -761,8 +777,11 @@ discard block |
||
761 | 777 | $distance = $distance; |
762 | 778 | $unit = 'km'; |
763 | 779 | } |
764 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
765 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
780 | + if (!isset($polar_data)) { |
|
781 | + $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
782 | + } else { |
|
783 | + $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
784 | + } |
|
766 | 785 | } |
767 | 786 | ?> |
768 | 787 | <div class="col-md-6"> |
@@ -814,8 +833,11 @@ discard block |
||
814 | 833 | foreach ($msg as $eachmsg) { |
815 | 834 | //$eachmsg = $msg[0]; |
816 | 835 | $data = $eachmsg['source_data']; |
817 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
818 | - else $max = 500; |
|
836 | + if ($data > 500) { |
|
837 | + $max = (round(($data+100)/100))*100; |
|
838 | + } else { |
|
839 | + $max = 500; |
|
840 | + } |
|
819 | 841 | ?> |
820 | 842 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
821 | 843 | <script> |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | 9 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 10 | if ($airline_icao == 'all') { |
11 | - unset($_COOKIE['stats_airline_icao']); |
|
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
13 | - $airline_icao = ''; |
|
11 | + unset($_COOKIE['stats_airline_icao']); |
|
12 | + setcookie('stats_airline_icao', '', time()-3600); |
|
13 | + $airline_icao = ''; |
|
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
15 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
17 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | 18 | } |
19 | 19 | setcookie('stats_airline_icao',$airline_icao); |
20 | 20 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | function drawChart() { |
38 | 38 | var data = google.visualization.arrayToDataTable([ |
39 | 39 | ["'._("Aircraft Manufacturer").'", "'._("# of times").'"], '; |
40 | - $registration_data = ''; |
|
40 | + $registration_data = ''; |
|
41 | 41 | foreach($registration_array as $registration_item) |
42 | 42 | { |
43 | 43 | $registration_data .= '[ "'.$registration_item['registration'].' - '.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')",'.$registration_item['aircraft_registration_count'].'],'; |
@@ -6,19 +6,19 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft Registrations"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
20 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
21 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
21 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
22 | 22 | |
23 | 23 | require_once('header.php'); |
24 | 24 | include('statistics-sub-menu.php'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | </div> |
30 | 30 | <p>'._("Below are the <strong>Top 10</strong> most common aircraft registrations.").'</p>'; |
31 | 31 | |
32 | -$registration_array = $Stats->countAllAircraftRegistrations(true,$airline_icao,$filter_name,$year,$month); |
|
32 | +$registration_array = $Stats->countAllAircraftRegistrations(true, $airline_icao, $filter_name, $year, $month); |
|
33 | 33 | print '<div id="chart" class="chart" width="100%"></div> |
34 | 34 | <script> |
35 | 35 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | var data = google.visualization.arrayToDataTable([ |
39 | 39 | ["'._("Aircraft Manufacturer").'", "'._("# of times").'"], '; |
40 | 40 | $registration_data = ''; |
41 | -foreach($registration_array as $registration_item) |
|
41 | +foreach ($registration_array as $registration_item) |
|
42 | 42 | { |
43 | 43 | $registration_data .= '[ "'.$registration_item['registration'].' - '.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')",'.$registration_item['aircraft_registration_count'].'],'; |
44 | 44 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | print '</thead>'; |
74 | 74 | print '<tbody>'; |
75 | 75 | $i = 1; |
76 | - foreach($registration_array as $registration_item) |
|
76 | + foreach ($registration_array as $registration_item) |
|
77 | 77 | { |
78 | 78 | print '<tr>'; |
79 | 79 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft Registrations"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
21 | 25 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |