Completed
Push — master ( c85b53...f64dc3 )
by Yannick
10:49
created
statistics.php 1 patch
Spacing   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 }
20 20
 
21 21
 if (!isset($filter_name)) $filter_name = '';
22
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
22
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
23 23
 if ($type == 'aircraft' && $airline_icao == '' && isset($globalFilter)) {
24 24
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
25 25
 }
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	$title = _("Statistics");
35 35
 }
36 36
 
37
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
37
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
38
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
39 39
 
40 40
 require_once('header.php');
41 41
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			date_default_timezone_set('UTC');
63 63
 			$lastupdate = strtotime($last_update[0]['value']);
64 64
 			if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
65
-			print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
65
+			print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
66 66
 		}
67 67
 	}
68 68
 ?>
@@ -74,30 +74,30 @@  discard block
 block discarded – undo
74 74
 <?php
75 75
 	if ($type == 'aircraft') {
76 76
 ?>
77
-        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span>
78
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
79
-        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
80
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
77
+        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span>
78
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
79
+        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
80
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
81 81
 	<?php
82
-	    if ((isset($globalVA) && $globalVA) ||(isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
82
+	    if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
83 83
 	?>
84
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
85
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
84
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span>
85
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
86 86
         <?php
87 87
     	    } else {
88 88
     	?>
89
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
90
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
89
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span>
90
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
91 91
     	<?php
92 92
     	    }
93 93
     	?>
94
-        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
95
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
94
+        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
95
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
96 96
         <?php
97 97
     		if ($airline_icao == '') {
98 98
     	?>
99
-        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
100
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
99
+        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span>
100
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
101 101
 	<?php
102 102
 		}
103 103
 	?>
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 		if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) {
106 106
 			if ($airline_icao == '' || $airline_icao == 'all') {
107 107
 	?>
108
-        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span>
109
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
108
+        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span>
109
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
110 110
 	<?php
111 111
 			}
112 112
 		}
@@ -114,22 +114,22 @@  discard block
 block discarded – undo
114 114
 <?php
115 115
 	} elseif ($type == 'marine') {
116 116
 ?>
117
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarine(array(),$year,$month)); ?></span> <?php echo _("Vessels"); ?></span>
118
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
119
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarineTypes(array(),$year,$month)); ?></span> <?php echo _("Types"); ?></span>
120
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
117
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarine(array(), $year, $month)); ?></span> <?php echo _("Vessels"); ?></span>
118
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
119
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarineTypes(array(), $year, $month)); ?></span> <?php echo _("Types"); ?></span>
120
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
121 121
 <?php
122 122
 	} elseif ($type == 'tracker') {
123 123
 ?>
124
-	<span><span class="badge"><?php print number_format($Tracker->countOverallTracker(array(),$year,$month)); ?></span> <?php echo _("Trackers"); ?></span>
125
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
126
-	<span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(),$year,$month)); ?></span> <?php echo _("Types"); ?></span>
127
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
124
+	<span><span class="badge"><?php print number_format($Tracker->countOverallTracker(array(), $year, $month)); ?></span> <?php echo _("Trackers"); ?></span>
125
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
126
+	<span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(), $year, $month)); ?></span> <?php echo _("Types"); ?></span>
127
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
128 128
 <?php
129 129
 	}
130 130
 ?>
131 131
     </p>
132
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
132
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
133 133
     <div class="specific-stats">
134 134
 <?php
135 135
 	if ($type == 'aircraft') {
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
             <div class="col-md-6">
139 139
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
140 140
                  <?php
141
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
141
+                  $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
142 142
 		    if (count($aircraft_array) == 0) print _("No data available");
143 143
 		    else {
144 144
                     print '<div id="chart1" class="chart" width="100%"></div><script>';
145 145
                     $aircraft_data = '';
146
-                    foreach($aircraft_array as $aircraft_item)
146
+                    foreach ($aircraft_array as $aircraft_item)
147 147
                     {
148 148
                         $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
149 149
                     }
@@ -172,17 +172,17 @@  discard block
 block discarded – undo
172 172
             	    ?>
173 173
                 </div>
174 174
             </div>
175
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
175
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
176 176
 <?php
177 177
 //    echo $airline_icao;
178 178
 		if ($airline_icao == '' || $airline_icao == 'all') {
179
-			$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
179
+			$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month);
180 180
 			if (count($airline_array) > 0) {
181 181
 				print '<div class="col-md-6">';
182 182
 				print '<h2>'._("Top 10 Most Common Airline").'</h2>';
183 183
 				print '<div id="chart2" class="chart" width="100%"></div><script>';
184 184
 				$airline_data = '';
185
-				foreach($airline_array as $airline_item)
185
+				foreach ($airline_array as $airline_item)
186 186
 				{
187 187
 					$airline_data .= '["'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
188 188
 				}
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 			}
209 209
 ?>
210 210
         </div>
211
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
211
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
212 212
 <?php
213 213
 		}
214 214
 ?>
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
             <div class="col-md-6">
223 223
                 <h2><?php echo _("Top 10 Most Common Vessel Type"); ?></h2>
224 224
                  <?php
225
-                  $marine_array = $Marine->countAllMarineTypes(true,0,'',array(),$year,$month,$day);
225
+                  $marine_array = $Marine->countAllMarineTypes(true, 0, '', array(), $year, $month, $day);
226 226
 		    if (count($marine_array) == 0) print _("No data available");
227 227
 		    else {
228 228
                     print '<div id="chart1" class="chart" width="100%"></div><script>';
229 229
                     $marine_data = '';
230
-                    foreach($marine_array as $marine_item)
230
+                    foreach ($marine_array as $marine_item)
231 231
                     {
232 232
                         $marine_data .= '["'.$marine_item['marine_type'].'",'.$marine_item['marine_type_count'].'],';
233 233
                     }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
             	    ?>
259 259
                 </div>
260 260
             </div>
261
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
261
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
262 262
 <!--	</div>-->
263 263
 <?php
264 264
 	}
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
             <div class="col-md-6">
271 271
                 <h2><?php echo _("Top 10 Most Common Tracker Type"); ?></h2>
272 272
                  <?php
273
-                  $tracker_array = $Tracker->countAllTrackerTypes(true,0,'',array(),$year,$month,$day);
273
+                  $tracker_array = $Tracker->countAllTrackerTypes(true, 0, '', array(), $year, $month, $day);
274 274
 		    if (count($tracker_array) == 0) print _("No data available");
275 275
 		    else {
276 276
                     print '<div id="chart1" class="chart" width="100%"></div><script>';
277 277
                     $tracker_data = '';
278
-                    foreach($tracker_array as $tracker_item)
278
+                    foreach ($tracker_array as $tracker_item)
279 279
                     {
280 280
                         $tracker_data .= '["'.$tracker_item['tracker_type'].'",'.$tracker_item['tracker_type_count'].'],';
281 281
                     }
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             	    ?>
307 307
                 </div>
308 308
             </div>
309
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
309
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
310 310
 <!--	</div>-->
311 311
 <?php
312 312
 	}
@@ -316,8 +316,8 @@  discard block
 block discarded – undo
316 316
 ?>
317 317
         <div class="row column">
318 318
 <?php
319
-		$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
320
-		if ((isset($globalVA) && $globalVA) ||(isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
319
+		$flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month);
320
+		if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
321 321
 			if (empty($flightover_array)) {
322 322
 				print '<div class="col-md-12">';
323 323
 			} else {
@@ -326,12 +326,12 @@  discard block
 block discarded – undo
326 326
 ?>
327 327
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
328 328
 <?php
329
-			$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
329
+			$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
330 330
 			if (count($pilot_array) == 0) print _("No data available");
331 331
 			else {
332 332
 				print '<div id="chart7" class="chart" width="100%"></div><script>';
333 333
 				$pilot_data = '';
334
-				foreach($pilot_array as $pilot_item)
334
+				foreach ($pilot_array as $pilot_item)
335 335
 				{
336 336
 					$pilot_data .= '["'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
337 337
 				}
@@ -353,19 +353,19 @@  discard block
 block discarded – undo
353 353
 ?>
354 354
             </div>
355 355
         
356
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
356
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
357 357
 <?php
358 358
 		} else {
359 359
 ?>
360 360
             <div class="col-md-6">
361 361
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
362 362
 <?php
363
-			$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
363
+			$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
364 364
 			if (count($owner_array) == 0) print _("No data available");
365 365
 			else {
366 366
 				print '<div id="chart7" class="chart" width="100%"></div><script>';
367 367
 				$owner_data = '';
368
-				foreach($owner_array as $owner_item)
368
+				foreach ($owner_array as $owner_item)
369 369
 				{
370 370
 					$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
371 371
 				}
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                 </div>
386 386
             </div>
387 387
         
388
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
388
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
389 389
 <?php
390 390
 		}
391 391
 		if (!empty($flightover_array)) {
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 				print '<div id="chart10" class="chart" width="100%"></div><script>';
400 400
 				print 'var series = [';
401 401
 				$flightover_data = '';
402
-				foreach($flightover_array as $flightover_item)
402
+				foreach ($flightover_array as $flightover_item)
403 403
 				{
404 404
 					$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
405 405
 				}
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 		}
446 446
 ?>
447 447
         </div>
448
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
448
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
449 449
 
450 450
     	
451 451
         </div>
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 			print '<div id="chart10" class="chart" width="100%"></div><script>';
466 466
 			print 'var series = [';
467 467
 			$flightover_data = '';
468
-			foreach($flightover_array as $flightover_item)
468
+			foreach ($flightover_array as $flightover_item)
469 469
 			{
470 470
 				$flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],';
471 471
 			}
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 			print '<div id="chart10" class="chart" width="100%"></div><script>';
526 526
 			print 'var series = [';
527 527
 			$flightover_data = '';
528
-			foreach($flightover_array as $flightover_item)
528
+			foreach ($flightover_array as $flightover_item)
529 529
 			{
530 530
 				$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
531 531
 			}
@@ -578,14 +578,14 @@  discard block
 block discarded – undo
578 578
         <div class="row column">
579 579
             <div class="col-md-6">
580 580
 <?php
581
-		$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
581
+		$airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month);
582 582
 		if (count($airport_airport_array) > 0) {
583 583
 			print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
584 584
 			print '<div id="chart3" class="chart" width="100%"></div><script>';
585 585
 			print "\n";
586 586
 			print 'var series = [';
587 587
 			$airport_data = '';
588
-			foreach($airport_airport_array as $airport_item)
588
+			foreach ($airport_airport_array as $airport_item)
589 589
 			{
590 590
 				$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
591 591
 			}
@@ -636,18 +636,18 @@  discard block
 block discarded – undo
636 636
 		}
637 637
 ?>
638 638
             </div>
639
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
639
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
640 640
 
641 641
             <div class="col-md-6">
642 642
 <?php
643
-		$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
643
+		$airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
644 644
 		if (count($airport_airport_array2) > 0) {
645 645
 			print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
646 646
 			print '<div id="chart4" class="chart" width="100%"></div><script>';
647 647
 			print "\n";
648 648
 			print 'var series = [';
649 649
 			$airport_data = '';
650
-			foreach($airport_airport_array2 as $airport_item)
650
+			foreach ($airport_airport_array2 as $airport_item)
651 651
 			{
652 652
 				$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
653 653
 			}
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 ?>
700 700
             </div>
701 701
         </div>
702
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
702
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
703 703
 <?php 
704 704
 	}
705 705
 ?>
@@ -713,19 +713,19 @@  discard block
 block discarded – undo
713 713
             <div class="col-md-6">
714 714
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
715 715
 <?php
716
-			$year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
716
+			$year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
717 717
 			if (count($year_array) == 0) print _("No data available");
718 718
 			else {
719 719
 				print '<div id="chart8" class="chart" width="100%"></div><script>';
720 720
 				$year_data = '';
721 721
 				$year_cnt = '';
722
-				foreach($year_array as $year_item)
722
+				foreach ($year_array as $year_item)
723 723
 				{
724 724
 					$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
725 725
 					$year_cnt .= $year_item['date_count'].',';
726 726
 				}
727 727
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
728
-				$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
728
+				$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
729 729
 				print 'c3.generate({
730 730
 				    bindto: "#chart8",
731 731
 				    data: { x: "x",
@@ -738,23 +738,23 @@  discard block
 block discarded – undo
738 738
                     <a href="<?php print $globalURL; ?>/statistics/year<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
739 739
                 </div>
740 740
             </div>
741
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
741
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
742 742
             <div class="col-md-6">
743 743
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
744 744
 <?php
745
-			$month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
745
+			$month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
746 746
 			if (count($month_array) == 0) print _("No data available");
747 747
 			else {
748 748
 				print '<div id="chart9" class="chart" width="100%"></div><script>';
749 749
 				$month_data = '';
750 750
 				$month_cnt = '';
751
-				foreach($month_array as $month_item)
751
+				foreach ($month_array as $month_item)
752 752
 				{
753 753
 					$month_data .= '"'.$month_item['date_name'].'",';
754 754
 					$month_cnt .= $month_item['date_count'].',';
755 755
 				}
756 756
 				$month_data = "['x',".substr($month_data, 0, -1)."]";
757
-				$month_cnt = "['flights',".substr($month_cnt,0,-1)."]";
757
+				$month_cnt = "['flights',".substr($month_cnt, 0, -1)."]";
758 758
 				print 'c3.generate({
759 759
 				    bindto: "#chart9",
760 760
 				    data: { x: "x",
@@ -767,24 +767,24 @@  discard block
 block discarded – undo
767 767
                     <a href="<?php print $globalURL; ?>/statistics/month<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
768 768
                 </div>
769 769
             </div>
770
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
770
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
771 771
 
772 772
             <div class="col-md-6">
773 773
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
774 774
 <?php
775
-			$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
775
+			$date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
776 776
 			if (empty($date_array)) print _("No data available");
777 777
 			else {
778 778
 				print '<div id="chart5" class="chart" width="100%"></div><script>';
779 779
 				$date_data = '';
780 780
 				$date_cnt = '';
781
-				foreach($date_array as $date_item)
781
+				foreach ($date_array as $date_item)
782 782
 				{
783 783
 					$date_data .= '"'.$date_item['date_name'].'",';
784 784
 					$date_cnt .= $date_item['date_count'].',';
785 785
 				}
786 786
 				$date_data = "['x',".substr($date_data, 0, -1)."]";
787
-				$date_cnt = "['flights',".substr($date_cnt,0,-1)."]";
787
+				$date_cnt = "['flights',".substr($date_cnt, 0, -1)."]";
788 788
 				print 'c3.generate({
789 789
 				    bindto: "#chart5",
790 790
 				    data: { x: "x",
@@ -797,23 +797,23 @@  discard block
 block discarded – undo
797 797
                     <a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
798 798
                 </div>
799 799
             </div>
800
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
800
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
801 801
             <div class="col-md-6">
802 802
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
803 803
 <?php
804
-			$hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
804
+			$hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
805 805
 			if (empty($hour_array)) print _("No data available");
806 806
 			else {
807 807
 				print '<div id="chart6" class="chart" width="100%"></div><script>';
808 808
 				$hour_data = '';
809 809
 				$hour_cnt = '';
810
-				foreach($hour_array as $hour_item)
810
+				foreach ($hour_array as $hour_item)
811 811
 				{
812 812
 					$hour_data .= '"'.$hour_item['hour_name'].':00",';
813 813
 					$hour_cnt .= $hour_item['hour_count'].',';
814 814
 				}
815 815
 				$hour_data = "[".substr($hour_data, 0, -1)."]";
816
-				$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
816
+				$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
817 817
 				print 'c3.generate({
818 818
 				    bindto: "#chart6",
819 819
 				    data: {
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
                     <a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
827 827
                 </div>
828 828
             </div>
829
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
829
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
830 830
         </div>
831 831
 <?php
832 832
 		}
@@ -844,19 +844,19 @@  discard block
 block discarded – undo
844 844
             <div class="col-md-6">
845 845
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
846 846
 <?php
847
-			$year_array = $Marine->countAllMonthsLastYear(true,$airline_icao,$filter_name);
847
+			$year_array = $Marine->countAllMonthsLastYear(true, $airline_icao, $filter_name);
848 848
 			if (count($year_array) == 0) print _("No data available");
849 849
 			else {
850 850
 				print '<div id="chart8" class="chart" width="100%"></div><script>';
851 851
 				$year_data = '';
852 852
 				$year_cnt = '';
853
-				foreach($year_array as $year_item)
853
+				foreach ($year_array as $year_item)
854 854
 				{
855 855
 					$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
856 856
 					$year_cnt .= $year_item['date_count'].',';
857 857
 				}
858 858
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
859
-				$year_cnt = "['vessels',".substr($year_cnt,0,-1)."]";
859
+				$year_cnt = "['vessels',".substr($year_cnt, 0, -1)."]";
860 860
 				print 'c3.generate({
861 861
 				    bindto: "#chart8",
862 862
 				    data: { x: "x",
@@ -870,23 +870,23 @@  discard block
 block discarded – undo
870 870
                 </div>
871 871
             </div>
872 872
             
873
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
873
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
874 874
             <div class="col-md-6">
875 875
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
876 876
 <?php
877
-			$month_array = $Marine->countAllDatesLastMonth($airline_icao,$filter_name);
877
+			$month_array = $Marine->countAllDatesLastMonth($airline_icao, $filter_name);
878 878
 			if (count($month_array) == 0) print _("No data available");
879 879
 			else {
880 880
 				print '<div id="chart9" class="chart" width="100%"></div><script>';
881 881
 				$month_data = '';
882 882
 				$month_cnt = '';
883
-				foreach($month_array as $month_item)
883
+				foreach ($month_array as $month_item)
884 884
 				{
885 885
 					$month_data .= '"'.$month_item['date_name'].'",';
886 886
 					$month_cnt .= $month_item['date_count'].',';
887 887
 				}
888 888
 				$month_data = "['x',".substr($month_data, 0, -1)."]";
889
-				$month_cnt = "['vessels',".substr($month_cnt,0,-1)."]";
889
+				$month_cnt = "['vessels',".substr($month_cnt, 0, -1)."]";
890 890
 				print 'c3.generate({
891 891
 				    bindto: "#chart9",
892 892
 				    data: { x: "x",
@@ -899,24 +899,24 @@  discard block
 block discarded – undo
899 899
                     <a href="<?php print $globalURL; ?>/marine/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
900 900
                 </div>
901 901
             </div>
902
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
902
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
903 903
 
904 904
             <div class="col-md-6">
905 905
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
906 906
 <?php
907
-			$date_array = $Marine->countAllDatesLast7Days($airline_icao,$filter_name);
907
+			$date_array = $Marine->countAllDatesLast7Days($airline_icao, $filter_name);
908 908
 			if (empty($date_array)) print _("No data available");
909 909
 			else {
910 910
 				print '<div id="chart5" class="chart" width="100%"></div><script>';
911 911
 				$date_data = '';
912 912
 				$date_cnt = '';
913
-				foreach($date_array as $date_item)
913
+				foreach ($date_array as $date_item)
914 914
 				{
915 915
 					$date_data .= '"'.$date_item['date_name'].'",';
916 916
 					$date_cnt .= $date_item['date_count'].',';
917 917
 				}
918 918
 				$date_data = "['x',".substr($date_data, 0, -1)."]";
919
-				$date_cnt = "['vessels',".substr($date_cnt,0,-1)."]";
919
+				$date_cnt = "['vessels',".substr($date_cnt, 0, -1)."]";
920 920
 				print 'c3.generate({
921 921
 				    bindto: "#chart5",
922 922
 				    data: { x: "x",
@@ -929,23 +929,23 @@  discard block
 block discarded – undo
929 929
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
930 930
                 </div>
931 931
             </div>
932
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
932
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
933 933
             <div class="col-md-6">
934 934
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
935 935
 <?php
936
-			$hour_array = $Marine->countAllHours('hour',true,$airline_icao,$filter_name);
936
+			$hour_array = $Marine->countAllHours('hour', true, $airline_icao, $filter_name);
937 937
 			if (empty($hour_array)) print _("No data available");
938 938
 			else {
939 939
 				print '<div id="chart6" class="chart" width="100%"></div><script>';
940 940
 				$hour_data = '';
941 941
 				$hour_cnt = '';
942
-				foreach($hour_array as $hour_item)
942
+				foreach ($hour_array as $hour_item)
943 943
 				{
944 944
 					$hour_data .= '"'.$hour_item['hour_name'].':00",';
945 945
 					$hour_cnt .= $hour_item['hour_count'].',';
946 946
 				}
947 947
 				$hour_data = "[".substr($hour_data, 0, -1)."]";
948
-				$hour_cnt = "['vessels',".substr($hour_cnt,0,-1)."]";
948
+				$hour_cnt = "['vessels',".substr($hour_cnt, 0, -1)."]";
949 949
 				print 'c3.generate({
950 950
 				    bindto: "#chart6",
951 951
 				    data: {
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
                     <a href="<?php print $globalURL; ?>/marine/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
959 959
                 </div>
960 960
             </div>
961
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
961
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
962 962
         </div>
963 963
 <?php
964 964
 		}
@@ -982,13 +982,13 @@  discard block
 block discarded – undo
982 982
 				print '<div id="chart8" class="chart" width="100%"></div><script>';
983 983
 				$year_data = '';
984 984
 				$year_cnt = '';
985
-				foreach($year_array as $year_item)
985
+				foreach ($year_array as $year_item)
986 986
 				{
987 987
 					$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
988 988
 					$year_cnt .= $year_item['date_count'].',';
989 989
 				}
990 990
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
991
-				$year_cnt = "['trackers',".substr($year_cnt,0,-1)."]";
991
+				$year_cnt = "['trackers',".substr($year_cnt, 0, -1)."]";
992 992
 				print 'c3.generate({
993 993
 				    bindto: "#chart8",
994 994
 				    data: { x: "x",
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
                 </div>
1003 1003
             </div>
1004 1004
             
1005
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1005
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1006 1006
             <div class="col-md-6">
1007 1007
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
1008 1008
 <?php
@@ -1012,13 +1012,13 @@  discard block
 block discarded – undo
1012 1012
 				print '<div id="chart9" class="chart" width="100%"></div><script>';
1013 1013
 				$month_data = '';
1014 1014
 				$month_cnt = '';
1015
-				foreach($month_array as $month_item)
1015
+				foreach ($month_array as $month_item)
1016 1016
 				{
1017 1017
 					$month_data .= '"'.$month_item['date_name'].'",';
1018 1018
 					$month_cnt .= $month_item['date_count'].',';
1019 1019
 				}
1020 1020
 				$month_data = "['x',".substr($month_data, 0, -1)."]";
1021
-				$month_cnt = "['trackers',".substr($month_cnt,0,-1)."]";
1021
+				$month_cnt = "['trackers',".substr($month_cnt, 0, -1)."]";
1022 1022
 				print 'c3.generate({
1023 1023
 				    bindto: "#chart9",
1024 1024
 				    data: { x: "x",
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
                     <a href="<?php print $globalURL; ?>/tracker/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1032 1032
                 </div>
1033 1033
             </div>
1034
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1034
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1035 1035
 
1036 1036
             <div class="col-md-6">
1037 1037
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
@@ -1042,13 +1042,13 @@  discard block
 block discarded – undo
1042 1042
 				print '<div id="chart5" class="chart" width="100%"></div><script>';
1043 1043
 				$date_data = '';
1044 1044
 				$date_cnt = '';
1045
-				foreach($date_array as $date_item)
1045
+				foreach ($date_array as $date_item)
1046 1046
 				{
1047 1047
 					$date_data .= '"'.$date_item['date_name'].'",';
1048 1048
 					$date_cnt .= $date_item['date_count'].',';
1049 1049
 				}
1050 1050
 				$date_data = "['x',".substr($date_data, 0, -1)."]";
1051
-				$date_cnt = "['trackers',".substr($date_cnt,0,-1)."]";
1051
+				$date_cnt = "['trackers',".substr($date_cnt, 0, -1)."]";
1052 1052
 				print 'c3.generate({
1053 1053
 				    bindto: "#chart5",
1054 1054
 				    data: { x: "x",
@@ -1061,23 +1061,23 @@  discard block
 block discarded – undo
1061 1061
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1062 1062
                 </div>
1063 1063
             </div>
1064
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1064
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1065 1065
             <div class="col-md-6">
1066 1066
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1067 1067
 <?php
1068
-			$hour_array = $Tracker->countAllHours('hour',true);
1068
+			$hour_array = $Tracker->countAllHours('hour', true);
1069 1069
 			if (empty($hour_array)) print _("No data available");
1070 1070
 			else {
1071 1071
 				print '<div id="chart6" class="chart" width="100%"></div><script>';
1072 1072
 				$hour_data = '';
1073 1073
 				$hour_cnt = '';
1074
-				foreach($hour_array as $hour_item)
1074
+				foreach ($hour_array as $hour_item)
1075 1075
 				{
1076 1076
 					$hour_data .= '"'.$hour_item['hour_name'].':00",';
1077 1077
 					$hour_cnt .= $hour_item['hour_count'].',';
1078 1078
 				}
1079 1079
 				$hour_data = "[".substr($hour_data, 0, -1)."]";
1080
-				$hour_cnt = "['trackers',".substr($hour_cnt,0,-1)."]";
1080
+				$hour_cnt = "['trackers',".substr($hour_cnt, 0, -1)."]";
1081 1081
 				print 'c3.generate({
1082 1082
 				    bindto: "#chart6",
1083 1083
 				    data: {
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
                     <a href="<?php print $globalURL; ?>/tracker/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1091 1091
                 </div>
1092 1092
             </div>
1093
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1093
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1094 1094
         </div>
1095 1095
 <?php
1096 1096
 		}
@@ -1114,13 +1114,13 @@  discard block
 block discarded – undo
1114 1114
 				print '<div id="chart32" class="chart" width="100%"></div><script>';
1115 1115
 				$year_data = '';
1116 1116
 				$year_cnt = '';
1117
-				foreach($year_array as $year_item)
1117
+				foreach ($year_array as $year_item)
1118 1118
 				{
1119 1119
 					$year_data .= '"'.$year_item['year'].'-01-01",';
1120 1120
 					$year_cnt .= $year_item['count'].',';
1121 1121
 				}
1122 1122
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
1123
-				$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1123
+				$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1124 1124
 				print 'c3.generate({
1125 1125
 				    bindto: "#chart32",
1126 1126
 				    data: { x: "x",
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1134 1134
                 </div>
1135 1135
             </div>
1136
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1136
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1137 1137
 
1138 1138
         <div class="row column">
1139 1139
             <div class="col-md-6">
@@ -1145,13 +1145,13 @@  discard block
 block discarded – undo
1145 1145
 				print '<div id="chart33" class="chart" width="100%"></div><script>';
1146 1146
 				$year_data = '';
1147 1147
 				$year_cnt = '';
1148
-				foreach($year_array as $year_item)
1148
+				foreach ($year_array as $year_item)
1149 1149
 				{
1150 1150
 					$year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",';
1151 1151
 					$year_cnt .= $year_item['count'].',';
1152 1152
 				}
1153 1153
 				$year_data = "['x',".substr($year_data, 0, -1)."]";
1154
-				$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1154
+				$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1155 1155
 				print 'c3.generate({
1156 1156
 				    bindto: "#chart33",
1157 1157
 				    data: { x: "x",
@@ -1164,7 +1164,7 @@  discard block
 block discarded – undo
1164 1164
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1165 1165
                 </div>
1166 1166
             </div>
1167
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1167
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1168 1168
 <br/>
1169 1169
 <?php
1170 1170
 		}
@@ -1182,9 +1182,9 @@  discard block
 block discarded – undo
1182 1182
 <?php
1183 1183
 			//$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
1184 1184
 			if ($year == '' && $month == '') {
1185
-				$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
1185
+				$polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d'));
1186 1186
 			} else {
1187
-				$polar = $Stats->getStatsSource('polar',$year,$month);
1187
+				$polar = $Stats->getStatsSource('polar', $year, $month);
1188 1188
 			}
1189 1189
 			if (!empty($polar)) {
1190 1190
 				print '<h2>'._("Coverage pattern").'</h2>';
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
 					unset($polar_data);
1193 1193
 					$Spotter = new Spotter();
1194 1194
 					$data = json_decode($eachpolar['source_data']);
1195
-					foreach($data as $value => $key) {
1195
+					foreach ($data as $value => $key) {
1196 1196
 						$direction = $Spotter->parseDirection(($value*22.5));
1197 1197
 						$distance = $key;
1198 1198
 						$unit = 'km';
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
 ?>
1213 1213
             <div class="col-md-6">
1214 1214
                 <h4><?php print $eachpolar['source_name']; ?></h4>
1215
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1215
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1216 1216
         	<script>
1217 1217
         	    (function() {
1218 1218
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 		      color: color,
1237 1237
 		      unit: '<?php echo $unit; ?>'
1238 1238
 		    };
1239
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1239
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1240 1240
 		    })();
1241 1241
 		</script>
1242 1242
             </div>
@@ -1250,22 +1250,22 @@  discard block
 block discarded – undo
1250 1250
 <?php
1251 1251
 			//$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
1252 1252
 			if ($year == '' && $month == '') {
1253
-				$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
1253
+				$msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d'));
1254 1254
 			} else {
1255
-				$msg = $Stats->getStatsSource('msg',$year,$month);
1255
+				$msg = $Stats->getStatsSource('msg', $year, $month);
1256 1256
 			}
1257 1257
 			if (!empty($msg)) {
1258 1258
 				print '<h2>'._("Messages received").'</h2>';
1259 1259
 				foreach ($msg as $eachmsg) {
1260 1260
 					//$eachmsg = $msg[0];
1261 1261
 					$data = $eachmsg['source_data'];
1262
-					if ($data > 500) $max = (round(($data+100)/100))*100;
1262
+					if ($data > 500) $max = (round(($data + 100)/100))*100;
1263 1263
 					else $max = 500;
1264 1264
 ?>
1265
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1265
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1266 1266
         	<script>
1267 1267
 		      var g = new JustGage({
1268
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
1268
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
1269 1269
 			    value: <?php echo $data; ?>,
1270 1270
 			    min: 0,
1271 1271
 			    max: <?php print $max; ?>,
@@ -1286,9 +1286,9 @@  discard block
 block discarded – undo
1286 1286
 <?php
1287 1287
 		//$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
1288 1288
 			if ($year == '' && $month == '') {
1289
-				$hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d'));
1289
+				$hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d'));
1290 1290
 			} else {
1291
-				$hist = $Stats->getStatsSource('hist',$year,$month);
1291
+				$hist = $Stats->getStatsSource('hist', $year, $month);
1292 1292
 			}
1293 1293
 			foreach ($hist as $hists) {
1294 1294
 				//$hist_data = '';
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 				$source = $hists['source_name'];
1298 1298
 				$hist_array = json_decode($hists['source_data']);
1299 1299
 				$unit = 'km';
1300
-				foreach($hist_array as $distance => $nb)
1300
+				foreach ($hist_array as $distance => $nb)
1301 1301
 				{
1302 1302
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1303 1303
 						$distance = round($distance*0.539957);
@@ -1318,18 +1318,18 @@  discard block
 block discarded – undo
1318 1318
 				$nb_data = "['flights',".substr($nb_data, 0, -1)."]";
1319 1319
 ?>
1320 1320
             <div class="col-md-6">
1321
-                <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
1321
+                <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2>
1322 1322
 <?php
1323
-				print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>';
1323
+				print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div><script>';
1324 1324
 				print 'c3.generate({
1325
-				    bindto: "#charthist-'.str_replace(' ','_',strtolower($source)).'",
1325
+				    bindto: "#charthist-'.str_replace(' ', '_', strtolower($source)).'",
1326 1326
 				    data: { x: "x",
1327 1327
 				    columns: ['.$distance_data.','.$nb_data.'], types: { flights: "area"}, colors: { flights: "#1a3151"}},
1328 1328
 				    axis: { x: {label : { text: "Distance in '.$unit.'", position: "outer-right"}}, y: { label: "# of Flights"}},legend: { show: false }});';
1329 1329
 				print '</script>';
1330 1330
 ?>
1331 1331
     	    </div>
1332
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1332
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1333 1333
 <?php
1334 1334
 			}
1335 1335
 ?>
Please login to merge, or discard this patch.