@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
| 40 | 40 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
| 41 | 41 | } |
| 42 | - ?> |
|
| 42 | + ?> |
|
| 43 | 43 | </div> |
| 44 | 44 | <?php |
| 45 | 45 | // print_r($Stats->getAllAirlineNames()); |
| 46 | - ?> |
|
| 46 | + ?> |
|
| 47 | 47 | <?php include('statistics-sub-menu.php'); ?> |
| 48 | 48 | <p class="global-stats"> |
| 49 | 49 | <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name)); ?></span> <?php echo _("Flights"); ?></span> |
@@ -51,23 +51,23 @@ discard block |
||
| 51 | 51 | <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
| 52 | 52 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 53 | 53 | <?php |
| 54 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
| 54 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
| 55 | 55 | ?> |
| 56 | 56 | <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name)); ?></span> <?php echo _("Pilots"); ?></span> |
| 57 | 57 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 58 | 58 | <?php |
| 59 | - } else { |
|
| 60 | - ?> |
|
| 59 | + } else { |
|
| 60 | + ?> |
|
| 61 | 61 | <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name)); ?></span> <?php echo _("Owners"); ?></span> |
| 62 | 62 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 63 | 63 | <?php |
| 64 | - } |
|
| 65 | - ?> |
|
| 64 | + } |
|
| 65 | + ?> |
|
| 66 | 66 | <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name)); ?></span> <?php echo _("Aircrafts"); ?></span> |
| 67 | 67 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 68 | 68 | <?php |
| 69 | - if ($airline_icao == '') { |
|
| 70 | - ?> |
|
| 69 | + if ($airline_icao == '') { |
|
| 70 | + ?> |
|
| 71 | 71 | <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name)); ?></span> <?php echo _("Airlines"); ?></span> |
| 72 | 72 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 73 | 73 | <?php |
@@ -88,25 +88,25 @@ discard block |
||
| 88 | 88 | <div class="col-md-6"> |
| 89 | 89 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
| 90 | 90 | <?php |
| 91 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
|
| 92 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
| 93 | - else { |
|
| 91 | + $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
|
| 92 | + if (count($aircraft_array) == 0) print _("No data available"); |
|
| 93 | + else { |
|
| 94 | 94 | |
| 95 | - print '<div id="chart1" class="chart" width="100%"></div> |
|
| 95 | + print '<div id="chart1" class="chart" width="100%"></div> |
|
| 96 | 96 | <script> |
| 97 | 97 | google.load("visualization", "1", {packages:["corechart"]}); |
| 98 | 98 | google.setOnLoadCallback(drawChart1); |
| 99 | 99 | function drawChart1() { |
| 100 | 100 | var data = google.visualization.arrayToDataTable([ |
| 101 | 101 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
| 102 | - $aircraft_data = ''; |
|
| 103 | - foreach($aircraft_array as $aircraft_item) |
|
| 104 | - { |
|
| 105 | - $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
| 106 | - } |
|
| 107 | - $aircraft_data = substr($aircraft_data, 0, -1); |
|
| 108 | - print $aircraft_data; |
|
| 109 | - print ']); |
|
| 102 | + $aircraft_data = ''; |
|
| 103 | + foreach($aircraft_array as $aircraft_item) |
|
| 104 | + { |
|
| 105 | + $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
| 106 | + } |
|
| 107 | + $aircraft_data = substr($aircraft_data, 0, -1); |
|
| 108 | + print $aircraft_data; |
|
| 109 | + print ']); |
|
| 110 | 110 | |
| 111 | 111 | var options = { |
| 112 | 112 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | drawChart1(); |
| 122 | 122 | }); |
| 123 | 123 | </script>'; |
| 124 | - } |
|
| 125 | - ?> |
|
| 124 | + } |
|
| 125 | + ?> |
|
| 126 | 126 | <div class="more"> |
| 127 | 127 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 128 | 128 | </div> |
@@ -130,27 +130,27 @@ discard block |
||
| 130 | 130 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 131 | 131 | <?php |
| 132 | 132 | // echo $airline_icao; |
| 133 | - if ($airline_icao == '' || $airline_icao == 'all') { |
|
| 133 | + if ($airline_icao == '' || $airline_icao == 'all') { |
|
| 134 | 134 | $airline_array = $Stats->countAllAirlines(true,$filter_name); |
| 135 | 135 | if (count($airline_array) == 0) print _("No data available"); |
| 136 | 136 | else { |
| 137 | - print '<div class="col-md-6">'; |
|
| 138 | - print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
| 139 | - print '<div id="chart2" class="chart" width="100%"></div> |
|
| 137 | + print '<div class="col-md-6">'; |
|
| 138 | + print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
| 139 | + print '<div id="chart2" class="chart" width="100%"></div> |
|
| 140 | 140 | <script> |
| 141 | 141 | google.load("visualization", "1", {packages:["corechart"]}); |
| 142 | 142 | google.setOnLoadCallback(drawChart2); |
| 143 | 143 | function drawChart2() { |
| 144 | 144 | var data = google.visualization.arrayToDataTable([ |
| 145 | 145 | ["'._("Airline").'", "'._("# of times").'"], '; |
| 146 | - $airline_data = ''; |
|
| 147 | - foreach($airline_array as $airline_item) |
|
| 148 | - { |
|
| 146 | + $airline_data = ''; |
|
| 147 | + foreach($airline_array as $airline_item) |
|
| 148 | + { |
|
| 149 | 149 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
| 150 | - } |
|
| 151 | - $airline_data = substr($airline_data, 0, -1); |
|
| 152 | - print $airline_data; |
|
| 153 | - print ']); |
|
| 150 | + } |
|
| 151 | + $airline_data = substr($airline_data, 0, -1); |
|
| 152 | + print $airline_data; |
|
| 153 | + print ']); |
|
| 154 | 154 | |
| 155 | 155 | var options = { |
| 156 | 156 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -165,51 +165,51 @@ discard block |
||
| 165 | 165 | drawChart2(); |
| 166 | 166 | }); |
| 167 | 167 | </script>'; |
| 168 | - print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
|
| 169 | - print '</div>'; |
|
| 168 | + print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
|
| 169 | + print '</div>'; |
|
| 170 | 170 | } |
| 171 | 171 | ?> |
| 172 | 172 | </div> |
| 173 | 173 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 174 | 174 | <?php |
| 175 | - } |
|
| 175 | + } |
|
| 176 | 176 | ?> |
| 177 | 177 | <div class="row column"> |
| 178 | 178 | |
| 179 | 179 | <?php |
| 180 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
| 180 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
| 181 | 181 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 182 | - if (empty($flightover_array)) { |
|
| 183 | - ?> |
|
| 182 | + if (empty($flightover_array)) { |
|
| 183 | + ?> |
|
| 184 | 184 | <div class="col-md-12"> |
| 185 | 185 | <?php |
| 186 | - } else { |
|
| 187 | - ?> |
|
| 186 | + } else { |
|
| 187 | + ?> |
|
| 188 | 188 | <div class="col-md-6"> |
| 189 | 189 | <?php |
| 190 | - } |
|
| 191 | - ?> |
|
| 190 | + } |
|
| 191 | + ?> |
|
| 192 | 192 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
| 193 | 193 | <?php |
| 194 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
|
| 195 | - if (count($pilot_array) == 0) print _("No data available"); |
|
| 196 | - else { |
|
| 194 | + $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
|
| 195 | + if (count($pilot_array) == 0) print _("No data available"); |
|
| 196 | + else { |
|
| 197 | 197 | |
| 198 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
| 198 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
| 199 | 199 | <script> |
| 200 | 200 | google.load("visualization", "1", {packages:["corechart"]}); |
| 201 | 201 | google.setOnLoadCallback(drawChart7); |
| 202 | 202 | function drawChart7() { |
| 203 | 203 | var data = google.visualization.arrayToDataTable([ |
| 204 | 204 | ["'._("Pilots").'", "'._("# of times").'"], '; |
| 205 | - $pilot_data = ''; |
|
| 206 | - foreach($pilot_array as $pilot_item) |
|
| 207 | - { |
|
| 208 | - $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
|
| 209 | - } |
|
| 210 | - $pilot_data = substr($pilot_data, 0, -1); |
|
| 211 | - print $pilot_data; |
|
| 212 | - print ']); |
|
| 205 | + $pilot_data = ''; |
|
| 206 | + foreach($pilot_array as $pilot_item) |
|
| 207 | + { |
|
| 208 | + $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
|
| 209 | + } |
|
| 210 | + $pilot_data = substr($pilot_data, 0, -1); |
|
| 211 | + print $pilot_data; |
|
| 212 | + print ']); |
|
| 213 | 213 | |
| 214 | 214 | var options = { |
| 215 | 215 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | drawChart7(); |
| 225 | 225 | }); |
| 226 | 226 | </script>'; |
| 227 | - } |
|
| 228 | - ?> |
|
| 227 | + } |
|
| 228 | + ?> |
|
| 229 | 229 | <div class="more"> |
| 230 | 230 | <a href="<?php print $globalURL; ?>/statistics/pilot" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 231 | 231 | </div> |
@@ -233,30 +233,30 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 235 | 235 | <?php |
| 236 | - } else { |
|
| 237 | - ?> |
|
| 236 | + } else { |
|
| 237 | + ?> |
|
| 238 | 238 | <div class="col-md-6"> |
| 239 | 239 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
| 240 | 240 | <?php |
| 241 | - $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
|
| 242 | - if (count($owner_array) == 0) print _("No data available"); |
|
| 243 | - else { |
|
| 241 | + $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
|
| 242 | + if (count($owner_array) == 0) print _("No data available"); |
|
| 243 | + else { |
|
| 244 | 244 | |
| 245 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
| 245 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
| 246 | 246 | <script> |
| 247 | 247 | google.load("visualization", "1", {packages:["corechart"]}); |
| 248 | 248 | google.setOnLoadCallback(drawChart7); |
| 249 | 249 | function drawChart7() { |
| 250 | 250 | var data = google.visualization.arrayToDataTable([ |
| 251 | 251 | ["'._("Owner").'", "'._("# of times").'"], '; |
| 252 | - $owner_data = ''; |
|
| 253 | - foreach($owner_array as $owner_item) |
|
| 254 | - { |
|
| 255 | - $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
|
| 256 | - } |
|
| 257 | - $owner_data = substr($owner_data, 0, -1); |
|
| 258 | - print $owner_data; |
|
| 259 | - print ']); |
|
| 252 | + $owner_data = ''; |
|
| 253 | + foreach($owner_array as $owner_item) |
|
| 254 | + { |
|
| 255 | + $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
|
| 256 | + } |
|
| 257 | + $owner_data = substr($owner_data, 0, -1); |
|
| 258 | + print $owner_data; |
|
| 259 | + print ']); |
|
| 260 | 260 | |
| 261 | 261 | var options = { |
| 262 | 262 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | drawChart7(); |
| 272 | 272 | }); |
| 273 | 273 | </script>'; |
| 274 | - } |
|
| 275 | - ?> |
|
| 274 | + } |
|
| 275 | + ?> |
|
| 276 | 276 | <div class="more"> |
| 277 | 277 | <a href="<?php print $globalURL; ?>/statistics/owner" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 278 | 278 | </div> |
@@ -280,32 +280,32 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 282 | 282 | <?php |
| 283 | - } |
|
| 284 | - if (!empty($flightover_array)) { |
|
| 285 | - ?> |
|
| 283 | + } |
|
| 284 | + if (!empty($flightover_array)) { |
|
| 285 | + ?> |
|
| 286 | 286 | |
| 287 | 287 | <div class="col-md-6"> |
| 288 | 288 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
| 289 | 289 | <?php |
| 290 | - //$flightover_array = $Stats->countAllFlightOverCountries(); |
|
| 291 | - if (count($flightover_array) == 0) print _("No data available"); |
|
| 292 | - else { |
|
| 290 | + //$flightover_array = $Stats->countAllFlightOverCountries(); |
|
| 291 | + if (count($flightover_array) == 0) print _("No data available"); |
|
| 292 | + else { |
|
| 293 | 293 | |
| 294 | - print '<div id="chart10" class="chart" width="100%"></div> |
|
| 294 | + print '<div id="chart10" class="chart" width="100%"></div> |
|
| 295 | 295 | <script> |
| 296 | 296 | google.load("visualization", "1", {packages:["corechart"]}); |
| 297 | 297 | google.setOnLoadCallback(drawChart10); |
| 298 | 298 | function drawChart10() { |
| 299 | 299 | var data = google.visualization.arrayToDataTable([ |
| 300 | 300 | ["'._("Country").'", "'._("# of times").'"], '; |
| 301 | - $flightover_data = ''; |
|
| 302 | - foreach($flightover_array as $flightover_item) |
|
| 303 | - { |
|
| 304 | - $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
|
| 305 | - } |
|
| 306 | - $flightover_data = substr($flightover_data, 0, -1); |
|
| 307 | - print $flightover_data; |
|
| 308 | - print ']); |
|
| 301 | + $flightover_data = ''; |
|
| 302 | + foreach($flightover_array as $flightover_item) |
|
| 303 | + { |
|
| 304 | + $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
|
| 305 | + } |
|
| 306 | + $flightover_data = substr($flightover_data, 0, -1); |
|
| 307 | + print $flightover_data; |
|
| 308 | + print ']); |
|
| 309 | 309 | |
| 310 | 310 | var options = { |
| 311 | 311 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -322,15 +322,15 @@ discard block |
||
| 322 | 322 | drawChart10(); |
| 323 | 323 | }); |
| 324 | 324 | </script>'; |
| 325 | - } |
|
| 326 | - ?> |
|
| 325 | + } |
|
| 326 | + ?> |
|
| 327 | 327 | <div class="more"> |
| 328 | 328 | <a href="<?php print $globalURL; ?>/statistics/country" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 329 | 329 | </div> |
| 330 | 330 | </div> |
| 331 | 331 | <?php |
| 332 | - } |
|
| 333 | - ?> |
|
| 332 | + } |
|
| 333 | + ?> |
|
| 334 | 334 | </div> |
| 335 | 335 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 336 | 336 | |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | <div class="col-md-6"> |
| 341 | 341 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
| 342 | 342 | <?php |
| 343 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
| 344 | - if (count($airport_airport_array) == 0) print _("No data available"); |
|
| 345 | - else { |
|
| 343 | + $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
| 344 | + if (count($airport_airport_array) == 0) print _("No data available"); |
|
| 345 | + else { |
|
| 346 | 346 | |
| 347 | - print '<div id="chart3" class="chart" width="100%"></div> |
|
| 347 | + print '<div id="chart3" class="chart" width="100%"></div> |
|
| 348 | 348 | <script> |
| 349 | 349 | google.load("visualization", "1", {packages:["geochart"]}); |
| 350 | 350 | google.setOnLoadCallback(drawCharts3); |
@@ -355,17 +355,17 @@ discard block |
||
| 355 | 355 | |
| 356 | 356 | var data = google.visualization.arrayToDataTable([ |
| 357 | 357 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 358 | - $airport_data = ''; |
|
| 359 | - foreach($airport_airport_array as $airport_item) |
|
| 360 | - { |
|
| 361 | - $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
| 362 | - $name = str_replace("'", "", $name); |
|
| 363 | - $name = str_replace('"', "", $name); |
|
| 364 | - $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
| 365 | - } |
|
| 366 | - $airport_data = substr($airport_data, 0, -1); |
|
| 367 | - print $airport_data; |
|
| 368 | - print ']); |
|
| 358 | + $airport_data = ''; |
|
| 359 | + foreach($airport_airport_array as $airport_item) |
|
| 360 | + { |
|
| 361 | + $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
| 362 | + $name = str_replace("'", "", $name); |
|
| 363 | + $name = str_replace('"', "", $name); |
|
| 364 | + $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
| 365 | + } |
|
| 366 | + $airport_data = substr($airport_data, 0, -1); |
|
| 367 | + print $airport_data; |
|
| 368 | + print ']); |
|
| 369 | 369 | |
| 370 | 370 | var options = { |
| 371 | 371 | legend: {position: "none"}, |
@@ -379,8 +379,8 @@ discard block |
||
| 379 | 379 | chart.draw(data, options); |
| 380 | 380 | } |
| 381 | 381 | </script>'; |
| 382 | - } |
|
| 383 | - ?> |
|
| 382 | + } |
|
| 383 | + ?> |
|
| 384 | 384 | <div class="more"> |
| 385 | 385 | <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 386 | 386 | </div> |
@@ -390,11 +390,11 @@ discard block |
||
| 390 | 390 | <div class="col-md-6"> |
| 391 | 391 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
| 392 | 392 | <?php |
| 393 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
| 394 | - if (count($airport_airport_array2) == 0) print _("No data available"); |
|
| 395 | - else { |
|
| 393 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
| 394 | + if (count($airport_airport_array2) == 0) print _("No data available"); |
|
| 395 | + else { |
|
| 396 | 396 | |
| 397 | - print '<div id="chart4" class="chart" width="100%"></div> |
|
| 397 | + print '<div id="chart4" class="chart" width="100%"></div> |
|
| 398 | 398 | <script> |
| 399 | 399 | google.load("visualization", "1", {packages:["geochart"]}); |
| 400 | 400 | google.setOnLoadCallback(drawCharts4); |
@@ -405,17 +405,17 @@ discard block |
||
| 405 | 405 | |
| 406 | 406 | var data = google.visualization.arrayToDataTable([ |
| 407 | 407 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 408 | - $airport_data2 = ''; |
|
| 409 | - foreach($airport_airport_array2 as $airport_item2) |
|
| 410 | - { |
|
| 411 | - $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
| 412 | - $name2 = str_replace("'", "", $name2); |
|
| 413 | - $name2 = str_replace('"', "", $name2); |
|
| 414 | - $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
| 415 | - } |
|
| 416 | - $airport_data2 = substr($airport_data2, 0, -1); |
|
| 417 | - print $airport_data2; |
|
| 418 | - print ']); |
|
| 408 | + $airport_data2 = ''; |
|
| 409 | + foreach($airport_airport_array2 as $airport_item2) |
|
| 410 | + { |
|
| 411 | + $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
| 412 | + $name2 = str_replace("'", "", $name2); |
|
| 413 | + $name2 = str_replace('"', "", $name2); |
|
| 414 | + $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
| 415 | + } |
|
| 416 | + $airport_data2 = substr($airport_data2, 0, -1); |
|
| 417 | + print $airport_data2; |
|
| 418 | + print ']); |
|
| 419 | 419 | |
| 420 | 420 | var options = { |
| 421 | 421 | legend: {position: "none"}, |
@@ -429,8 +429,8 @@ discard block |
||
| 429 | 429 | chart.draw(data, options); |
| 430 | 430 | } |
| 431 | 431 | </script>'; |
| 432 | - } |
|
| 433 | - ?> |
|
| 432 | + } |
|
| 433 | + ?> |
|
| 434 | 434 | <div class="more"> |
| 435 | 435 | <a href="<?php print $globalURL; ?>/statistics/airport-arrival" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 436 | 436 | </div> |
@@ -442,24 +442,24 @@ discard block |
||
| 442 | 442 | <div class="col-md-6"> |
| 443 | 443 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
| 444 | 444 | <?php |
| 445 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
| 446 | - if (count($year_array) == 0) print _("No data available"); |
|
| 447 | - else { |
|
| 448 | - print '<div id="chart8" class="chart" width="100%"></div> |
|
| 445 | + $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
| 446 | + if (count($year_array) == 0) print _("No data available"); |
|
| 447 | + else { |
|
| 448 | + print '<div id="chart8" class="chart" width="100%"></div> |
|
| 449 | 449 | <script> |
| 450 | 450 | google.load("visualization", "1", {packages:["corechart"]}); |
| 451 | 451 | google.setOnLoadCallback(drawChart8); |
| 452 | 452 | function drawChart8() { |
| 453 | 453 | var data = google.visualization.arrayToDataTable([ |
| 454 | 454 | ["'._("Month").'", "'._("# of Flights").'"], '; |
| 455 | - $year_data = ''; |
|
| 456 | - foreach($year_array as $year_item) |
|
| 457 | - { |
|
| 458 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 459 | - } |
|
| 460 | - $year_data = substr($year_data, 0, -1); |
|
| 461 | - print $year_data; |
|
| 462 | - print ']); |
|
| 455 | + $year_data = ''; |
|
| 456 | + foreach($year_array as $year_item) |
|
| 457 | + { |
|
| 458 | + $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 459 | + } |
|
| 460 | + $year_data = substr($year_data, 0, -1); |
|
| 461 | + print $year_data; |
|
| 462 | + print ']); |
|
| 463 | 463 | |
| 464 | 464 | var options = { |
| 465 | 465 | legend: {position: "none"}, |
@@ -477,8 +477,8 @@ discard block |
||
| 477 | 477 | drawChart8(); |
| 478 | 478 | }); |
| 479 | 479 | </script>'; |
| 480 | - } |
|
| 481 | - ?> |
|
| 480 | + } |
|
| 481 | + ?> |
|
| 482 | 482 | <div class="more"> |
| 483 | 483 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 484 | 484 | </div> |
@@ -488,24 +488,24 @@ discard block |
||
| 488 | 488 | <div class="col-md-6"> |
| 489 | 489 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
| 490 | 490 | <?php |
| 491 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
| 492 | - if (count($month_array) == 0) print _("No data available"); |
|
| 493 | - else { |
|
| 494 | - print '<div id="chart9" class="chart" width="100%"></div> |
|
| 491 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
| 492 | + if (count($month_array) == 0) print _("No data available"); |
|
| 493 | + else { |
|
| 494 | + print '<div id="chart9" class="chart" width="100%"></div> |
|
| 495 | 495 | <script> |
| 496 | 496 | google.load("visualization", "1", {packages:["corechart"]}); |
| 497 | 497 | google.setOnLoadCallback(drawChart9); |
| 498 | 498 | function drawChart9() { |
| 499 | 499 | var data = google.visualization.arrayToDataTable([ |
| 500 | 500 | ["'._("Day").'", "'._("# of Flights").'"], '; |
| 501 | - $month_data = ''; |
|
| 502 | - foreach($month_array as $month_item) |
|
| 503 | - { |
|
| 504 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 505 | - } |
|
| 506 | - $month_data = substr($month_data, 0, -1); |
|
| 507 | - print $month_data; |
|
| 508 | - print ']); |
|
| 501 | + $month_data = ''; |
|
| 502 | + foreach($month_array as $month_item) |
|
| 503 | + { |
|
| 504 | + $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 505 | + } |
|
| 506 | + $month_data = substr($month_data, 0, -1); |
|
| 507 | + print $month_data; |
|
| 508 | + print ']); |
|
| 509 | 509 | |
| 510 | 510 | var options = { |
| 511 | 511 | legend: {position: "none"}, |
@@ -523,8 +523,8 @@ discard block |
||
| 523 | 523 | drawChart9(); |
| 524 | 524 | }); |
| 525 | 525 | </script>'; |
| 526 | - } |
|
| 527 | - ?> |
|
| 526 | + } |
|
| 527 | + ?> |
|
| 528 | 528 | <div class="more"> |
| 529 | 529 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 530 | 530 | </div> |
@@ -534,25 +534,25 @@ discard block |
||
| 534 | 534 | <div class="col-md-6"> |
| 535 | 535 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
| 536 | 536 | <?php |
| 537 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
| 538 | - if (empty($date_array)) print _("No data available"); |
|
| 539 | - else { |
|
| 540 | - print '<div id="chart5" class="chart" width="100%"></div> |
|
| 537 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
| 538 | + if (empty($date_array)) print _("No data available"); |
|
| 539 | + else { |
|
| 540 | + print '<div id="chart5" class="chart" width="100%"></div> |
|
| 541 | 541 | <script> |
| 542 | 542 | google.load("visualization", "1", {packages:["corechart"]}); |
| 543 | 543 | google.setOnLoadCallback(drawChart5); |
| 544 | 544 | function drawChart5() { |
| 545 | 545 | var data = google.visualization.arrayToDataTable([ |
| 546 | 546 | ["'._("Date").'", "'._("# of Flights").'"], '; |
| 547 | - $date_data = ''; |
|
| 547 | + $date_data = ''; |
|
| 548 | 548 | |
| 549 | - foreach($date_array as $date_item) |
|
| 550 | - { |
|
| 551 | - $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
| 552 | - } |
|
| 553 | - $date_data = substr($date_data, 0, -1); |
|
| 554 | - print $date_data; |
|
| 555 | - print ']); |
|
| 549 | + foreach($date_array as $date_item) |
|
| 550 | + { |
|
| 551 | + $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
| 552 | + } |
|
| 553 | + $date_data = substr($date_data, 0, -1); |
|
| 554 | + print $date_data; |
|
| 555 | + print ']); |
|
| 556 | 556 | |
| 557 | 557 | var options = { |
| 558 | 558 | legend: {position: "none"}, |
@@ -570,8 +570,8 @@ discard block |
||
| 570 | 570 | drawChart5(); |
| 571 | 571 | }); |
| 572 | 572 | </script>'; |
| 573 | - } |
|
| 574 | - ?> |
|
| 573 | + } |
|
| 574 | + ?> |
|
| 575 | 575 | <div class="more"> |
| 576 | 576 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 577 | 577 | </div> |
@@ -581,25 +581,25 @@ discard block |
||
| 581 | 581 | <div class="col-md-6"> |
| 582 | 582 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 583 | 583 | <?php |
| 584 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
| 585 | - if (empty($hour_array)) print _("No data available"); |
|
| 586 | - else { |
|
| 584 | + $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
| 585 | + if (empty($hour_array)) print _("No data available"); |
|
| 586 | + else { |
|
| 587 | 587 | |
| 588 | - print '<div id="chart6" class="chart" width="100%"></div> |
|
| 588 | + print '<div id="chart6" class="chart" width="100%"></div> |
|
| 589 | 589 | <script> |
| 590 | 590 | google.load("visualization", "1", {packages:["corechart"]}); |
| 591 | 591 | google.setOnLoadCallback(drawChart6); |
| 592 | 592 | function drawChart6() { |
| 593 | 593 | var data = google.visualization.arrayToDataTable([ |
| 594 | 594 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 595 | - $hour_data = ''; |
|
| 596 | - foreach($hour_array as $hour_item) |
|
| 597 | - { |
|
| 598 | - $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
| 599 | - } |
|
| 600 | - $hour_data = substr($hour_data, 0, -1); |
|
| 601 | - print $hour_data; |
|
| 602 | - print ']); |
|
| 595 | + $hour_data = ''; |
|
| 596 | + foreach($hour_array as $hour_item) |
|
| 597 | + { |
|
| 598 | + $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
| 599 | + } |
|
| 600 | + $hour_data = substr($hour_data, 0, -1); |
|
| 601 | + print $hour_data; |
|
| 602 | + print ']); |
|
| 603 | 603 | |
| 604 | 604 | var options = { |
| 605 | 605 | legend: {position: "none"}, |
@@ -617,8 +617,8 @@ discard block |
||
| 617 | 617 | drawChart6(); |
| 618 | 618 | }); |
| 619 | 619 | </script>'; |
| 620 | - } |
|
| 621 | - ?> |
|
| 620 | + } |
|
| 621 | + ?> |
|
| 622 | 622 | <div class="more"> |
| 623 | 623 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 624 | 624 | </div> |
@@ -626,21 +626,21 @@ discard block |
||
| 626 | 626 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 627 | 627 | </div> |
| 628 | 628 | <?php |
| 629 | - if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') { |
|
| 629 | + if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') { |
|
| 630 | 630 | ?> |
| 631 | 631 | <div class="row column"> |
| 632 | 632 | <?php |
| 633 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 634 | - if (!empty($polar)) { |
|
| 635 | - print '<h2>'._("Coverage pattern").'</h2>'; |
|
| 636 | - foreach ($polar as $eachpolar) { |
|
| 637 | - unset($polar_data); |
|
| 638 | - $Spotter = new Spotter(); |
|
| 639 | - $data = json_decode($eachpolar['source_data']); |
|
| 640 | - foreach($data as $value => $key) { |
|
| 641 | - $direction = $Spotter->parseDirection(($value*22.5)); |
|
| 642 | - $distance = $key; |
|
| 643 | - $unit = 'km'; |
|
| 633 | + $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 634 | + if (!empty($polar)) { |
|
| 635 | + print '<h2>'._("Coverage pattern").'</h2>'; |
|
| 636 | + foreach ($polar as $eachpolar) { |
|
| 637 | + unset($polar_data); |
|
| 638 | + $Spotter = new Spotter(); |
|
| 639 | + $data = json_decode($eachpolar['source_data']); |
|
| 640 | + foreach($data as $value => $key) { |
|
| 641 | + $direction = $Spotter->parseDirection(($value*22.5)); |
|
| 642 | + $distance = $key; |
|
| 643 | + $unit = 'km'; |
|
| 644 | 644 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 645 | 645 | $distance = round($distance*0.539957); |
| 646 | 646 | $unit = 'nm'; |
@@ -651,10 +651,10 @@ discard block |
||
| 651 | 651 | $distance = $distance; |
| 652 | 652 | $unit = 'km'; |
| 653 | 653 | } |
| 654 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 655 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 656 | - } |
|
| 657 | - ?> |
|
| 654 | + if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 655 | + else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 656 | + } |
|
| 657 | + ?> |
|
| 658 | 658 | <div class="col-md-6"> |
| 659 | 659 | <h4><?php print $eachpolar['source_name']; ?></h4> |
| 660 | 660 | <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
@@ -686,22 +686,22 @@ discard block |
||
| 686 | 686 | </script> |
| 687 | 687 | </div> |
| 688 | 688 | <?php |
| 689 | - } |
|
| 690 | - } |
|
| 691 | - ?> |
|
| 689 | + } |
|
| 690 | + } |
|
| 691 | + ?> |
|
| 692 | 692 | </div> |
| 693 | 693 | <div class="row column"> |
| 694 | 694 | <div class="col-md-6"> |
| 695 | 695 | <?php |
| 696 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 697 | - if (!empty($msg)) { |
|
| 698 | - print '<h2>'._("Messages received").'</h2>'; |
|
| 699 | - foreach ($msg as $eachmsg) { |
|
| 700 | - //$eachmsg = $msg[0]; |
|
| 701 | - $data = $eachmsg['source_data']; |
|
| 702 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 703 | - else $max = 500; |
|
| 704 | - ?> |
|
| 696 | + $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 697 | + if (!empty($msg)) { |
|
| 698 | + print '<h2>'._("Messages received").'</h2>'; |
|
| 699 | + foreach ($msg as $eachmsg) { |
|
| 700 | + //$eachmsg = $msg[0]; |
|
| 701 | + $data = $eachmsg['source_data']; |
|
| 702 | + if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 703 | + else $max = 500; |
|
| 704 | + ?> |
|
| 705 | 705 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
| 706 | 706 | <script> |
| 707 | 707 | var g = new JustGage({ |
@@ -717,9 +717,9 @@ discard block |
||
| 717 | 717 | }); |
| 718 | 718 | </script> |
| 719 | 719 | <?php |
| 720 | - } |
|
| 721 | - } |
|
| 722 | - ?> |
|
| 720 | + } |
|
| 721 | + } |
|
| 722 | + ?> |
|
| 723 | 723 | </div> |
| 724 | 724 | </div> |
| 725 | 725 | <div class="row column"> |
@@ -746,19 +746,19 @@ discard block |
||
| 746 | 746 | $hist_data .= '[ "'.$distance.'",'.$nb.'],'; |
| 747 | 747 | } |
| 748 | 748 | $hist_data = substr($hist_data, 0, -1); |
| 749 | - ?> |
|
| 749 | + ?> |
|
| 750 | 750 | <div class="col-md-6"> |
| 751 | 751 | <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
| 752 | 752 | <?php |
| 753 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 753 | + print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 754 | 754 | <script> |
| 755 | 755 | google.load("visualization", "1", {packages:["corechart"]}); |
| 756 | 756 | google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
| 757 | 757 | function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
| 758 | 758 | var data = google.visualization.arrayToDataTable([ |
| 759 | 759 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
| 760 | - print $hist_data; |
|
| 761 | - print ']); |
|
| 760 | + print $hist_data; |
|
| 761 | + print ']); |
|
| 762 | 762 | |
| 763 | 763 | var options = { |
| 764 | 764 | legend: {position: "none"}, |
@@ -776,15 +776,15 @@ discard block |
||
| 776 | 776 | drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
| 777 | 777 | }); |
| 778 | 778 | </script>'; |
| 779 | - ?> |
|
| 779 | + ?> |
|
| 780 | 780 | </div> |
| 781 | 781 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 782 | 782 | <?php |
| 783 | - } |
|
| 784 | - ?> |
|
| 783 | + } |
|
| 784 | + ?> |
|
| 785 | 785 | </div> |
| 786 | 786 | <?php |
| 787 | - } |
|
| 787 | + } |
|
| 788 | 788 | ?> |
| 789 | 789 | </div> |
| 790 | 790 | </div> |
@@ -7,17 +7,17 @@ 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 | require_once('header.php'); |
| 22 | 22 | |
| 23 | 23 | ?> |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | date_default_timezone_set('UTC'); |
| 38 | 38 | $lastupdate = strtotime($last_update[0]['value']); |
| 39 | 39 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
| 40 | - print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
|
| 40 | + print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>'; |
|
| 41 | 41 | } |
| 42 | 42 | ?> |
| 43 | 43 | </div> |
@@ -46,30 +46,30 @@ discard block |
||
| 46 | 46 | ?> |
| 47 | 47 | <?php include('statistics-sub-menu.php'); ?> |
| 48 | 48 | <p class="global-stats"> |
| 49 | - <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name)); ?></span> <?php echo _("Flights"); ?></span> |
|
| 50 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 51 | - <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
|
| 52 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 49 | + <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name)); ?></span> <?php echo _("Flights"); ?></span> |
|
| 50 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 51 | + <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
|
| 52 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 53 | 53 | <?php |
| 54 | 54 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 55 | 55 | ?> |
| 56 | - <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name)); ?></span> <?php echo _("Pilots"); ?></span> |
|
| 57 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 56 | + <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name)); ?></span> <?php echo _("Pilots"); ?></span> |
|
| 57 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 58 | 58 | <?php |
| 59 | 59 | } else { |
| 60 | 60 | ?> |
| 61 | - <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name)); ?></span> <?php echo _("Owners"); ?></span> |
|
| 62 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 61 | + <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name)); ?></span> <?php echo _("Owners"); ?></span> |
|
| 62 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 63 | 63 | <?php |
| 64 | 64 | } |
| 65 | 65 | ?> |
| 66 | - <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name)); ?></span> <?php echo _("Aircrafts"); ?></span> |
|
| 67 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 66 | + <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name)); ?></span> <?php echo _("Aircrafts"); ?></span> |
|
| 67 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 68 | 68 | <?php |
| 69 | 69 | if ($airline_icao == '') { |
| 70 | 70 | ?> |
| 71 | 71 | <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name)); ?></span> <?php echo _("Airlines"); ?></span> |
| 72 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 72 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 73 | 73 | <?php |
| 74 | 74 | } |
| 75 | 75 | ?> |
@@ -77,18 +77,18 @@ discard block |
||
| 77 | 77 | if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) { |
| 78 | 78 | ?> |
| 79 | 79 | <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name)); ?></span> <?php echo _("Military"); ?></span> |
| 80 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 80 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 81 | 81 | <?php |
| 82 | 82 | } |
| 83 | 83 | ?> |
| 84 | 84 | </p> |
| 85 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 85 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 86 | 86 | <div class="specific-stats"> |
| 87 | 87 | <div class="row column"> |
| 88 | 88 | <div class="col-md-6"> |
| 89 | 89 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
| 90 | 90 | <?php |
| 91 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
|
| 91 | + $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name); |
|
| 92 | 92 | if (count($aircraft_array) == 0) print _("No data available"); |
| 93 | 93 | else { |
| 94 | 94 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | var data = google.visualization.arrayToDataTable([ |
| 101 | 101 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
| 102 | 102 | $aircraft_data = ''; |
| 103 | - foreach($aircraft_array as $aircraft_item) |
|
| 103 | + foreach ($aircraft_array as $aircraft_item) |
|
| 104 | 104 | { |
| 105 | 105 | $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
| 106 | 106 | } |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 128 | 128 | </div> |
| 129 | 129 | </div> |
| 130 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 130 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 131 | 131 | <?php |
| 132 | 132 | // echo $airline_icao; |
| 133 | 133 | if ($airline_icao == '' || $airline_icao == 'all') { |
| 134 | - $airline_array = $Stats->countAllAirlines(true,$filter_name); |
|
| 134 | + $airline_array = $Stats->countAllAirlines(true, $filter_name); |
|
| 135 | 135 | if (count($airline_array) == 0) print _("No data available"); |
| 136 | 136 | else { |
| 137 | 137 | print '<div class="col-md-6">'; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | var data = google.visualization.arrayToDataTable([ |
| 145 | 145 | ["'._("Airline").'", "'._("# of times").'"], '; |
| 146 | 146 | $airline_data = ''; |
| 147 | - foreach($airline_array as $airline_item) |
|
| 147 | + foreach ($airline_array as $airline_item) |
|
| 148 | 148 | { |
| 149 | 149 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
| 150 | 150 | } |
@@ -170,14 +170,14 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | ?> |
| 172 | 172 | </div> |
| 173 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 173 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 174 | 174 | <?php |
| 175 | 175 | } |
| 176 | 176 | ?> |
| 177 | 177 | <div class="row column"> |
| 178 | 178 | |
| 179 | 179 | <?php |
| 180 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
| 180 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao, $filter_name); |
|
| 181 | 181 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 182 | 182 | if (empty($flightover_array)) { |
| 183 | 183 | ?> |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | ?> |
| 192 | 192 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
| 193 | 193 | <?php |
| 194 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
|
| 194 | + $pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name); |
|
| 195 | 195 | if (count($pilot_array) == 0) print _("No data available"); |
| 196 | 196 | else { |
| 197 | 197 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | var data = google.visualization.arrayToDataTable([ |
| 204 | 204 | ["'._("Pilots").'", "'._("# of times").'"], '; |
| 205 | 205 | $pilot_data = ''; |
| 206 | - foreach($pilot_array as $pilot_item) |
|
| 206 | + foreach ($pilot_array as $pilot_item) |
|
| 207 | 207 | { |
| 208 | 208 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
| 209 | 209 | } |
@@ -231,14 +231,14 @@ discard block |
||
| 231 | 231 | </div> |
| 232 | 232 | </div> |
| 233 | 233 | |
| 234 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 234 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 235 | 235 | <?php |
| 236 | 236 | } else { |
| 237 | 237 | ?> |
| 238 | 238 | <div class="col-md-6"> |
| 239 | 239 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
| 240 | 240 | <?php |
| 241 | - $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
|
| 241 | + $owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name); |
|
| 242 | 242 | if (count($owner_array) == 0) print _("No data available"); |
| 243 | 243 | else { |
| 244 | 244 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | var data = google.visualization.arrayToDataTable([ |
| 251 | 251 | ["'._("Owner").'", "'._("# of times").'"], '; |
| 252 | 252 | $owner_data = ''; |
| 253 | - foreach($owner_array as $owner_item) |
|
| 253 | + foreach ($owner_array as $owner_item) |
|
| 254 | 254 | { |
| 255 | 255 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
| 256 | 256 | } |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | </div> |
| 279 | 279 | </div> |
| 280 | 280 | |
| 281 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 281 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 282 | 282 | <?php |
| 283 | 283 | } |
| 284 | 284 | if (!empty($flightover_array)) { |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | var data = google.visualization.arrayToDataTable([ |
| 300 | 300 | ["'._("Country").'", "'._("# of times").'"], '; |
| 301 | 301 | $flightover_data = ''; |
| 302 | - foreach($flightover_array as $flightover_item) |
|
| 302 | + foreach ($flightover_array as $flightover_item) |
|
| 303 | 303 | { |
| 304 | 304 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
| 305 | 305 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | ?> |
| 334 | 334 | </div> |
| 335 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 335 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 336 | 336 | |
| 337 | 337 | |
| 338 | 338 | </div> |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | <div class="col-md-6"> |
| 341 | 341 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
| 342 | 342 | <?php |
| 343 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
| 343 | + $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name); |
|
| 344 | 344 | if (count($airport_airport_array) == 0) print _("No data available"); |
| 345 | 345 | else { |
| 346 | 346 | |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | var data = google.visualization.arrayToDataTable([ |
| 357 | 357 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 358 | 358 | $airport_data = ''; |
| 359 | - foreach($airport_airport_array as $airport_item) |
|
| 359 | + foreach ($airport_airport_array as $airport_item) |
|
| 360 | 360 | { |
| 361 | 361 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
| 362 | 362 | $name = str_replace("'", "", $name); |
@@ -385,12 +385,12 @@ discard block |
||
| 385 | 385 | <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 386 | 386 | </div> |
| 387 | 387 | </div> |
| 388 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 388 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 389 | 389 | |
| 390 | 390 | <div class="col-md-6"> |
| 391 | 391 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
| 392 | 392 | <?php |
| 393 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
| 393 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name); |
|
| 394 | 394 | if (count($airport_airport_array2) == 0) print _("No data available"); |
| 395 | 395 | else { |
| 396 | 396 | |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | var data = google.visualization.arrayToDataTable([ |
| 407 | 407 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 408 | 408 | $airport_data2 = ''; |
| 409 | - foreach($airport_airport_array2 as $airport_item2) |
|
| 409 | + foreach ($airport_airport_array2 as $airport_item2) |
|
| 410 | 410 | { |
| 411 | 411 | $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
| 412 | 412 | $name2 = str_replace("'", "", $name2); |
@@ -436,13 +436,13 @@ discard block |
||
| 436 | 436 | </div> |
| 437 | 437 | </div> |
| 438 | 438 | </div> |
| 439 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 439 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 440 | 440 | |
| 441 | 441 | <div class="row column"> |
| 442 | 442 | <div class="col-md-6"> |
| 443 | 443 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
| 444 | 444 | <?php |
| 445 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
| 445 | + $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
| 446 | 446 | if (count($year_array) == 0) print _("No data available"); |
| 447 | 447 | else { |
| 448 | 448 | print '<div id="chart8" class="chart" width="100%"></div> |
@@ -453,9 +453,9 @@ discard block |
||
| 453 | 453 | var data = google.visualization.arrayToDataTable([ |
| 454 | 454 | ["'._("Month").'", "'._("# of Flights").'"], '; |
| 455 | 455 | $year_data = ''; |
| 456 | - foreach($year_array as $year_item) |
|
| 456 | + foreach ($year_array as $year_item) |
|
| 457 | 457 | { |
| 458 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 458 | + $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 459 | 459 | } |
| 460 | 460 | $year_data = substr($year_data, 0, -1); |
| 461 | 461 | print $year_data; |
@@ -483,12 +483,12 @@ discard block |
||
| 483 | 483 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 484 | 484 | </div> |
| 485 | 485 | </div> |
| 486 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 486 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 487 | 487 | |
| 488 | 488 | <div class="col-md-6"> |
| 489 | 489 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
| 490 | 490 | <?php |
| 491 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
| 491 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name); |
|
| 492 | 492 | if (count($month_array) == 0) print _("No data available"); |
| 493 | 493 | else { |
| 494 | 494 | print '<div id="chart9" class="chart" width="100%"></div> |
@@ -499,9 +499,9 @@ discard block |
||
| 499 | 499 | var data = google.visualization.arrayToDataTable([ |
| 500 | 500 | ["'._("Day").'", "'._("# of Flights").'"], '; |
| 501 | 501 | $month_data = ''; |
| 502 | - foreach($month_array as $month_item) |
|
| 502 | + foreach ($month_array as $month_item) |
|
| 503 | 503 | { |
| 504 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 504 | + $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 505 | 505 | } |
| 506 | 506 | $month_data = substr($month_data, 0, -1); |
| 507 | 507 | print $month_data; |
@@ -529,12 +529,12 @@ discard block |
||
| 529 | 529 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 530 | 530 | </div> |
| 531 | 531 | </div> |
| 532 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 532 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 533 | 533 | |
| 534 | 534 | <div class="col-md-6"> |
| 535 | 535 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
| 536 | 536 | <?php |
| 537 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
| 537 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name); |
|
| 538 | 538 | if (empty($date_array)) print _("No data available"); |
| 539 | 539 | else { |
| 540 | 540 | print '<div id="chart5" class="chart" width="100%"></div> |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | ["'._("Date").'", "'._("# of Flights").'"], '; |
| 547 | 547 | $date_data = ''; |
| 548 | 548 | |
| 549 | - foreach($date_array as $date_item) |
|
| 549 | + foreach ($date_array as $date_item) |
|
| 550 | 550 | { |
| 551 | 551 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
| 552 | 552 | } |
@@ -576,12 +576,12 @@ discard block |
||
| 576 | 576 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 577 | 577 | </div> |
| 578 | 578 | </div> |
| 579 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 579 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 580 | 580 | |
| 581 | 581 | <div class="col-md-6"> |
| 582 | 582 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 583 | 583 | <?php |
| 584 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
| 584 | + $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name); |
|
| 585 | 585 | if (empty($hour_array)) print _("No data available"); |
| 586 | 586 | else { |
| 587 | 587 | |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | var data = google.visualization.arrayToDataTable([ |
| 594 | 594 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 595 | 595 | $hour_data = ''; |
| 596 | - foreach($hour_array as $hour_item) |
|
| 596 | + foreach ($hour_array as $hour_item) |
|
| 597 | 597 | { |
| 598 | 598 | $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
| 599 | 599 | } |
@@ -623,21 +623,21 @@ discard block |
||
| 623 | 623 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 624 | 624 | </div> |
| 625 | 625 | </div> |
| 626 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 626 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 627 | 627 | </div> |
| 628 | 628 | <?php |
| 629 | 629 | if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') { |
| 630 | 630 | ?> |
| 631 | 631 | <div class="row column"> |
| 632 | 632 | <?php |
| 633 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 633 | + $polar = $Stats->getStatsSource(date('Y-m-d'), 'polar'); |
|
| 634 | 634 | if (!empty($polar)) { |
| 635 | 635 | print '<h2>'._("Coverage pattern").'</h2>'; |
| 636 | 636 | foreach ($polar as $eachpolar) { |
| 637 | 637 | unset($polar_data); |
| 638 | 638 | $Spotter = new Spotter(); |
| 639 | 639 | $data = json_decode($eachpolar['source_data']); |
| 640 | - foreach($data as $value => $key) { |
|
| 640 | + foreach ($data as $value => $key) { |
|
| 641 | 641 | $direction = $Spotter->parseDirection(($value*22.5)); |
| 642 | 642 | $distance = $key; |
| 643 | 643 | $unit = 'km'; |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | ?> |
| 658 | 658 | <div class="col-md-6"> |
| 659 | 659 | <h4><?php print $eachpolar['source_name']; ?></h4> |
| 660 | - <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
| 660 | + <div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
| 661 | 661 | <script> |
| 662 | 662 | (function() { |
| 663 | 663 | var margin = {top: 100, right: 100, bottom: 100, left: 100}, |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | color: color, |
| 682 | 682 | unit: '<?php echo $unit; ?>' |
| 683 | 683 | }; |
| 684 | - RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
| 684 | + RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
| 685 | 685 | })(); |
| 686 | 686 | </script> |
| 687 | 687 | </div> |
@@ -693,19 +693,19 @@ discard block |
||
| 693 | 693 | <div class="row column"> |
| 694 | 694 | <div class="col-md-6"> |
| 695 | 695 | <?php |
| 696 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 696 | + $msg = $Stats->getStatsSource(date('Y-m-d'), 'msg'); |
|
| 697 | 697 | if (!empty($msg)) { |
| 698 | 698 | print '<h2>'._("Messages received").'</h2>'; |
| 699 | 699 | foreach ($msg as $eachmsg) { |
| 700 | 700 | //$eachmsg = $msg[0]; |
| 701 | 701 | $data = $eachmsg['source_data']; |
| 702 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 702 | + if ($data > 500) $max = (round(($data + 100)/100))*100; |
|
| 703 | 703 | else $max = 500; |
| 704 | 704 | ?> |
| 705 | - <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
| 705 | + <div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
| 706 | 706 | <script> |
| 707 | 707 | var g = new JustGage({ |
| 708 | - id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>", |
|
| 708 | + id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>", |
|
| 709 | 709 | value: <?php echo $data; ?>, |
| 710 | 710 | min: 0, |
| 711 | 711 | max: <?php print $max; ?>, |
@@ -725,12 +725,12 @@ discard block |
||
| 725 | 725 | <div class="row column"> |
| 726 | 726 | |
| 727 | 727 | <?php |
| 728 | - $hist = $Stats->getStatsSource(date('Y-m-d'),'hist'); |
|
| 728 | + $hist = $Stats->getStatsSource(date('Y-m-d'), 'hist'); |
|
| 729 | 729 | foreach ($hist as $hists) { |
| 730 | 730 | $hist_data = ''; |
| 731 | 731 | $source = $hists['source_name']; |
| 732 | 732 | $hist_array = json_decode($hists['source_data']); |
| 733 | - foreach($hist_array as $distance => $nb) |
|
| 733 | + foreach ($hist_array as $distance => $nb) |
|
| 734 | 734 | { |
| 735 | 735 | $unit = 'km'; |
| 736 | 736 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -748,13 +748,13 @@ discard block |
||
| 748 | 748 | $hist_data = substr($hist_data, 0, -1); |
| 749 | 749 | ?> |
| 750 | 750 | <div class="col-md-6"> |
| 751 | - <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
|
| 751 | + <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2> |
|
| 752 | 752 | <?php |
| 753 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 753 | + print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div> |
|
| 754 | 754 | <script> |
| 755 | 755 | google.load("visualization", "1", {packages:["corechart"]}); |
| 756 | - google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
|
| 757 | - function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
|
| 756 | + google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).'); |
|
| 757 | + function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() { |
|
| 758 | 758 | var data = google.visualization.arrayToDataTable([ |
| 759 | 759 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
| 760 | 760 | print $hist_data; |
@@ -769,16 +769,16 @@ discard block |
||
| 769 | 769 | colors: ["#1a3151"] |
| 770 | 770 | }; |
| 771 | 771 | |
| 772 | - var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'")); |
|
| 772 | + var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'")); |
|
| 773 | 773 | chart.draw(data, options); |
| 774 | 774 | } |
| 775 | 775 | $(window).resize(function(){ |
| 776 | - drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
|
| 776 | + drawCharthist_'.str_replace(' ', '_', strtolower($source)).'(); |
|
| 777 | 777 | }); |
| 778 | 778 | </script>'; |
| 779 | 779 | ?> |
| 780 | 780 | </div> |
| 781 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 781 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 782 | 782 | <?php |
| 783 | 783 | } |
| 784 | 784 | ?> |
@@ -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 | require_once('header.php'); |
| 22 | 26 | |
@@ -36,7 +40,9 @@ discard block |
||
| 36 | 40 | if (isset($last_update[0]['value'])) { |
| 37 | 41 | date_default_timezone_set('UTC'); |
| 38 | 42 | $lastupdate = strtotime($last_update[0]['value']); |
| 39 | - if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
|
| 43 | + if (isset($globalTimezone) && $globalTimezone != '') { |
|
| 44 | + date_default_timezone_set($globalTimezone); |
|
| 45 | + } |
|
| 40 | 46 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
| 41 | 47 | } |
| 42 | 48 | ?> |
@@ -89,8 +95,9 @@ discard block |
||
| 89 | 95 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
| 90 | 96 | <?php |
| 91 | 97 | $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
| 92 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
| 93 | - else { |
|
| 98 | + if (count($aircraft_array) == 0) { |
|
| 99 | + print _("No data available"); |
|
| 100 | + } else { |
|
| 94 | 101 | |
| 95 | 102 | print '<div id="chart1" class="chart" width="100%"></div> |
| 96 | 103 | <script> |
@@ -132,8 +139,9 @@ discard block |
||
| 132 | 139 | // echo $airline_icao; |
| 133 | 140 | if ($airline_icao == '' || $airline_icao == 'all') { |
| 134 | 141 | $airline_array = $Stats->countAllAirlines(true,$filter_name); |
| 135 | - if (count($airline_array) == 0) print _("No data available"); |
|
| 136 | - else { |
|
| 142 | + if (count($airline_array) == 0) { |
|
| 143 | + print _("No data available"); |
|
| 144 | + } else { |
|
| 137 | 145 | print '<div class="col-md-6">'; |
| 138 | 146 | print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
| 139 | 147 | print '<div id="chart2" class="chart" width="100%"></div> |
@@ -192,8 +200,9 @@ discard block |
||
| 192 | 200 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
| 193 | 201 | <?php |
| 194 | 202 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
| 195 | - if (count($pilot_array) == 0) print _("No data available"); |
|
| 196 | - else { |
|
| 203 | + if (count($pilot_array) == 0) { |
|
| 204 | + print _("No data available"); |
|
| 205 | + } else { |
|
| 197 | 206 | |
| 198 | 207 | print '<div id="chart7" class="chart" width="100%"></div> |
| 199 | 208 | <script> |
@@ -239,8 +248,9 @@ discard block |
||
| 239 | 248 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
| 240 | 249 | <?php |
| 241 | 250 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
| 242 | - if (count($owner_array) == 0) print _("No data available"); |
|
| 243 | - else { |
|
| 251 | + if (count($owner_array) == 0) { |
|
| 252 | + print _("No data available"); |
|
| 253 | + } else { |
|
| 244 | 254 | |
| 245 | 255 | print '<div id="chart7" class="chart" width="100%"></div> |
| 246 | 256 | <script> |
@@ -288,8 +298,9 @@ discard block |
||
| 288 | 298 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
| 289 | 299 | <?php |
| 290 | 300 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
| 291 | - if (count($flightover_array) == 0) print _("No data available"); |
|
| 292 | - else { |
|
| 301 | + if (count($flightover_array) == 0) { |
|
| 302 | + print _("No data available"); |
|
| 303 | + } else { |
|
| 293 | 304 | |
| 294 | 305 | print '<div id="chart10" class="chart" width="100%"></div> |
| 295 | 306 | <script> |
@@ -341,8 +352,9 @@ discard block |
||
| 341 | 352 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
| 342 | 353 | <?php |
| 343 | 354 | $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
| 344 | - if (count($airport_airport_array) == 0) print _("No data available"); |
|
| 345 | - else { |
|
| 355 | + if (count($airport_airport_array) == 0) { |
|
| 356 | + print _("No data available"); |
|
| 357 | + } else { |
|
| 346 | 358 | |
| 347 | 359 | print '<div id="chart3" class="chart" width="100%"></div> |
| 348 | 360 | <script> |
@@ -391,8 +403,9 @@ discard block |
||
| 391 | 403 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
| 392 | 404 | <?php |
| 393 | 405 | $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
| 394 | - if (count($airport_airport_array2) == 0) print _("No data available"); |
|
| 395 | - else { |
|
| 406 | + if (count($airport_airport_array2) == 0) { |
|
| 407 | + print _("No data available"); |
|
| 408 | + } else { |
|
| 396 | 409 | |
| 397 | 410 | print '<div id="chart4" class="chart" width="100%"></div> |
| 398 | 411 | <script> |
@@ -443,8 +456,9 @@ discard block |
||
| 443 | 456 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
| 444 | 457 | <?php |
| 445 | 458 | $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
| 446 | - if (count($year_array) == 0) print _("No data available"); |
|
| 447 | - else { |
|
| 459 | + if (count($year_array) == 0) { |
|
| 460 | + print _("No data available"); |
|
| 461 | + } else { |
|
| 448 | 462 | print '<div id="chart8" class="chart" width="100%"></div> |
| 449 | 463 | <script> |
| 450 | 464 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -489,8 +503,9 @@ discard block |
||
| 489 | 503 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
| 490 | 504 | <?php |
| 491 | 505 | $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
| 492 | - if (count($month_array) == 0) print _("No data available"); |
|
| 493 | - else { |
|
| 506 | + if (count($month_array) == 0) { |
|
| 507 | + print _("No data available"); |
|
| 508 | + } else { |
|
| 494 | 509 | print '<div id="chart9" class="chart" width="100%"></div> |
| 495 | 510 | <script> |
| 496 | 511 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -535,8 +550,9 @@ discard block |
||
| 535 | 550 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
| 536 | 551 | <?php |
| 537 | 552 | $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
| 538 | - if (empty($date_array)) print _("No data available"); |
|
| 539 | - else { |
|
| 553 | + if (empty($date_array)) { |
|
| 554 | + print _("No data available"); |
|
| 555 | + } else { |
|
| 540 | 556 | print '<div id="chart5" class="chart" width="100%"></div> |
| 541 | 557 | <script> |
| 542 | 558 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -582,8 +598,9 @@ discard block |
||
| 582 | 598 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 583 | 599 | <?php |
| 584 | 600 | $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
| 585 | - if (empty($hour_array)) print _("No data available"); |
|
| 586 | - else { |
|
| 601 | + if (empty($hour_array)) { |
|
| 602 | + print _("No data available"); |
|
| 603 | + } else { |
|
| 587 | 604 | |
| 588 | 605 | print '<div id="chart6" class="chart" width="100%"></div> |
| 589 | 606 | <script> |
@@ -651,8 +668,11 @@ discard block |
||
| 651 | 668 | $distance = $distance; |
| 652 | 669 | $unit = 'km'; |
| 653 | 670 | } |
| 654 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 655 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 671 | + if (!isset($polar_data)) { |
|
| 672 | + $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 673 | + } else { |
|
| 674 | + $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 675 | + } |
|
| 656 | 676 | } |
| 657 | 677 | ?> |
| 658 | 678 | <div class="col-md-6"> |
@@ -699,8 +719,11 @@ discard block |
||
| 699 | 719 | foreach ($msg as $eachmsg) { |
| 700 | 720 | //$eachmsg = $msg[0]; |
| 701 | 721 | $data = $eachmsg['source_data']; |
| 702 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 703 | - else $max = 500; |
|
| 722 | + if ($data > 500) { |
|
| 723 | + $max = (round(($data+100)/100))*100; |
|
| 724 | + } else { |
|
| 725 | + $max = 500; |
|
| 726 | + } |
|
| 704 | 727 | ?> |
| 705 | 728 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
| 706 | 729 | <script> |