@@ -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,26 +130,26 @@ 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) { |
| 136 | - print '<div class="col-md-6">'; |
|
| 137 | - print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
| 138 | - print '<div id="chart2" class="chart" width="100%"></div> |
|
| 136 | + print '<div class="col-md-6">'; |
|
| 137 | + print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
| 138 | + print '<div id="chart2" class="chart" width="100%"></div> |
|
| 139 | 139 | <script> |
| 140 | 140 | google.load("visualization", "1", {packages:["corechart"]}); |
| 141 | 141 | google.setOnLoadCallback(drawChart2); |
| 142 | 142 | function drawChart2() { |
| 143 | 143 | var data = google.visualization.arrayToDataTable([ |
| 144 | 144 | ["'._("Airline").'", "'._("# of times").'"], '; |
| 145 | - $airline_data = ''; |
|
| 146 | - foreach($airline_array as $airline_item) |
|
| 147 | - { |
|
| 145 | + $airline_data = ''; |
|
| 146 | + foreach($airline_array as $airline_item) |
|
| 147 | + { |
|
| 148 | 148 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
| 149 | - } |
|
| 150 | - $airline_data = substr($airline_data, 0, -1); |
|
| 151 | - print $airline_data; |
|
| 152 | - print ']); |
|
| 149 | + } |
|
| 150 | + $airline_data = substr($airline_data, 0, -1); |
|
| 151 | + print $airline_data; |
|
| 152 | + print ']); |
|
| 153 | 153 | |
| 154 | 154 | var options = { |
| 155 | 155 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -164,23 +164,23 @@ discard block |
||
| 164 | 164 | drawChart2(); |
| 165 | 165 | }); |
| 166 | 166 | </script>'; |
| 167 | - print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
|
| 168 | - print '</div>'; |
|
| 167 | + print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
|
| 168 | + print '</div>'; |
|
| 169 | 169 | } |
| 170 | 170 | ?> |
| 171 | 171 | </div> |
| 172 | 172 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 173 | 173 | <?php |
| 174 | - } |
|
| 174 | + } |
|
| 175 | 175 | ?> |
| 176 | 176 | <div class="row column"> |
| 177 | 177 | <?php |
| 178 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
| 179 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
| 178 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
| 179 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
| 180 | 180 | if (empty($flightover_array)) { |
| 181 | - print '<div class="col-md-12">'; |
|
| 181 | + print '<div class="col-md-12">'; |
|
| 182 | 182 | } else { |
| 183 | - print '<div class="col-md-6">'; |
|
| 183 | + print '<div class="col-md-6">'; |
|
| 184 | 184 | } |
| 185 | 185 | ?> |
| 186 | 186 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
@@ -188,21 +188,21 @@ discard block |
||
| 188 | 188 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
| 189 | 189 | if (count($pilot_array) == 0) print _("No data available"); |
| 190 | 190 | else { |
| 191 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
| 191 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
| 192 | 192 | <script> |
| 193 | 193 | google.load("visualization", "1", {packages:["corechart"]}); |
| 194 | 194 | google.setOnLoadCallback(drawChart7); |
| 195 | 195 | function drawChart7() { |
| 196 | 196 | var data = google.visualization.arrayToDataTable([ |
| 197 | 197 | ["'._("Pilots").'", "'._("# of times").'"], '; |
| 198 | - $pilot_data = ''; |
|
| 199 | - foreach($pilot_array as $pilot_item) |
|
| 200 | - { |
|
| 198 | + $pilot_data = ''; |
|
| 199 | + foreach($pilot_array as $pilot_item) |
|
| 200 | + { |
|
| 201 | 201 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
| 202 | - } |
|
| 203 | - $pilot_data = substr($pilot_data, 0, -1); |
|
| 204 | - print $pilot_data; |
|
| 205 | - print ']); |
|
| 202 | + } |
|
| 203 | + $pilot_data = substr($pilot_data, 0, -1); |
|
| 204 | + print $pilot_data; |
|
| 205 | + print ']); |
|
| 206 | 206 | |
| 207 | 207 | var options = { |
| 208 | 208 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | drawChart7(); |
| 218 | 218 | }); |
| 219 | 219 | </script>'; |
| 220 | - } |
|
| 220 | + } |
|
| 221 | 221 | ?> |
| 222 | 222 | <div class="more"> |
| 223 | 223 | <a href="<?php print $globalURL; ?>/statistics/pilot" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 228 | 228 | <?php |
| 229 | - } else { |
|
| 229 | + } else { |
|
| 230 | 230 | ?> |
| 231 | 231 | <div class="col-md-6"> |
| 232 | 232 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
@@ -234,21 +234,21 @@ discard block |
||
| 234 | 234 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
| 235 | 235 | if (count($owner_array) == 0) print _("No data available"); |
| 236 | 236 | else { |
| 237 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
| 237 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
| 238 | 238 | <script> |
| 239 | 239 | google.load("visualization", "1", {packages:["corechart"]}); |
| 240 | 240 | google.setOnLoadCallback(drawChart7); |
| 241 | 241 | function drawChart7() { |
| 242 | 242 | var data = google.visualization.arrayToDataTable([ |
| 243 | 243 | ["'._("Owner").'", "'._("# of times").'"], '; |
| 244 | - $owner_data = ''; |
|
| 245 | - foreach($owner_array as $owner_item) |
|
| 246 | - { |
|
| 244 | + $owner_data = ''; |
|
| 245 | + foreach($owner_array as $owner_item) |
|
| 246 | + { |
|
| 247 | 247 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
| 248 | - } |
|
| 249 | - $owner_data = substr($owner_data, 0, -1); |
|
| 250 | - print $owner_data; |
|
| 251 | - print ']); |
|
| 248 | + } |
|
| 249 | + $owner_data = substr($owner_data, 0, -1); |
|
| 250 | + print $owner_data; |
|
| 251 | + print ']); |
|
| 252 | 252 | |
| 253 | 253 | var options = { |
| 254 | 254 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -272,8 +272,8 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 274 | 274 | <?php |
| 275 | - } |
|
| 276 | - if (!empty($flightover_array)) { |
|
| 275 | + } |
|
| 276 | + if (!empty($flightover_array)) { |
|
| 277 | 277 | ?> |
| 278 | 278 | <div class="col-md-6"> |
| 279 | 279 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
@@ -281,21 +281,21 @@ discard block |
||
| 281 | 281 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
| 282 | 282 | if (count($flightover_array) == 0) print _("No data available"); |
| 283 | 283 | else { |
| 284 | - print '<div id="chart10" class="chart" width="100%"></div> |
|
| 284 | + print '<div id="chart10" class="chart" width="100%"></div> |
|
| 285 | 285 | <script> |
| 286 | 286 | google.load("visualization", "1", {packages:["corechart"]}); |
| 287 | 287 | google.setOnLoadCallback(drawChart10); |
| 288 | 288 | function drawChart10() { |
| 289 | 289 | var data = google.visualization.arrayToDataTable([ |
| 290 | 290 | ["'._("Country").'", "'._("# of times").'"], '; |
| 291 | - $flightover_data = ''; |
|
| 292 | - foreach($flightover_array as $flightover_item) |
|
| 293 | - { |
|
| 291 | + $flightover_data = ''; |
|
| 292 | + foreach($flightover_array as $flightover_item) |
|
| 293 | + { |
|
| 294 | 294 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
| 295 | - } |
|
| 296 | - $flightover_data = substr($flightover_data, 0, -1); |
|
| 297 | - print $flightover_data; |
|
| 298 | - print ']); |
|
| 295 | + } |
|
| 296 | + $flightover_data = substr($flightover_data, 0, -1); |
|
| 297 | + print $flightover_data; |
|
| 298 | + print ']); |
|
| 299 | 299 | |
| 300 | 300 | var options = { |
| 301 | 301 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | </div> |
| 320 | 320 | </div> |
| 321 | 321 | <?php |
| 322 | - } |
|
| 322 | + } |
|
| 323 | 323 | ?> |
| 324 | 324 | </div> |
| 325 | 325 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
@@ -329,8 +329,8 @@ discard block |
||
| 329 | 329 | <div class="row column"> |
| 330 | 330 | <div class="col-md-6"> |
| 331 | 331 | <?php |
| 332 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
| 333 | - if (count($airport_airport_array) > 0) { |
|
| 332 | + $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
| 333 | + if (count($airport_airport_array) > 0) { |
|
| 334 | 334 | print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>'; |
| 335 | 335 | print '<div id="chart3" class="chart" width="100%"></div> |
| 336 | 336 | <script> |
@@ -343,13 +343,13 @@ discard block |
||
| 343 | 343 | |
| 344 | 344 | var data = google.visualization.arrayToDataTable([ |
| 345 | 345 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 346 | - $airport_data = ''; |
|
| 346 | + $airport_data = ''; |
|
| 347 | 347 | foreach($airport_airport_array as $airport_item) |
| 348 | 348 | { |
| 349 | - $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
| 350 | - $name = str_replace("'", "", $name); |
|
| 351 | - $name = str_replace('"', "", $name); |
|
| 352 | - $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
| 349 | + $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
| 350 | + $name = str_replace("'", "", $name); |
|
| 351 | + $name = str_replace('"', "", $name); |
|
| 352 | + $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
| 353 | 353 | } |
| 354 | 354 | $airport_data = substr($airport_data, 0, -1); |
| 355 | 355 | print $airport_data; |
@@ -368,15 +368,15 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | </script>'; |
| 370 | 370 | print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
| 371 | - } |
|
| 371 | + } |
|
| 372 | 372 | ?> |
| 373 | 373 | </div> |
| 374 | 374 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 375 | 375 | |
| 376 | 376 | <div class="col-md-6"> |
| 377 | 377 | <?php |
| 378 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
| 379 | - if (count($airport_airport_array2) > 0) { |
|
| 378 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
| 379 | + if (count($airport_airport_array2) > 0) { |
|
| 380 | 380 | print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>'; |
| 381 | 381 | print '<div id="chart4" class="chart" width="100%"></div> |
| 382 | 382 | <script> |
@@ -392,9 +392,9 @@ discard block |
||
| 392 | 392 | $airport_data2 = ''; |
| 393 | 393 | foreach($airport_airport_array2 as $airport_item2) |
| 394 | 394 | { |
| 395 | - $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
| 396 | - $name2 = str_replace(array("'",'"'), '', $name2); |
|
| 397 | - $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
| 395 | + $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
| 396 | + $name2 = str_replace(array("'",'"'), '', $name2); |
|
| 397 | + $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
| 398 | 398 | } |
| 399 | 399 | $airport_data2 = substr($airport_data2, 0, -1); |
| 400 | 400 | print $airport_data2; |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | </script>'; |
| 415 | 415 | print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
| 416 | - } |
|
| 416 | + } |
|
| 417 | 417 | ?> |
| 418 | 418 | </div> |
| 419 | 419 | </div> |
@@ -423,24 +423,24 @@ discard block |
||
| 423 | 423 | <div class="col-md-6"> |
| 424 | 424 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
| 425 | 425 | <?php |
| 426 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
| 427 | - if (count($year_array) == 0) print _("No data available"); |
|
| 428 | - else { |
|
| 429 | - print '<div id="chart8" class="chart" width="100%"></div> |
|
| 426 | + $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
| 427 | + if (count($year_array) == 0) print _("No data available"); |
|
| 428 | + else { |
|
| 429 | + print '<div id="chart8" class="chart" width="100%"></div> |
|
| 430 | 430 | <script> |
| 431 | 431 | google.load("visualization", "1", {packages:["corechart"]}); |
| 432 | 432 | google.setOnLoadCallback(drawChart8); |
| 433 | 433 | function drawChart8() { |
| 434 | 434 | var data = google.visualization.arrayToDataTable([ |
| 435 | 435 | ["'._("Month").'", "'._("# of Flights").'"], '; |
| 436 | - $year_data = ''; |
|
| 437 | - foreach($year_array as $year_item) |
|
| 438 | - { |
|
| 439 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 440 | - } |
|
| 441 | - $year_data = substr($year_data, 0, -1); |
|
| 442 | - print $year_data; |
|
| 443 | - print ']); |
|
| 436 | + $year_data = ''; |
|
| 437 | + foreach($year_array as $year_item) |
|
| 438 | + { |
|
| 439 | + $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 440 | + } |
|
| 441 | + $year_data = substr($year_data, 0, -1); |
|
| 442 | + print $year_data; |
|
| 443 | + print ']); |
|
| 444 | 444 | |
| 445 | 445 | var options = { |
| 446 | 446 | legend: {position: "none"}, |
@@ -458,8 +458,8 @@ discard block |
||
| 458 | 458 | drawChart8(); |
| 459 | 459 | }); |
| 460 | 460 | </script>'; |
| 461 | - } |
|
| 462 | - ?> |
|
| 461 | + } |
|
| 462 | + ?> |
|
| 463 | 463 | <div class="more"> |
| 464 | 464 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 465 | 465 | </div> |
@@ -469,24 +469,24 @@ discard block |
||
| 469 | 469 | <div class="col-md-6"> |
| 470 | 470 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
| 471 | 471 | <?php |
| 472 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
| 473 | - if (count($month_array) == 0) print _("No data available"); |
|
| 474 | - else { |
|
| 475 | - print '<div id="chart9" class="chart" width="100%"></div> |
|
| 472 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
| 473 | + if (count($month_array) == 0) print _("No data available"); |
|
| 474 | + else { |
|
| 475 | + print '<div id="chart9" class="chart" width="100%"></div> |
|
| 476 | 476 | <script> |
| 477 | 477 | google.load("visualization", "1", {packages:["corechart"]}); |
| 478 | 478 | google.setOnLoadCallback(drawChart9); |
| 479 | 479 | function drawChart9() { |
| 480 | 480 | var data = google.visualization.arrayToDataTable([ |
| 481 | 481 | ["'._("Day").'", "'._("# of Flights").'"], '; |
| 482 | - $month_data = ''; |
|
| 483 | - foreach($month_array as $month_item) |
|
| 484 | - { |
|
| 485 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 486 | - } |
|
| 487 | - $month_data = substr($month_data, 0, -1); |
|
| 488 | - print $month_data; |
|
| 489 | - print ']); |
|
| 482 | + $month_data = ''; |
|
| 483 | + foreach($month_array as $month_item) |
|
| 484 | + { |
|
| 485 | + $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 486 | + } |
|
| 487 | + $month_data = substr($month_data, 0, -1); |
|
| 488 | + print $month_data; |
|
| 489 | + print ']); |
|
| 490 | 490 | |
| 491 | 491 | var options = { |
| 492 | 492 | legend: {position: "none"}, |
@@ -504,8 +504,8 @@ discard block |
||
| 504 | 504 | drawChart9(); |
| 505 | 505 | }); |
| 506 | 506 | </script>'; |
| 507 | - } |
|
| 508 | - ?> |
|
| 507 | + } |
|
| 508 | + ?> |
|
| 509 | 509 | <div class="more"> |
| 510 | 510 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 511 | 511 | </div> |
@@ -515,25 +515,25 @@ discard block |
||
| 515 | 515 | <div class="col-md-6"> |
| 516 | 516 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
| 517 | 517 | <?php |
| 518 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
| 519 | - if (empty($date_array)) print _("No data available"); |
|
| 520 | - else { |
|
| 521 | - print '<div id="chart5" class="chart" width="100%"></div> |
|
| 518 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
| 519 | + if (empty($date_array)) print _("No data available"); |
|
| 520 | + else { |
|
| 521 | + print '<div id="chart5" class="chart" width="100%"></div> |
|
| 522 | 522 | <script> |
| 523 | 523 | google.load("visualization", "1", {packages:["corechart"]}); |
| 524 | 524 | google.setOnLoadCallback(drawChart5); |
| 525 | 525 | function drawChart5() { |
| 526 | 526 | var data = google.visualization.arrayToDataTable([ |
| 527 | 527 | ["'._("Date").'", "'._("# of Flights").'"], '; |
| 528 | - $date_data = ''; |
|
| 528 | + $date_data = ''; |
|
| 529 | 529 | |
| 530 | - foreach($date_array as $date_item) |
|
| 531 | - { |
|
| 532 | - $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
| 533 | - } |
|
| 534 | - $date_data = substr($date_data, 0, -1); |
|
| 535 | - print $date_data; |
|
| 536 | - print ']); |
|
| 530 | + foreach($date_array as $date_item) |
|
| 531 | + { |
|
| 532 | + $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
| 533 | + } |
|
| 534 | + $date_data = substr($date_data, 0, -1); |
|
| 535 | + print $date_data; |
|
| 536 | + print ']); |
|
| 537 | 537 | |
| 538 | 538 | var options = { |
| 539 | 539 | legend: {position: "none"}, |
@@ -551,8 +551,8 @@ discard block |
||
| 551 | 551 | drawChart5(); |
| 552 | 552 | }); |
| 553 | 553 | </script>'; |
| 554 | - } |
|
| 555 | - ?> |
|
| 554 | + } |
|
| 555 | + ?> |
|
| 556 | 556 | <div class="more"> |
| 557 | 557 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 558 | 558 | </div> |
@@ -562,25 +562,25 @@ discard block |
||
| 562 | 562 | <div class="col-md-6"> |
| 563 | 563 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 564 | 564 | <?php |
| 565 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
| 566 | - if (empty($hour_array)) print _("No data available"); |
|
| 567 | - else { |
|
| 565 | + $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
| 566 | + if (empty($hour_array)) print _("No data available"); |
|
| 567 | + else { |
|
| 568 | 568 | |
| 569 | - print '<div id="chart6" class="chart" width="100%"></div> |
|
| 569 | + print '<div id="chart6" class="chart" width="100%"></div> |
|
| 570 | 570 | <script> |
| 571 | 571 | google.load("visualization", "1", {packages:["corechart"]}); |
| 572 | 572 | google.setOnLoadCallback(drawChart6); |
| 573 | 573 | function drawChart6() { |
| 574 | 574 | var data = google.visualization.arrayToDataTable([ |
| 575 | 575 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 576 | - $hour_data = ''; |
|
| 577 | - foreach($hour_array as $hour_item) |
|
| 578 | - { |
|
| 579 | - $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
| 580 | - } |
|
| 581 | - $hour_data = substr($hour_data, 0, -1); |
|
| 582 | - print $hour_data; |
|
| 583 | - print ']); |
|
| 576 | + $hour_data = ''; |
|
| 577 | + foreach($hour_array as $hour_item) |
|
| 578 | + { |
|
| 579 | + $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
| 580 | + } |
|
| 581 | + $hour_data = substr($hour_data, 0, -1); |
|
| 582 | + print $hour_data; |
|
| 583 | + print ']); |
|
| 584 | 584 | |
| 585 | 585 | var options = { |
| 586 | 586 | legend: {position: "none"}, |
@@ -598,8 +598,8 @@ discard block |
||
| 598 | 598 | drawChart6(); |
| 599 | 599 | }); |
| 600 | 600 | </script>'; |
| 601 | - } |
|
| 602 | - ?> |
|
| 601 | + } |
|
| 602 | + ?> |
|
| 603 | 603 | <div class="more"> |
| 604 | 604 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 605 | 605 | </div> |
@@ -607,21 +607,21 @@ discard block |
||
| 607 | 607 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 608 | 608 | </div> |
| 609 | 609 | <?php |
| 610 | - if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') { |
|
| 610 | + if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') { |
|
| 611 | 611 | ?> |
| 612 | 612 | <div class="row column"> |
| 613 | 613 | <?php |
| 614 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 615 | - if (!empty($polar)) { |
|
| 616 | - print '<h2>'._("Coverage pattern").'</h2>'; |
|
| 617 | - foreach ($polar as $eachpolar) { |
|
| 618 | - unset($polar_data); |
|
| 619 | - $Spotter = new Spotter(); |
|
| 620 | - $data = json_decode($eachpolar['source_data']); |
|
| 621 | - foreach($data as $value => $key) { |
|
| 622 | - $direction = $Spotter->parseDirection(($value*22.5)); |
|
| 623 | - $distance = $key; |
|
| 624 | - $unit = 'km'; |
|
| 614 | + $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 615 | + if (!empty($polar)) { |
|
| 616 | + print '<h2>'._("Coverage pattern").'</h2>'; |
|
| 617 | + foreach ($polar as $eachpolar) { |
|
| 618 | + unset($polar_data); |
|
| 619 | + $Spotter = new Spotter(); |
|
| 620 | + $data = json_decode($eachpolar['source_data']); |
|
| 621 | + foreach($data as $value => $key) { |
|
| 622 | + $direction = $Spotter->parseDirection(($value*22.5)); |
|
| 623 | + $distance = $key; |
|
| 624 | + $unit = 'km'; |
|
| 625 | 625 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 626 | 626 | $distance = round($distance*0.539957); |
| 627 | 627 | $unit = 'nm'; |
@@ -632,10 +632,10 @@ discard block |
||
| 632 | 632 | $distance = $distance; |
| 633 | 633 | $unit = 'km'; |
| 634 | 634 | } |
| 635 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 636 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 637 | - } |
|
| 638 | - ?> |
|
| 635 | + if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 636 | + else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 637 | + } |
|
| 638 | + ?> |
|
| 639 | 639 | <div class="col-md-6"> |
| 640 | 640 | <h4><?php print $eachpolar['source_name']; ?></h4> |
| 641 | 641 | <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
@@ -667,22 +667,22 @@ discard block |
||
| 667 | 667 | </script> |
| 668 | 668 | </div> |
| 669 | 669 | <?php |
| 670 | - } |
|
| 671 | - } |
|
| 672 | - ?> |
|
| 670 | + } |
|
| 671 | + } |
|
| 672 | + ?> |
|
| 673 | 673 | </div> |
| 674 | 674 | <div class="row column"> |
| 675 | 675 | <div class="col-md-6"> |
| 676 | 676 | <?php |
| 677 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 678 | - if (!empty($msg)) { |
|
| 679 | - print '<h2>'._("Messages received").'</h2>'; |
|
| 680 | - foreach ($msg as $eachmsg) { |
|
| 681 | - //$eachmsg = $msg[0]; |
|
| 682 | - $data = $eachmsg['source_data']; |
|
| 683 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 684 | - else $max = 500; |
|
| 685 | - ?> |
|
| 677 | + $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 678 | + if (!empty($msg)) { |
|
| 679 | + print '<h2>'._("Messages received").'</h2>'; |
|
| 680 | + foreach ($msg as $eachmsg) { |
|
| 681 | + //$eachmsg = $msg[0]; |
|
| 682 | + $data = $eachmsg['source_data']; |
|
| 683 | + if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 684 | + else $max = 500; |
|
| 685 | + ?> |
|
| 686 | 686 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
| 687 | 687 | <script> |
| 688 | 688 | var g = new JustGage({ |
@@ -698,9 +698,9 @@ discard block |
||
| 698 | 698 | }); |
| 699 | 699 | </script> |
| 700 | 700 | <?php |
| 701 | - } |
|
| 702 | - } |
|
| 703 | - ?> |
|
| 701 | + } |
|
| 702 | + } |
|
| 703 | + ?> |
|
| 704 | 704 | </div> |
| 705 | 705 | </div> |
| 706 | 706 | <div class="row column"> |
@@ -727,19 +727,19 @@ discard block |
||
| 727 | 727 | $hist_data .= '[ "'.$distance.'",'.$nb.'],'; |
| 728 | 728 | } |
| 729 | 729 | $hist_data = substr($hist_data, 0, -1); |
| 730 | - ?> |
|
| 730 | + ?> |
|
| 731 | 731 | <div class="col-md-6"> |
| 732 | 732 | <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
| 733 | 733 | <?php |
| 734 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 734 | + print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 735 | 735 | <script> |
| 736 | 736 | google.load("visualization", "1", {packages:["corechart"]}); |
| 737 | 737 | google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
| 738 | 738 | function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
| 739 | 739 | var data = google.visualization.arrayToDataTable([ |
| 740 | 740 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
| 741 | - print $hist_data; |
|
| 742 | - print ']); |
|
| 741 | + print $hist_data; |
|
| 742 | + print ']); |
|
| 743 | 743 | |
| 744 | 744 | var options = { |
| 745 | 745 | legend: {position: "none"}, |
@@ -757,15 +757,15 @@ discard block |
||
| 757 | 757 | drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
| 758 | 758 | }); |
| 759 | 759 | </script>'; |
| 760 | - ?> |
|
| 760 | + ?> |
|
| 761 | 761 | </div> |
| 762 | 762 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 763 | 763 | <?php |
| 764 | - } |
|
| 765 | - ?> |
|
| 764 | + } |
|
| 765 | + ?> |
|
| 766 | 766 | </div> |
| 767 | 767 | <?php |
| 768 | - } |
|
| 768 | + } |
|
| 769 | 769 | ?> |
| 770 | 770 | </div> |
| 771 | 771 | </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) { |
| 136 | 136 | print '<div class="col-md-6">'; |
| 137 | 137 | print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | var data = google.visualization.arrayToDataTable([ |
| 144 | 144 | ["'._("Airline").'", "'._("# of times").'"], '; |
| 145 | 145 | $airline_data = ''; |
| 146 | - foreach($airline_array as $airline_item) |
|
| 146 | + foreach ($airline_array as $airline_item) |
|
| 147 | 147 | { |
| 148 | 148 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
| 149 | 149 | } |
@@ -169,13 +169,13 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | ?> |
| 171 | 171 | </div> |
| 172 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 172 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 173 | 173 | <?php |
| 174 | 174 | } |
| 175 | 175 | ?> |
| 176 | 176 | <div class="row column"> |
| 177 | 177 | <?php |
| 178 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
| 178 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao, $filter_name); |
|
| 179 | 179 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 180 | 180 | if (empty($flightover_array)) { |
| 181 | 181 | print '<div class="col-md-12">'; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | ?> |
| 186 | 186 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
| 187 | 187 | <?php |
| 188 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
|
| 188 | + $pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name); |
|
| 189 | 189 | if (count($pilot_array) == 0) print _("No data available"); |
| 190 | 190 | else { |
| 191 | 191 | print '<div id="chart7" class="chart" width="100%"></div> |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | var data = google.visualization.arrayToDataTable([ |
| 197 | 197 | ["'._("Pilots").'", "'._("# of times").'"], '; |
| 198 | 198 | $pilot_data = ''; |
| 199 | - foreach($pilot_array as $pilot_item) |
|
| 199 | + foreach ($pilot_array as $pilot_item) |
|
| 200 | 200 | { |
| 201 | 201 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
| 202 | 202 | } |
@@ -224,14 +224,14 @@ discard block |
||
| 224 | 224 | </div> |
| 225 | 225 | </div> |
| 226 | 226 | |
| 227 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 227 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 228 | 228 | <?php |
| 229 | 229 | } else { |
| 230 | 230 | ?> |
| 231 | 231 | <div class="col-md-6"> |
| 232 | 232 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
| 233 | 233 | <?php |
| 234 | - $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
|
| 234 | + $owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name); |
|
| 235 | 235 | if (count($owner_array) == 0) print _("No data available"); |
| 236 | 236 | else { |
| 237 | 237 | print '<div id="chart7" class="chart" width="100%"></div> |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | var data = google.visualization.arrayToDataTable([ |
| 243 | 243 | ["'._("Owner").'", "'._("# of times").'"], '; |
| 244 | 244 | $owner_data = ''; |
| 245 | - foreach($owner_array as $owner_item) |
|
| 245 | + foreach ($owner_array as $owner_item) |
|
| 246 | 246 | { |
| 247 | 247 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
| 248 | 248 | } |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | </div> |
| 271 | 271 | </div> |
| 272 | 272 | |
| 273 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 273 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 274 | 274 | <?php |
| 275 | 275 | } |
| 276 | 276 | if (!empty($flightover_array)) { |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | var data = google.visualization.arrayToDataTable([ |
| 290 | 290 | ["'._("Country").'", "'._("# of times").'"], '; |
| 291 | 291 | $flightover_data = ''; |
| 292 | - foreach($flightover_array as $flightover_item) |
|
| 292 | + foreach ($flightover_array as $flightover_item) |
|
| 293 | 293 | { |
| 294 | 294 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
| 295 | 295 | } |
@@ -322,14 +322,14 @@ discard block |
||
| 322 | 322 | } |
| 323 | 323 | ?> |
| 324 | 324 | </div> |
| 325 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 325 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | </div> |
| 329 | 329 | <div class="row column"> |
| 330 | 330 | <div class="col-md-6"> |
| 331 | 331 | <?php |
| 332 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
| 332 | + $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name); |
|
| 333 | 333 | if (count($airport_airport_array) > 0) { |
| 334 | 334 | print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>'; |
| 335 | 335 | print '<div id="chart3" class="chart" width="100%"></div> |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | var data = google.visualization.arrayToDataTable([ |
| 345 | 345 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 346 | 346 | $airport_data = ''; |
| 347 | - foreach($airport_airport_array as $airport_item) |
|
| 347 | + foreach ($airport_airport_array as $airport_item) |
|
| 348 | 348 | { |
| 349 | 349 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
| 350 | 350 | $name = str_replace("'", "", $name); |
@@ -371,11 +371,11 @@ discard block |
||
| 371 | 371 | } |
| 372 | 372 | ?> |
| 373 | 373 | </div> |
| 374 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 374 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 375 | 375 | |
| 376 | 376 | <div class="col-md-6"> |
| 377 | 377 | <?php |
| 378 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
| 378 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name); |
|
| 379 | 379 | if (count($airport_airport_array2) > 0) { |
| 380 | 380 | print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>'; |
| 381 | 381 | print '<div id="chart4" class="chart" width="100%"></div> |
@@ -390,10 +390,10 @@ discard block |
||
| 390 | 390 | var data = google.visualization.arrayToDataTable([ |
| 391 | 391 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 392 | 392 | $airport_data2 = ''; |
| 393 | - foreach($airport_airport_array2 as $airport_item2) |
|
| 393 | + foreach ($airport_airport_array2 as $airport_item2) |
|
| 394 | 394 | { |
| 395 | 395 | $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
| 396 | - $name2 = str_replace(array("'",'"'), '', $name2); |
|
| 396 | + $name2 = str_replace(array("'", '"'), '', $name2); |
|
| 397 | 397 | $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
| 398 | 398 | } |
| 399 | 399 | $airport_data2 = substr($airport_data2, 0, -1); |
@@ -417,13 +417,13 @@ discard block |
||
| 417 | 417 | ?> |
| 418 | 418 | </div> |
| 419 | 419 | </div> |
| 420 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 420 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 421 | 421 | |
| 422 | 422 | <div class="row column"> |
| 423 | 423 | <div class="col-md-6"> |
| 424 | 424 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
| 425 | 425 | <?php |
| 426 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
| 426 | + $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
| 427 | 427 | if (count($year_array) == 0) print _("No data available"); |
| 428 | 428 | else { |
| 429 | 429 | print '<div id="chart8" class="chart" width="100%"></div> |
@@ -434,9 +434,9 @@ discard block |
||
| 434 | 434 | var data = google.visualization.arrayToDataTable([ |
| 435 | 435 | ["'._("Month").'", "'._("# of Flights").'"], '; |
| 436 | 436 | $year_data = ''; |
| 437 | - foreach($year_array as $year_item) |
|
| 437 | + foreach ($year_array as $year_item) |
|
| 438 | 438 | { |
| 439 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 439 | + $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 440 | 440 | } |
| 441 | 441 | $year_data = substr($year_data, 0, -1); |
| 442 | 442 | print $year_data; |
@@ -464,12 +464,12 @@ discard block |
||
| 464 | 464 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 465 | 465 | </div> |
| 466 | 466 | </div> |
| 467 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 467 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 468 | 468 | |
| 469 | 469 | <div class="col-md-6"> |
| 470 | 470 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
| 471 | 471 | <?php |
| 472 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
| 472 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name); |
|
| 473 | 473 | if (count($month_array) == 0) print _("No data available"); |
| 474 | 474 | else { |
| 475 | 475 | print '<div id="chart9" class="chart" width="100%"></div> |
@@ -480,9 +480,9 @@ discard block |
||
| 480 | 480 | var data = google.visualization.arrayToDataTable([ |
| 481 | 481 | ["'._("Day").'", "'._("# of Flights").'"], '; |
| 482 | 482 | $month_data = ''; |
| 483 | - foreach($month_array as $month_item) |
|
| 483 | + foreach ($month_array as $month_item) |
|
| 484 | 484 | { |
| 485 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 485 | + $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 486 | 486 | } |
| 487 | 487 | $month_data = substr($month_data, 0, -1); |
| 488 | 488 | print $month_data; |
@@ -510,12 +510,12 @@ discard block |
||
| 510 | 510 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 511 | 511 | </div> |
| 512 | 512 | </div> |
| 513 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 513 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 514 | 514 | |
| 515 | 515 | <div class="col-md-6"> |
| 516 | 516 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
| 517 | 517 | <?php |
| 518 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
| 518 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name); |
|
| 519 | 519 | if (empty($date_array)) print _("No data available"); |
| 520 | 520 | else { |
| 521 | 521 | print '<div id="chart5" class="chart" width="100%"></div> |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | ["'._("Date").'", "'._("# of Flights").'"], '; |
| 528 | 528 | $date_data = ''; |
| 529 | 529 | |
| 530 | - foreach($date_array as $date_item) |
|
| 530 | + foreach ($date_array as $date_item) |
|
| 531 | 531 | { |
| 532 | 532 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
| 533 | 533 | } |
@@ -557,12 +557,12 @@ discard block |
||
| 557 | 557 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 558 | 558 | </div> |
| 559 | 559 | </div> |
| 560 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 560 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 561 | 561 | |
| 562 | 562 | <div class="col-md-6"> |
| 563 | 563 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 564 | 564 | <?php |
| 565 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
| 565 | + $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name); |
|
| 566 | 566 | if (empty($hour_array)) print _("No data available"); |
| 567 | 567 | else { |
| 568 | 568 | |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | var data = google.visualization.arrayToDataTable([ |
| 575 | 575 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 576 | 576 | $hour_data = ''; |
| 577 | - foreach($hour_array as $hour_item) |
|
| 577 | + foreach ($hour_array as $hour_item) |
|
| 578 | 578 | { |
| 579 | 579 | $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
| 580 | 580 | } |
@@ -604,21 +604,21 @@ discard block |
||
| 604 | 604 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 605 | 605 | </div> |
| 606 | 606 | </div> |
| 607 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 607 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 608 | 608 | </div> |
| 609 | 609 | <?php |
| 610 | 610 | if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') { |
| 611 | 611 | ?> |
| 612 | 612 | <div class="row column"> |
| 613 | 613 | <?php |
| 614 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 614 | + $polar = $Stats->getStatsSource(date('Y-m-d'), 'polar'); |
|
| 615 | 615 | if (!empty($polar)) { |
| 616 | 616 | print '<h2>'._("Coverage pattern").'</h2>'; |
| 617 | 617 | foreach ($polar as $eachpolar) { |
| 618 | 618 | unset($polar_data); |
| 619 | 619 | $Spotter = new Spotter(); |
| 620 | 620 | $data = json_decode($eachpolar['source_data']); |
| 621 | - foreach($data as $value => $key) { |
|
| 621 | + foreach ($data as $value => $key) { |
|
| 622 | 622 | $direction = $Spotter->parseDirection(($value*22.5)); |
| 623 | 623 | $distance = $key; |
| 624 | 624 | $unit = 'km'; |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | ?> |
| 639 | 639 | <div class="col-md-6"> |
| 640 | 640 | <h4><?php print $eachpolar['source_name']; ?></h4> |
| 641 | - <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
| 641 | + <div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
| 642 | 642 | <script> |
| 643 | 643 | (function() { |
| 644 | 644 | var margin = {top: 100, right: 100, bottom: 100, left: 100}, |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | color: color, |
| 663 | 663 | unit: '<?php echo $unit; ?>' |
| 664 | 664 | }; |
| 665 | - RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
| 665 | + RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
| 666 | 666 | })(); |
| 667 | 667 | </script> |
| 668 | 668 | </div> |
@@ -674,19 +674,19 @@ discard block |
||
| 674 | 674 | <div class="row column"> |
| 675 | 675 | <div class="col-md-6"> |
| 676 | 676 | <?php |
| 677 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 677 | + $msg = $Stats->getStatsSource(date('Y-m-d'), 'msg'); |
|
| 678 | 678 | if (!empty($msg)) { |
| 679 | 679 | print '<h2>'._("Messages received").'</h2>'; |
| 680 | 680 | foreach ($msg as $eachmsg) { |
| 681 | 681 | //$eachmsg = $msg[0]; |
| 682 | 682 | $data = $eachmsg['source_data']; |
| 683 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 683 | + if ($data > 500) $max = (round(($data + 100)/100))*100; |
|
| 684 | 684 | else $max = 500; |
| 685 | 685 | ?> |
| 686 | - <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
| 686 | + <div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
| 687 | 687 | <script> |
| 688 | 688 | var g = new JustGage({ |
| 689 | - id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>", |
|
| 689 | + id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>", |
|
| 690 | 690 | value: <?php echo $data; ?>, |
| 691 | 691 | min: 0, |
| 692 | 692 | max: <?php print $max; ?>, |
@@ -706,12 +706,12 @@ discard block |
||
| 706 | 706 | <div class="row column"> |
| 707 | 707 | |
| 708 | 708 | <?php |
| 709 | - $hist = $Stats->getStatsSource(date('Y-m-d'),'hist'); |
|
| 709 | + $hist = $Stats->getStatsSource(date('Y-m-d'), 'hist'); |
|
| 710 | 710 | foreach ($hist as $hists) { |
| 711 | 711 | $hist_data = ''; |
| 712 | 712 | $source = $hists['source_name']; |
| 713 | 713 | $hist_array = json_decode($hists['source_data']); |
| 714 | - foreach($hist_array as $distance => $nb) |
|
| 714 | + foreach ($hist_array as $distance => $nb) |
|
| 715 | 715 | { |
| 716 | 716 | $unit = 'km'; |
| 717 | 717 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -729,13 +729,13 @@ discard block |
||
| 729 | 729 | $hist_data = substr($hist_data, 0, -1); |
| 730 | 730 | ?> |
| 731 | 731 | <div class="col-md-6"> |
| 732 | - <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
|
| 732 | + <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2> |
|
| 733 | 733 | <?php |
| 734 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 734 | + print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div> |
|
| 735 | 735 | <script> |
| 736 | 736 | google.load("visualization", "1", {packages:["corechart"]}); |
| 737 | - google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
|
| 738 | - function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
|
| 737 | + google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).'); |
|
| 738 | + function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() { |
|
| 739 | 739 | var data = google.visualization.arrayToDataTable([ |
| 740 | 740 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
| 741 | 741 | print $hist_data; |
@@ -750,16 +750,16 @@ discard block |
||
| 750 | 750 | colors: ["#1a3151"] |
| 751 | 751 | }; |
| 752 | 752 | |
| 753 | - var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'")); |
|
| 753 | + var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'")); |
|
| 754 | 754 | chart.draw(data, options); |
| 755 | 755 | } |
| 756 | 756 | $(window).resize(function(){ |
| 757 | - drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
|
| 757 | + drawCharthist_'.str_replace(' ', '_', strtolower($source)).'(); |
|
| 758 | 758 | }); |
| 759 | 759 | </script>'; |
| 760 | 760 | ?> |
| 761 | 761 | </div> |
| 762 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 762 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 763 | 763 | <?php |
| 764 | 764 | } |
| 765 | 765 | ?> |
@@ -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> |
@@ -186,8 +193,9 @@ discard block |
||
| 186 | 193 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
| 187 | 194 | <?php |
| 188 | 195 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
| 189 | - if (count($pilot_array) == 0) print _("No data available"); |
|
| 190 | - else { |
|
| 196 | + if (count($pilot_array) == 0) { |
|
| 197 | + print _("No data available"); |
|
| 198 | + } else { |
|
| 191 | 199 | print '<div id="chart7" class="chart" width="100%"></div> |
| 192 | 200 | <script> |
| 193 | 201 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -232,8 +240,9 @@ discard block |
||
| 232 | 240 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
| 233 | 241 | <?php |
| 234 | 242 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
| 235 | - if (count($owner_array) == 0) print _("No data available"); |
|
| 236 | - else { |
|
| 243 | + if (count($owner_array) == 0) { |
|
| 244 | + print _("No data available"); |
|
| 245 | + } else { |
|
| 237 | 246 | print '<div id="chart7" class="chart" width="100%"></div> |
| 238 | 247 | <script> |
| 239 | 248 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -279,8 +288,9 @@ discard block |
||
| 279 | 288 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
| 280 | 289 | <?php |
| 281 | 290 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
| 282 | - if (count($flightover_array) == 0) print _("No data available"); |
|
| 283 | - else { |
|
| 291 | + if (count($flightover_array) == 0) { |
|
| 292 | + print _("No data available"); |
|
| 293 | + } else { |
|
| 284 | 294 | print '<div id="chart10" class="chart" width="100%"></div> |
| 285 | 295 | <script> |
| 286 | 296 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -424,8 +434,9 @@ discard block |
||
| 424 | 434 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
| 425 | 435 | <?php |
| 426 | 436 | $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
| 427 | - if (count($year_array) == 0) print _("No data available"); |
|
| 428 | - else { |
|
| 437 | + if (count($year_array) == 0) { |
|
| 438 | + print _("No data available"); |
|
| 439 | + } else { |
|
| 429 | 440 | print '<div id="chart8" class="chart" width="100%"></div> |
| 430 | 441 | <script> |
| 431 | 442 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -470,8 +481,9 @@ discard block |
||
| 470 | 481 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
| 471 | 482 | <?php |
| 472 | 483 | $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
| 473 | - if (count($month_array) == 0) print _("No data available"); |
|
| 474 | - else { |
|
| 484 | + if (count($month_array) == 0) { |
|
| 485 | + print _("No data available"); |
|
| 486 | + } else { |
|
| 475 | 487 | print '<div id="chart9" class="chart" width="100%"></div> |
| 476 | 488 | <script> |
| 477 | 489 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -516,8 +528,9 @@ discard block |
||
| 516 | 528 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
| 517 | 529 | <?php |
| 518 | 530 | $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
| 519 | - if (empty($date_array)) print _("No data available"); |
|
| 520 | - else { |
|
| 531 | + if (empty($date_array)) { |
|
| 532 | + print _("No data available"); |
|
| 533 | + } else { |
|
| 521 | 534 | print '<div id="chart5" class="chart" width="100%"></div> |
| 522 | 535 | <script> |
| 523 | 536 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -563,8 +576,9 @@ discard block |
||
| 563 | 576 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 564 | 577 | <?php |
| 565 | 578 | $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
| 566 | - if (empty($hour_array)) print _("No data available"); |
|
| 567 | - else { |
|
| 579 | + if (empty($hour_array)) { |
|
| 580 | + print _("No data available"); |
|
| 581 | + } else { |
|
| 568 | 582 | |
| 569 | 583 | print '<div id="chart6" class="chart" width="100%"></div> |
| 570 | 584 | <script> |
@@ -632,8 +646,11 @@ discard block |
||
| 632 | 646 | $distance = $distance; |
| 633 | 647 | $unit = 'km'; |
| 634 | 648 | } |
| 635 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 636 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 649 | + if (!isset($polar_data)) { |
|
| 650 | + $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 651 | + } else { |
|
| 652 | + $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 653 | + } |
|
| 637 | 654 | } |
| 638 | 655 | ?> |
| 639 | 656 | <div class="col-md-6"> |
@@ -680,8 +697,11 @@ discard block |
||
| 680 | 697 | foreach ($msg as $eachmsg) { |
| 681 | 698 | //$eachmsg = $msg[0]; |
| 682 | 699 | $data = $eachmsg['source_data']; |
| 683 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 684 | - else $max = 500; |
|
| 700 | + if ($data > 500) { |
|
| 701 | + $max = (round(($data+100)/100))*100; |
|
| 702 | + } else { |
|
| 703 | + $max = 500; |
|
| 704 | + } |
|
| 685 | 705 | ?> |
| 686 | 706 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
| 687 | 707 | <script> |