Completed
Push — master ( 21d685...34a40a )
by Yannick
06:46
created
statistics.php 3 patches
Indentation   +233 added lines, -233 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
47 47
 		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
48 48
 	}
49
-    ?>
49
+	?>
50 50
     </div>
51 51
     <?php include('statistics-sub-menu.php'); ?>
52 52
     <p class="global-stats">
@@ -55,23 +55,23 @@  discard block
 block discarded – undo
55 55
         <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
56 56
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
57 57
 	<?php
58
-	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
58
+		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
59 59
 	?>
60 60
     	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
61 61
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
62 62
         <?php
63
-    	    } else {
64
-    	?>
63
+			} else {
64
+		?>
65 65
     	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
66 66
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
67 67
     	<?php
68
-    	    }
69
-    	?>
68
+			}
69
+		?>
70 70
         <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
71 71
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
72 72
         <?php
73
-    		if ($airline_icao == '') {
74
-    	?>
73
+			if ($airline_icao == '') {
74
+		?>
75 75
         <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
76 76
 	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
77 77
 	<?php
@@ -94,25 +94,25 @@  discard block
 block discarded – undo
94 94
             <div class="col-md-6">
95 95
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
96 96
                  <?php
97
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
98
-		    if (count($aircraft_array) == 0) print _("No data available");
99
-		    else {
97
+				  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
98
+			if (count($aircraft_array) == 0) print _("No data available");
99
+			else {
100 100
 
101
-                    print '<div id="chart1" class="chart" width="100%"></div>
101
+					print '<div id="chart1" class="chart" width="100%"></div>
102 102
                     <script> 
103 103
                         google.load("visualization", "1", {packages:["corechart"]});
104 104
                       google.setOnLoadCallback(drawChart1);
105 105
                       function drawChart1() {
106 106
                         var data = google.visualization.arrayToDataTable([
107 107
                             ["'._("Aircraft").'", "'._("# of times").'"], ';
108
-                            $aircraft_data = '';
109
-                          foreach($aircraft_array as $aircraft_item)
110
-                                    {
111
-                                            $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
112
-                                    }
113
-                                    $aircraft_data = substr($aircraft_data, 0, -1);
114
-                                    print $aircraft_data;
115
-                        print ']);
108
+							$aircraft_data = '';
109
+						  foreach($aircraft_array as $aircraft_item)
110
+									{
111
+											$aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
112
+									}
113
+									$aircraft_data = substr($aircraft_data, 0, -1);
114
+									print $aircraft_data;
115
+						print ']);
116 116
 
117 117
                         var options = {
118 118
                             chartArea: {"width": "80%", "height": "60%"},
@@ -127,45 +127,45 @@  discard block
 block discarded – undo
127 127
                               drawChart1();
128 128
                             });
129 129
                   </script>';
130
-                  }
131
-                  ?>
130
+				  }
131
+				  ?>
132 132
                 <div class="more">
133 133
             	    <?php
134
-            		if ($year != '' && $month != '') {
135
-            	    ?>
134
+					if ($year != '' && $month != '') {
135
+					?>
136 136
             	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
137 137
             	    <?php
138
-            		} else {
139
-            	    ?>
138
+					} else {
139
+					?>
140 140
             	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?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>
141 141
             	    <?php
142
-            		}
143
-            	    ?>
142
+					}
143
+					?>
144 144
                 </div>
145 145
             </div>
146 146
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
147 147
 <?php
148 148
 //    echo $airline_icao;
149
-    if ($airline_icao == '' || $airline_icao == 'all') {
149
+	if ($airline_icao == '' || $airline_icao == 'all') {
150 150
 	$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
151 151
 	if (count($airline_array) > 0) {
152
-            print '<div class="col-md-6">';
153
-	    print '<h2>'._("Top 10 Most Common Airline").'</h2>';
154
-	    print '<div id="chart2" class="chart" width="100%"></div>
152
+			print '<div class="col-md-6">';
153
+		print '<h2>'._("Top 10 Most Common Airline").'</h2>';
154
+		print '<div id="chart2" class="chart" width="100%"></div>
155 155
                     <script> 
156 156
                         google.load("visualization", "1", {packages:["corechart"]});
157 157
                       google.setOnLoadCallback(drawChart2);
158 158
                       function drawChart2() {
159 159
                         var data = google.visualization.arrayToDataTable([
160 160
                             ["'._("Airline").'", "'._("# of times").'"], ';
161
-	    $airline_data = '';
162
-	    foreach($airline_array as $airline_item)
163
-	    {
161
+		$airline_data = '';
162
+		foreach($airline_array as $airline_item)
163
+		{
164 164
 		$airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
165
-	    }
166
-	    $airline_data = substr($airline_data, 0, -1);
167
-	    print $airline_data;
168
-	    print ']);
165
+		}
166
+		$airline_data = substr($airline_data, 0, -1);
167
+		print $airline_data;
168
+		print ']);
169 169
 
170 170
                         var options = {
171 171
                             chartArea: {"width": "80%", "height": "60%"},
@@ -180,31 +180,31 @@  discard block
 block discarded – undo
180 180
                               drawChart2();
181 181
                             });
182 182
                   </script>';
183
-	    if ($year != '' && $month != '') {
183
+		if ($year != '' && $month != '') {
184 184
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airline';
185 185
 		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
186 186
 		print '/'.$year.'/'.$month.'/" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
187
-	    } else {
187
+		} else {
188 188
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airline';
189 189
 		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
190 190
 		print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
191
-	    }
192
-    	    print '</div>';
191
+		}
192
+			print '</div>';
193 193
 	}
194 194
 ?>
195 195
         </div>
196 196
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
197 197
 <?php
198
-    }
198
+	}
199 199
 ?>
200 200
         <div class="row column">
201 201
 <?php
202
-    $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
203
-    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
202
+	$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
203
+	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
204 204
 	if (empty($flightover_array)) {
205
-	    print '<div class="col-md-12">';
205
+		print '<div class="col-md-12">';
206 206
 	} else {
207
-            print '<div class="col-md-6">';
207
+			print '<div class="col-md-6">';
208 208
 	}
209 209
 ?>
210 210
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
@@ -212,21 +212,21 @@  discard block
 block discarded – undo
212 212
 	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
213 213
 	if (count($pilot_array) == 0) print _("No data available");
214 214
 	else {
215
-	    print '<div id="chart7" class="chart" width="100%"></div>
215
+		print '<div id="chart7" class="chart" width="100%"></div>
216 216
                     <script> 
217 217
                         google.load("visualization", "1", {packages:["corechart"]});
218 218
                       google.setOnLoadCallback(drawChart7);
219 219
                       function drawChart7() {
220 220
                         var data = google.visualization.arrayToDataTable([
221 221
                             ["'._("Pilots").'", "'._("# of times").'"], ';
222
-	    $pilot_data = '';
223
-	    foreach($pilot_array as $pilot_item)
224
-	    {
222
+		$pilot_data = '';
223
+		foreach($pilot_array as $pilot_item)
224
+		{
225 225
 		$pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
226
-	    }
227
-	    $pilot_data = substr($pilot_data, 0, -1);
228
-	    print $pilot_data;
229
-	    print ']);
226
+		}
227
+		$pilot_data = substr($pilot_data, 0, -1);
228
+		print $pilot_data;
229
+		print ']);
230 230
 
231 231
                         var options = {
232 232
                             chartArea: {"width": "80%", "height": "60%"},
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
                               drawChart7();
242 242
                             });
243 243
                   </script>';
244
-        }
245
-        print '<div class="more">';
244
+		}
245
+		print '<div class="more">';
246 246
 	print '<a href="'.$globalURL.'/statistics/pilot'; 
247 247
 	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
248 248
 	print'" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a>';
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         
253 253
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
254 254
 <?php
255
-    } else {
255
+	} else {
256 256
 ?>
257 257
             <div class="col-md-6">
258 258
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
@@ -260,21 +260,21 @@  discard block
 block discarded – undo
260 260
 	$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
261 261
 	if (count($owner_array) == 0) print _("No data available");
262 262
 	else {
263
-	    print '<div id="chart7" class="chart" width="100%"></div>
263
+		print '<div id="chart7" class="chart" width="100%"></div>
264 264
                     <script> 
265 265
                         google.load("visualization", "1", {packages:["corechart"]});
266 266
                       google.setOnLoadCallback(drawChart7);
267 267
                       function drawChart7() {
268 268
                         var data = google.visualization.arrayToDataTable([
269 269
                             ["'._("Owner").'", "'._("# of times").'"], ';
270
-                            $owner_data = '';
271
-	    foreach($owner_array as $owner_item)
272
-	    {
270
+							$owner_data = '';
271
+		foreach($owner_array as $owner_item)
272
+		{
273 273
 		$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
274
-	    }
275
-	    $owner_data = substr($owner_data, 0, -1);
276
-	    print $owner_data;
277
-	    print ']);
274
+		}
275
+		$owner_data = substr($owner_data, 0, -1);
276
+		print $owner_data;
277
+		print ']);
278 278
 
279 279
                         var options = {
280 280
                             chartArea: {"width": "80%", "height": "60%"},
@@ -298,8 +298,8 @@  discard block
 block discarded – undo
298 298
         
299 299
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
300 300
 <?php
301
-    }
302
-    if (!empty($flightover_array)) {
301
+	}
302
+	if (!empty($flightover_array)) {
303 303
 ?>
304 304
             <div class="col-md-6">
305 305
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
@@ -307,21 +307,21 @@  discard block
 block discarded – undo
307 307
 	 //$flightover_array = $Stats->countAllFlightOverCountries();
308 308
 	if (count($flightover_array) == 0) print _("No data available");
309 309
 	else {
310
-	    print '<div id="chart10" class="chart" width="100%"></div>
310
+		print '<div id="chart10" class="chart" width="100%"></div>
311 311
                     <script> 
312 312
                         google.load("visualization", "1", {packages:["corechart"]});
313 313
                       google.setOnLoadCallback(drawChart10);
314 314
                       function drawChart10() {
315 315
                         var data = google.visualization.arrayToDataTable([
316 316
                             ["'._("Country").'", "'._("# of times").'"], ';
317
-                            $flightover_data = '';
318
-	    foreach($flightover_array as $flightover_item)
319
-	    {
317
+							$flightover_data = '';
318
+		foreach($flightover_array as $flightover_item)
319
+		{
320 320
 		$flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
321
-	    }
322
-	    $flightover_data = substr($flightover_data, 0, -1);
323
-	    print $flightover_data;
324
-	    print ']);
321
+		}
322
+		$flightover_data = substr($flightover_data, 0, -1);
323
+		print $flightover_data;
324
+		print ']);
325 325
 
326 326
                         var options = {
327 327
                             chartArea: {"width": "80%", "height": "60%"},
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
                 </div>
346 346
             </div>
347 347
 <?php
348
-    }
348
+	}
349 349
 ?>
350 350
         </div>
351 351
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
         <div class="row column">
356 356
             <div class="col-md-6">
357 357
 <?php
358
-    $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
359
-    if (count($airport_airport_array) > 0) {
358
+	$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
359
+	if (count($airport_airport_array) > 0) {
360 360
 	print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
361 361
 	print '<div id="chart3" class="chart" width="100%"></div>
362 362
                 <script>
@@ -369,13 +369,13 @@  discard block
 block discarded – undo
369 369
 
370 370
                 var data = google.visualization.arrayToDataTable([ 
371 371
                     ["'._("Airport").'", "'._("# of times").'"],';
372
-                    $airport_data = '';
372
+					$airport_data = '';
373 373
 	foreach($airport_airport_array as $airport_item)
374 374
 	{
375
-	    $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
376
-	    $name = str_replace("'", "", $name);
377
-	    $name = str_replace('"', "", $name);
378
-	    $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],';
375
+		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
376
+		$name = str_replace("'", "", $name);
377
+		$name = str_replace('"', "", $name);
378
+		$airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],';
379 379
 	}
380 380
 	$airport_data = substr($airport_data, 0, -1);
381 381
 	print $airport_data;
@@ -396,15 +396,15 @@  discard block
 block discarded – undo
396 396
 	print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure'; 
397 397
 	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
398 398
 	print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
399
-    }
399
+	}
400 400
 ?>
401 401
             </div>
402 402
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
403 403
 
404 404
             <div class="col-md-6">
405 405
 <?php
406
-    $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
407
-    if (count($airport_airport_array2) > 0) {
406
+	$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
407
+	if (count($airport_airport_array2) > 0) {
408 408
 	print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
409 409
 	print '<div id="chart4" class="chart" width="100%"></div>
410 410
                 <script>
@@ -420,9 +420,9 @@  discard block
 block discarded – undo
420 420
 	$airport_data2 = '';
421 421
 	foreach($airport_airport_array2 as $airport_item2)
422 422
 	{
423
-	    $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
424
-	    $name2 = str_replace(array("'",'"'), '', $name2);
425
-	    $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
423
+		$name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
424
+		$name2 = str_replace(array("'",'"'), '', $name2);
425
+		$airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
426 426
 	}
427 427
 	$airport_data2 = substr($airport_data2, 0, -1);
428 428
 	print $airport_data2;
@@ -443,36 +443,36 @@  discard block
 block discarded – undo
443 443
 	print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival';
444 444
 	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
445 445
 	print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
446
-    }
446
+	}
447 447
 ?>
448 448
             </div>
449 449
         </div>
450 450
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
451 451
 <?php
452
-    if ($year == '' && $month == '') {
452
+	if ($year == '' && $month == '') {
453 453
 ?>
454 454
         <div class="row column">
455 455
             <div class="col-md-6">
456 456
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
457 457
                 <?php
458
-                  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
459
-		    if (count($year_array) == 0) print _("No data available");
460
-		    else {
461
-                  print '<div id="chart8" class="chart" width="100%"></div>
458
+				  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
459
+			if (count($year_array) == 0) print _("No data available");
460
+			else {
461
+				  print '<div id="chart8" class="chart" width="100%"></div>
462 462
                     <script> 
463 463
                         google.load("visualization", "1", {packages:["corechart"]});
464 464
                       google.setOnLoadCallback(drawChart8);
465 465
                       function drawChart8() {
466 466
                         var data = google.visualization.arrayToDataTable([
467 467
                             ["'._("Month").'", "'._("# of Flights").'"], ';
468
-                            $year_data = '';
469
-                          foreach($year_array as $year_item)
470
-                                    {
471
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
472
-                                    }
473
-                                    $year_data = substr($year_data, 0, -1);
474
-                                    print $year_data;
475
-                        print ']);
468
+							$year_data = '';
469
+						  foreach($year_array as $year_item)
470
+									{
471
+										$year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
472
+									}
473
+									$year_data = substr($year_data, 0, -1);
474
+									print $year_data;
475
+						print ']);
476 476
 
477 477
                         var options = {
478 478
                             legend: {position: "none"},
@@ -490,8 +490,8 @@  discard block
 block discarded – undo
490 490
                               drawChart8();
491 491
                             });
492 492
                   </script>';
493
-                  }
494
-                  ?>
493
+				  }
494
+				  ?>
495 495
                 <div class="more">
496 496
                     <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>
497 497
                 </div>
@@ -500,24 +500,24 @@  discard block
 block discarded – undo
500 500
             <div class="col-md-6">
501 501
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
502 502
                 <?php
503
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
504
-		    if (count($month_array) == 0) print _("No data available");
505
-		    else {
506
-                  print '<div id="chart9" class="chart" width="100%"></div>
503
+				  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
504
+			if (count($month_array) == 0) print _("No data available");
505
+			else {
506
+				  print '<div id="chart9" class="chart" width="100%"></div>
507 507
                     <script> 
508 508
                         google.load("visualization", "1", {packages:["corechart"]});
509 509
                       google.setOnLoadCallback(drawChart9);
510 510
                       function drawChart9() {
511 511
                         var data = google.visualization.arrayToDataTable([
512 512
                             ["'._("Day").'", "'._("# of Flights").'"], ';
513
-                            $month_data = '';
514
-                          foreach($month_array as $month_item)
515
-                                    {
516
-                                        $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
517
-                                    }
518
-                                    $month_data = substr($month_data, 0, -1);
519
-                                    print $month_data;
520
-                        print ']);
513
+							$month_data = '';
514
+						  foreach($month_array as $month_item)
515
+									{
516
+										$month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
517
+									}
518
+									$month_data = substr($month_data, 0, -1);
519
+									print $month_data;
520
+						print ']);
521 521
 
522 522
                         var options = {
523 523
                             legend: {position: "none"},
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
                               drawChart9();
536 536
                             });
537 537
                   </script>';
538
-                  }
539
-                  ?>
538
+				  }
539
+				  ?>
540 540
                 <div class="more">
541 541
                     <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>
542 542
                 </div>
@@ -546,25 +546,25 @@  discard block
 block discarded – undo
546 546
             <div class="col-md-6">
547 547
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
548 548
                 <?php
549
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
550
-		    if (empty($date_array)) print _("No data available");
551
-		    else {
552
-                  print '<div id="chart5" class="chart" width="100%"></div>
549
+					$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
550
+			if (empty($date_array)) print _("No data available");
551
+			else {
552
+				  print '<div id="chart5" class="chart" width="100%"></div>
553 553
                     <script> 
554 554
                         google.load("visualization", "1", {packages:["corechart"]});
555 555
                       google.setOnLoadCallback(drawChart5);
556 556
                       function drawChart5() {
557 557
                         var data = google.visualization.arrayToDataTable([
558 558
                             ["'._("Date").'", "'._("# of Flights").'"], ';
559
-                            $date_data = '';
559
+							$date_data = '';
560 560
                         
561
-                          foreach($date_array as $date_item)
562
-                                    {
563
-                                        $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
564
-                                    }
565
-                                    $date_data = substr($date_data, 0, -1);
566
-                                    print $date_data;
567
-                        print ']);
561
+						  foreach($date_array as $date_item)
562
+									{
563
+										$date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
564
+									}
565
+									$date_data = substr($date_data, 0, -1);
566
+									print $date_data;
567
+						print ']);
568 568
 
569 569
                         var options = {
570 570
                             legend: {position: "none"},
@@ -582,8 +582,8 @@  discard block
 block discarded – undo
582 582
                               drawChart5();
583 583
                             });
584 584
                   </script>';
585
-                  }
586
-                  ?>
585
+				  }
586
+				  ?>
587 587
                 <div class="more">
588 588
                     <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>
589 589
                 </div>
@@ -592,25 +592,25 @@  discard block
 block discarded – undo
592 592
             <div class="col-md-6">
593 593
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
594 594
                 <?php
595
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
596
-		    if (empty($hour_array)) print _("No data available");
597
-		    else {
595
+				  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
596
+			if (empty($hour_array)) print _("No data available");
597
+			else {
598 598
 
599
-                  print '<div id="chart6" class="chart" width="100%"></div>
599
+				  print '<div id="chart6" class="chart" width="100%"></div>
600 600
                     <script> 
601 601
                         google.load("visualization", "1", {packages:["corechart"]});
602 602
                       google.setOnLoadCallback(drawChart6);
603 603
                       function drawChart6() {
604 604
                         var data = google.visualization.arrayToDataTable([
605 605
                             ["'._("Hour").'", "'._("# of Flights").'"], ';
606
-                            $hour_data = '';
607
-                          foreach($hour_array as $hour_item)
608
-                                    {
609
-                                        $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
610
-                                    }
611
-                                    $hour_data = substr($hour_data, 0, -1);
612
-                                    print $hour_data;
613
-                        print ']);
606
+							$hour_data = '';
607
+						  foreach($hour_array as $hour_item)
608
+									{
609
+										$hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
610
+									}
611
+									$hour_data = substr($hour_data, 0, -1);
612
+									print $hour_data;
613
+						print ']);
614 614
 
615 615
                         var options = {
616 616
                             legend: {position: "none"},
@@ -628,8 +628,8 @@  discard block
 block discarded – undo
628 628
                               drawChart6();
629 629
                             });
630 630
                   </script>';
631
-                  }
632
-                ?>
631
+				  }
632
+				?>
633 633
                 <div class="more">
634 634
                     <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>
635 635
                 </div>
@@ -637,36 +637,36 @@  discard block
 block discarded – undo
637 637
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
638 638
         </div>
639 639
 <?php
640
-    }
640
+	}
641 641
 ?>
642 642
 
643 643
 <?php
644
-    if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) {
644
+	if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) {
645 645
 ?>
646 646
         <div class="row column">
647 647
             <div class="col-md-6">
648 648
                 <h2><?php echo _("Fatalities by Years"); ?></h2>
649 649
                 <?php
650
-		    require_once('require/class.Accident.php');
651
-            	    $Accident = new Accident();
652
-                  $year_array = $Accident->countFatalitiesByYear($filter_name);
653
-		    if (count($year_array) == 0) print _("No data available");
654
-		    else {
655
-                  print '<div id="chart32" class="chart" width="100%"></div>
650
+			require_once('require/class.Accident.php');
651
+					$Accident = new Accident();
652
+				  $year_array = $Accident->countFatalitiesByYear($filter_name);
653
+			if (count($year_array) == 0) print _("No data available");
654
+			else {
655
+				  print '<div id="chart32" class="chart" width="100%"></div>
656 656
                     <script> 
657 657
                         google.load("visualization", "1", {packages:["corechart"]});
658 658
                       google.setOnLoadCallback(drawChart32);
659 659
                       function drawChart32() {
660 660
                         var data = google.visualization.arrayToDataTable([
661 661
                             ["'._("Year").'", "'._("# of Fatalities").'"], ';
662
-                            $year_data = '';
663
-                          foreach($year_array as $year_item)
664
-                                    {
665
-                                        $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],';
666
-                                    }
667
-                                    $year_data = substr($year_data, 0, -1);
668
-                                    print $year_data;
669
-                        print ']);
662
+							$year_data = '';
663
+						  foreach($year_array as $year_item)
664
+									{
665
+										$year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],';
666
+									}
667
+									$year_data = substr($year_data, 0, -1);
668
+									print $year_data;
669
+						print ']);
670 670
 
671 671
                         var options = {
672 672
                             legend: {position: "none"},
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
                               drawChart32();
685 685
                             });
686 686
                   </script>';
687
-                  }
688
-                  ?>
687
+				  }
688
+				  ?>
689 689
                 <div class="more">
690 690
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
691 691
                 </div>
@@ -696,26 +696,26 @@  discard block
 block discarded – undo
696 696
             <div class="col-md-6">
697 697
                 <h2><?php echo _("Fatalities last 12 Months"); ?></h2>
698 698
                 <?php
699
-		    require_once('require/class.Accident.php');
700
-            	    $Accident = new Accident();
701
-                  $year_array = $Accident->countFatalitiesLast12Months($filter_name);
702
-		    if (count($year_array) == 0) print _("No data available");
703
-		    else {
704
-                  print '<div id="chart33" class="chart" width="100%"></div>
699
+			require_once('require/class.Accident.php');
700
+					$Accident = new Accident();
701
+				  $year_array = $Accident->countFatalitiesLast12Months($filter_name);
702
+			if (count($year_array) == 0) print _("No data available");
703
+			else {
704
+				  print '<div id="chart33" class="chart" width="100%"></div>
705 705
                     <script> 
706 706
                         google.load("visualization", "1", {packages:["corechart"]});
707 707
                       google.setOnLoadCallback(drawChart33);
708 708
                       function drawChart33() {
709 709
                         var data = google.visualization.arrayToDataTable([
710 710
                             ["'._("Month").'", "'._("# of Fatalities").'"], ';
711
-                            $year_data = '';
712
-                          foreach($year_array as $year_item)
713
-                                    {
714
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
715
-                                    }
716
-                                    $year_data = substr($year_data, 0, -1);
717
-                                    print $year_data;
718
-                        print ']);
711
+							$year_data = '';
712
+						  foreach($year_array as $year_item)
713
+									{
714
+										$year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
715
+									}
716
+									$year_data = substr($year_data, 0, -1);
717
+									print $year_data;
718
+						print ']);
719 719
 
720 720
                         var options = {
721 721
                             legend: {position: "none"},
@@ -733,8 +733,8 @@  discard block
 block discarded – undo
733 733
                               drawChart33();
734 734
                             });
735 735
                   </script>';
736
-                  }
737
-                  ?>
736
+				  }
737
+				  ?>
738 738
                 <div class="more">
739 739
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
740 740
                 </div>
@@ -742,30 +742,30 @@  discard block
 block discarded – undo
742 742
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
743 743
 <br/>
744 744
 <?php
745
-    }
745
+	}
746 746
 ?>
747 747
 
748 748
 <?php
749
-    if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') {
749
+	if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') {
750 750
 ?>
751 751
         <div class="row column">
752 752
         	<?php
753
-        	    //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
754
-        	    if ($year == '' && $month == '') {
755
-		        $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
756
-		    } else {
757
-        		$polar = $Stats->getStatsSource('polar',$year,$month);
758
-        	    }
759
-        	    if (!empty($polar)) {
760
-            		print '<h2>'._("Coverage pattern").'</h2>';
761
-        		foreach ($polar as $eachpolar) {
762
-        		    unset($polar_data);
763
-	        	    $Spotter = new Spotter();
764
-        		    $data = json_decode($eachpolar['source_data']);
765
-        		    foreach($data as $value => $key) {
766
-        			$direction = $Spotter->parseDirection(($value*22.5));
767
-        			$distance = $key;
768
-        			$unit = 'km';
753
+				//$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
754
+				if ($year == '' && $month == '') {
755
+				$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
756
+			} else {
757
+				$polar = $Stats->getStatsSource('polar',$year,$month);
758
+				}
759
+				if (!empty($polar)) {
760
+					print '<h2>'._("Coverage pattern").'</h2>';
761
+				foreach ($polar as $eachpolar) {
762
+					unset($polar_data);
763
+					$Spotter = new Spotter();
764
+					$data = json_decode($eachpolar['source_data']);
765
+					foreach($data as $value => $key) {
766
+					$direction = $Spotter->parseDirection(($value*22.5));
767
+					$distance = $key;
768
+					$unit = 'km';
769 769
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
770 770
 					$distance = round($distance*0.539957);
771 771
 					$unit = 'nm';
@@ -776,10 +776,10 @@  discard block
 block discarded – undo
776 776
 					$distance = $distance;
777 777
 					$unit = 'km';
778 778
 				}
779
-        			if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
780
-        	    		else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
781
-        		    }
782
-        	?>
779
+					if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
780
+						else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
781
+					}
782
+			?>
783 783
             <div class="col-md-6">
784 784
                 <h4><?php print $eachpolar['source_name']; ?></h4>
785 785
         	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
@@ -811,27 +811,27 @@  discard block
 block discarded – undo
811 811
 		</script>
812 812
             </div>
813 813
             <?php
814
-        	    }
815
-        	}
816
-            ?>
814
+				}
815
+			}
816
+			?>
817 817
         </div>
818 818
         <div class="row column">
819 819
             <div class="col-md-6">
820 820
         	<?php
821
-        	    //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
822
-        	    if ($year == '' && $month == '') {
823
-        		$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
824
-        	    } else {
825
-        		$msg = $Stats->getStatsSource('msg',$year,$month);
826
-        	    }
827
-        	    if (!empty($msg)) {
828
-            		print '<h2>'._("Messages received").'</h2>';
829
-        		foreach ($msg as $eachmsg) {
830
-        		    //$eachmsg = $msg[0];
831
-        		    $data = $eachmsg['source_data'];
832
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
833
-        		    else $max = 500;
834
-        	?>
821
+				//$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
822
+				if ($year == '' && $month == '') {
823
+				$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
824
+				} else {
825
+				$msg = $Stats->getStatsSource('msg',$year,$month);
826
+				}
827
+				if (!empty($msg)) {
828
+					print '<h2>'._("Messages received").'</h2>';
829
+				foreach ($msg as $eachmsg) {
830
+					//$eachmsg = $msg[0];
831
+					$data = $eachmsg['source_data'];
832
+					if ($data > 500) $max = (round(($data+100)/100))*100;
833
+					else $max = 500;
834
+			?>
835 835
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
836 836
         	<script>
837 837
 		      var g = new JustGage({
@@ -847,9 +847,9 @@  discard block
 block discarded – undo
847 847
 			  });
848 848
 		</script>
849 849
             <?php
850
-        	   }
851
-        	}
852
-            ?>
850
+			   }
851
+			}
852
+			?>
853 853
             </div>
854 854
         </div>
855 855
         <div class="row column">
@@ -881,19 +881,19 @@  discard block
 block discarded – undo
881 881
 				$hist_data .= '[ "'.$distance.'",'.$nb.'],';
882 882
 			}
883 883
 			$hist_data = substr($hist_data, 0, -1);
884
-            ?>
884
+			?>
885 885
             <div class="col-md-6">
886 886
                 <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
887 887
                 <?php
888
-                  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
888
+				  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
889 889
                     <script> 
890 890
                         google.load("visualization", "1", {packages:["corechart"]});
891 891
                       google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).');
892 892
                       function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() {
893 893
                         var data = google.visualization.arrayToDataTable([
894 894
                             ["'._("Distance").'", "'._("# of Flights").'"], ';
895
-                            print $hist_data;
896
-                        print ']);
895
+							print $hist_data;
896
+						print ']);
897 897
 
898 898
                         var options = {
899 899
                             legend: {position: "none"},
@@ -911,15 +911,15 @@  discard block
 block discarded – undo
911 911
                               drawCharthist_'.str_replace(' ','_',strtolower($source)).'();
912 912
                             });
913 913
                   </script>';
914
-        	?>
914
+			?>
915 915
     	    </div>
916 916
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
917 917
         	<?php
918
-                  }
919
-                ?>
918
+				  }
919
+				?>
920 920
         </div>
921 921
 <?php
922
-    }
922
+	}
923 923
 ?>
924 924
     </div>
925 925
 </div>  
Please login to merge, or discard this patch.
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 $Stats = new Stats();
8 8
 
9 9
 if (!isset($filter_name)) $filter_name = '';
10
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 if ($airline_icao == '' && isset($globalFilter)) {
12 12
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
13 13
 }
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	$title = _("Statistics");
23 23
 }
24 24
 
25
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
26
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
25
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
26
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
27 27
 
28 28
 require_once('header.php');
29 29
 
@@ -44,36 +44,36 @@  discard block
 block discarded – undo
44 44
 		date_default_timezone_set('UTC');
45 45
 		$lastupdate = strtotime($last_update[0]['value']);
46 46
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
47
-		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
47
+		print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
48 48
 	}
49 49
     ?>
50 50
     </div>
51 51
     <?php include('statistics-sub-menu.php'); ?>
52 52
     <p class="global-stats">
53
-        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span>
54
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
55
-        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
56
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
53
+        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span>
54
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
55
+        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
56
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
57 57
 	<?php
58 58
 	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
59 59
 	?>
60
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
61
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
60
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span>
61
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
62 62
         <?php
63 63
     	    } else {
64 64
     	?>
65
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
66
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
65
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span>
66
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
67 67
     	<?php
68 68
     	    }
69 69
     	?>
70
-        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
71
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
70
+        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircrafts types"); ?></span>
71
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
72 72
         <?php
73 73
     		if ($airline_icao == '') {
74 74
     	?>
75
-        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
76
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
75
+        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span>
76
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
77 77
 	<?php
78 78
 		}
79 79
 	?>
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 		if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) {
82 82
 			if ($airline_icao == '' || $airline_icao == 'all') {
83 83
 	?>
84
-        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span>
85
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
84
+        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span>
85
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
86 86
 	<?php
87 87
 			}
88 88
 		}
89 89
 	?>
90 90
     </p>
91
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
91
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
92 92
     <div class="specific-stats">
93 93
         <div class="row column">
94 94
             <div class="col-md-6">
95 95
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
96 96
                  <?php
97
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
97
+                  $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
98 98
 		    if (count($aircraft_array) == 0) print _("No data available");
99 99
 		    else {
100 100
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                         var data = google.visualization.arrayToDataTable([
107 107
                             ["'._("Aircraft").'", "'._("# of times").'"], ';
108 108
                             $aircraft_data = '';
109
-                          foreach($aircraft_array as $aircraft_item)
109
+                          foreach ($aircraft_array as $aircraft_item)
110 110
                                     {
111 111
                                             $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
112 112
                                     }
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
             	    ?>
144 144
                 </div>
145 145
             </div>
146
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
146
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
147 147
 <?php
148 148
 //    echo $airline_icao;
149 149
     if ($airline_icao == '' || $airline_icao == 'all') {
150
-	$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
150
+	$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month);
151 151
 	if (count($airline_array) > 0) {
152 152
             print '<div class="col-md-6">';
153 153
 	    print '<h2>'._("Top 10 Most Common Airline").'</h2>';
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                         var data = google.visualization.arrayToDataTable([
160 160
                             ["'._("Airline").'", "'._("# of times").'"], ';
161 161
 	    $airline_data = '';
162
-	    foreach($airline_array as $airline_item)
162
+	    foreach ($airline_array as $airline_item)
163 163
 	    {
164 164
 		$airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
165 165
 	    }
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
 	}
194 194
 ?>
195 195
         </div>
196
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
196
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
197 197
 <?php
198 198
     }
199 199
 ?>
200 200
         <div class="row column">
201 201
 <?php
202
-    $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
202
+    $flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month);
203 203
     if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
204 204
 	if (empty($flightover_array)) {
205 205
 	    print '<div class="col-md-12">';
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 ?>
210 210
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
211 211
 <?php
212
-	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
212
+	$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
213 213
 	if (count($pilot_array) == 0) print _("No data available");
214 214
 	else {
215 215
 	    print '<div id="chart7" class="chart" width="100%"></div>
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
                         var data = google.visualization.arrayToDataTable([
221 221
                             ["'._("Pilots").'", "'._("# of times").'"], ';
222 222
 	    $pilot_data = '';
223
-	    foreach($pilot_array as $pilot_item)
223
+	    foreach ($pilot_array as $pilot_item)
224 224
 	    {
225 225
 		$pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
226 226
 	    }
@@ -250,14 +250,14 @@  discard block
 block discarded – undo
250 250
 ?>
251 251
             </div>
252 252
         
253
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
253
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
254 254
 <?php
255 255
     } else {
256 256
 ?>
257 257
             <div class="col-md-6">
258 258
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
259 259
 <?php
260
-	$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
260
+	$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
261 261
 	if (count($owner_array) == 0) print _("No data available");
262 262
 	else {
263 263
 	    print '<div id="chart7" class="chart" width="100%"></div>
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                         var data = google.visualization.arrayToDataTable([
269 269
                             ["'._("Owner").'", "'._("# of times").'"], ';
270 270
                             $owner_data = '';
271
-	    foreach($owner_array as $owner_item)
271
+	    foreach ($owner_array as $owner_item)
272 272
 	    {
273 273
 		$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
274 274
 	    }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                 </div>
297 297
             </div>
298 298
         
299
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
299
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
300 300
 <?php
301 301
     }
302 302
     if (!empty($flightover_array)) {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                         var data = google.visualization.arrayToDataTable([
316 316
                             ["'._("Country").'", "'._("# of times").'"], ';
317 317
                             $flightover_data = '';
318
-	    foreach($flightover_array as $flightover_item)
318
+	    foreach ($flightover_array as $flightover_item)
319 319
 	    {
320 320
 		$flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
321 321
 	    }
@@ -348,14 +348,14 @@  discard block
 block discarded – undo
348 348
     }
349 349
 ?>
350 350
         </div>
351
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
351
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
352 352
 
353 353
     	
354 354
         </div>
355 355
         <div class="row column">
356 356
             <div class="col-md-6">
357 357
 <?php
358
-    $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
358
+    $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month);
359 359
     if (count($airport_airport_array) > 0) {
360 360
 	print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
361 361
 	print '<div id="chart3" class="chart" width="100%"></div>
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                 var data = google.visualization.arrayToDataTable([ 
371 371
                     ["'._("Airport").'", "'._("# of times").'"],';
372 372
                     $airport_data = '';
373
-	foreach($airport_airport_array as $airport_item)
373
+	foreach ($airport_airport_array as $airport_item)
374 374
 	{
375 375
 	    $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
376 376
 	    $name = str_replace("'", "", $name);
@@ -399,11 +399,11 @@  discard block
 block discarded – undo
399 399
     }
400 400
 ?>
401 401
             </div>
402
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
402
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
403 403
 
404 404
             <div class="col-md-6">
405 405
 <?php
406
-    $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
406
+    $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
407 407
     if (count($airport_airport_array2) > 0) {
408 408
 	print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
409 409
 	print '<div id="chart4" class="chart" width="100%"></div>
@@ -418,10 +418,10 @@  discard block
 block discarded – undo
418 418
                 var data = google.visualization.arrayToDataTable([ 
419 419
                     ["'._("Airport").'", "'._("# of times").'"],';
420 420
 	$airport_data2 = '';
421
-	foreach($airport_airport_array2 as $airport_item2)
421
+	foreach ($airport_airport_array2 as $airport_item2)
422 422
 	{
423 423
 	    $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
424
-	    $name2 = str_replace(array("'",'"'), '', $name2);
424
+	    $name2 = str_replace(array("'", '"'), '', $name2);
425 425
 	    $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
426 426
 	}
427 427
 	$airport_data2 = substr($airport_data2, 0, -1);
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 ?>
448 448
             </div>
449 449
         </div>
450
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
450
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
451 451
 <?php
452 452
     if ($year == '' && $month == '') {
453 453
 ?>
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             <div class="col-md-6">
456 456
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
457 457
                 <?php
458
-                  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
458
+                  $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
459 459
 		    if (count($year_array) == 0) print _("No data available");
460 460
 		    else {
461 461
                   print '<div id="chart8" class="chart" width="100%"></div>
@@ -466,9 +466,9 @@  discard block
 block discarded – undo
466 466
                         var data = google.visualization.arrayToDataTable([
467 467
                             ["'._("Month").'", "'._("# of Flights").'"], ';
468 468
                             $year_data = '';
469
-                          foreach($year_array as $year_item)
469
+                          foreach ($year_array as $year_item)
470 470
                                     {
471
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
471
+                                        $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
472 472
                                     }
473 473
                                     $year_data = substr($year_data, 0, -1);
474 474
                                     print $year_data;
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
                     <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>
497 497
                 </div>
498 498
             </div>
499
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
499
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
500 500
             <div class="col-md-6">
501 501
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
502 502
                 <?php
503
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
503
+                  $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
504 504
 		    if (count($month_array) == 0) print _("No data available");
505 505
 		    else {
506 506
                   print '<div id="chart9" class="chart" width="100%"></div>
@@ -511,9 +511,9 @@  discard block
 block discarded – undo
511 511
                         var data = google.visualization.arrayToDataTable([
512 512
                             ["'._("Day").'", "'._("# of Flights").'"], ';
513 513
                             $month_data = '';
514
-                          foreach($month_array as $month_item)
514
+                          foreach ($month_array as $month_item)
515 515
                                     {
516
-                                        $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
516
+                                        $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
517 517
                                     }
518 518
                                     $month_data = substr($month_data, 0, -1);
519 519
                                     print $month_data;
@@ -541,12 +541,12 @@  discard block
 block discarded – undo
541 541
                     <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>
542 542
                 </div>
543 543
             </div>
544
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
544
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
545 545
 
546 546
             <div class="col-md-6">
547 547
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
548 548
                 <?php
549
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
549
+                    $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
550 550
 		    if (empty($date_array)) print _("No data available");
551 551
 		    else {
552 552
                   print '<div id="chart5" class="chart" width="100%"></div>
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
                             ["'._("Date").'", "'._("# of Flights").'"], ';
559 559
                             $date_data = '';
560 560
                         
561
-                          foreach($date_array as $date_item)
561
+                          foreach ($date_array as $date_item)
562 562
                                     {
563 563
                                         $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
564 564
                                     }
@@ -588,11 +588,11 @@  discard block
 block discarded – undo
588 588
                     <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>
589 589
                 </div>
590 590
             </div>
591
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
591
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
592 592
             <div class="col-md-6">
593 593
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
594 594
                 <?php
595
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
595
+                  $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
596 596
 		    if (empty($hour_array)) print _("No data available");
597 597
 		    else {
598 598
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
                         var data = google.visualization.arrayToDataTable([
605 605
                             ["'._("Hour").'", "'._("# of Flights").'"], ';
606 606
                             $hour_data = '';
607
-                          foreach($hour_array as $hour_item)
607
+                          foreach ($hour_array as $hour_item)
608 608
                                     {
609 609
                                         $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
610 610
                                     }
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
                     <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>
635 635
                 </div>
636 636
             </div>
637
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
637
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
638 638
         </div>
639 639
 <?php
640 640
     }
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
                         var data = google.visualization.arrayToDataTable([
661 661
                             ["'._("Year").'", "'._("# of Fatalities").'"], ';
662 662
                             $year_data = '';
663
-                          foreach($year_array as $year_item)
663
+                          foreach ($year_array as $year_item)
664 664
                                     {
665 665
                                         $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],';
666 666
                                     }
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
691 691
                 </div>
692 692
             </div>
693
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
693
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
694 694
 
695 695
         <div class="row column">
696 696
             <div class="col-md-6">
@@ -709,9 +709,9 @@  discard block
 block discarded – undo
709 709
                         var data = google.visualization.arrayToDataTable([
710 710
                             ["'._("Month").'", "'._("# of Fatalities").'"], ';
711 711
                             $year_data = '';
712
-                          foreach($year_array as $year_item)
712
+                          foreach ($year_array as $year_item)
713 713
                                     {
714
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
714
+                                        $year_data .= '[ "'.date('F, Y', strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],';
715 715
                                     }
716 716
                                     $year_data = substr($year_data, 0, -1);
717 717
                                     print $year_data;
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
740 740
                 </div>
741 741
             </div>
742
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
742
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
743 743
 <br/>
744 744
 <?php
745 745
     }
@@ -752,9 +752,9 @@  discard block
 block discarded – undo
752 752
         	<?php
753 753
         	    //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
754 754
         	    if ($year == '' && $month == '') {
755
-		        $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
755
+		        $polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d'));
756 756
 		    } else {
757
-        		$polar = $Stats->getStatsSource('polar',$year,$month);
757
+        		$polar = $Stats->getStatsSource('polar', $year, $month);
758 758
         	    }
759 759
         	    if (!empty($polar)) {
760 760
             		print '<h2>'._("Coverage pattern").'</h2>';
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
         		    unset($polar_data);
763 763
 	        	    $Spotter = new Spotter();
764 764
         		    $data = json_decode($eachpolar['source_data']);
765
-        		    foreach($data as $value => $key) {
765
+        		    foreach ($data as $value => $key) {
766 766
         			$direction = $Spotter->parseDirection(($value*22.5));
767 767
         			$distance = $key;
768 768
         			$unit = 'km';
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
         	?>
783 783
             <div class="col-md-6">
784 784
                 <h4><?php print $eachpolar['source_name']; ?></h4>
785
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
785
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
786 786
         	<script>
787 787
         	    (function() {
788 788
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 		      color: color,
807 807
 		      unit: '<?php echo $unit; ?>'
808 808
 		    };
809
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
809
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
810 810
 		    })();
811 811
 		</script>
812 812
             </div>
@@ -820,22 +820,22 @@  discard block
 block discarded – undo
820 820
         	<?php
821 821
         	    //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
822 822
         	    if ($year == '' && $month == '') {
823
-        		$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
823
+        		$msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d'));
824 824
         	    } else {
825
-        		$msg = $Stats->getStatsSource('msg',$year,$month);
825
+        		$msg = $Stats->getStatsSource('msg', $year, $month);
826 826
         	    }
827 827
         	    if (!empty($msg)) {
828 828
             		print '<h2>'._("Messages received").'</h2>';
829 829
         		foreach ($msg as $eachmsg) {
830 830
         		    //$eachmsg = $msg[0];
831 831
         		    $data = $eachmsg['source_data'];
832
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
832
+        		    if ($data > 500) $max = (round(($data + 100)/100))*100;
833 833
         		    else $max = 500;
834 834
         	?>
835
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
835
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
836 836
         	<script>
837 837
 		      var g = new JustGage({
838
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
838
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
839 839
 			    value: <?php echo $data; ?>,
840 840
 			    min: 0,
841 841
 			    max: <?php print $max; ?>,
@@ -857,15 +857,15 @@  discard block
 block discarded – undo
857 857
             <?php
858 858
 		//$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
859 859
 		if ($year == '' && $month == '') {
860
-			$hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d'));
860
+			$hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d'));
861 861
 		} else {
862
-			$hist = $Stats->getStatsSource('hist',$year,$month);
862
+			$hist = $Stats->getStatsSource('hist', $year, $month);
863 863
 		}
864 864
 		foreach ($hist as $hists) {
865 865
 			$hist_data = '';
866 866
 			$source = $hists['source_name'];
867 867
 			$hist_array = json_decode($hists['source_data']);
868
-			foreach($hist_array as $distance => $nb)
868
+			foreach ($hist_array as $distance => $nb)
869 869
 			{
870 870
 				$unit = 'km';
871 871
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -883,13 +883,13 @@  discard block
 block discarded – undo
883 883
 			$hist_data = substr($hist_data, 0, -1);
884 884
             ?>
885 885
             <div class="col-md-6">
886
-                <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
886
+                <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2>
887 887
                 <?php
888
-                  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
888
+                  print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div>
889 889
                     <script> 
890 890
                         google.load("visualization", "1", {packages:["corechart"]});
891
-                      google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).');
892
-                      function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() {
891
+                      google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).');
892
+                      function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() {
893 893
                         var data = google.visualization.arrayToDataTable([
894 894
                             ["'._("Distance").'", "'._("# of Flights").'"], ';
895 895
                             print $hist_data;
@@ -904,16 +904,16 @@  discard block
 block discarded – undo
904 904
                             colors: ["#1a3151"]
905 905
                         };
906 906
 
907
-                        var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'"));
907
+                        var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'"));
908 908
                         chart.draw(data, options);
909 909
                       }
910 910
                       $(window).resize(function(){
911
-                              drawCharthist_'.str_replace(' ','_',strtolower($source)).'();
911
+                              drawCharthist_'.str_replace(' ', '_', strtolower($source)).'();
912 912
                             });
913 913
                   </script>';
914 914
         	?>
915 915
     	    </div>
916
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
916
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
917 917
         	<?php
918 918
                   }
919 919
                 ?>
Please login to merge, or discard this patch.
Braces   +103 added lines, -42 removed lines patch added patch discarded remove patch
@@ -6,11 +6,15 @@  discard block
 block discarded – undo
6 6
 $beginpage = microtime(true);
7 7
 $Stats = new Stats();
8 8
 
9
-if (!isset($filter_name)) $filter_name = '';
9
+if (!isset($filter_name)) {
10
+	$filter_name = '';
11
+}
10 12
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
11 13
 if ($airline_icao == '' && isset($globalFilter)) {
12
-	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
13
-}
14
+	if (isset($globalFilter['airline'])) {
15
+		$airline_icao = $globalFilter['airline'][0];
16
+	}
17
+	}
14 18
 if ($airline_icao != '' && $airline_icao != 'all') {
15 19
 	$Spotter = new Spotter();
16 20
 	$airline_info = $Spotter->getAllAirlineInfo($airline_icao);
@@ -36,14 +40,21 @@  discard block
 block discarded – undo
36 40
 <script type="text/javascript" src="<?php echo $globalURL; ?>/js/justgage.js"></script>
37 41
 <div class="column">
38 42
     <div class="info">
39
-            <h1><?php if (isset($airline_name)) echo _("Statistics for ").$airline_name; else echo _("Statistics"); ?></h1>
43
+            <h1><?php if (isset($airline_name)) {
44
+	echo _("Statistics for ").$airline_name;
45
+} else {
46
+	echo _("Statistics");
47
+}
48
+?></h1>
40 49
     <?php 
41 50
 	$last_update = $Stats->getLastStatsUpdate();
42 51
 	//if (isset($last_update[0]['value'])) print '<!-- Last update : '.$last_update[0]['value'].' -->';
43 52
 	if (isset($last_update[0]['value'])) {
44 53
 		date_default_timezone_set('UTC');
45 54
 		$lastupdate = strtotime($last_update[0]['value']);
46
-		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
55
+		if (isset($globalTimezone) && $globalTimezone != '') {
56
+			date_default_timezone_set($globalTimezone);
57
+		}
47 58
 		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
48 59
 	}
49 60
     ?>
@@ -95,8 +106,9 @@  discard block
 block discarded – undo
95 106
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
96 107
                  <?php
97 108
                   $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
98
-		    if (count($aircraft_array) == 0) print _("No data available");
99
-		    else {
109
+		    if (count($aircraft_array) == 0) {
110
+		    	print _("No data available");
111
+		    } else {
100 112
 
101 113
                     print '<div id="chart1" class="chart" width="100%"></div>
102 114
                     <script> 
@@ -133,11 +145,17 @@  discard block
 block discarded – undo
133 145
             	    <?php
134 146
             		if ($year != '' && $month != '') {
135 147
             	    ?>
136
-            	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
148
+            	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
149
+	echo '/'.$airline_icao;
150
+}
151
+?>/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
137 152
             	    <?php
138 153
             		} else {
139 154
             	    ?>
140
-            	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?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>
155
+            	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
156
+	echo '/'.$airline_icao;
157
+}
158
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
141 159
             	    <?php
142 160
             		}
143 161
             	    ?>
@@ -182,11 +200,15 @@  discard block
 block discarded – undo
182 200
                   </script>';
183 201
 	    if ($year != '' && $month != '') {
184 202
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airline';
185
-		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
203
+		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
204
+			echo '/'.$airline_icao;
205
+		}
186 206
 		print '/'.$year.'/'.$month.'/" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
187 207
 	    } else {
188 208
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airline';
189
-		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
209
+		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
210
+			echo '/'.$airline_icao;
211
+		}
190 212
 		print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
191 213
 	    }
192 214
     	    print '</div>';
@@ -210,8 +232,9 @@  discard block
 block discarded – undo
210 232
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
211 233
 <?php
212 234
 	$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
213
-	if (count($pilot_array) == 0) print _("No data available");
214
-	else {
235
+	if (count($pilot_array) == 0) {
236
+		print _("No data available");
237
+	} else {
215 238
 	    print '<div id="chart7" class="chart" width="100%"></div>
216 239
                     <script> 
217 240
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -244,7 +267,9 @@  discard block
 block discarded – undo
244 267
         }
245 268
         print '<div class="more">';
246 269
 	print '<a href="'.$globalURL.'/statistics/pilot'; 
247
-	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
270
+	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
271
+		echo '/'.$airline_icao;
272
+	}
248 273
 	print'" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a>';
249 274
 	print '</div>';
250 275
 ?>
@@ -258,8 +283,9 @@  discard block
 block discarded – undo
258 283
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
259 284
 <?php
260 285
 	$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
261
-	if (count($owner_array) == 0) print _("No data available");
262
-	else {
286
+	if (count($owner_array) == 0) {
287
+		print _("No data available");
288
+	} else {
263 289
 	    print '<div id="chart7" class="chart" width="100%"></div>
264 290
                     <script> 
265 291
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -292,7 +318,10 @@  discard block
 block discarded – undo
292 318
 	}
293 319
 ?>
294 320
                 <div class="more">
295
-                    <a href="<?php print $globalURL; ?>/statistics/owner<?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>
321
+                    <a href="<?php print $globalURL; ?>/statistics/owner<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
322
+	echo '/'.$airline_icao;
323
+}
324
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
296 325
                 </div>
297 326
             </div>
298 327
         
@@ -305,8 +334,9 @@  discard block
 block discarded – undo
305 334
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
306 335
 <?php
307 336
 	 //$flightover_array = $Stats->countAllFlightOverCountries();
308
-	if (count($flightover_array) == 0) print _("No data available");
309
-	else {
337
+	if (count($flightover_array) == 0) {
338
+		print _("No data available");
339
+	} else {
310 340
 	    print '<div id="chart10" class="chart" width="100%"></div>
311 341
                     <script> 
312 342
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -341,7 +371,10 @@  discard block
 block discarded – undo
341 371
 	}
342 372
 ?>
343 373
                 <div class="more">
344
-                    <a href="<?php print $globalURL; ?>/statistics/country<?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>
374
+                    <a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
375
+	echo '/'.$airline_icao;
376
+}
377
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
345 378
                 </div>
346 379
             </div>
347 380
 <?php
@@ -394,7 +427,9 @@  discard block
 block discarded – undo
394 427
               }
395 428
                 </script>';
396 429
 	print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure'; 
397
-	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
430
+	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
431
+		echo '/'.$airline_icao;
432
+	}
398 433
 	print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
399 434
     }
400 435
 ?>
@@ -441,7 +476,9 @@  discard block
 block discarded – undo
441 476
               }
442 477
                 </script>';
443 478
 	print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival';
444
-	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
479
+	if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
480
+		echo '/'.$airline_icao;
481
+	}
445 482
 	print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
446 483
     }
447 484
 ?>
@@ -456,8 +493,9 @@  discard block
 block discarded – undo
456 493
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
457 494
                 <?php
458 495
                   $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
459
-		    if (count($year_array) == 0) print _("No data available");
460
-		    else {
496
+		    if (count($year_array) == 0) {
497
+		    	print _("No data available");
498
+		    } else {
461 499
                   print '<div id="chart8" class="chart" width="100%"></div>
462 500
                     <script> 
463 501
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -493,7 +531,10 @@  discard block
 block discarded – undo
493 531
                   }
494 532
                   ?>
495 533
                 <div class="more">
496
-                    <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>
534
+                    <a href="<?php print $globalURL; ?>/statistics/year<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
535
+	echo '/'.$airline_icao;
536
+}
537
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
497 538
                 </div>
498 539
             </div>
499 540
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -501,8 +542,9 @@  discard block
 block discarded – undo
501 542
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
502 543
                 <?php
503 544
                   $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
504
-		    if (count($month_array) == 0) print _("No data available");
505
-		    else {
545
+		    if (count($month_array) == 0) {
546
+		    	print _("No data available");
547
+		    } else {
506 548
                   print '<div id="chart9" class="chart" width="100%"></div>
507 549
                     <script> 
508 550
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -538,7 +580,10 @@  discard block
 block discarded – undo
538 580
                   }
539 581
                   ?>
540 582
                 <div class="more">
541
-                    <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>
583
+                    <a href="<?php print $globalURL; ?>/statistics/month<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
584
+	echo '/'.$airline_icao;
585
+}
586
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
542 587
                 </div>
543 588
             </div>
544 589
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -547,8 +592,9 @@  discard block
 block discarded – undo
547 592
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
548 593
                 <?php
549 594
                     $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
550
-		    if (empty($date_array)) print _("No data available");
551
-		    else {
595
+		    if (empty($date_array)) {
596
+		    	print _("No data available");
597
+		    } else {
552 598
                   print '<div id="chart5" class="chart" width="100%"></div>
553 599
                     <script> 
554 600
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -585,7 +631,10 @@  discard block
 block discarded – undo
585 631
                   }
586 632
                   ?>
587 633
                 <div class="more">
588
-                    <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>
634
+                    <a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
635
+	echo '/'.$airline_icao;
636
+}
637
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
589 638
                 </div>
590 639
             </div>
591 640
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -593,8 +642,9 @@  discard block
 block discarded – undo
593 642
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
594 643
                 <?php
595 644
                   $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
596
-		    if (empty($hour_array)) print _("No data available");
597
-		    else {
645
+		    if (empty($hour_array)) {
646
+		    	print _("No data available");
647
+		    } else {
598 648
 
599 649
                   print '<div id="chart6" class="chart" width="100%"></div>
600 650
                     <script> 
@@ -631,7 +681,10 @@  discard block
 block discarded – undo
631 681
                   }
632 682
                 ?>
633 683
                 <div class="more">
634
-                    <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>
684
+                    <a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
685
+	echo '/'.$airline_icao;
686
+}
687
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
635 688
                 </div>
636 689
             </div>
637 690
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -650,8 +703,9 @@  discard block
 block discarded – undo
650 703
 		    require_once('require/class.Accident.php');
651 704
             	    $Accident = new Accident();
652 705
                   $year_array = $Accident->countFatalitiesByYear($filter_name);
653
-		    if (count($year_array) == 0) print _("No data available");
654
-		    else {
706
+		    if (count($year_array) == 0) {
707
+		    	print _("No data available");
708
+		    } else {
655 709
                   print '<div id="chart32" class="chart" width="100%"></div>
656 710
                     <script> 
657 711
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -699,8 +753,9 @@  discard block
 block discarded – undo
699 753
 		    require_once('require/class.Accident.php');
700 754
             	    $Accident = new Accident();
701 755
                   $year_array = $Accident->countFatalitiesLast12Months($filter_name);
702
-		    if (count($year_array) == 0) print _("No data available");
703
-		    else {
756
+		    if (count($year_array) == 0) {
757
+		    	print _("No data available");
758
+		    } else {
704 759
                   print '<div id="chart33" class="chart" width="100%"></div>
705 760
                     <script> 
706 761
                         google.load("visualization", "1", {packages:["corechart"]});
@@ -776,8 +831,11 @@  discard block
 block discarded – undo
776 831
 					$distance = $distance;
777 832
 					$unit = 'km';
778 833
 				}
779
-        			if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
780
-        	    		else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
834
+        			if (!isset($polar_data)) {
835
+        				$polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
836
+        			} else {
837
+        	    			$polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
838
+        	    		}
781 839
         		    }
782 840
         	?>
783 841
             <div class="col-md-6">
@@ -829,8 +887,11 @@  discard block
 block discarded – undo
829 887
         		foreach ($msg as $eachmsg) {
830 888
         		    //$eachmsg = $msg[0];
831 889
         		    $data = $eachmsg['source_data'];
832
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
833
-        		    else $max = 500;
890
+        		    if ($data > 500) {
891
+        		    	$max = (round(($data+100)/100))*100;
892
+        		    } else {
893
+        		    	$max = 500;
894
+        		    }
834 895
         	?>
835 896
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
836 897
         	<script>
Please login to merge, or discard this patch.