Completed
Push — master ( 5393b5...235efc )
by Yannick
29:44
created
statistics.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -267,16 +267,16 @@  discard block
 block discarded – undo
267 267
                 <div class="more">
268 268
             	    <?php
269 269
             	    
270
-            		if ($year != '' && $month != '') {
271
-            	    ?>
270
+					if ($year != '' && $month != '') {
271
+					?>
272 272
             	    <a href="<?php print $globalURL; ?>/marine/statistics/type/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
273 273
             	    <?php
274
-            		} else {
275
-            	    ?>
274
+					} else {
275
+					?>
276 276
             	    <a href="<?php print $globalURL; ?>/marine/statistics/type" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
277 277
             	    <?php
278
-            		}
279
-            	    ?>
278
+					}
279
+					?>
280 280
                 </div>
281 281
             </div>
282 282
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 ?>
309 309
                 <div class="more">
310 310
             	    <?php
311
-            	    /*
311
+					/*
312 312
             		if ($year != '' && $month != '') {
313 313
             	    ?>
314 314
             	    <a href="<?php print $globalURL; ?>/marine/statistics/race/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
             	    <?php
320 320
             		}
321 321
             		*/
322
-            	    ?>
322
+					?>
323 323
                 </div>
324 324
             </div>
325 325
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 ?>
357 357
                 <div class="more">
358 358
             	    <?php
359
-            	    /*
359
+					/*
360 360
             		if ($year != '' && $month != '') {
361 361
             	    ?>
362 362
             	    <a href="<?php print $globalURL; ?>/tracker/statistics/type/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
             	    <?php
368 368
             		}
369 369
             		*/
370
-            	    ?>
370
+					?>
371 371
                 </div>
372 372
             </div>
373 373
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
Please login to merge, or discard this patch.
Spacing   +157 added lines, -157 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 }
24 24
 
25 25
 if (!isset($filter_name)) $filter_name = '';
26
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
26
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
27 27
 if ($type == 'aircraft' && $airline_icao == '' && isset($globalFilter)) {
28 28
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
29 29
 }
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	$airline_info = $Spotter->getAllAirlineInfo($airline_icao);
33 33
 	if (isset($airline_info[0]['name'])) {
34 34
 		$airline_name = $airline_info[0]['name'];
35
-	} elseif (strpos($airline_icao,'alliance_') !== FALSE) {
35
+	} elseif (strpos($airline_icao, 'alliance_') !== FALSE) {
36 36
 		$alliance_name = $airline_icao;
37 37
 	}
38 38
 }
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	$title = _("Statistics");
43 43
 }
44 44
 
45
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
46
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
45
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
46
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
47 47
 
48 48
 require_once('header.php');
49 49
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	date_default_timezone_set('UTC');
75 75
 	$lastupdate = strtotime($last_update[0]['value']);
76 76
 	if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
77
-	print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
77
+	print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
78 78
 }
79 79
 
80 80
 ?>
@@ -86,31 +86,31 @@  discard block
 block discarded – undo
86 86
 <?php
87 87
 if ($type == 'aircraft') {
88 88
 ?>
89
-        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span>
90
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
91
-        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
92
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
89
+        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span>
90
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
91
+        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
92
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
93 93
 <?php
94 94
 	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
95 95
 ?>
96
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
97
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
96
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span>
97
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
98 98
 <?php
99 99
 	}
100 100
 	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
101 101
 ?>
102
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
103
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
102
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span>
103
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
104 104
 <?php
105 105
 	}
106 106
 ?>
107
-        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircraft types"); ?></span>
108
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
107
+        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircraft types"); ?></span>
108
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
109 109
 <?php
110 110
 	if ($airline_icao == '') {
111 111
 ?>
112
-        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
113
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
112
+        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span>
113
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
114 114
 <?php
115 115
 	}
116 116
 ?>
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	if (!(isset($globalVA) && $globalVA) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS) && !(isset($globalVAM) && $globalVAM)) {
119 119
 		if ($airline_icao == '' || $airline_icao == 'all') {
120 120
 ?>
121
-        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span>
122
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
121
+        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span>
122
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
123 123
 <?php
124 124
 		}
125 125
 	}
@@ -127,35 +127,35 @@  discard block
 block discarded – undo
127 127
 <?php
128 128
 } elseif ($type == 'marine') {
129 129
 ?>
130
-	<span><span class="badge"><?php print number_format($Stats->countOverallMarine($filter_name,$year,$month)); ?></span> <?php echo _("Vessels"); ?></span>
131
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
130
+	<span><span class="badge"><?php print number_format($Stats->countOverallMarine($filter_name, $year, $month)); ?></span> <?php echo _("Vessels"); ?></span>
131
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
132 132
 <?php
133 133
 	if (isset($globalVM) && $globalVM) {
134 134
 ?>
135
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarineTypes($filter_name,$year,$month)); ?></span> <?php echo _("Types"); ?></span>
136
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
137
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarineRaces($filter_name,$year,$month)); ?></span> <?php echo _("Races"); ?></span>
138
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
139
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarineCaptains($filter_name,$year,$month)); ?></span> <?php echo _("Captains"); ?></span>
140
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
135
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarineTypes($filter_name, $year, $month)); ?></span> <?php echo _("Types"); ?></span>
136
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
137
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarineRaces($filter_name, $year, $month)); ?></span> <?php echo _("Races"); ?></span>
138
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
139
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarineCaptains($filter_name, $year, $month)); ?></span> <?php echo _("Captains"); ?></span>
140
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
141 141
 <?php
142 142
 	} else {
143 143
 ?>
144
-	<span><span class="badge"><?php print number_format($Stats->countOverallMarineTypes($filter_name,$year,$month)); ?></span> <?php echo _("Types"); ?></span>
145
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
144
+	<span><span class="badge"><?php print number_format($Stats->countOverallMarineTypes($filter_name, $year, $month)); ?></span> <?php echo _("Types"); ?></span>
145
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
146 146
 <?php
147 147
 	}
148 148
 } elseif ($type == 'tracker') {
149 149
 ?>
150
-	<span><span class="badge"><?php print number_format($Stats->countOverallTracker($filter_name,$year,$month)); ?></span> <?php echo _("Trackers"); ?></span>
151
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
152
-	<span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(),$year,$month)); ?></span> <?php echo _("Types"); ?></span>
153
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
150
+	<span><span class="badge"><?php print number_format($Stats->countOverallTracker($filter_name, $year, $month)); ?></span> <?php echo _("Trackers"); ?></span>
151
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
152
+	<span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(), $year, $month)); ?></span> <?php echo _("Types"); ?></span>
153
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
154 154
 <?php
155 155
 }
156 156
 ?>
157 157
     </p>
158
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
158
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
159 159
     <div class="specific-stats">
160 160
 <?php
161 161
 if ($type == 'aircraft') {
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
             <div class="col-md-6">
165 165
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
166 166
 <?php
167
-	$aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
167
+	$aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
168 168
 	if (count($aircraft_array) == 0) {
169 169
 		print _("No data available");
170 170
 	} else {
171 171
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
172 172
 		$aircraft_data = '';
173
-		foreach($aircraft_array as $aircraft_item) {
173
+		foreach ($aircraft_array as $aircraft_item) {
174 174
 			if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
175 175
 			else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
176 176
 		}
@@ -199,16 +199,16 @@  discard block
 block discarded – undo
199 199
 ?>
200 200
                 </div>
201 201
             </div>
202
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
202
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
203 203
 <?php
204 204
 	if ($airline_icao == '' || $airline_icao == 'all') {
205
-		$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
205
+		$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month);
206 206
 		if (count($airline_array) > 0) {
207 207
 			print '<div class="col-md-6">';
208 208
 			print '<h2>'._("Top 10 Most Common Airline").'</h2>';
209 209
 			print '<div id="chart2" class="chart" width="100%"></div><script>';
210 210
 			$airline_data = '';
211
-			foreach($airline_array as $airline_item) {
211
+			foreach ($airline_array as $airline_item) {
212 212
 				$airline_data .= '["'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
213 213
 			}
214 214
 			$airline_data = substr($airline_data, 0, -1);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		}
234 234
 ?>
235 235
         </div>
236
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
236
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
237 237
 <?php
238 238
 	}
239 239
 }
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
             <div class="col-md-6">
246 246
                 <h2><?php echo _("Top 10 Most Common Vessel Type"); ?></h2>
247 247
 <?php
248
-	$marine_array = $Stats->countAllMarineTypes(true,$filter_name,$year,$month);
248
+	$marine_array = $Stats->countAllMarineTypes(true, $filter_name, $year, $month);
249 249
 	if (count($marine_array) == 0) print _("No data available");
250 250
 	else {
251 251
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
252 252
 		$marine_data = '';
253
-		foreach($marine_array as $marine_item) {
253
+		foreach ($marine_array as $marine_item) {
254 254
 			$marine_data .= '["'.$marine_item['marine_type'].'",'.$marine_item['marine_type_count'].'],';
255 255
 		}
256 256
 		$marine_data = substr($marine_data, 0, -1);
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             	    ?>
280 280
                 </div>
281 281
             </div>
282
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
282
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
283 283
 <!--	</div>-->
284 284
 <?php
285 285
 	if (isset($globalVM) && $globalVM) {
@@ -287,12 +287,12 @@  discard block
 block discarded – undo
287 287
             <div class="col-md-6">
288 288
                 <h2><?php echo _("Top 10 Races Number of Participants"); ?></h2>
289 289
 <?php
290
-	$marine_array = $Marine->countAllCaptainsByRaces(true,$filter_name,$year,$month);
290
+	$marine_array = $Marine->countAllCaptainsByRaces(true, $filter_name, $year, $month);
291 291
 	if (count($marine_array) == 0) print _("No data available");
292 292
 	else {
293 293
 		print '<div id="chart991" class="chart" width="100%"></div><script>';
294 294
 		$marine_data = '';
295
-		foreach($marine_array as $marine_item) {
295
+		foreach ($marine_array as $marine_item) {
296 296
 			$marine_data .= '["'.$marine_item['marine_race_name'].'",'.$marine_item['marine_captain_count'].'],';
297 297
 		}
298 298
 		$marine_data = substr($marine_data, 0, -1);
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
             	    ?>
323 323
                 </div>
324 324
             </div>
325
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
325
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
326 326
 	</div>
327 327
         <div class="row column">
328 328
 
@@ -335,12 +335,12 @@  discard block
 block discarded – undo
335 335
             <div class="col-md-6">
336 336
                 <h2><?php echo _("Top 10 Most Common Tracker Type"); ?></h2>
337 337
 <?php
338
-	$tracker_array = $Tracker->countAllTrackerTypes(true,0,'',array(),$year,$month);
338
+	$tracker_array = $Tracker->countAllTrackerTypes(true, 0, '', array(), $year, $month);
339 339
 	if (count($tracker_array) == 0) print _("No data available");
340 340
 	else {
341 341
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
342 342
 		$tracker_data = '';
343
-		foreach($tracker_array as $tracker_item) {
343
+		foreach ($tracker_array as $tracker_item) {
344 344
 			$tracker_data .= '["'.$tracker_item['tracker_type'].'",'.$tracker_item['tracker_type_count'].'],';
345 345
 		}
346 346
 		$tracker_data = substr($tracker_data, 0, -1);
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
             	    ?>
371 371
                 </div>
372 372
             </div>
373
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
373
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
374 374
 <!--	</div>-->
375 375
 <?php
376 376
 }
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 		else {
386 386
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
387 387
 			$owner_data = '';
388
-			foreach($owner_array as $owner_item) {
388
+			foreach ($owner_array as $owner_item) {
389 389
 				$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
390 390
 			}
391 391
 			$owner_data = substr($owner_data, 0, -1);
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
                 </div>
406 406
                 -->
407 407
             </div>
408
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
408
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
409 409
             <div class="col-md-6">
410 410
                 <h2><?php echo _("Top 10 Most Common Countries Owners"); ?></h2>
411 411
 <?php
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 		else {
415 415
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
416 416
 			$owner_data = '';
417
-			foreach($countries_array as $owner_item) {
417
+			foreach ($countries_array as $owner_item) {
418 418
 				$owner_data .= '["'.$owner_item['country_name'].'",'.$owner_item['country_count'].'],';
419 419
 			}
420 420
 			$owner_data = substr($owner_data, 0, -1);
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                 -->
436 436
             </div>
437 437
             
438
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
438
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
439 439
 ²	</div>
440 440
         <div class="row column">
441 441
             <div class="col-md-6">
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		else {
447 447
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
448 448
 			$launch_site_data = '';
449
-			foreach($launch_site_array as $launch_site_item) {
449
+			foreach ($launch_site_array as $launch_site_item) {
450 450
 				$launch_site_data .= '["'.$launch_site_item['launch_site'].'",'.$launch_site_item['launch_site_count'].'],';
451 451
 			}
452 452
 			$launch_site_data = substr($launch_site_data, 0, -1);
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 ?>
474 474
         <div class="row column">
475 475
 <?php
476
-	$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
476
+	$flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month);
477 477
 	//if ((isset($globalVA) && $globalVA) ||(isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
478 478
 	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
479 479
 		if (empty($flightover_array)) {
@@ -484,12 +484,12 @@  discard block
 block discarded – undo
484 484
 ?>
485 485
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
486 486
 <?php
487
-		$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
487
+		$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
488 488
 		if (count($pilot_array) == 0) print _("No data available");
489 489
 		else {
490 490
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
491 491
 			$pilot_data = '';
492
-			foreach($pilot_array as $pilot_item) {
492
+			foreach ($pilot_array as $pilot_item) {
493 493
 				$pilot_data .= '["'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
494 494
 			}
495 495
 			$pilot_data = substr($pilot_data, 0, -1);
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 ?>
511 511
             </div>
512 512
 
513
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
513
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
514 514
 <?php
515 515
 	}
516 516
 	// else {
@@ -519,12 +519,12 @@  discard block
 block discarded – undo
519 519
             <div class="col-md-6">
520 520
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
521 521
 <?php
522
-		$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
522
+		$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
523 523
 		if (count($owner_array) == 0) print _("No data available");
524 524
 		else {
525 525
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
526 526
 			$owner_data = '';
527
-			foreach($owner_array as $owner_item) {
527
+			foreach ($owner_array as $owner_item) {
528 528
 				$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
529 529
 			}
530 530
 			$owner_data = substr($owner_data, 0, -1);
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
                 </div>
544 544
             </div>
545 545
         
546
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
546
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
547 547
 <?php
548 548
 	}
549 549
 	if (!empty($flightover_array)) {
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 			print '<div id="chart10" class="chart" width="100%"></div><script>';
558 558
 			print 'var series = [';
559 559
 			$flightover_data = '';
560
-			foreach($flightover_array as $flightover_item) {
560
+			foreach ($flightover_array as $flightover_item) {
561 561
 				$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
562 562
 			}
563 563
 			$flightover_data = substr($flightover_data, 0, -1);
@@ -602,12 +602,12 @@  discard block
 block discarded – undo
602 602
 	}
603 603
 ?>
604 604
         </div>
605
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
605
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
606 606
         </div>
607 607
 <?php
608 608
 }
609 609
 if ($type == 'marine') {
610
-	$flightover_array = $Stats->countAllMarineOverCountries(true,$filter_name,$year,$month);
610
+	$flightover_array = $Stats->countAllMarineOverCountries(true, $filter_name, $year, $month);
611 611
 ?>
612 612
 <!--    <div class="row column">-->
613 613
 	<div class="col-md-6">
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 		print '<div id="chart10" class="chart" width="100%"></div><script>';
619 619
 		print 'var series = [';
620 620
 		$flightover_data = '';
621
-		foreach($flightover_array as $flightover_item) {
621
+		foreach ($flightover_array as $flightover_item) {
622 622
 			$flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],';
623 623
 		}
624 624
 		$flightover_data = substr($flightover_data, 0, -1);
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
                 <div class="more">
659 659
                     <a href="<?php print $globalURL; ?>/marine/statistics/country" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
660 660
                 </div>
661
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
661
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
662 662
             </div>
663 663
         </div>
664 664
 
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 		print '<div id="chart10" class="chart" width="100%"></div><script>';
677 677
 		print 'var series = [';
678 678
 		$flightover_data = '';
679
-		foreach($flightover_array as $flightover_item) {
679
+		foreach ($flightover_array as $flightover_item) {
680 680
 			$flightover_data .= '[ "'.$flightover_item['tracker_country_iso3'].'",'.$flightover_item['tracker_count'].'],';
681 681
 		}
682 682
 		$flightover_data = substr($flightover_data, 0, -1);
@@ -726,14 +726,14 @@  discard block
 block discarded – undo
726 726
         <div class="row column">
727 727
             <div class="col-md-6">
728 728
 <?php
729
-	$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
729
+	$airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month);
730 730
 	if (count($airport_airport_array) > 0) {
731 731
 		print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
732 732
 		print '<div id="chart3" class="chart" width="100%"></div><script>';
733 733
 		print "\n";
734 734
 		print 'var series = [';
735 735
 		$airport_data = '';
736
-		foreach($airport_airport_array as $airport_item) {
736
+		foreach ($airport_airport_array as $airport_item) {
737 737
 			$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
738 738
 		}
739 739
 		$airport_data = substr($airport_data, 0, -1);
@@ -783,18 +783,18 @@  discard block
 block discarded – undo
783 783
 	}
784 784
 ?>
785 785
             </div>
786
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
786
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
787 787
 
788 788
             <div class="col-md-6">
789 789
 <?php
790
-	$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
790
+	$airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
791 791
 	if (count($airport_airport_array2) > 0) {
792 792
 		print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
793 793
 		print '<div id="chart4" class="chart" width="100%"></div><script>';
794 794
 		print "\n";
795 795
 		print 'var series = [';
796 796
 		$airport_data = '';
797
-		foreach($airport_airport_array2 as $airport_item)
797
+		foreach ($airport_airport_array2 as $airport_item)
798 798
 		{
799 799
 			if (isset($airport_item['airport_arrival_longitude']) && isset($airport_item['airport_arrival_latitude'])) {
800 800
 				$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 ?>
849 849
             </div>
850 850
         </div>
851
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
851
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
852 852
 <?php 
853 853
 }
854 854
 if ($type == 'aircraft') {
@@ -860,18 +860,18 @@  discard block
 block discarded – undo
860 860
             <div class="col-md-6">
861 861
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
862 862
 <?php
863
-		$year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
863
+		$year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
864 864
 		if (count($year_array) == 0) print _("No data available");
865 865
 		else {
866 866
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
867 867
 			$year_data = '';
868 868
 			$year_cnt = '';
869
-			foreach($year_array as $year_item) {
869
+			foreach ($year_array as $year_item) {
870 870
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
871 871
 				$year_cnt .= $year_item['date_count'].',';
872 872
 			}
873 873
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
874
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
874
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
875 875
 			print 'c3.generate({
876 876
 			    bindto: "#chart8",
877 877
 			    data: { x: "x",
@@ -884,22 +884,22 @@  discard block
 block discarded – undo
884 884
                     <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>
885 885
                 </div>
886 886
             </div>
887
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
887
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
888 888
             <div class="col-md-6">
889 889
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
890 890
 <?php
891
-		$month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
891
+		$month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
892 892
 		if (count($month_array) == 0) print _("No data available");
893 893
 		else {
894 894
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
895 895
 			$month_data = '';
896 896
 			$month_cnt = '';
897
-			foreach($month_array as $month_item) {
897
+			foreach ($month_array as $month_item) {
898 898
 				$month_data .= '"'.$month_item['date_name'].'",';
899 899
 				$month_cnt .= $month_item['date_count'].',';
900 900
 			}
901 901
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
902
-			$month_cnt = "['flights',".substr($month_cnt,0,-1)."]";
902
+			$month_cnt = "['flights',".substr($month_cnt, 0, -1)."]";
903 903
 			print 'c3.generate({
904 904
 			    bindto: "#chart9",
905 905
 			    data: { x: "x",
@@ -912,23 +912,23 @@  discard block
 block discarded – undo
912 912
                     <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>
913 913
                 </div>
914 914
             </div>
915
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
915
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
916 916
 
917 917
             <div class="col-md-6">
918 918
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
919 919
 <?php
920
-		$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
920
+		$date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
921 921
 		if (empty($date_array)) print _("No data available");
922 922
 		else {
923 923
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
924 924
 			$date_data = '';
925 925
 			$date_cnt = '';
926
-			foreach($date_array as $date_item) {
926
+			foreach ($date_array as $date_item) {
927 927
 				$date_data .= '"'.$date_item['date_name'].'",';
928 928
 				$date_cnt .= $date_item['date_count'].',';
929 929
 			}
930 930
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
931
-			$date_cnt = "['flights',".substr($date_cnt,0,-1)."]";
931
+			$date_cnt = "['flights',".substr($date_cnt, 0, -1)."]";
932 932
 			print 'c3.generate({
933 933
 			    bindto: "#chart5",
934 934
 			    data: { x: "x",
@@ -941,22 +941,22 @@  discard block
 block discarded – undo
941 941
                     <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>
942 942
                 </div>
943 943
             </div>
944
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
944
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
945 945
             <div class="col-md-6">
946 946
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
947 947
 <?php
948
-		$hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
948
+		$hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
949 949
 		if (empty($hour_array)) print _("No data available");
950 950
 		else {
951 951
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
952 952
 			$hour_data = '';
953 953
 			$hour_cnt = '';
954
-			foreach($hour_array as $hour_item) {
954
+			foreach ($hour_array as $hour_item) {
955 955
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
956 956
 				$hour_cnt .= $hour_item['hour_count'].',';
957 957
 			}
958 958
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
959
-			$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
959
+			$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
960 960
 			print 'c3.generate({
961 961
 			    bindto: "#chart6",
962 962
 			    data: {
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
                     <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>
970 970
                 </div>
971 971
             </div>
972
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
972
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
973 973
         </div>
974 974
 <?php
975 975
 	}
@@ -985,18 +985,18 @@  discard block
 block discarded – undo
985 985
             <div class="col-md-6">
986 986
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
987 987
 <?php
988
-		$year_array = $Stats->countAllMarineMonthsLastYear(true,$filter_name);
988
+		$year_array = $Stats->countAllMarineMonthsLastYear(true, $filter_name);
989 989
 		if (count($year_array) == 0) print _("No data available");
990 990
 		else {
991 991
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
992 992
 			$year_data = '';
993 993
 			$year_cnt = '';
994
-			foreach($year_array as $year_item) {
994
+			foreach ($year_array as $year_item) {
995 995
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
996 996
 				$year_cnt .= $year_item['date_count'].',';
997 997
 			}
998 998
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
999
-			$year_cnt = "['vessels',".substr($year_cnt,0,-1)."]";
999
+			$year_cnt = "['vessels',".substr($year_cnt, 0, -1)."]";
1000 1000
 			print 'c3.generate({
1001 1001
 			    bindto: "#chart8",
1002 1002
 			    data: { x: "x",
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
                 </div>
1011 1011
             </div>
1012 1012
             
1013
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1013
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1014 1014
             <div class="col-md-6">
1015 1015
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
1016 1016
 <?php
@@ -1020,12 +1020,12 @@  discard block
 block discarded – undo
1020 1020
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
1021 1021
 			$month_data = '';
1022 1022
 			$month_cnt = '';
1023
-			foreach($month_array as $month_item) {
1023
+			foreach ($month_array as $month_item) {
1024 1024
 				$month_data .= '"'.$month_item['date_name'].'",';
1025 1025
 				$month_cnt .= $month_item['date_count'].',';
1026 1026
 			}
1027 1027
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
1028
-			$month_cnt = "['vessels',".substr($month_cnt,0,-1)."]";
1028
+			$month_cnt = "['vessels',".substr($month_cnt, 0, -1)."]";
1029 1029
 			print 'c3.generate({
1030 1030
 			    bindto: "#chart9",
1031 1031
 			    data: { x: "x",
@@ -1038,7 +1038,7 @@  discard block
 block discarded – undo
1038 1038
                     <a href="<?php print $globalURL; ?>/marine/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1039 1039
                 </div>
1040 1040
             </div>
1041
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1041
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1042 1042
 
1043 1043
             <div class="col-md-6">
1044 1044
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
@@ -1049,12 +1049,12 @@  discard block
 block discarded – undo
1049 1049
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
1050 1050
 			$date_data = '';
1051 1051
 			$date_cnt = '';
1052
-			foreach($date_array as $date_item) {
1052
+			foreach ($date_array as $date_item) {
1053 1053
 				$date_data .= '"'.$date_item['date_name'].'",';
1054 1054
 				$date_cnt .= $date_item['date_count'].',';
1055 1055
 			}
1056 1056
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
1057
-			$date_cnt = "['vessels',".substr($date_cnt,0,-1)."]";
1057
+			$date_cnt = "['vessels',".substr($date_cnt, 0, -1)."]";
1058 1058
 			print 'c3.generate({
1059 1059
 			    bindto: "#chart5",
1060 1060
 			    data: { x: "x",
@@ -1067,22 +1067,22 @@  discard block
 block discarded – undo
1067 1067
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1068 1068
                 </div>
1069 1069
             </div>
1070
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1070
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1071 1071
             <div class="col-md-6">
1072 1072
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1073 1073
 <?php
1074
-		$hour_array = $Stats->countAllMarineHours('hour',true,$filter_name);
1074
+		$hour_array = $Stats->countAllMarineHours('hour', true, $filter_name);
1075 1075
 		if (empty($hour_array)) print _("No data available");
1076 1076
 		else {
1077 1077
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
1078 1078
 			$hour_data = '';
1079 1079
 			$hour_cnt = '';
1080
-			foreach($hour_array as $hour_item) {
1080
+			foreach ($hour_array as $hour_item) {
1081 1081
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
1082 1082
 				$hour_cnt .= $hour_item['hour_count'].',';
1083 1083
 			}
1084 1084
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
1085
-			$hour_cnt = "['vessels',".substr($hour_cnt,0,-1)."]";
1085
+			$hour_cnt = "['vessels',".substr($hour_cnt, 0, -1)."]";
1086 1086
 			print 'c3.generate({
1087 1087
 			    bindto: "#chart6",
1088 1088
 			    data: {
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
                     <a href="<?php print $globalURL; ?>/marine/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1096 1096
                 </div>
1097 1097
             </div>
1098
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1098
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1099 1099
         </div>
1100 1100
 <?php
1101 1101
 	}
@@ -1117,12 +1117,12 @@  discard block
 block discarded – undo
1117 1117
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
1118 1118
 			$year_data = '';
1119 1119
 			$year_cnt = '';
1120
-			foreach($year_array as $year_item) {
1120
+			foreach ($year_array as $year_item) {
1121 1121
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
1122 1122
 				$year_cnt .= $year_item['date_count'].',';
1123 1123
 			}
1124 1124
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1125
-			$year_cnt = "['trackers',".substr($year_cnt,0,-1)."]";
1125
+			$year_cnt = "['trackers',".substr($year_cnt, 0, -1)."]";
1126 1126
 			print 'c3.generate({
1127 1127
 			    bindto: "#chart8",
1128 1128
 			    data: { x: "x",
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
                 </div>
1137 1137
             </div>
1138 1138
             
1139
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1139
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1140 1140
             <div class="col-md-6">
1141 1141
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
1142 1142
 <?php
@@ -1146,12 +1146,12 @@  discard block
 block discarded – undo
1146 1146
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
1147 1147
 			$month_data = '';
1148 1148
 			$month_cnt = '';
1149
-			foreach($month_array as $month_item) {
1149
+			foreach ($month_array as $month_item) {
1150 1150
 				$month_data .= '"'.$month_item['date_name'].'",';
1151 1151
 				$month_cnt .= $month_item['date_count'].',';
1152 1152
 			}
1153 1153
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
1154
-			$month_cnt = "['trackers',".substr($month_cnt,0,-1)."]";
1154
+			$month_cnt = "['trackers',".substr($month_cnt, 0, -1)."]";
1155 1155
 			print 'c3.generate({
1156 1156
 			    bindto: "#chart9",
1157 1157
 			    data: { x: "x",
@@ -1164,7 +1164,7 @@  discard block
 block discarded – undo
1164 1164
                     <a href="<?php print $globalURL; ?>/tracker/statistics/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
 
1169 1169
             <div class="col-md-6">
1170 1170
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
@@ -1175,12 +1175,12 @@  discard block
 block discarded – undo
1175 1175
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
1176 1176
 			$date_data = '';
1177 1177
 			$date_cnt = '';
1178
-			foreach($date_array as $date_item) {
1178
+			foreach ($date_array as $date_item) {
1179 1179
 				$date_data .= '"'.$date_item['date_name'].'",';
1180 1180
 				$date_cnt .= $date_item['date_count'].',';
1181 1181
 			}
1182 1182
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
1183
-			$date_cnt = "['trackers',".substr($date_cnt,0,-1)."]";
1183
+			$date_cnt = "['trackers',".substr($date_cnt, 0, -1)."]";
1184 1184
 			print 'c3.generate({
1185 1185
 			    bindto: "#chart5",
1186 1186
 			    data: { x: "x",
@@ -1193,22 +1193,22 @@  discard block
 block discarded – undo
1193 1193
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1194 1194
                 </div>
1195 1195
             </div>
1196
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1196
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1197 1197
             <div class="col-md-6">
1198 1198
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1199 1199
 <?php
1200
-		$hour_array = $Stats->countAllTrackerHours('hour',true);
1200
+		$hour_array = $Stats->countAllTrackerHours('hour', true);
1201 1201
 		if (empty($hour_array)) print _("No data available");
1202 1202
 		else {
1203 1203
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
1204 1204
 			$hour_data = '';
1205 1205
 			$hour_cnt = '';
1206
-			foreach($hour_array as $hour_item) {
1206
+			foreach ($hour_array as $hour_item) {
1207 1207
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
1208 1208
 				$hour_cnt .= $hour_item['hour_count'].',';
1209 1209
 			}
1210 1210
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
1211
-			$hour_cnt = "['trackers',".substr($hour_cnt,0,-1)."]";
1211
+			$hour_cnt = "['trackers',".substr($hour_cnt, 0, -1)."]";
1212 1212
 			print 'c3.generate({
1213 1213
 			    bindto: "#chart6",
1214 1214
 			    data: {
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
                     <a href="<?php print $globalURL; ?>/tracker/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1222 1222
                 </div>
1223 1223
             </div>
1224
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1224
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1225 1225
         </div>
1226 1226
 <?php
1227 1227
 	}
@@ -1243,12 +1243,12 @@  discard block
 block discarded – undo
1243 1243
 			print '<div id="chart21" class="chart" width="100%"></div><script>';
1244 1244
 			$year_data = '';
1245 1245
 			$year_cnt = '';
1246
-			foreach($year_array as $year_item) {
1246
+			foreach ($year_array as $year_item) {
1247 1247
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
1248 1248
 				$year_cnt .= $year_item['date_count'].',';
1249 1249
 			}
1250 1250
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1251
-			$year_cnt = "['satellite',".substr($year_cnt,0,-1)."]";
1251
+			$year_cnt = "['satellite',".substr($year_cnt, 0, -1)."]";
1252 1252
 			print 'c3.generate({
1253 1253
 			    bindto: "#chart21",
1254 1254
 			    data: { x: "x",
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
             -->
1265 1265
             </div>
1266 1266
             
1267
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1267
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1268 1268
             <div class="col-md-6">
1269 1269
                 <h2><?php echo _("Busiest Launch Years of the last 10 Years"); ?></h2>
1270 1270
 <?php
@@ -1274,12 +1274,12 @@  discard block
 block discarded – undo
1274 1274
 			print '<div id="chart22" class="chart" width="100%"></div><script>';
1275 1275
 			$year_data = '';
1276 1276
 			$year_cnt = '';
1277
-			foreach($year_array as $year_item) {
1277
+			foreach ($year_array as $year_item) {
1278 1278
 				$year_data .= '"'.$year_item['year_name'].'-01-01'.'",';
1279 1279
 				$year_cnt .= $year_item['date_count'].',';
1280 1280
 			}
1281 1281
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1282
-			$year_cnt = "['satellite',".substr($year_cnt,0,-1)."]";
1282
+			$year_cnt = "['satellite',".substr($year_cnt, 0, -1)."]";
1283 1283
 			print 'c3.generate({
1284 1284
 			    bindto: "#chart22",
1285 1285
 			    data: { x: "x",
@@ -1295,7 +1295,7 @@  discard block
 block discarded – undo
1295 1295
             -->
1296 1296
             </div>
1297 1297
             
1298
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1298
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1299 1299
         </div>
1300 1300
 <?php
1301 1301
 	}
@@ -1317,12 +1317,12 @@  discard block
 block discarded – undo
1317 1317
 			print '<div id="chart32" class="chart" width="100%"></div><script>';
1318 1318
 			$year_data = '';
1319 1319
 			$year_cnt = '';
1320
-			foreach($year_array as $year_item) {
1320
+			foreach ($year_array as $year_item) {
1321 1321
 				$year_data .= '"'.$year_item['year'].'-01-01",';
1322 1322
 				$year_cnt .= $year_item['count'].',';
1323 1323
 			}
1324 1324
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1325
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1325
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1326 1326
 			print 'c3.generate({
1327 1327
 			    bindto: "#chart32",
1328 1328
 			    data: { x: "x",
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1336 1336
                 </div>
1337 1337
             </div>
1338
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1338
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1339 1339
 
1340 1340
         <div class="row column">
1341 1341
             <div class="col-md-6">
@@ -1347,12 +1347,12 @@  discard block
 block discarded – undo
1347 1347
 			print '<div id="chart33" class="chart" width="100%"></div><script>';
1348 1348
 			$year_data = '';
1349 1349
 			$year_cnt = '';
1350
-			foreach($year_array as $year_item) {
1350
+			foreach ($year_array as $year_item) {
1351 1351
 				$year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",';
1352 1352
 				$year_cnt .= $year_item['count'].',';
1353 1353
 			}
1354 1354
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1355
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1355
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1356 1356
 			print 'c3.generate({
1357 1357
 			    bindto: "#chart33",
1358 1358
 			    data: { x: "x",
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1366 1366
                 </div>
1367 1367
             </div>
1368
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1368
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1369 1369
 <br/>
1370 1370
 <?php
1371 1371
 	}
@@ -1379,19 +1379,19 @@  discard block
 block discarded – undo
1379 1379
 	//$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
1380 1380
 	if ($year == '' && $month == '') {
1381 1381
 		if ($type == 'aircraft') {
1382
-			$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
1382
+			$polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d'));
1383 1383
 		} elseif ($type == 'marine') {
1384
-			$polar = $Stats->getStatsSource('polar_marine',date('Y'),date('m'),date('d'));
1384
+			$polar = $Stats->getStatsSource('polar_marine', date('Y'), date('m'), date('d'));
1385 1385
 		} elseif ($type == 'tracker') {
1386
-			$polar = $Stats->getStatsSource('polar_tracker',date('Y'),date('m'),date('d'));
1386
+			$polar = $Stats->getStatsSource('polar_tracker', date('Y'), date('m'), date('d'));
1387 1387
 		}
1388 1388
 	} else {
1389 1389
 		if ($type == 'aircraft') {
1390
-			$polar = $Stats->getStatsSource('polar',$year,$month);
1390
+			$polar = $Stats->getStatsSource('polar', $year, $month);
1391 1391
 		} elseif ($type == 'marine') {
1392
-			$polar = $Stats->getStatsSource('polar_marine',$year,$month);
1392
+			$polar = $Stats->getStatsSource('polar_marine', $year, $month);
1393 1393
 		} elseif ($type == 'tracker') {
1394
-			$polar = $Stats->getStatsSource('polar_tracker',$year,$month);
1394
+			$polar = $Stats->getStatsSource('polar_tracker', $year, $month);
1395 1395
 		}
1396 1396
 	}
1397 1397
 	if (!empty($polar)) {
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
 			unset($polar_data);
1401 1401
 			$Spotter = new Spotter();
1402 1402
 			$data = json_decode($eachpolar['source_data']);
1403
-			foreach($data as $value => $key) {
1403
+			foreach ($data as $value => $key) {
1404 1404
 				$direction = $Spotter->parseDirection(($value*22.5));
1405 1405
 				$distance = $key;
1406 1406
 				$unit = 'km';
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
 ?>
1421 1421
             <div class="col-md-6">
1422 1422
                 <h4><?php print $eachpolar['source_name']; ?></h4>
1423
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1423
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1424 1424
         	<script>
1425 1425
         	    (function() {
1426 1426
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
 		      color: color,
1445 1445
 		      unit: '<?php echo $unit; ?>'
1446 1446
 		    };
1447
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1447
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1448 1448
 		    })();
1449 1449
 		</script>
1450 1450
             </div>
@@ -1459,19 +1459,19 @@  discard block
 block discarded – undo
1459 1459
 	//$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
1460 1460
 	if ($year == '' && $month == '') {
1461 1461
 		if ($type == 'aircraft') {
1462
-			$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
1462
+			$msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d'));
1463 1463
 		} elseif ($type == 'marine') {
1464
-			$msg = $Stats->getStatsSource('msg_marine',date('Y'),date('m'),date('d'));
1464
+			$msg = $Stats->getStatsSource('msg_marine', date('Y'), date('m'), date('d'));
1465 1465
 		} elseif ($type == 'tracker') {
1466
-			$msg = $Stats->getStatsSource('msg_tracker',date('Y'),date('m'),date('d'));
1466
+			$msg = $Stats->getStatsSource('msg_tracker', date('Y'), date('m'), date('d'));
1467 1467
 		}
1468 1468
 	} else {
1469 1469
 		if ($type == 'aircraft') {
1470
-			$msg = $Stats->getStatsSource('msg',$year,$month);
1470
+			$msg = $Stats->getStatsSource('msg', $year, $month);
1471 1471
 		} elseif ($type == 'marine') {
1472
-			$msg = $Stats->getStatsSource('msg_marine',$year,$month);
1472
+			$msg = $Stats->getStatsSource('msg_marine', $year, $month);
1473 1473
 		} elseif ($type == 'tracker') {
1474
-			$msg = $Stats->getStatsSource('msg_tracker',$year,$month);
1474
+			$msg = $Stats->getStatsSource('msg_tracker', $year, $month);
1475 1475
 		}
1476 1476
 	}
1477 1477
 	if (!empty($msg)) {
@@ -1479,13 +1479,13 @@  discard block
 block discarded – undo
1479 1479
 		foreach ($msg as $eachmsg) {
1480 1480
 			//$eachmsg = $msg[0];
1481 1481
 			$data = $eachmsg['source_data'];
1482
-			if ($data > 500) $max = (round(($data+100)/100))*100;
1482
+			if ($data > 500) $max = (round(($data + 100)/100))*100;
1483 1483
 			else $max = 500;
1484 1484
 ?>
1485
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1485
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1486 1486
         	<script>
1487 1487
 		      var g = new JustGage({
1488
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
1488
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
1489 1489
 			    value: <?php echo $data; ?>,
1490 1490
 			    min: 0,
1491 1491
 			    max: <?php print $max; ?>,
@@ -1507,19 +1507,19 @@  discard block
 block discarded – undo
1507 1507
 	//$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
1508 1508
 	if ($year == '' && $month == '') {
1509 1509
 		if ($type == 'aircraft') {
1510
-			$hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d'));
1510
+			$hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d'));
1511 1511
 		} elseif ($type == 'marine') {
1512
-			$hist = $Stats->getStatsSource('hist_marine',date('Y'),date('m'),date('d'));
1512
+			$hist = $Stats->getStatsSource('hist_marine', date('Y'), date('m'), date('d'));
1513 1513
 		} elseif ($type == 'tracker') {
1514
-			$hist = $Stats->getStatsSource('hist_tracker',date('Y'),date('m'),date('d'));
1514
+			$hist = $Stats->getStatsSource('hist_tracker', date('Y'), date('m'), date('d'));
1515 1515
 		}
1516 1516
 	} else {
1517 1517
 		if ($type == 'aircraft') {
1518
-			$hist = $Stats->getStatsSource('hist',$year,$month);
1518
+			$hist = $Stats->getStatsSource('hist', $year, $month);
1519 1519
 		} elseif ($type == 'marine') {
1520
-			$hist = $Stats->getStatsSource('hist_marine',$year,$month);
1520
+			$hist = $Stats->getStatsSource('hist_marine', $year, $month);
1521 1521
 		} elseif ($type == 'tracker') {
1522
-			$hist = $Stats->getStatsSource('hist_tracker',$year,$month);
1522
+			$hist = $Stats->getStatsSource('hist_tracker', $year, $month);
1523 1523
 		}
1524 1524
 	}
1525 1525
 	foreach ($hist as $hists) {
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 		$source = $hists['source_name'];
1530 1530
 		$hist_array = json_decode($hists['source_data']);
1531 1531
 		$unit = 'km';
1532
-		foreach($hist_array as $distance => $nb) {
1532
+		foreach ($hist_array as $distance => $nb) {
1533 1533
 			if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1534 1534
 				$distance = round($distance*0.539957);
1535 1535
 				$unit = 'nm';
@@ -1549,18 +1549,18 @@  discard block
 block discarded – undo
1549 1549
 		$nb_data = "['flights',".substr($nb_data, 0, -1)."]";
1550 1550
 ?>
1551 1551
             <div class="col-md-6">
1552
-                <h2><?php echo sprintf(_("Distance for %s"),$source); ?></h2>
1552
+                <h2><?php echo sprintf(_("Distance for %s"), $source); ?></h2>
1553 1553
 <?php
1554
-		print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>';
1554
+		print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div><script>';
1555 1555
 		print 'c3.generate({
1556
-		    bindto: "#charthist-'.str_replace(' ','_',strtolower($source)).'",
1556
+		    bindto: "#charthist-'.str_replace(' ', '_', strtolower($source)).'",
1557 1557
 		    data: { x: "x",
1558 1558
 		    columns: ['.$distance_data.','.$nb_data.'], types: { flights: "area"}, colors: { flights: "#1a3151"}},
1559 1559
 		    axis: { x: {label : { text: "Distance in '.$unit.'", position: "outer-right"}}, y: { label: "# of Flights"}},legend: { show: false }});';
1560 1560
 		print '</script>';
1561 1561
 ?>
1562 1562
     	    </div>
1563
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1563
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1564 1564
 <?php
1565 1565
 	}
1566 1566
 ?>
Please login to merge, or discard this patch.