Completed
Push — master ( d56a2b...17d606 )
by Yannick
05:33
created
statistics.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
127 127
                     <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
385 385
                 <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
483 483
                     <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</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
 block discarded – undo
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
 block discarded – undo
529 529
                     <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</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
 block discarded – undo
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
 block discarded – undo
576 576
                     <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</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
 block discarded – undo
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
 block discarded – undo
623 623
                     <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                 ?>
Please login to merge, or discard this patch.