Completed
Push — master ( 46434e...ad133e )
by Yannick
32:08 queued 16:03
created
race-detailed.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Language.php');
6 6
 require_once('require/class.MarineArchive.php');
7 7
 
8
-if (!isset($_GET['race'])){
8
+if (!isset($_GET['race'])) {
9 9
 	header('Location: '.$globalURL.'/');
10 10
 } else {
11 11
 	$type = 'marine';
12 12
 	$Marine = new Marine();
13 13
 	$MarineArchive = new MarineArchive();
14 14
 	//calculuation for the pagination
15
-	if(!isset($_GET['limit']))
15
+	if (!isset($_GET['limit']))
16 16
 	{
17 17
 		$limit_start = 0;
18 18
 		$limit_end = 25;
@@ -32,25 +32,25 @@  discard block
 block discarded – undo
32 32
 	$limit_previous_2 = $limit_end - $absolute_difference;
33 33
 	
34 34
 	
35
-	$race = filter_input(INPUT_GET,'race',FILTER_SANITIZE_STRING);
35
+	$race = filter_input(INPUT_GET, 'race', FILTER_SANITIZE_STRING);
36 36
 	$page_url = $globalURL.'/marine/race/'.$race;
37
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
38
-	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
39
-	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
37
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
38
+	$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
39
+	$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
40 40
 	$race_data = $Marine->getRace($race);
41 41
 	$filter = array();
42
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
43
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
42
+	if ($year != '') $filter = array_merge($filter, array('year' => $year));
43
+	if ($month != '') $filter = array_merge($filter, array('month' => $month));
44 44
 	if ($sort != '') 
45 45
 	{
46
-		$spotter_array = $Marine->getMarineDataByRace($race,$limit_start.",".$absolute_difference, $sort,$filter);
46
+		$spotter_array = $Marine->getMarineDataByRace($race, $limit_start.",".$absolute_difference, $sort, $filter);
47 47
 		/*
48 48
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
49 49
 			$spotter_array = $MarineArchive->getMarineDataByRace($race,$limit_start.",".$absolute_difference, $sort,$filter);
50 50
 		}
51 51
 		*/
52 52
 	} else {
53
-		$spotter_array = $Marine->getMarineDataByRace($race,$limit_start.",".$absolute_difference,'',$filter);
53
+		$spotter_array = $Marine->getMarineDataByRace($race, $limit_start.",".$absolute_difference, '', $filter);
54 54
 		/*
55 55
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
56 56
 			$spotter_array = $MarineArchive->getMarineDataByRace($race,$limit_start.",".$absolute_difference,'',$filter);
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 	if (!empty($spotter_array))
62 62
 	{
63
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['race_name']);
63
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['race_name']);
64 64
 		$ident = $spotter_array[0]['ident'];
65 65
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
66 66
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
 		} else $flights = 0;
125 125
 		if ($flights == 0)
126 126
 		*/
127
-		$flights = $Marine->countCaptainsByRace($race,$filter);
127
+		$flights = $Marine->countCaptainsByRace($race, $filter);
128 128
 		print '<div><span class="label">'._("Captains").'</span>'.$flights.'</div>';
129
-		$aircraft_type = count($Marine->countAllBoatTypesByRace($race,$filter));
129
+		$aircraft_type = count($Marine->countAllBoatTypesByRace($race, $filter));
130 130
 		print '<div><span class="label">'._("Boat type").'</span>'.$aircraft_type.'</div>';
131 131
 		//$aircraft_registration = count($Marine->countAllAircraftRegistrationByrace($race,$filter));
132 132
 		//print '<div><span class="label">'._("Aircraft").'</span>'.$aircraft_registration.'</div>';
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	
153 153
 		//include('race-sub-menu.php');
154 154
 		print '<div class="table column">';
155
-		print '<p>'.sprintf(_("The table below shows the detailed information of all races with the race <strong>%s</strong>."),$spotter_array[0]['race_name']).'</p>';
155
+		print '<p>'.sprintf(_("The table below shows the detailed information of all races with the race <strong>%s</strong>."), $spotter_array[0]['race_name']).'</p>';
156 156
 
157 157
 		include('table-output.php'); 
158 158
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,8 +39,12 @@  discard block
 block discarded – undo
39 39
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
40 40
 	$race_data = $Marine->getRace($race);
41 41
 	$filter = array();
42
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
43
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
42
+	if ($year != '') {
43
+		$filter = array_merge($filter,array('year' => $year));
44
+	}
45
+	if ($month != '') {
46
+		$filter = array_merge($filter,array('month' => $month));
47
+	}
44 48
 	if ($sort != '') 
45 49
 	{
46 50
 		$spotter_array = $Marine->getMarineDataByRace($race,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -62,8 +66,12 @@  discard block
 block discarded – undo
62 66
 	{
63 67
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['race_name']);
64 68
 		$ident = $spotter_array[0]['ident'];
65
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
66
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
69
+		if (isset($spotter_array[0]['latitude'])) {
70
+			$latitude = $spotter_array[0]['latitude'];
71
+		}
72
+		if (isset($spotter_array[0]['longitude'])) {
73
+			$longitude = $spotter_array[0]['longitude'];
74
+		}
67 75
 		require_once('header.php');
68 76
 		/*
69 77
 		if (isset($globalArchive) && $globalArchive) {
@@ -116,7 +124,9 @@  discard block
 block discarded – undo
116 124
 		*/
117 125
 		print '<div class="info column">';
118 126
 		print '<h1>'.$spotter_array[0]['race_name'].'</h1>';
119
-		if (isset($spotter_array[0]['race_id']) && $spotter_array[0]['race_id'] != '') print '<div><span class="label">'._("race ID").'</span>'.$spotter_array[0]['race_id'].'</div>';
127
+		if (isset($spotter_array[0]['race_id']) && $spotter_array[0]['race_id'] != '') {
128
+			print '<div><span class="label">'._("race ID").'</span>'.$spotter_array[0]['race_id'].'</div>';
129
+		}
120 130
 		/*
121 131
 		if ($year == '' && $month == '') {
122 132
 			$Stats = new Stats();
@@ -142,7 +152,9 @@  discard block
 block discarded – undo
142 152
 		if (isset($race_data['race_startdate']) && $race_data['race_startdate'] != '') {
143 153
 			if (isset($globalTimezone)) {
144 154
 				date_default_timezone_set($globalTimezone);
145
-			} else date_default_timezone_set('UTC');
155
+			} else {
156
+				date_default_timezone_set('UTC');
157
+			}
146 158
 			print '<div><span class="startdate">'._("Start date").'</span>'.date("r", strtotime($race_data['race_startdate'])).'</div>';
147 159
 		}
148 160
 		print '</div>';
Please login to merge, or discard this patch.
statistics.php 3 patches
Braces   +172 added lines, -82 removed lines patch added patch discarded remove patch
@@ -22,11 +22,15 @@  discard block
 block discarded – undo
22 22
 	require_once('require/class.Spotter.php');
23 23
 }
24 24
 
25
-if (!isset($filter_name)) $filter_name = '';
25
+if (!isset($filter_name)) {
26
+	$filter_name = '';
27
+}
26 28
 $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
27 29
 if ($type == 'aircraft' && $airline_icao == '' && isset($globalFilter)) {
28
-	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
29
-}
30
+	if (isset($globalFilter['airline'])) {
31
+		$airline_icao = $globalFilter['airline'][0];
32
+	}
33
+	}
30 34
 if ($type == 'aircraft' && $airline_icao != '' && $airline_icao != 'all') {
31 35
 	$Spotter = new Spotter();
32 36
 	$airline_info = $Spotter->getAllAirlineInfo($airline_icao);
@@ -61,7 +65,12 @@  discard block
 block discarded – undo
61 65
 <script type="text/javascript" src="<?php echo $globalURL; ?>/js/datamaps.world.min.js"></script>
62 66
 <div class="column">
63 67
     <div class="info">
64
-            <h1><?php if (isset($airline_name)) echo _("Statistics for ").$airline_name; else echo _("Statistics"); ?></h1>
68
+            <h1><?php if (isset($airline_name)) {
69
+	echo _("Statistics for ").$airline_name;
70
+} else {
71
+	echo _("Statistics");
72
+}
73
+?></h1>
65 74
 <?php 
66 75
 if ($type == 'aircraft') {
67 76
 	$last_update = $Stats->getLastStatsUpdate();
@@ -73,7 +82,9 @@  discard block
 block discarded – undo
73 82
 if (isset($last_update[0]['value'])) {
74 83
 	date_default_timezone_set('UTC');
75 84
 	$lastupdate = strtotime($last_update[0]['value']);
76
-	if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
85
+	if (isset($globalTimezone) && $globalTimezone != '') {
86
+		date_default_timezone_set($globalTimezone);
87
+	}
77 88
 	print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
78 89
 }
79 90
 
@@ -166,8 +177,11 @@  discard block
 block discarded – undo
166 177
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
167 178
 		$aircraft_data = '';
168 179
 		foreach($aircraft_array as $aircraft_item) {
169
-			if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
170
-			else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
180
+			if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') {
181
+				$aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
182
+			} else {
183
+				$aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
184
+			}
171 185
 		}
172 186
 		$aircraft_data = substr($aircraft_data, 0, -1);
173 187
 		print 'var series = ['.$aircraft_data.'];';
@@ -184,11 +198,17 @@  discard block
 block discarded – undo
184 198
 <?php
185 199
 	if ($year != '' && $month != '') {
186 200
 ?>
187
-            	    <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>
201
+            	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
202
+	echo '/'.$airline_icao;
203
+}
204
+?>/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
188 205
 <?php
189 206
 	} else {
190 207
 ?>
191
-            	    <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>
208
+            	    <a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
209
+	echo '/'.$airline_icao;
210
+}
211
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
192 212
 <?php
193 213
 	}
194 214
 ?>
@@ -217,11 +237,15 @@  discard block
 block discarded – undo
217 237
 			print '</script>';
218 238
 			if ($year != '' && $month != '') {
219 239
 				print '<div class="more"><a href="'.$globalURL.'/statistics/airline';
220
-				if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
240
+				if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
241
+					echo '/'.$airline_icao;
242
+				}
221 243
 				print '/'.$year.'/'.$month.'/" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
222 244
 			} else {
223 245
 				print '<div class="more"><a href="'.$globalURL.'/statistics/airline';
224
-				if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
246
+				if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
247
+					echo '/'.$airline_icao;
248
+				}
225 249
 				print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
226 250
 			}
227 251
 			print '</div>';
@@ -241,8 +265,9 @@  discard block
 block discarded – undo
241 265
                 <h2><?php echo _("Top 10 Most Common Vessel Type"); ?></h2>
242 266
 <?php
243 267
 	$marine_array = $Stats->countAllMarineTypes(true,$filter_name,$year,$month);
244
-	if (count($marine_array) == 0) print _("No data available");
245
-	else {
268
+	if (count($marine_array) == 0) {
269
+		print _("No data available");
270
+	} else {
246 271
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
247 272
 		$marine_data = '';
248 273
 		foreach($marine_array as $marine_item) {
@@ -283,8 +308,9 @@  discard block
 block discarded – undo
283 308
                 <h2><?php echo _("Top 10 Races Number of Participants"); ?></h2>
284 309
 <?php
285 310
 	$marine_array = $Marine->countAllCaptainsByRaces(true,$filter_name,$year,$month);
286
-	if (count($marine_array) == 0) print _("No data available");
287
-	else {
311
+	if (count($marine_array) == 0) {
312
+		print _("No data available");
313
+	} else {
288 314
 		print '<div id="chart991" class="chart" width="100%"></div><script>';
289 315
 		$marine_data = '';
290 316
 		foreach($marine_array as $marine_item) {
@@ -331,8 +357,9 @@  discard block
 block discarded – undo
331 357
                 <h2><?php echo _("Top 10 Most Common Tracker Type"); ?></h2>
332 358
 <?php
333 359
 	$tracker_array = $Tracker->countAllTrackerTypes(true,0,'',array(),$year,$month);
334
-	if (count($tracker_array) == 0) print _("No data available");
335
-	else {
360
+	if (count($tracker_array) == 0) {
361
+		print _("No data available");
362
+	} else {
336 363
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
337 364
 		$tracker_data = '';
338 365
 		foreach($tracker_array as $tracker_item) {
@@ -376,8 +403,9 @@  discard block
 block discarded – undo
376 403
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
377 404
 <?php
378 405
 		$owner_array = $Satellite->countAllOwners(true);
379
-		if (count($owner_array) == 0) print _("No data available");
380
-		else {
406
+		if (count($owner_array) == 0) {
407
+			print _("No data available");
408
+		} else {
381 409
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
382 410
 			$owner_data = '';
383 411
 			foreach($owner_array as $owner_item) {
@@ -396,7 +424,10 @@  discard block
 block discarded – undo
396 424
 ?>
397 425
                <!--
398 426
                 <div class="more">
399
-                    <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>
427
+                    <a href="<?php print $globalURL; ?>/statistics/owner<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
428
+	echo '/'.$airline_icao;
429
+}
430
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
400 431
                 </div>
401 432
                 -->
402 433
             </div>
@@ -405,8 +436,9 @@  discard block
 block discarded – undo
405 436
                 <h2><?php echo _("Top 10 Most Common Countries Owners"); ?></h2>
406 437
 <?php
407 438
 		$countries_array = $Satellite->countAllCountriesOwners(true);
408
-		if (count($countries_array) == 0) print _("No data available");
409
-		else {
439
+		if (count($countries_array) == 0) {
440
+			print _("No data available");
441
+		} else {
410 442
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
411 443
 			$owner_data = '';
412 444
 			foreach($countries_array as $owner_item) {
@@ -425,7 +457,10 @@  discard block
 block discarded – undo
425 457
 ?>
426 458
 	    <!--
427 459
                 <div class="more">
428
-                    <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>
460
+                    <a href="<?php print $globalURL; ?>/statistics/owner<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
461
+	echo '/'.$airline_icao;
462
+}
463
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
429 464
                 </div>
430 465
                 -->
431 466
             </div>
@@ -437,8 +472,9 @@  discard block
 block discarded – undo
437 472
                 <h2><?php echo _("Top 10 Most Common Launch Sites"); ?></h2>
438 473
 <?php
439 474
 		$launch_site_array = $Satellite->countAllLaunchSite(true);
440
-		if (count($launch_site_array) == 0) print _("No data available");
441
-		else {
475
+		if (count($launch_site_array) == 0) {
476
+			print _("No data available");
477
+		} else {
442 478
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
443 479
 			$launch_site_data = '';
444 480
 			foreach($launch_site_array as $launch_site_item) {
@@ -457,7 +493,10 @@  discard block
 block discarded – undo
457 493
 ?>
458 494
                <!--
459 495
                 <div class="more">
460
-                    <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>
496
+                    <a href="<?php print $globalURL; ?>/statistics/owner<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
497
+	echo '/'.$airline_icao;
498
+}
499
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
461 500
                 </div>
462 501
                 -->
463 502
             </div>
@@ -480,8 +519,9 @@  discard block
 block discarded – undo
480 519
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
481 520
 <?php
482 521
 		$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
483
-		if (count($pilot_array) == 0) print _("No data available");
484
-		else {
522
+		if (count($pilot_array) == 0) {
523
+			print _("No data available");
524
+		} else {
485 525
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
486 526
 			$pilot_data = '';
487 527
 			foreach($pilot_array as $pilot_item) {
@@ -499,7 +539,9 @@  discard block
 block discarded – undo
499 539
 		}
500 540
 		print '<div class="more">';
501 541
 		print '<a href="'.$globalURL.'/statistics/pilot'; 
502
-		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
542
+		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
543
+			echo '/'.$airline_icao;
544
+		}
503 545
 		print'" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a>';
504 546
 		print '</div>';
505 547
 ?>
@@ -515,8 +557,9 @@  discard block
 block discarded – undo
515 557
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
516 558
 <?php
517 559
 		$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
518
-		if (count($owner_array) == 0) print _("No data available");
519
-		else {
560
+		if (count($owner_array) == 0) {
561
+			print _("No data available");
562
+		} else {
520 563
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
521 564
 			$owner_data = '';
522 565
 			foreach($owner_array as $owner_item) {
@@ -534,7 +577,10 @@  discard block
 block discarded – undo
534 577
 		}
535 578
 ?>
536 579
                 <div class="more">
537
-                    <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>
580
+                    <a href="<?php print $globalURL; ?>/statistics/owner<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
581
+	echo '/'.$airline_icao;
582
+}
583
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
538 584
                 </div>
539 585
             </div>
540 586
         
@@ -547,8 +593,9 @@  discard block
 block discarded – undo
547 593
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
548 594
 <?php
549 595
 	 //$flightover_array = $Stats->countAllFlightOverCountries();
550
-		if (count($flightover_array) == 0) print _("No data available");
551
-		else {
596
+		if (count($flightover_array) == 0) {
597
+			print _("No data available");
598
+		} else {
552 599
 			print '<div id="chart10" class="chart" width="100%"></div><script>';
553 600
 			print 'var series = [';
554 601
 			$flightover_data = '';
@@ -590,7 +637,10 @@  discard block
 block discarded – undo
590 637
 		}
591 638
 ?>
592 639
                 <div class="more">
593
-                    <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>
640
+                    <a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
641
+	echo '/'.$airline_icao;
642
+}
643
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
594 644
                 </div>
595 645
             </div>
596 646
 <?php
@@ -608,8 +658,9 @@  discard block
 block discarded – undo
608 658
 	<div class="col-md-6">
609 659
             <h2><?php echo _("Top 20 Most Common Country a Vessel was inside"); ?></h2>
610 660
 <?php
611
-	if (count($flightover_array) == 0) print _("No data available");
612
-	else {
661
+	if (count($flightover_array) == 0) {
662
+		print _("No data available");
663
+	} else {
613 664
 		print '<div id="chart10" class="chart" width="100%"></div><script>';
614 665
 		print 'var series = [';
615 666
 		$flightover_data = '';
@@ -666,8 +717,9 @@  discard block
 block discarded – undo
666 717
 	<div class="col-md-6">
667 718
             <h2><?php echo _("Top 20 Most Common Country a Tracker was inside"); ?></h2>
668 719
 <?php
669
-	if (count($flightover_array) == 0) print _("No data available");
670
-	else {
720
+	if (count($flightover_array) == 0) {
721
+		print _("No data available");
722
+	} else {
671 723
 		print '<div id="chart10" class="chart" width="100%"></div><script>';
672 724
 		print 'var series = [';
673 725
 		$flightover_data = '';
@@ -773,7 +825,9 @@  discard block
 block discarded – undo
773 825
 		});";
774 826
 		print '</script>';
775 827
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure'; 
776
-		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
828
+		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
829
+			echo '/'.$airline_icao;
830
+		}
777 831
 		print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
778 832
 	}
779 833
 ?>
@@ -837,7 +891,9 @@  discard block
 block discarded – undo
837 891
 		});";
838 892
 		print '</script>';
839 893
 		print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival';
840
-		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao;
894
+		if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
895
+			echo '/'.$airline_icao;
896
+		}
841 897
 		print '" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
842 898
 	}
843 899
 ?>
@@ -856,8 +912,9 @@  discard block
 block discarded – undo
856 912
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
857 913
 <?php
858 914
 		$year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
859
-		if (count($year_array) == 0) print _("No data available");
860
-		else {
915
+		if (count($year_array) == 0) {
916
+			print _("No data available");
917
+		} else {
861 918
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
862 919
 			$year_data = '';
863 920
 			$year_cnt = '';
@@ -876,7 +933,10 @@  discard block
 block discarded – undo
876 933
 		}
877 934
 ?>
878 935
                 <div class="more">
879
-                    <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>
936
+                    <a href="<?php print $globalURL; ?>/statistics/year<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
937
+	echo '/'.$airline_icao;
938
+}
939
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
880 940
                 </div>
881 941
             </div>
882 942
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -884,8 +944,9 @@  discard block
 block discarded – undo
884 944
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
885 945
 <?php
886 946
 		$month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
887
-		if (count($month_array) == 0) print _("No data available");
888
-		else {
947
+		if (count($month_array) == 0) {
948
+			print _("No data available");
949
+		} else {
889 950
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
890 951
 			$month_data = '';
891 952
 			$month_cnt = '';
@@ -904,7 +965,10 @@  discard block
 block discarded – undo
904 965
 		}
905 966
 ?>
906 967
                 <div class="more">
907
-                    <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>
968
+                    <a href="<?php print $globalURL; ?>/statistics/month<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
969
+	echo '/'.$airline_icao;
970
+}
971
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
908 972
                 </div>
909 973
             </div>
910 974
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -913,8 +977,9 @@  discard block
 block discarded – undo
913 977
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
914 978
 <?php
915 979
 		$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
916
-		if (empty($date_array)) print _("No data available");
917
-		else {
980
+		if (empty($date_array)) {
981
+			print _("No data available");
982
+		} else {
918 983
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
919 984
 			$date_data = '';
920 985
 			$date_cnt = '';
@@ -933,7 +998,10 @@  discard block
 block discarded – undo
933 998
 		}
934 999
 ?>
935 1000
                 <div class="more">
936
-                    <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>
1001
+                    <a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
1002
+	echo '/'.$airline_icao;
1003
+}
1004
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
937 1005
                 </div>
938 1006
             </div>
939 1007
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -941,8 +1009,9 @@  discard block
 block discarded – undo
941 1009
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
942 1010
 <?php
943 1011
 		$hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
944
-		if (empty($hour_array)) print _("No data available");
945
-		else {
1012
+		if (empty($hour_array)) {
1013
+			print _("No data available");
1014
+		} else {
946 1015
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
947 1016
 			$hour_data = '';
948 1017
 			$hour_cnt = '';
@@ -961,7 +1030,10 @@  discard block
 block discarded – undo
961 1030
 		}
962 1031
 ?>
963 1032
                 <div class="more">
964
-                    <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>
1033
+                    <a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') {
1034
+	echo '/'.$airline_icao;
1035
+}
1036
+?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
965 1037
                 </div>
966 1038
             </div>
967 1039
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -981,8 +1053,9 @@  discard block
 block discarded – undo
981 1053
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
982 1054
 <?php
983 1055
 		$year_array = $Stats->countAllMarineMonthsLastYear(true,$filter_name);
984
-		if (count($year_array) == 0) print _("No data available");
985
-		else {
1056
+		if (count($year_array) == 0) {
1057
+			print _("No data available");
1058
+		} else {
986 1059
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
987 1060
 			$year_data = '';
988 1061
 			$year_cnt = '';
@@ -1010,8 +1083,9 @@  discard block
 block discarded – undo
1010 1083
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
1011 1084
 <?php
1012 1085
 		$month_array = $Stats->countAllMarineDatesLastMonth($filter_name);
1013
-		if (count($month_array) == 0) print _("No data available");
1014
-		else {
1086
+		if (count($month_array) == 0) {
1087
+			print _("No data available");
1088
+		} else {
1015 1089
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
1016 1090
 			$month_data = '';
1017 1091
 			$month_cnt = '';
@@ -1039,8 +1113,9 @@  discard block
 block discarded – undo
1039 1113
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
1040 1114
 <?php
1041 1115
 		$date_array = $Stats->countAllMarineDatesLast7Days($filter_name);
1042
-		if (empty($date_array)) print _("No data available");
1043
-		else {
1116
+		if (empty($date_array)) {
1117
+			print _("No data available");
1118
+		} else {
1044 1119
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
1045 1120
 			$date_data = '';
1046 1121
 			$date_cnt = '';
@@ -1067,8 +1142,9 @@  discard block
 block discarded – undo
1067 1142
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1068 1143
 <?php
1069 1144
 		$hour_array = $Stats->countAllMarineHours('hour',true,$filter_name);
1070
-		if (empty($hour_array)) print _("No data available");
1071
-		else {
1145
+		if (empty($hour_array)) {
1146
+			print _("No data available");
1147
+		} else {
1072 1148
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
1073 1149
 			$hour_data = '';
1074 1150
 			$hour_cnt = '';
@@ -1107,8 +1183,9 @@  discard block
 block discarded – undo
1107 1183
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
1108 1184
 <?php
1109 1185
 		$year_array = $Stats->countAllTrackerMonthsLastYear(true);
1110
-		if (count($year_array) == 0) print _("No data available");
1111
-		else {
1186
+		if (count($year_array) == 0) {
1187
+			print _("No data available");
1188
+		} else {
1112 1189
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
1113 1190
 			$year_data = '';
1114 1191
 			$year_cnt = '';
@@ -1136,8 +1213,9 @@  discard block
 block discarded – undo
1136 1213
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
1137 1214
 <?php
1138 1215
 		$month_array = $Stats->countAllTrackerDatesLastMonth();
1139
-		if (count($month_array) == 0) print _("No data available");
1140
-		else {
1216
+		if (count($month_array) == 0) {
1217
+			print _("No data available");
1218
+		} else {
1141 1219
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
1142 1220
 			$month_data = '';
1143 1221
 			$month_cnt = '';
@@ -1165,8 +1243,9 @@  discard block
 block discarded – undo
1165 1243
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
1166 1244
 <?php
1167 1245
 		$date_array = $Stats->countAllTrackerDatesLast7Days();
1168
-		if (empty($date_array)) print _("No data available");
1169
-		else {
1246
+		if (empty($date_array)) {
1247
+			print _("No data available");
1248
+		} else {
1170 1249
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
1171 1250
 			$date_data = '';
1172 1251
 			$date_cnt = '';
@@ -1193,8 +1272,9 @@  discard block
 block discarded – undo
1193 1272
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1194 1273
 <?php
1195 1274
 		$hour_array = $Stats->countAllTrackerHours('hour',true);
1196
-		if (empty($hour_array)) print _("No data available");
1197
-		else {
1275
+		if (empty($hour_array)) {
1276
+			print _("No data available");
1277
+		} else {
1198 1278
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
1199 1279
 			$hour_data = '';
1200 1280
 			$hour_cnt = '';
@@ -1233,8 +1313,9 @@  discard block
 block discarded – undo
1233 1313
                 <h2><?php echo _("Busiest Launch Months of the last 12 Months"); ?></h2>
1234 1314
 <?php
1235 1315
 		$year_array = $Satellite->countAllMonthsLastYear();
1236
-		if (count($year_array) == 0) print _("No data available");
1237
-		else {
1316
+		if (count($year_array) == 0) {
1317
+			print _("No data available");
1318
+		} else {
1238 1319
 			print '<div id="chart21" class="chart" width="100%"></div><script>';
1239 1320
 			$year_data = '';
1240 1321
 			$year_cnt = '';
@@ -1264,8 +1345,9 @@  discard block
 block discarded – undo
1264 1345
                 <h2><?php echo _("Busiest Launch Years of the last 10 Years"); ?></h2>
1265 1346
 <?php
1266 1347
 		$year_array = $Satellite->countAllYears();
1267
-		if (count($year_array) == 0) print _("No data available");
1268
-		else {
1348
+		if (count($year_array) == 0) {
1349
+			print _("No data available");
1350
+		} else {
1269 1351
 			print '<div id="chart22" class="chart" width="100%"></div><script>';
1270 1352
 			$year_data = '';
1271 1353
 			$year_cnt = '';
@@ -1307,8 +1389,9 @@  discard block
 block discarded – undo
1307 1389
                 <h2><?php echo _("Fatalities by Years"); ?></h2>
1308 1390
 <?php
1309 1391
 		$year_array = $Stats->countFatalitiesByYear();
1310
-		if (count($year_array) == 0) print _("No data available");
1311
-		else {
1392
+		if (count($year_array) == 0) {
1393
+			print _("No data available");
1394
+		} else {
1312 1395
 			print '<div id="chart32" class="chart" width="100%"></div><script>';
1313 1396
 			$year_data = '';
1314 1397
 			$year_cnt = '';
@@ -1337,8 +1420,9 @@  discard block
 block discarded – undo
1337 1420
                 <h2><?php echo _("Fatalities last 12 Months"); ?></h2>
1338 1421
 <?php
1339 1422
 		$year_array = $Stats->countFatalitiesLast12Months();
1340
-		if (count($year_array) == 0) print _("No data available");
1341
-		else {
1423
+		if (count($year_array) == 0) {
1424
+			print _("No data available");
1425
+		} else {
1342 1426
 			print '<div id="chart33" class="chart" width="100%"></div><script>';
1343 1427
 			$year_data = '';
1344 1428
 			$year_cnt = '';
@@ -1409,8 +1493,11 @@  discard block
 block discarded – undo
1409 1493
 					$distance = $distance;
1410 1494
 					$unit = 'km';
1411 1495
 				}
1412
-				if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
1413
-				else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
1496
+				if (!isset($polar_data)) {
1497
+					$polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
1498
+				} else {
1499
+					$polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
1500
+				}
1414 1501
 			}
1415 1502
 ?>
1416 1503
             <div class="col-md-6">
@@ -1474,9 +1561,12 @@  discard block
 block discarded – undo
1474 1561
 		foreach ($msg as $eachmsg) {
1475 1562
 			//$eachmsg = $msg[0];
1476 1563
 			$data = $eachmsg['source_data'];
1477
-			if ($data > 500) $max = (round(($data+100)/100))*100;
1478
-			else $max = 500;
1479
-?>
1564
+			if ($data > 500) {
1565
+				$max = (round(($data+100)/100))*100;
1566
+			} else {
1567
+				$max = 500;
1568
+			}
1569
+			?>
1480 1570
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1481 1571
         	<script>
1482 1572
 		      var g = new JustGage({
Please login to merge, or discard this patch.
Spacing   +157 added lines, -157 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 }
24 24
 
25 25
 if (!isset($filter_name)) $filter_name = '';
26
-$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
26
+$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
27 27
 if ($type == 'aircraft' && $airline_icao == '' && isset($globalFilter)) {
28 28
 	if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0];
29 29
 }
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	$airline_info = $Spotter->getAllAirlineInfo($airline_icao);
33 33
 	if (isset($airline_info[0]['name'])) {
34 34
 		$airline_name = $airline_info[0]['name'];
35
-	} elseif (strpos($airline_icao,'alliance_') !== FALSE) {
35
+	} elseif (strpos($airline_icao, 'alliance_') !== FALSE) {
36 36
 		$alliance_name = $airline_icao;
37 37
 	}
38 38
 }
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	$title = _("Statistics");
43 43
 }
44 44
 
45
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
46
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
45
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
46
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
47 47
 
48 48
 require_once('header.php');
49 49
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	date_default_timezone_set('UTC');
75 75
 	$lastupdate = strtotime($last_update[0]['value']);
76 76
 	if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
77
-	print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
77
+	print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>';
78 78
 }
79 79
 
80 80
 ?>
@@ -86,31 +86,31 @@  discard block
 block discarded – undo
86 86
 <?php
87 87
 if ($type == 'aircraft') {
88 88
 ?>
89
-        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Flights"); ?></span>
90
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
91
-        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
92
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
89
+        <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Flights"); ?></span>
90
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
91
+        <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Arrivals seen"); ?></span>
92
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
93 93
 <?php
94 94
 	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
95 95
 ?>
96
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span>
97
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
96
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Pilots"); ?></span>
97
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
98 98
 <?php
99 99
 	}
100 100
 	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
101 101
 ?>
102
-    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span>
103
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
102
+    	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Owners"); ?></span>
103
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
104 104
 <?php
105 105
 	}
106 106
 ?>
107
-        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircraft types"); ?></span>
108
-        <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
107
+        <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name, $year, $month)); ?></span> <?php echo _("Aircraft types"); ?></span>
108
+        <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
109 109
 <?php
110 110
 	if ($airline_icao == '') {
111 111
 ?>
112
-        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span>
113
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
112
+        <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name, $year, $month)); ?></span> <?php echo _("Airlines"); ?></span>
113
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
114 114
 <?php
115 115
 	}
116 116
 ?>
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	if (!(isset($globalVA) && $globalVA) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS) && !(isset($globalVAM) && $globalVAM)) {
119 119
 		if ($airline_icao == '' || $airline_icao == 'all') {
120 120
 ?>
121
-        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name,$year,$month)); ?></span> <?php echo _("Military"); ?></span>
122
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
121
+        <span><span class="badge"><?php print number_format($Stats->countOverallMilitaryFlights($filter_name, $year, $month)); ?></span> <?php echo _("Military"); ?></span>
122
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
123 123
 <?php
124 124
 		}
125 125
 	}
@@ -127,35 +127,35 @@  discard block
 block discarded – undo
127 127
 <?php
128 128
 } elseif ($type == 'marine') {
129 129
 ?>
130
-	<span><span class="badge"><?php print number_format($Stats->countOverallMarine($filter_name,$year,$month)); ?></span> <?php echo _("Vessels"); ?></span>
131
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
130
+	<span><span class="badge"><?php print number_format($Stats->countOverallMarine($filter_name, $year, $month)); ?></span> <?php echo _("Vessels"); ?></span>
131
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
132 132
 <?php
133 133
 	if (isset($globalVM) && $globalVM) {
134 134
 ?>
135
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarineTypes($filter_name,$year,$month)); ?></span> <?php echo _("Types"); ?></span>
136
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
137
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarineRaces($filter_name,$year,$month)); ?></span> <?php echo _("Races"); ?></span>
138
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
139
-	<span><span class="badge"><?php print number_format($Marine->countOverallMarineCaptains($filter_name,$year,$month)); ?></span> <?php echo _("Captains"); ?></span>
140
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
135
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarineTypes($filter_name, $year, $month)); ?></span> <?php echo _("Types"); ?></span>
136
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
137
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarineRaces($filter_name, $year, $month)); ?></span> <?php echo _("Races"); ?></span>
138
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
139
+	<span><span class="badge"><?php print number_format($Marine->countOverallMarineCaptains($filter_name, $year, $month)); ?></span> <?php echo _("Captains"); ?></span>
140
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
141 141
 <?php
142 142
 	} else {
143 143
 ?>
144
-	<span><span class="badge"><?php print number_format($Stats->countOverallMarineTypes($filter_name,$year,$month)); ?></span> <?php echo _("Types"); ?></span>
145
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
144
+	<span><span class="badge"><?php print number_format($Stats->countOverallMarineTypes($filter_name, $year, $month)); ?></span> <?php echo _("Types"); ?></span>
145
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
146 146
 <?php
147 147
 	}
148 148
 } elseif ($type == 'tracker') {
149 149
 ?>
150
-	<span><span class="badge"><?php print number_format($Stats->countOverallTracker($filter_name,$year,$month)); ?></span> <?php echo _("Trackers"); ?></span>
151
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
152
-	<span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(),$year,$month)); ?></span> <?php echo _("Types"); ?></span>
153
-	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
150
+	<span><span class="badge"><?php print number_format($Stats->countOverallTracker($filter_name, $year, $month)); ?></span> <?php echo _("Trackers"); ?></span>
151
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
152
+	<span><span class="badge"><?php print number_format($Tracker->countOverallTrackerTypes(array(), $year, $month)); ?></span> <?php echo _("Types"); ?></span>
153
+	<!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
154 154
 <?php
155 155
 }
156 156
 ?>
157 157
     </p>
158
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
158
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
159 159
     <div class="specific-stats">
160 160
 <?php
161 161
 if ($type == 'aircraft') {
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
             <div class="col-md-6">
165 165
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
166 166
 <?php
167
-	$aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month);
167
+	$aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month);
168 168
 	if (count($aircraft_array) == 0) {
169 169
 		print _("No data available");
170 170
 	} else {
171 171
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
172 172
 		$aircraft_data = '';
173
-		foreach($aircraft_array as $aircraft_item) {
173
+		foreach ($aircraft_array as $aircraft_item) {
174 174
 			if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
175 175
 			else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
176 176
 		}
@@ -199,16 +199,16 @@  discard block
 block discarded – undo
199 199
 ?>
200 200
                 </div>
201 201
             </div>
202
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
202
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
203 203
 <?php
204 204
 	if ($airline_icao == '' || $airline_icao == 'all') {
205
-		$airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month);
205
+		$airline_array = $Stats->countAllAirlines(true, $filter_name, $year, $month);
206 206
 		if (count($airline_array) > 0) {
207 207
 			print '<div class="col-md-6">';
208 208
 			print '<h2>'._("Top 10 Most Common Airline").'</h2>';
209 209
 			print '<div id="chart2" class="chart" width="100%"></div><script>';
210 210
 			$airline_data = '';
211
-			foreach($airline_array as $airline_item) {
211
+			foreach ($airline_array as $airline_item) {
212 212
 				$airline_data .= '["'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
213 213
 			}
214 214
 			$airline_data = substr($airline_data, 0, -1);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		}
234 234
 ?>
235 235
         </div>
236
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
236
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
237 237
 <?php
238 238
 	}
239 239
 }
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
             <div class="col-md-6">
246 246
                 <h2><?php echo _("Top 10 Most Common Vessel Type"); ?></h2>
247 247
 <?php
248
-	$marine_array = $Stats->countAllMarineTypes(true,$filter_name,$year,$month);
248
+	$marine_array = $Stats->countAllMarineTypes(true, $filter_name, $year, $month);
249 249
 	if (count($marine_array) == 0) print _("No data available");
250 250
 	else {
251 251
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
252 252
 		$marine_data = '';
253
-		foreach($marine_array as $marine_item) {
253
+		foreach ($marine_array as $marine_item) {
254 254
 			$marine_data .= '["'.$marine_item['marine_type'].'",'.$marine_item['marine_type_count'].'],';
255 255
 		}
256 256
 		$marine_data = substr($marine_data, 0, -1);
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             	    ?>
280 280
                 </div>
281 281
             </div>
282
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
282
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
283 283
 <!--	</div>-->
284 284
 <?php
285 285
 	if (isset($globalVM) && $globalVM) {
@@ -287,12 +287,12 @@  discard block
 block discarded – undo
287 287
             <div class="col-md-6">
288 288
                 <h2><?php echo _("Top 10 Races Number of Participants"); ?></h2>
289 289
 <?php
290
-	$marine_array = $Marine->countAllCaptainsByRaces(true,$filter_name,$year,$month);
290
+	$marine_array = $Marine->countAllCaptainsByRaces(true, $filter_name, $year, $month);
291 291
 	if (count($marine_array) == 0) print _("No data available");
292 292
 	else {
293 293
 		print '<div id="chart991" class="chart" width="100%"></div><script>';
294 294
 		$marine_data = '';
295
-		foreach($marine_array as $marine_item) {
295
+		foreach ($marine_array as $marine_item) {
296 296
 			$marine_data .= '["'.$marine_item['marine_race_name'].'",'.$marine_item['marine_captain_count'].'],';
297 297
 		}
298 298
 		$marine_data = substr($marine_data, 0, -1);
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
             	    ?>
323 323
                 </div>
324 324
             </div>
325
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
325
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
326 326
 	</div>
327 327
         <div class="row column">
328 328
 
@@ -335,12 +335,12 @@  discard block
 block discarded – undo
335 335
             <div class="col-md-6">
336 336
                 <h2><?php echo _("Top 10 Most Common Tracker Type"); ?></h2>
337 337
 <?php
338
-	$tracker_array = $Tracker->countAllTrackerTypes(true,0,'',array(),$year,$month);
338
+	$tracker_array = $Tracker->countAllTrackerTypes(true, 0, '', array(), $year, $month);
339 339
 	if (count($tracker_array) == 0) print _("No data available");
340 340
 	else {
341 341
 		print '<div id="chart1" class="chart" width="100%"></div><script>';
342 342
 		$tracker_data = '';
343
-		foreach($tracker_array as $tracker_item) {
343
+		foreach ($tracker_array as $tracker_item) {
344 344
 			$tracker_data .= '["'.$tracker_item['tracker_type'].'",'.$tracker_item['tracker_type_count'].'],';
345 345
 		}
346 346
 		$tracker_data = substr($tracker_data, 0, -1);
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
             	    ?>
371 371
                 </div>
372 372
             </div>
373
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
373
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
374 374
 <!--	</div>-->
375 375
 <?php
376 376
 }
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 		else {
386 386
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
387 387
 			$owner_data = '';
388
-			foreach($owner_array as $owner_item) {
388
+			foreach ($owner_array as $owner_item) {
389 389
 				$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
390 390
 			}
391 391
 			$owner_data = substr($owner_data, 0, -1);
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
                 </div>
406 406
                 -->
407 407
             </div>
408
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
408
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
409 409
             <div class="col-md-6">
410 410
                 <h2><?php echo _("Top 10 Most Common Countries Owners"); ?></h2>
411 411
 <?php
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 		else {
415 415
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
416 416
 			$owner_data = '';
417
-			foreach($countries_array as $owner_item) {
417
+			foreach ($countries_array as $owner_item) {
418 418
 				$owner_data .= '["'.$owner_item['country_name'].'",'.$owner_item['country_count'].'],';
419 419
 			}
420 420
 			$owner_data = substr($owner_data, 0, -1);
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                 -->
436 436
             </div>
437 437
             
438
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
438
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
439 439
 ²	</div>
440 440
         <div class="row column">
441 441
             <div class="col-md-6">
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		else {
447 447
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
448 448
 			$launch_site_data = '';
449
-			foreach($launch_site_array as $launch_site_item) {
449
+			foreach ($launch_site_array as $launch_site_item) {
450 450
 				$launch_site_data .= '["'.$launch_site_item['launch_site'].'",'.$launch_site_item['launch_site_count'].'],';
451 451
 			}
452 452
 			$launch_site_data = substr($launch_site_data, 0, -1);
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 ?>
474 474
         <div class="row column">
475 475
 <?php
476
-	$flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month);
476
+	$flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name, $year, $month);
477 477
 	//if ((isset($globalVA) && $globalVA) ||(isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
478 478
 	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
479 479
 		if (empty($flightover_array)) {
@@ -484,12 +484,12 @@  discard block
 block discarded – undo
484 484
 ?>
485 485
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
486 486
 <?php
487
-		$pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month);
487
+		$pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name, $year, $month);
488 488
 		if (count($pilot_array) == 0) print _("No data available");
489 489
 		else {
490 490
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
491 491
 			$pilot_data = '';
492
-			foreach($pilot_array as $pilot_item) {
492
+			foreach ($pilot_array as $pilot_item) {
493 493
 				$pilot_data .= '["'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
494 494
 			}
495 495
 			$pilot_data = substr($pilot_data, 0, -1);
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 ?>
511 511
             </div>
512 512
 
513
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
513
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
514 514
 <?php
515 515
 	}
516 516
 	// else {
@@ -519,12 +519,12 @@  discard block
 block discarded – undo
519 519
             <div class="col-md-6">
520 520
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
521 521
 <?php
522
-		$owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month);
522
+		$owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name, $year, $month);
523 523
 		if (count($owner_array) == 0) print _("No data available");
524 524
 		else {
525 525
 			print '<div id="chart7" class="chart" width="100%"></div><script>';
526 526
 			$owner_data = '';
527
-			foreach($owner_array as $owner_item) {
527
+			foreach ($owner_array as $owner_item) {
528 528
 				$owner_data .= '["'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
529 529
 			}
530 530
 			$owner_data = substr($owner_data, 0, -1);
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
                 </div>
544 544
             </div>
545 545
         
546
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
546
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
547 547
 <?php
548 548
 	}
549 549
 	if (!empty($flightover_array)) {
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 			print '<div id="chart10" class="chart" width="100%"></div><script>';
558 558
 			print 'var series = [';
559 559
 			$flightover_data = '';
560
-			foreach($flightover_array as $flightover_item) {
560
+			foreach ($flightover_array as $flightover_item) {
561 561
 				$flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],';
562 562
 			}
563 563
 			$flightover_data = substr($flightover_data, 0, -1);
@@ -602,12 +602,12 @@  discard block
 block discarded – undo
602 602
 	}
603 603
 ?>
604 604
         </div>
605
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
605
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
606 606
         </div>
607 607
 <?php
608 608
 }
609 609
 if ($type == 'marine') {
610
-	$flightover_array = $Stats->countAllMarineOverCountries(true,$filter_name,$year,$month);
610
+	$flightover_array = $Stats->countAllMarineOverCountries(true, $filter_name, $year, $month);
611 611
 ?>
612 612
 <!--    <div class="row column">-->
613 613
 	<div class="col-md-6">
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 		print '<div id="chart10" class="chart" width="100%"></div><script>';
619 619
 		print 'var series = [';
620 620
 		$flightover_data = '';
621
-		foreach($flightover_array as $flightover_item) {
621
+		foreach ($flightover_array as $flightover_item) {
622 622
 			$flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],';
623 623
 		}
624 624
 		$flightover_data = substr($flightover_data, 0, -1);
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
                 <div class="more">
659 659
                     <a href="<?php print $globalURL; ?>/marine/statistics/country" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
660 660
                 </div>
661
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
661
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
662 662
             </div>
663 663
         </div>
664 664
 
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 		print '<div id="chart10" class="chart" width="100%"></div><script>';
677 677
 		print 'var series = [';
678 678
 		$flightover_data = '';
679
-		foreach($flightover_array as $flightover_item) {
679
+		foreach ($flightover_array as $flightover_item) {
680 680
 			$flightover_data .= '[ "'.$flightover_item['tracker_country_iso3'].'",'.$flightover_item['tracker_count'].'],';
681 681
 		}
682 682
 		$flightover_data = substr($flightover_data, 0, -1);
@@ -726,14 +726,14 @@  discard block
 block discarded – undo
726 726
         <div class="row column">
727 727
             <div class="col-md-6">
728 728
 <?php
729
-	$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month);
729
+	$airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name, $year, $month);
730 730
 	if (count($airport_airport_array) > 0) {
731 731
 		print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>';
732 732
 		print '<div id="chart3" class="chart" width="100%"></div><script>';
733 733
 		print "\n";
734 734
 		print 'var series = [';
735 735
 		$airport_data = '';
736
-		foreach($airport_airport_array as $airport_item) {
736
+		foreach ($airport_airport_array as $airport_item) {
737 737
 			$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
738 738
 		}
739 739
 		$airport_data = substr($airport_data, 0, -1);
@@ -783,18 +783,18 @@  discard block
 block discarded – undo
783 783
 	}
784 784
 ?>
785 785
             </div>
786
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
786
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
787 787
 
788 788
             <div class="col-md-6">
789 789
 <?php
790
-	$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month);
790
+	$airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name, $year, $month);
791 791
 	if (count($airport_airport_array2) > 0) {
792 792
 		print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>';
793 793
 		print '<div id="chart4" class="chart" width="100%"></div><script>';
794 794
 		print "\n";
795 795
 		print 'var series = [';
796 796
 		$airport_data = '';
797
-		foreach($airport_airport_array2 as $airport_item)
797
+		foreach ($airport_airport_array2 as $airport_item)
798 798
 		{
799 799
 			if (isset($airport_item['airport_arrival_longitude']) && isset($airport_item['airport_arrival_latitude'])) {
800 800
 				$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 ?>
849 849
             </div>
850 850
         </div>
851
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
851
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
852 852
 <?php 
853 853
 }
854 854
 if ($type == 'aircraft') {
@@ -860,18 +860,18 @@  discard block
 block discarded – undo
860 860
             <div class="col-md-6">
861 861
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
862 862
 <?php
863
-		$year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
863
+		$year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name);
864 864
 		if (count($year_array) == 0) print _("No data available");
865 865
 		else {
866 866
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
867 867
 			$year_data = '';
868 868
 			$year_cnt = '';
869
-			foreach($year_array as $year_item) {
869
+			foreach ($year_array as $year_item) {
870 870
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
871 871
 				$year_cnt .= $year_item['date_count'].',';
872 872
 			}
873 873
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
874
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
874
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
875 875
 			print 'c3.generate({
876 876
 			    bindto: "#chart8",
877 877
 			    data: { x: "x",
@@ -884,22 +884,22 @@  discard block
 block discarded – undo
884 884
                     <a href="<?php print $globalURL; ?>/statistics/year<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
885 885
                 </div>
886 886
             </div>
887
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
887
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
888 888
             <div class="col-md-6">
889 889
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
890 890
 <?php
891
-		$month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
891
+		$month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name);
892 892
 		if (count($month_array) == 0) print _("No data available");
893 893
 		else {
894 894
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
895 895
 			$month_data = '';
896 896
 			$month_cnt = '';
897
-			foreach($month_array as $month_item) {
897
+			foreach ($month_array as $month_item) {
898 898
 				$month_data .= '"'.$month_item['date_name'].'",';
899 899
 				$month_cnt .= $month_item['date_count'].',';
900 900
 			}
901 901
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
902
-			$month_cnt = "['flights',".substr($month_cnt,0,-1)."]";
902
+			$month_cnt = "['flights',".substr($month_cnt, 0, -1)."]";
903 903
 			print 'c3.generate({
904 904
 			    bindto: "#chart9",
905 905
 			    data: { x: "x",
@@ -912,23 +912,23 @@  discard block
 block discarded – undo
912 912
                     <a href="<?php print $globalURL; ?>/statistics/month<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
913 913
                 </div>
914 914
             </div>
915
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
915
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
916 916
 
917 917
             <div class="col-md-6">
918 918
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
919 919
 <?php
920
-		$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
920
+		$date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name);
921 921
 		if (empty($date_array)) print _("No data available");
922 922
 		else {
923 923
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
924 924
 			$date_data = '';
925 925
 			$date_cnt = '';
926
-			foreach($date_array as $date_item) {
926
+			foreach ($date_array as $date_item) {
927 927
 				$date_data .= '"'.$date_item['date_name'].'",';
928 928
 				$date_cnt .= $date_item['date_count'].',';
929 929
 			}
930 930
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
931
-			$date_cnt = "['flights',".substr($date_cnt,0,-1)."]";
931
+			$date_cnt = "['flights',".substr($date_cnt, 0, -1)."]";
932 932
 			print 'c3.generate({
933 933
 			    bindto: "#chart5",
934 934
 			    data: { x: "x",
@@ -941,22 +941,22 @@  discard block
 block discarded – undo
941 941
                     <a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
942 942
                 </div>
943 943
             </div>
944
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
944
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
945 945
             <div class="col-md-6">
946 946
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
947 947
 <?php
948
-		$hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
948
+		$hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name);
949 949
 		if (empty($hour_array)) print _("No data available");
950 950
 		else {
951 951
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
952 952
 			$hour_data = '';
953 953
 			$hour_cnt = '';
954
-			foreach($hour_array as $hour_item) {
954
+			foreach ($hour_array as $hour_item) {
955 955
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
956 956
 				$hour_cnt .= $hour_item['hour_count'].',';
957 957
 			}
958 958
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
959
-			$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
959
+			$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
960 960
 			print 'c3.generate({
961 961
 			    bindto: "#chart6",
962 962
 			    data: {
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
                     <a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
970 970
                 </div>
971 971
             </div>
972
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
972
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
973 973
         </div>
974 974
 <?php
975 975
 	}
@@ -985,18 +985,18 @@  discard block
 block discarded – undo
985 985
             <div class="col-md-6">
986 986
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
987 987
 <?php
988
-		$year_array = $Stats->countAllMarineMonthsLastYear(true,$filter_name);
988
+		$year_array = $Stats->countAllMarineMonthsLastYear(true, $filter_name);
989 989
 		if (count($year_array) == 0) print _("No data available");
990 990
 		else {
991 991
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
992 992
 			$year_data = '';
993 993
 			$year_cnt = '';
994
-			foreach($year_array as $year_item) {
994
+			foreach ($year_array as $year_item) {
995 995
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
996 996
 				$year_cnt .= $year_item['date_count'].',';
997 997
 			}
998 998
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
999
-			$year_cnt = "['vessels',".substr($year_cnt,0,-1)."]";
999
+			$year_cnt = "['vessels',".substr($year_cnt, 0, -1)."]";
1000 1000
 			print 'c3.generate({
1001 1001
 			    bindto: "#chart8",
1002 1002
 			    data: { x: "x",
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
                 </div>
1011 1011
             </div>
1012 1012
             
1013
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1013
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1014 1014
             <div class="col-md-6">
1015 1015
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
1016 1016
 <?php
@@ -1020,12 +1020,12 @@  discard block
 block discarded – undo
1020 1020
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
1021 1021
 			$month_data = '';
1022 1022
 			$month_cnt = '';
1023
-			foreach($month_array as $month_item) {
1023
+			foreach ($month_array as $month_item) {
1024 1024
 				$month_data .= '"'.$month_item['date_name'].'",';
1025 1025
 				$month_cnt .= $month_item['date_count'].',';
1026 1026
 			}
1027 1027
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
1028
-			$month_cnt = "['vessels',".substr($month_cnt,0,-1)."]";
1028
+			$month_cnt = "['vessels',".substr($month_cnt, 0, -1)."]";
1029 1029
 			print 'c3.generate({
1030 1030
 			    bindto: "#chart9",
1031 1031
 			    data: { x: "x",
@@ -1038,7 +1038,7 @@  discard block
 block discarded – undo
1038 1038
                     <a href="<?php print $globalURL; ?>/marine/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1039 1039
                 </div>
1040 1040
             </div>
1041
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1041
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1042 1042
 
1043 1043
             <div class="col-md-6">
1044 1044
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
@@ -1049,12 +1049,12 @@  discard block
 block discarded – undo
1049 1049
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
1050 1050
 			$date_data = '';
1051 1051
 			$date_cnt = '';
1052
-			foreach($date_array as $date_item) {
1052
+			foreach ($date_array as $date_item) {
1053 1053
 				$date_data .= '"'.$date_item['date_name'].'",';
1054 1054
 				$date_cnt .= $date_item['date_count'].',';
1055 1055
 			}
1056 1056
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
1057
-			$date_cnt = "['vessels',".substr($date_cnt,0,-1)."]";
1057
+			$date_cnt = "['vessels',".substr($date_cnt, 0, -1)."]";
1058 1058
 			print 'c3.generate({
1059 1059
 			    bindto: "#chart5",
1060 1060
 			    data: { x: "x",
@@ -1067,22 +1067,22 @@  discard block
 block discarded – undo
1067 1067
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1068 1068
                 </div>
1069 1069
             </div>
1070
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1070
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1071 1071
             <div class="col-md-6">
1072 1072
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1073 1073
 <?php
1074
-		$hour_array = $Stats->countAllMarineHours('hour',true,$filter_name);
1074
+		$hour_array = $Stats->countAllMarineHours('hour', true, $filter_name);
1075 1075
 		if (empty($hour_array)) print _("No data available");
1076 1076
 		else {
1077 1077
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
1078 1078
 			$hour_data = '';
1079 1079
 			$hour_cnt = '';
1080
-			foreach($hour_array as $hour_item) {
1080
+			foreach ($hour_array as $hour_item) {
1081 1081
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
1082 1082
 				$hour_cnt .= $hour_item['hour_count'].',';
1083 1083
 			}
1084 1084
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
1085
-			$hour_cnt = "['vessels',".substr($hour_cnt,0,-1)."]";
1085
+			$hour_cnt = "['vessels',".substr($hour_cnt, 0, -1)."]";
1086 1086
 			print 'c3.generate({
1087 1087
 			    bindto: "#chart6",
1088 1088
 			    data: {
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
                     <a href="<?php print $globalURL; ?>/marine/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1096 1096
                 </div>
1097 1097
             </div>
1098
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1098
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1099 1099
         </div>
1100 1100
 <?php
1101 1101
 	}
@@ -1117,12 +1117,12 @@  discard block
 block discarded – undo
1117 1117
 			print '<div id="chart8" class="chart" width="100%"></div><script>';
1118 1118
 			$year_data = '';
1119 1119
 			$year_cnt = '';
1120
-			foreach($year_array as $year_item) {
1120
+			foreach ($year_array as $year_item) {
1121 1121
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
1122 1122
 				$year_cnt .= $year_item['date_count'].',';
1123 1123
 			}
1124 1124
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1125
-			$year_cnt = "['trackers',".substr($year_cnt,0,-1)."]";
1125
+			$year_cnt = "['trackers',".substr($year_cnt, 0, -1)."]";
1126 1126
 			print 'c3.generate({
1127 1127
 			    bindto: "#chart8",
1128 1128
 			    data: { x: "x",
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
                 </div>
1137 1137
             </div>
1138 1138
             
1139
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1139
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1140 1140
             <div class="col-md-6">
1141 1141
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
1142 1142
 <?php
@@ -1146,12 +1146,12 @@  discard block
 block discarded – undo
1146 1146
 			print '<div id="chart9" class="chart" width="100%"></div><script>';
1147 1147
 			$month_data = '';
1148 1148
 			$month_cnt = '';
1149
-			foreach($month_array as $month_item) {
1149
+			foreach ($month_array as $month_item) {
1150 1150
 				$month_data .= '"'.$month_item['date_name'].'",';
1151 1151
 				$month_cnt .= $month_item['date_count'].',';
1152 1152
 			}
1153 1153
 			$month_data = "['x',".substr($month_data, 0, -1)."]";
1154
-			$month_cnt = "['trackers',".substr($month_cnt,0,-1)."]";
1154
+			$month_cnt = "['trackers',".substr($month_cnt, 0, -1)."]";
1155 1155
 			print 'c3.generate({
1156 1156
 			    bindto: "#chart9",
1157 1157
 			    data: { x: "x",
@@ -1164,7 +1164,7 @@  discard block
 block discarded – undo
1164 1164
                     <a href="<?php print $globalURL; ?>/tracker/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1165 1165
                 </div>
1166 1166
             </div>
1167
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1167
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1168 1168
 
1169 1169
             <div class="col-md-6">
1170 1170
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
@@ -1175,12 +1175,12 @@  discard block
 block discarded – undo
1175 1175
 			print '<div id="chart5" class="chart" width="100%"></div><script>';
1176 1176
 			$date_data = '';
1177 1177
 			$date_cnt = '';
1178
-			foreach($date_array as $date_item) {
1178
+			foreach ($date_array as $date_item) {
1179 1179
 				$date_data .= '"'.$date_item['date_name'].'",';
1180 1180
 				$date_cnt .= $date_item['date_count'].',';
1181 1181
 			}
1182 1182
 			$date_data = "['x',".substr($date_data, 0, -1)."]";
1183
-			$date_cnt = "['trackers',".substr($date_cnt,0,-1)."]";
1183
+			$date_cnt = "['trackers',".substr($date_cnt, 0, -1)."]";
1184 1184
 			print 'c3.generate({
1185 1185
 			    bindto: "#chart5",
1186 1186
 			    data: { x: "x",
@@ -1193,22 +1193,22 @@  discard block
 block discarded – undo
1193 1193
                     <a href="<?php print $globalURL; ?>/marine/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1194 1194
                 </div>
1195 1195
             </div>
1196
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1196
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1197 1197
             <div class="col-md-6">
1198 1198
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
1199 1199
 <?php
1200
-		$hour_array = $Stats->countAllTrackerHours('hour',true);
1200
+		$hour_array = $Stats->countAllTrackerHours('hour', true);
1201 1201
 		if (empty($hour_array)) print _("No data available");
1202 1202
 		else {
1203 1203
 			print '<div id="chart6" class="chart" width="100%"></div><script>';
1204 1204
 			$hour_data = '';
1205 1205
 			$hour_cnt = '';
1206
-			foreach($hour_array as $hour_item) {
1206
+			foreach ($hour_array as $hour_item) {
1207 1207
 				$hour_data .= '"'.$hour_item['hour_name'].':00",';
1208 1208
 				$hour_cnt .= $hour_item['hour_count'].',';
1209 1209
 			}
1210 1210
 			$hour_data = "[".substr($hour_data, 0, -1)."]";
1211
-			$hour_cnt = "['trackers',".substr($hour_cnt,0,-1)."]";
1211
+			$hour_cnt = "['trackers',".substr($hour_cnt, 0, -1)."]";
1212 1212
 			print 'c3.generate({
1213 1213
 			    bindto: "#chart6",
1214 1214
 			    data: {
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
                     <a href="<?php print $globalURL; ?>/tracker/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1222 1222
                 </div>
1223 1223
             </div>
1224
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1224
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1225 1225
         </div>
1226 1226
 <?php
1227 1227
 	}
@@ -1243,12 +1243,12 @@  discard block
 block discarded – undo
1243 1243
 			print '<div id="chart21" class="chart" width="100%"></div><script>';
1244 1244
 			$year_data = '';
1245 1245
 			$year_cnt = '';
1246
-			foreach($year_array as $year_item) {
1246
+			foreach ($year_array as $year_item) {
1247 1247
 				$year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",';
1248 1248
 				$year_cnt .= $year_item['date_count'].',';
1249 1249
 			}
1250 1250
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1251
-			$year_cnt = "['satellite',".substr($year_cnt,0,-1)."]";
1251
+			$year_cnt = "['satellite',".substr($year_cnt, 0, -1)."]";
1252 1252
 			print 'c3.generate({
1253 1253
 			    bindto: "#chart21",
1254 1254
 			    data: { x: "x",
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
             -->
1265 1265
             </div>
1266 1266
             
1267
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1267
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1268 1268
             <div class="col-md-6">
1269 1269
                 <h2><?php echo _("Busiest Launch Years of the last 10 Years"); ?></h2>
1270 1270
 <?php
@@ -1274,12 +1274,12 @@  discard block
 block discarded – undo
1274 1274
 			print '<div id="chart22" class="chart" width="100%"></div><script>';
1275 1275
 			$year_data = '';
1276 1276
 			$year_cnt = '';
1277
-			foreach($year_array as $year_item) {
1277
+			foreach ($year_array as $year_item) {
1278 1278
 				$year_data .= '"'.$year_item['year_name'].'-01-01'.'",';
1279 1279
 				$year_cnt .= $year_item['date_count'].',';
1280 1280
 			}
1281 1281
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1282
-			$year_cnt = "['satellite',".substr($year_cnt,0,-1)."]";
1282
+			$year_cnt = "['satellite',".substr($year_cnt, 0, -1)."]";
1283 1283
 			print 'c3.generate({
1284 1284
 			    bindto: "#chart22",
1285 1285
 			    data: { x: "x",
@@ -1295,7 +1295,7 @@  discard block
 block discarded – undo
1295 1295
             -->
1296 1296
             </div>
1297 1297
             
1298
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1298
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1299 1299
         </div>
1300 1300
 <?php
1301 1301
 	}
@@ -1317,12 +1317,12 @@  discard block
 block discarded – undo
1317 1317
 			print '<div id="chart32" class="chart" width="100%"></div><script>';
1318 1318
 			$year_data = '';
1319 1319
 			$year_cnt = '';
1320
-			foreach($year_array as $year_item) {
1320
+			foreach ($year_array as $year_item) {
1321 1321
 				$year_data .= '"'.$year_item['year'].'-01-01",';
1322 1322
 				$year_cnt .= $year_item['count'].',';
1323 1323
 			}
1324 1324
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1325
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1325
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1326 1326
 			print 'c3.generate({
1327 1327
 			    bindto: "#chart32",
1328 1328
 			    data: { x: "x",
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1336 1336
                 </div>
1337 1337
             </div>
1338
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1338
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1339 1339
 
1340 1340
         <div class="row column">
1341 1341
             <div class="col-md-6">
@@ -1347,12 +1347,12 @@  discard block
 block discarded – undo
1347 1347
 			print '<div id="chart33" class="chart" width="100%"></div><script>';
1348 1348
 			$year_data = '';
1349 1349
 			$year_cnt = '';
1350
-			foreach($year_array as $year_item) {
1350
+			foreach ($year_array as $year_item) {
1351 1351
 				$year_data .= '"'.$year_item['year'].'-'.$year_item['month'].'-01",';
1352 1352
 				$year_cnt .= $year_item['count'].',';
1353 1353
 			}
1354 1354
 			$year_data = "['x',".substr($year_data, 0, -1)."]";
1355
-			$year_cnt = "['flights',".substr($year_cnt,0,-1)."]";
1355
+			$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]";
1356 1356
 			print 'c3.generate({
1357 1357
 			    bindto: "#chart33",
1358 1358
 			    data: { x: "x",
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
                     <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
1366 1366
                 </div>
1367 1367
             </div>
1368
-    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1368
+    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1369 1369
 <br/>
1370 1370
 <?php
1371 1371
 	}
@@ -1379,19 +1379,19 @@  discard block
 block discarded – undo
1379 1379
 	//$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
1380 1380
 	if ($year == '' && $month == '') {
1381 1381
 		if ($type == 'aircraft') {
1382
-			$polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d'));
1382
+			$polar = $Stats->getStatsSource('polar', date('Y'), date('m'), date('d'));
1383 1383
 		} elseif ($type == 'marine') {
1384
-			$polar = $Stats->getStatsSource('polar_marine',date('Y'),date('m'),date('d'));
1384
+			$polar = $Stats->getStatsSource('polar_marine', date('Y'), date('m'), date('d'));
1385 1385
 		} elseif ($type == 'tracker') {
1386
-			$polar = $Stats->getStatsSource('polar_tracker',date('Y'),date('m'),date('d'));
1386
+			$polar = $Stats->getStatsSource('polar_tracker', date('Y'), date('m'), date('d'));
1387 1387
 		}
1388 1388
 	} else {
1389 1389
 		if ($type == 'aircraft') {
1390
-			$polar = $Stats->getStatsSource('polar',$year,$month);
1390
+			$polar = $Stats->getStatsSource('polar', $year, $month);
1391 1391
 		} elseif ($type == 'marine') {
1392
-			$polar = $Stats->getStatsSource('polar_marine',$year,$month);
1392
+			$polar = $Stats->getStatsSource('polar_marine', $year, $month);
1393 1393
 		} elseif ($type == 'tracker') {
1394
-			$polar = $Stats->getStatsSource('polar_tracker',$year,$month);
1394
+			$polar = $Stats->getStatsSource('polar_tracker', $year, $month);
1395 1395
 		}
1396 1396
 	}
1397 1397
 	if (!empty($polar)) {
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
 			unset($polar_data);
1401 1401
 			$Spotter = new Spotter();
1402 1402
 			$data = json_decode($eachpolar['source_data']);
1403
-			foreach($data as $value => $key) {
1403
+			foreach ($data as $value => $key) {
1404 1404
 				$direction = $Spotter->parseDirection(($value*22.5));
1405 1405
 				$distance = $key;
1406 1406
 				$unit = 'km';
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
 ?>
1421 1421
             <div class="col-md-6">
1422 1422
                 <h4><?php print $eachpolar['source_name']; ?></h4>
1423
-        	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1423
+        	<div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
1424 1424
         	<script>
1425 1425
         	    (function() {
1426 1426
         	    var margin = {top: 100, right: 100, bottom: 100, left: 100},
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
 		      color: color,
1445 1445
 		      unit: '<?php echo $unit; ?>'
1446 1446
 		    };
1447
-		    RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1447
+		    RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions);
1448 1448
 		    })();
1449 1449
 		</script>
1450 1450
             </div>
@@ -1459,19 +1459,19 @@  discard block
 block discarded – undo
1459 1459
 	//$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
1460 1460
 	if ($year == '' && $month == '') {
1461 1461
 		if ($type == 'aircraft') {
1462
-			$msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d'));
1462
+			$msg = $Stats->getStatsSource('msg', date('Y'), date('m'), date('d'));
1463 1463
 		} elseif ($type == 'marine') {
1464
-			$msg = $Stats->getStatsSource('msg_marine',date('Y'),date('m'),date('d'));
1464
+			$msg = $Stats->getStatsSource('msg_marine', date('Y'), date('m'), date('d'));
1465 1465
 		} elseif ($type == 'tracker') {
1466
-			$msg = $Stats->getStatsSource('msg_tracker',date('Y'),date('m'),date('d'));
1466
+			$msg = $Stats->getStatsSource('msg_tracker', date('Y'), date('m'), date('d'));
1467 1467
 		}
1468 1468
 	} else {
1469 1469
 		if ($type == 'aircraft') {
1470
-			$msg = $Stats->getStatsSource('msg',$year,$month);
1470
+			$msg = $Stats->getStatsSource('msg', $year, $month);
1471 1471
 		} elseif ($type == 'marine') {
1472
-			$msg = $Stats->getStatsSource('msg_marine',$year,$month);
1472
+			$msg = $Stats->getStatsSource('msg_marine', $year, $month);
1473 1473
 		} elseif ($type == 'tracker') {
1474
-			$msg = $Stats->getStatsSource('msg_tracker',$year,$month);
1474
+			$msg = $Stats->getStatsSource('msg_tracker', $year, $month);
1475 1475
 		}
1476 1476
 	}
1477 1477
 	if (!empty($msg)) {
@@ -1479,13 +1479,13 @@  discard block
 block discarded – undo
1479 1479
 		foreach ($msg as $eachmsg) {
1480 1480
 			//$eachmsg = $msg[0];
1481 1481
 			$data = $eachmsg['source_data'];
1482
-			if ($data > 500) $max = (round(($data+100)/100))*100;
1482
+			if ($data > 500) $max = (round(($data + 100)/100))*100;
1483 1483
 			else $max = 500;
1484 1484
 ?>
1485
-        	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1485
+        	<div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
1486 1486
         	<script>
1487 1487
 		      var g = new JustGage({
1488
-			    id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>",
1488
+			    id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>",
1489 1489
 			    value: <?php echo $data; ?>,
1490 1490
 			    min: 0,
1491 1491
 			    max: <?php print $max; ?>,
@@ -1507,19 +1507,19 @@  discard block
 block discarded – undo
1507 1507
 	//$hist = $Stats->getStatsSource(date('Y-m-d'),'hist');
1508 1508
 	if ($year == '' && $month == '') {
1509 1509
 		if ($type == 'aircraft') {
1510
-			$hist = $Stats->getStatsSource('hist',date('Y'),date('m'),date('d'));
1510
+			$hist = $Stats->getStatsSource('hist', date('Y'), date('m'), date('d'));
1511 1511
 		} elseif ($type == 'marine') {
1512
-			$hist = $Stats->getStatsSource('hist_marine',date('Y'),date('m'),date('d'));
1512
+			$hist = $Stats->getStatsSource('hist_marine', date('Y'), date('m'), date('d'));
1513 1513
 		} elseif ($type == 'tracker') {
1514
-			$hist = $Stats->getStatsSource('hist_tracker',date('Y'),date('m'),date('d'));
1514
+			$hist = $Stats->getStatsSource('hist_tracker', date('Y'), date('m'), date('d'));
1515 1515
 		}
1516 1516
 	} else {
1517 1517
 		if ($type == 'aircraft') {
1518
-			$hist = $Stats->getStatsSource('hist',$year,$month);
1518
+			$hist = $Stats->getStatsSource('hist', $year, $month);
1519 1519
 		} elseif ($type == 'marine') {
1520
-			$hist = $Stats->getStatsSource('hist_marine',$year,$month);
1520
+			$hist = $Stats->getStatsSource('hist_marine', $year, $month);
1521 1521
 		} elseif ($type == 'tracker') {
1522
-			$hist = $Stats->getStatsSource('hist_tracker',$year,$month);
1522
+			$hist = $Stats->getStatsSource('hist_tracker', $year, $month);
1523 1523
 		}
1524 1524
 	}
1525 1525
 	foreach ($hist as $hists) {
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 		$source = $hists['source_name'];
1530 1530
 		$hist_array = json_decode($hists['source_data']);
1531 1531
 		$unit = 'km';
1532
-		foreach($hist_array as $distance => $nb) {
1532
+		foreach ($hist_array as $distance => $nb) {
1533 1533
 			if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1534 1534
 				$distance = round($distance*0.539957);
1535 1535
 				$unit = 'nm';
@@ -1549,18 +1549,18 @@  discard block
 block discarded – undo
1549 1549
 		$nb_data = "['flights',".substr($nb_data, 0, -1)."]";
1550 1550
 ?>
1551 1551
             <div class="col-md-6">
1552
-                <h2><?php echo sprintf(_("Distance for %s"),$source); ?></h2>
1552
+                <h2><?php echo sprintf(_("Distance for %s"), $source); ?></h2>
1553 1553
 <?php
1554
-		print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div><script>';
1554
+		print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div><script>';
1555 1555
 		print 'c3.generate({
1556
-		    bindto: "#charthist-'.str_replace(' ','_',strtolower($source)).'",
1556
+		    bindto: "#charthist-'.str_replace(' ', '_', strtolower($source)).'",
1557 1557
 		    data: { x: "x",
1558 1558
 		    columns: ['.$distance_data.','.$nb_data.'], types: { flights: "area"}, colors: { flights: "#1a3151"}},
1559 1559
 		    axis: { x: {label : { text: "Distance in '.$unit.'", position: "outer-right"}}, y: { label: "# of Flights"}},legend: { show: false }});';
1560 1560
 		print '</script>';
1561 1561
 ?>
1562 1562
     	    </div>
1563
-	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
1563
+	    <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> -->
1564 1564
 <?php
1565 1565
 	}
1566 1566
 ?>
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -267,16 +267,16 @@  discard block
 block discarded – undo
267 267
                 <div class="more">
268 268
             	    <?php
269 269
             	    
270
-            		if ($year != '' && $month != '') {
271
-            	    ?>
270
+					if ($year != '' && $month != '') {
271
+					?>
272 272
             	    <a href="<?php print $globalURL; ?>/marine/statistics/type/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
273 273
             	    <?php
274
-            		} else {
275
-            	    ?>
274
+					} else {
275
+					?>
276 276
             	    <a href="<?php print $globalURL; ?>/marine/statistics/type" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
277 277
             	    <?php
278
-            		}
279
-            	    ?>
278
+					}
279
+					?>
280 280
                 </div>
281 281
             </div>
282 282
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -308,16 +308,16 @@  discard block
 block discarded – undo
308 308
 ?>
309 309
                 <div class="more">
310 310
             	    <?php
311
-            		if ($year != '' && $month != '') {
312
-            	    ?>
311
+					if ($year != '' && $month != '') {
312
+					?>
313 313
             	    <a href="<?php print $globalURL; ?>/marine/statistics/race/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
314 314
             	    <?php
315
-            		} else {
316
-            	    ?>
315
+					} else {
316
+					?>
317 317
             	    <a href="<?php print $globalURL; ?>/marine/statistics/race" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
318 318
             	    <?php
319
-            		}
320
-            	    ?>
319
+					}
320
+					?>
321 321
                 </div>
322 322
             </div>
323 323
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 ?>
355 355
                 <div class="more">
356 356
             	    <?php
357
-            	    /*
357
+					/*
358 358
             		if ($year != '' && $month != '') {
359 359
             	    ?>
360 360
             	    <a href="<?php print $globalURL; ?>/tracker/statistics/type/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             	    <?php
366 366
             		}
367 367
             		*/
368
-            	    ?>
368
+					?>
369 369
                 </div>
370 370
             </div>
371 371
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
Please login to merge, or discard this patch.
search.php 3 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -91,32 +91,32 @@
 block discarded – undo
91 91
 $limit_previous_2 = $limit_end - $absolute_difference;
92 92
 
93 93
 if (
94
-    (isset($_GET['q']) && $_GET['q'] != '') || 
95
-    (isset($_GET['registration']) && $_GET['registration'] != '') || 
96
-    (isset($_GET['aircraft']) && $_GET['aircraft'] != '') ||
97
-    (isset($_GET['manufacturer']) && $_GET['manufacturer'] != '') ||
98
-    (isset($_GET['highlights']) && $_GET['highlights'] != '') ||
99
-    (isset($_GET['airline']) && $_GET['airline'] != '') ||
100
-    (isset($_GET['airline_country']) && $_GET['airline_country'] != '') ||
101
-    (isset($_GET['airline_type']) && $_GET['airline_type'] != '') ||
102
-    (isset($_GET['airport']) && $_GET['airport'] != '') ||
103
-    (isset($_GET['airport_country']) && $_GET['airport_country'] != '') ||
104
-    (isset($_GET['callsign']) && $_GET['callsign'] != '') ||
105
-    (isset($_GET['captain_id']) && $_GET['captain_id'] != '') ||
106
-    (isset($_GET['race_id']) && $_GET['race_id'] != '') ||
107
-    (isset($_GET['captain_name']) && $_GET['captain_name'] != '') ||
108
-    (isset($_GET['race_name']) && $_GET['race_name'] != '') ||
109
-    (isset($_GET['owner']) && $_GET['owner'] != '') ||
110
-    (isset($_GET['pilot_name']) && $_GET['pilot_name'] != '') ||
111
-    (isset($_GET['pilot_id']) && $_GET['pilot_id'] != '') ||
112
-    (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != '') ||
113
-    (isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != '') ||
114
-    (isset($_GET['mmsi']) && $_GET['mmsi'] != '') ||
115
-    (isset($_GET['imo']) && $_GET['imo'] != '') ||
116
-    ((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
117
-    (isset($_GET['origlon']) && $_GET['origlon'] != '') &&
118
-    (isset($_GET['dist']) && $_GET['dist'] != ''))
119
-    ){  
94
+	(isset($_GET['q']) && $_GET['q'] != '') || 
95
+	(isset($_GET['registration']) && $_GET['registration'] != '') || 
96
+	(isset($_GET['aircraft']) && $_GET['aircraft'] != '') ||
97
+	(isset($_GET['manufacturer']) && $_GET['manufacturer'] != '') ||
98
+	(isset($_GET['highlights']) && $_GET['highlights'] != '') ||
99
+	(isset($_GET['airline']) && $_GET['airline'] != '') ||
100
+	(isset($_GET['airline_country']) && $_GET['airline_country'] != '') ||
101
+	(isset($_GET['airline_type']) && $_GET['airline_type'] != '') ||
102
+	(isset($_GET['airport']) && $_GET['airport'] != '') ||
103
+	(isset($_GET['airport_country']) && $_GET['airport_country'] != '') ||
104
+	(isset($_GET['callsign']) && $_GET['callsign'] != '') ||
105
+	(isset($_GET['captain_id']) && $_GET['captain_id'] != '') ||
106
+	(isset($_GET['race_id']) && $_GET['race_id'] != '') ||
107
+	(isset($_GET['captain_name']) && $_GET['captain_name'] != '') ||
108
+	(isset($_GET['race_name']) && $_GET['race_name'] != '') ||
109
+	(isset($_GET['owner']) && $_GET['owner'] != '') ||
110
+	(isset($_GET['pilot_name']) && $_GET['pilot_name'] != '') ||
111
+	(isset($_GET['pilot_id']) && $_GET['pilot_id'] != '') ||
112
+	(isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != '') ||
113
+	(isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != '') ||
114
+	(isset($_GET['mmsi']) && $_GET['mmsi'] != '') ||
115
+	(isset($_GET['imo']) && $_GET['imo'] != '') ||
116
+	((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
117
+	(isset($_GET['origlon']) && $_GET['origlon'] != '') &&
118
+	(isset($_GET['dist']) && $_GET['dist'] != ''))
119
+	){  
120 120
 	$q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING);
121 121
 	$registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING);
122 122
 	$aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -26,24 +26,24 @@  discard block
 block discarded – undo
26 26
 $sql_date = '';
27 27
 if (isset($_GET['start_date'])) {
28 28
 	//for the date manipulation into the query
29
-	if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
29
+	if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
30 30
 		if (strtotime($_GET['start_date']) !== false && strtotime($_GET['end_date']) !== false) {
31 31
 			//$start_date = $_GET['start_date']." 00:00:00";
32
-			$start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
32
+			$start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00";
33 33
 			//$end_date = $_GET['end_date']." 00:00:00";
34
-			$end_date = date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
34
+			$end_date = date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00";
35 35
 			$sql_date = $start_date.",".$end_date;
36 36
 		}
37
-	} else if($_GET['start_date'] != ""){
37
+	} else if ($_GET['start_date'] != "") {
38 38
 		if (strtotime($_GET['start_date']) !== false) {
39 39
 			//$start_date = $_GET['start_date']." 00:00:00";
40
-			$start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
40
+			$start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00";
41 41
 			$sql_date = $start_date;
42 42
 		}
43
-	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
43
+	} else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
44 44
 		if (strtotime($_GET['end_date']) !== false) {
45 45
 			//$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00";
46
-			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
46
+			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00";
47 47
 			$sql_date = $end_date;
48 48
 		}
49 49
 	} else $sql_date = '';
@@ -51,21 +51,21 @@  discard block
 block discarded – undo
51 51
 
52 52
 if (isset($_GET['highest_altitude'])) {
53 53
 	//for altitude manipulation
54
-	if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
55
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
56
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
54
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
55
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
56
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
57 57
 		$sql_altitude = $start_altitude.",".$end_altitude;
58
-	} else if($_GET['highest_altitude'] != ""){
59
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
58
+	} else if ($_GET['highest_altitude'] != "") {
59
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
60 60
 		$sql_altitude = $end_altitude;
61
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
62
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
61
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
62
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000";
63 63
 		$sql_altitude = $start_altitude;
64 64
 	} else $sql_altitude = '';
65 65
 } else $sql_altitude = '';
66 66
 
67 67
 //calculuation for the pagination
68
-if(!isset($_GET['limit']))
68
+if (!isset($_GET['limit']))
69 69
 {
70 70
 	if (!isset($_GET['number_results']))
71 71
 	{
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 		$limit_end = 25;
74 74
 		$absolute_difference = 25;
75 75
 	} else {
76
-		if ($_GET['number_results'] > 1000){
76
+		if ($_GET['number_results'] > 1000) {
77 77
 			$_GET['number_results'] = 1000;
78 78
 		}
79 79
 		$limit_start = 0;
80
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
81
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
80
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
81
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
82 82
 	}
83
-}  else {
83
+} else {
84 84
 	$limit_explode = explode(",", $_GET['limit']);
85
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
86
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
85
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
86
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
87 87
 }
88 88
 $absolute_difference = abs($limit_start - $limit_end);
89 89
 $limit_next = $limit_end + $absolute_difference;
@@ -116,35 +116,35 @@  discard block
 block discarded – undo
116 116
     ((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
117 117
     (isset($_GET['origlon']) && $_GET['origlon'] != '') &&
118 118
     (isset($_GET['dist']) && $_GET['dist'] != ''))
119
-    ){  
120
-	$q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING);
121
-	$registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING);
122
-	$aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING);
123
-	$manufacturer = filter_input(INPUT_GET, 'manufacturer',FILTER_SANITIZE_STRING);
124
-	$highlights = filter_input(INPUT_GET, 'highlights',FILTER_SANITIZE_STRING);
125
-	$airline = filter_input(INPUT_GET, 'airline',FILTER_SANITIZE_STRING);
126
-	$airline_country = filter_input(INPUT_GET, 'airline_country',FILTER_SANITIZE_STRING);
127
-	$airline_type = filter_input(INPUT_GET, 'airline_type',FILTER_SANITIZE_STRING);
128
-	$airport = filter_input(INPUT_GET, 'airport',FILTER_SANITIZE_STRING);
129
-	$airport_country = filter_input(INPUT_GET, 'airport_country',FILTER_SANITIZE_STRING);
130
-	$callsign = filter_input(INPUT_GET, 'callsign',FILTER_SANITIZE_STRING);
131
-	$owner = filter_input(INPUT_GET, 'owner',FILTER_SANITIZE_STRING);
132
-	$pilot_name = filter_input(INPUT_GET, 'pilot_name',FILTER_SANITIZE_STRING);
133
-	$pilot_id = filter_input(INPUT_GET, 'pilot_id',FILTER_SANITIZE_STRING);
134
-	$mmsi = filter_input(INPUT_GET, 'mmsi',FILTER_SANITIZE_NUMBER_INT);
135
-	$imo = filter_input(INPUT_GET, 'imo',FILTER_SANITIZE_NUMBER_INT);
136
-	$captain_id  = filter_input(INPUT_GET, 'captain_id',FILTER_SANITIZE_NUMBER_INT);
137
-	$race_id  = filter_input(INPUT_GET, 'race_id',FILTER_SANITIZE_NUMBER_INT);
138
-	$captain_name  = filter_input(INPUT_GET, 'captain_name',FILTER_SANITIZE_STRING);
139
-	$race_name  = filter_input(INPUT_GET, 'race_name',FILTER_SANITIZE_STRING);
140
-	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route',FILTER_SANITIZE_STRING);
141
-	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route',FILTER_SANITIZE_STRING);
142
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
143
-	$archive = filter_input(INPUT_GET,'archive',FILTER_SANITIZE_NUMBER_INT);
144
-	$origlat = filter_input(INPUT_GET,'origlat',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
145
-	$origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
146
-	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
147
-	$number_results = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
119
+    ) {  
120
+	$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
121
+	$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
122
+	$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
123
+	$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
124
+	$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
125
+	$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
126
+	$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
127
+	$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
128
+	$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
129
+	$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
130
+	$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
131
+	$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
132
+	$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
133
+	$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
134
+	$mmsi = filter_input(INPUT_GET, 'mmsi', FILTER_SANITIZE_NUMBER_INT);
135
+	$imo = filter_input(INPUT_GET, 'imo', FILTER_SANITIZE_NUMBER_INT);
136
+	$captain_id = filter_input(INPUT_GET, 'captain_id', FILTER_SANITIZE_NUMBER_INT);
137
+	$race_id = filter_input(INPUT_GET, 'race_id', FILTER_SANITIZE_NUMBER_INT);
138
+	$captain_name = filter_input(INPUT_GET, 'captain_name', FILTER_SANITIZE_STRING);
139
+	$race_name = filter_input(INPUT_GET, 'race_name', FILTER_SANITIZE_STRING);
140
+	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
141
+	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
142
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
143
+	$archive = filter_input(INPUT_GET, 'archive', FILTER_SANITIZE_NUMBER_INT);
144
+	$origlat = filter_input(INPUT_GET, 'origlat', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
145
+	$origlon = filter_input(INPUT_GET, 'origlon', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
146
+	$dist = filter_input(INPUT_GET, 'dist', FILTER_SANITIZE_NUMBER_INT);
147
+	$number_results = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
148 148
 	if ($dist != '') {
149 149
 		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
150 150
 		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 	if ($archive == 1) {
154 154
 		if ($type == 'aircraft') {
155 155
 			$SpotterArchive = new SpotterArchive();
156
-			$spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
156
+			$spotter_array = $SpotterArchive->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
157 157
 		}
158 158
 	} else {
159 159
 		if ($type == 'aircraft') {
160
-			$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
160
+			$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
161 161
 		} elseif ($type == 'tracker') {
162
-			$spotter_array = $Tracker->searchTrackerData($q,$callsign,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
162
+			$spotter_array = $Tracker->searchTrackerData($q, $callsign, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
163 163
 		} elseif ($type == 'marine') {
164
-			$spotter_array = $Marine->searchMarineData($q,$callsign,$mmsi,$imo,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist,$captain_id,$captain_name,$race_id,$race_name);
164
+			$spotter_array = $Marine->searchMarineData($q, $callsign, $mmsi, $imo, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist, $captain_id, $captain_name, $race_id, $race_name);
165 165
 		}
166 166
 	}
167 167
 	 
@@ -197,12 +197,12 @@  discard block
 block discarded – undo
197 197
 	//remove 3D=true parameter
198 198
 	$no3D = str_replace("&3D=true", "", $_SERVER['QUERY_STRING']);
199 199
 	$kmlURL = str_replace("http://", "kml://", $globalURL);
200
-	if (!isset($_GET['3D'])){
200
+	if (!isset($_GET['3D'])) {
201 201
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'" class="active"><i class="fa fa-table"></i> '._("Table").'</a></li>';
202 202
 	} else {
203 203
 		print '<li><span class="notablet"><a href="'.$globalURL.'/search?'.$no3D.'"><i class="fa fa-table"></i> '._("Table").'</a></span></li>';
204 204
 	}
205
-	if (isset($_GET['3D'])){
205
+	if (isset($_GET['3D'])) {
206 206
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="active"><i class="fa fa-globe"></i> '._("3D Map").'</a></li>';
207 207
 	} else {
208 208
 		print '<li ><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="notablet nomobile"><i class="fa fa-globe"></i> '._("3D Map").'</a><a href="'.$kmlURL.'/search/kml?'.htmlentities($_SERVER['QUERY_STRING']).'" class="tablet mobile"><i class="fa fa-globe"></i> 3D Map</a></li>';
@@ -223,36 +223,36 @@  discard block
 block discarded – undo
223 223
 		print '<div class="column">';
224 224
 		print '<div class="info">';
225 225
 		print '<h1>'._("Search Results for").' ';
226
-		if (isset($_GET['q']) && $_GET['q'] != ""){ print _("Keyword:").' <span>'.$q.'</span> '; }
227
-		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
228
-		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
229
-		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
230
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
231
-		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
232
-		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
233
-		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
234
-		if (isset($_GET['airport']) && $_GET['airport'] != ""){ print _("Airport:").' <span>'.$airport.'</span> '; }
235
-		if (isset($_GET['airport_country']) && $_GET['airport_country'] != ""){ print _("Airport country:").' <span>'.$airport_country.'</span> '; }
236
-		if (isset($_GET['callsign']) && $_GET['callsign'] != ""){ print _("Callsign:").' <span>'.$callsign.'</span> '; }
237
-		if (isset($_GET['owner']) && $_GET['owner'] != ""){ print _("Owner:").' <span>'.$owner.'</span> '; }
238
-		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != ""){ print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
239
-		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != ""){ print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
240
-		if (isset($_GET['captain_id']) && $_GET['captain_id'] != ""){ print _("Captain id:").' <span>'.$captain_id.'</span> '; }
241
-		if (isset($_GET['captain_name']) && $_GET['captain_name'] != ""){ print _("Captain name:").' <span>'.$captain_name.'</span> '; }
242
-		if (isset($_GET['race_id']) && $_GET['race_id'] != ""){ print _("Race id:").' <span>'.$race_id.'</span> '; }
243
-		if (isset($_GET['race_name']) && $_GET['race_name'] != ""){ print _("Race name:").' <span>'.$race_name.'</span> '; }
244
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")){ print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; }
245
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; }
246
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
247
-		if (isset($_GET['mmsi']) && $_GET['mmsi'] != ""){ print _("MMSI:").' <span>'.$mmsi.'</span> '; }
248
-		if (isset($_GET['imo']) && $_GET['imo'] != ""){ print _("IMO:").' <span>'.$imo.'</span> '; }
249
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == ""){ print _("Date starting at:").' <span>'.$start_date.'</span> '; }
250
-		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date ending at:").' <span>'.$end_date.'</span> '; }
251
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; }
252
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == ""){ print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; }
253
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; }
254
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; }
255
-		if (isset($_GET['number_results']) && $_GET['number_results'] != ""){ print _("limit per page:").' <span>'.$number_results.'</span> '; }
226
+		if (isset($_GET['q']) && $_GET['q'] != "") { print _("Keyword:").' <span>'.$q.'</span> '; }
227
+		if (isset($_GET['aircraft']) && $_GET['aircraft'] != "") { print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
228
+		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != "") { print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
229
+		if (isset($_GET['registration']) && $_GET['registration'] != "") { print _("Registration:").' <span>'.$registration.'</span> '; }
230
+		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print _("Highlights:").' <span>'.$highlights.'</span> '; }
231
+		if (isset($_GET['airline']) && $_GET['airline'] != "") { print _("Airline:").' <span>'.$airline.'</span> '; }
232
+		if (isset($_GET['airline_country']) && $_GET['airline_country'] != "") { print _("Airline country:").' <span>'.$airline_country.'</span> '; }
233
+		if (isset($_GET['airline_type']) && $_GET['airline_type'] != "") { print _("Airline type:").' <span>'.$airline_type.'</span> '; }
234
+		if (isset($_GET['airport']) && $_GET['airport'] != "") { print _("Airport:").' <span>'.$airport.'</span> '; }
235
+		if (isset($_GET['airport_country']) && $_GET['airport_country'] != "") { print _("Airport country:").' <span>'.$airport_country.'</span> '; }
236
+		if (isset($_GET['callsign']) && $_GET['callsign'] != "") { print _("Callsign:").' <span>'.$callsign.'</span> '; }
237
+		if (isset($_GET['owner']) && $_GET['owner'] != "") { print _("Owner:").' <span>'.$owner.'</span> '; }
238
+		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != "") { print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
239
+		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != "") { print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
240
+		if (isset($_GET['captain_id']) && $_GET['captain_id'] != "") { print _("Captain id:").' <span>'.$captain_id.'</span> '; }
241
+		if (isset($_GET['captain_name']) && $_GET['captain_name'] != "") { print _("Captain name:").' <span>'.$captain_name.'</span> '; }
242
+		if (isset($_GET['race_id']) && $_GET['race_id'] != "") { print _("Race id:").' <span>'.$race_id.'</span> '; }
243
+		if (isset($_GET['race_name']) && $_GET['race_name'] != "") { print _("Race name:").' <span>'.$race_name.'</span> '; }
244
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")) { print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; }
245
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; }
246
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
247
+		if (isset($_GET['mmsi']) && $_GET['mmsi'] != "") { print _("MMSI:").' <span>'.$mmsi.'</span> '; }
248
+		if (isset($_GET['imo']) && $_GET['imo'] != "") { print _("IMO:").' <span>'.$imo.'</span> '; }
249
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == "") { print _("Date starting at:").' <span>'.$start_date.'</span> '; }
250
+		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date ending at:").' <span>'.$end_date.'</span> '; }
251
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; }
252
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == "") { print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; }
253
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; }
254
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; }
255
+		if (isset($_GET['number_results']) && $_GET['number_results'] != "") { print _("limit per page:").' <span>'.$number_results.'</span> '; }
256 256
 		print '</h1>';
257 257
 		print '</div>';
258 258
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 					    </select>
387 387
 					</div>
388 388
 				</div>
389
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
389
+				<script type="text/javascript">getSelect('manufacturer','<?php if (isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
390 390
 				<div class="form-group">
391 391
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
392 392
 						<div class="col-sm-10">
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 							</select>
396 396
 						</div>
397 397
 				</div>
398
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
398
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if (isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
399 399
 				<div class="form-group">
400 400
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
401 401
 					<div class="col-sm-10">
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 					</div>
419 419
 				</div>
420 420
 <?php
421
-	}else {
421
+	} else {
422 422
 ?>
423 423
 				<div class="form-group">
424 424
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 ?>
432 432
 				<div class="form-group">
433 433
 					<div class="col-sm-offset-2 col-sm-10">
434
-					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
435
-					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
434
+					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
435
+					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
436 436
 					</div>
437 437
 				</div>
438 438
 			</fieldset>
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 						</select>
447 447
 					</div>
448 448
 				</div>
449
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
449
+				<script type="text/javascript">getSelect('airlinenames','<?php if (isset($_GET['airline'])) print $airline; ?>');</script>
450 450
 				<div class="form-group">
451 451
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
452 452
 					<div class="col-sm-10">
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 						</select>
456 456
 					</div>
457 457
 				</div>
458
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
458
+				<script type="text/javascript">getSelect('airlinecountries','<?php if (isset($_GET['airline_country'])) print $airline_country; ?>');</script>
459 459
 				<div class="form-group">
460 460
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
461 461
 					<div class="col-sm-10">
@@ -464,10 +464,10 @@  discard block
 block discarded – undo
464 464
 				</div>
465 465
 				<div class="form-group">
466 466
 					<div class="col-sm-offset-2 col-sm-10">
467
-						<label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label>
468
-						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
469
-						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
470
-						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
467
+						<label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all") { print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label>
468
+						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger") { print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
469
+						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "cargo") { print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
470
+						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "military") { print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
471 471
 					</div>
472 472
 				</div>
473 473
 			</fieldset>
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 						</select>
482 482
 					</div>
483 483
 				</div>
484
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
484
+				<script type="text/javascript">getSelect('airportnames','<?php if (isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
485 485
 				<div class="form-group">
486 486
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
487 487
 					<div class="col-sm-10">
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 						</select>
491 491
 					</div>
492 492
 				</div>
493
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
493
+				<script type="text/javascript">getSelect('airportcountries','<?php if (isset($_GET['airport_country'])) print $airport_country; ?>');</script>
494 494
 			</fieldset>
495 495
 			<fieldset>
496 496
 				<legend><?php echo _("Route"); ?></legend>
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 						</select>
503 503
 					</div>
504 504
 				</div>
505
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
505
+				<script type="text/javascript">getSelect('departureairportnames','<?php if (isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
506 506
 				<div class="form-group">
507 507
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
508 508
 					<div class="col-sm-10">
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 						</select>
512 512
 					</div>
513 513
 				</div>
514
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
514
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if (isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
515 515
 			</fieldset>
516 516
 			<fieldset>
517 517
 				<legend>Altitude</legend>
@@ -522,9 +522,9 @@  discard block
 block discarded – undo
522 522
 							<option></option>
523 523
 <?php
524 524
 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
525
-foreach($altitude_array as $altitude)
525
+foreach ($altitude_array as $altitude)
526 526
 {
527
-	if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
527
+	if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
528 528
 	{
529 529
 		print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
530 530
 	} else {
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 							<option></option>
543 543
 <?php
544 544
 	$altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
545
-	foreach($altitude_array as $altitude)
545
+	foreach ($altitude_array as $altitude)
546 546
 	{
547
-		if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
547
+		if (isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
548 548
 		{
549 549
 			print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
550 550
 		} else {
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
 				<div class="col-sm-10">
707 707
 					<select class="form-control" name="number_results">
708 708
 <?php
709
-$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500,  600, 700, 800, 900, 1000);
710
-foreach($number_results_array as $number)
709
+$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000);
710
+foreach ($number_results_array as $number)
711 711
 {
712
-	if(isset($_GET['number_results']) && $_GET['number_results'] == $number)
712
+	if (isset($_GET['number_results']) && $_GET['number_results'] == $number)
713 713
 	{
714 714
 		print '<option value="'.$number.'" selected="selected">'.$number.'</option>';
715 715
 	} else {
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 		<fieldset>
729 729
 			<div class="form-group">
730 730
 				<div class="col-sm-offset-2 col-sm-10">
731
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
731
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
732 732
 					<p class="help-block">Disabled in demo</p>
733 733
 				</div>
734 734
 			</div>
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 		<fieldset>
740 740
 			<div class="form-group">
741 741
 				<div class="col-sm-offset-2 col-sm-10">
742
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
742
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
743 743
 				</div>
744 744
 			</div>
745 745
 		</fieldset>
Please login to merge, or discard this patch.
Braces   +158 added lines, -43 removed lines patch added patch discarded remove patch
@@ -46,8 +46,10 @@  discard block
 block discarded – undo
46 46
 			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
47 47
 			$sql_date = $end_date;
48 48
 		}
49
-	} else $sql_date = '';
50
-}
49
+	} else {
50
+		$sql_date = '';
51
+	}
52
+	}
51 53
 
52 54
 if (isset($_GET['highest_altitude'])) {
53 55
 	//for altitude manipulation
@@ -61,8 +63,12 @@  discard block
 block discarded – undo
61 63
 	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
62 64
 		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
63 65
 		$sql_altitude = $start_altitude;
64
-	} else $sql_altitude = '';
65
-} else $sql_altitude = '';
66
+	} else {
67
+		$sql_altitude = '';
68
+	}
69
+	} else {
70
+	$sql_altitude = '';
71
+}
66 72
 
67 73
 //calculuation for the pagination
68 74
 if(!isset($_GET['limit']))
@@ -80,7 +86,7 @@  discard block
 block discarded – undo
80 86
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
81 87
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
82 88
 	}
83
-}  else {
89
+} else {
84 90
 	$limit_explode = explode(",", $_GET['limit']);
85 91
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
86 92
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -146,10 +152,15 @@  discard block
 block discarded – undo
146 152
 	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
147 153
 	$number_results = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
148 154
 	if ($dist != '') {
149
-		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
150
-		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
155
+		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') {
156
+			$dist = $dist*1.60934;
157
+		} elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') {
158
+			$dist = $dist*1.852;
159
+		}
160
+	}
161
+	if (!isset($sql_date)) {
162
+		$sql_date = '';
151 163
 	}
152
-	if (!isset($sql_date)) $sql_date = '';
153 164
 	if ($archive == 1) {
154 165
 		if ($type == 'aircraft') {
155 166
 			$SpotterArchive = new SpotterArchive();
@@ -227,7 +238,10 @@  discard block
 block discarded – undo
227 238
 		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
228 239
 		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
229 240
 		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
230
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
241
+		if (isset($_GET['highlights'])) {
242
+			if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> ';
243
+		}
244
+		}
231 245
 		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
232 246
 		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
233 247
 		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
@@ -367,7 +381,10 @@  discard block
 block discarded – undo
367 381
 			<div class="form-group">
368 382
 				<label class="control-label col-sm-2"><?php echo _("Keywords"); ?></label>
369 383
 				<div class="col-sm-10">
370
-					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) print $q; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
384
+					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) {
385
+	print $q;
386
+}
387
+?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
371 388
 				</div>
372 389
 			</div>
373 390
 		</fieldset>
@@ -386,7 +403,10 @@  discard block
 block discarded – undo
386 403
 					    </select>
387 404
 					</div>
388 405
 				</div>
389
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
406
+				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) {
407
+	print $manufacturer;
408
+}
409
+?>')</script>
390 410
 				<div class="form-group">
391 411
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
392 412
 						<div class="col-sm-10">
@@ -395,11 +415,17 @@  discard block
 block discarded – undo
395 415
 							</select>
396 416
 						</div>
397 417
 				</div>
398
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
418
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) {
419
+	print $aircraft_icao;
420
+}
421
+?>');</script>
399 422
 				<div class="form-group">
400 423
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
401 424
 					<div class="col-sm-10">
402
-						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) print $registration; ?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
425
+						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) {
426
+	print $registration;
427
+}
428
+?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
403 429
 					</div>
404 430
 				</div>
405 431
 <?php
@@ -408,22 +434,31 @@  discard block
 block discarded – undo
408 434
 				<div class="form-group">
409 435
 					<label class="control-label col-sm-2"><?php echo _("Pilot id"); ?></label> 
410 436
 					<div class="col-sm-10">
411
-						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $pilot_id; ?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
437
+						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) {
438
+	print $pilot_id;
439
+}
440
+?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
412 441
 					</div>
413 442
 				</div>
414 443
 				<div class="form-group">
415 444
 					<label class="control-label col-sm-2"><?php echo _("Pilot name"); ?></label> 
416 445
 					<div class="col-sm-10">
417
-						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $pilot_name; ?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
446
+						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) {
447
+	print $pilot_name;
448
+}
449
+?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
418 450
 					</div>
419 451
 				</div>
420 452
 <?php
421
-	}else {
453
+	} else {
422 454
 ?>
423 455
 				<div class="form-group">
424 456
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
425 457
 					<div class="col-sm-10">
426
-						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) print $owner; ?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
458
+						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) {
459
+	print $owner;
460
+}
461
+?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
427 462
 					</div>
428 463
 				</div>
429 464
 <?php
@@ -431,8 +466,14 @@  discard block
 block discarded – undo
431 466
 ?>
432 467
 				<div class="form-group">
433 468
 					<div class="col-sm-offset-2 col-sm-10">
434
-					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
435
-					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
469
+					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
470
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
471
+}
472
+} ?>> <label for="highlights"><?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
473
+					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
474
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
475
+}
476
+} ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
436 477
 					</div>
437 478
 				</div>
438 479
 			</fieldset>
@@ -446,7 +487,10 @@  discard block
 block discarded – undo
446 487
 						</select>
447 488
 					</div>
448 489
 				</div>
449
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
490
+				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) {
491
+	print $airline;
492
+}
493
+?>');</script>
450 494
 				<div class="form-group">
451 495
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
452 496
 					<div class="col-sm-10">
@@ -455,19 +499,34 @@  discard block
 block discarded – undo
455 499
 						</select>
456 500
 					</div>
457 501
 				</div>
458
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
502
+				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) {
503
+	print $airline_country;
504
+}
505
+?>');</script>
459 506
 				<div class="form-group">
460 507
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
461 508
 					<div class="col-sm-10">
462
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
509
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
510
+	print $callsign;
511
+}
512
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
463 513
 					</div>
464 514
 				</div>
465 515
 				<div class="form-group">
466 516
 					<div class="col-sm-offset-2 col-sm-10">
467 517
 						<label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label>
468
-						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
469
-						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
470
-						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
518
+						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) {
519
+	if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"';
520
+}
521
+} ?>> <?php echo _("Only Passenger airlines"); ?></label>
522
+						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) {
523
+	if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"';
524
+}
525
+} ?>> <?php echo _("Only Cargo airlines"); ?></label>
526
+						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) {
527
+	if ( $_GET['airline_type'] == "military"){ print 'checked="checked"';
528
+}
529
+} ?>> <?php echo _("Only Military airlines"); ?></label>
471 530
 					</div>
472 531
 				</div>
473 532
 			</fieldset>
@@ -481,7 +540,10 @@  discard block
 block discarded – undo
481 540
 						</select>
482 541
 					</div>
483 542
 				</div>
484
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
543
+				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) {
544
+	print $airport_icao;
545
+}
546
+?>');</script>
485 547
 				<div class="form-group">
486 548
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
487 549
 					<div class="col-sm-10">
@@ -490,7 +552,10 @@  discard block
 block discarded – undo
490 552
 						</select>
491 553
 					</div>
492 554
 				</div>
493
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
555
+				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) {
556
+	print $airport_country;
557
+}
558
+?>');</script>
494 559
 			</fieldset>
495 560
 			<fieldset>
496 561
 				<legend><?php echo _("Route"); ?></legend>
@@ -502,7 +567,10 @@  discard block
 block discarded – undo
502 567
 						</select>
503 568
 					</div>
504 569
 				</div>
505
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
570
+				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) {
571
+	print $departure_airport_route;
572
+}
573
+?>');</script>
506 574
 				<div class="form-group">
507 575
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
508 576
 					<div class="col-sm-10">
@@ -511,7 +579,10 @@  discard block
 block discarded – undo
511 579
 						</select>
512 580
 					</div>
513 581
 				</div>
514
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
582
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) {
583
+	print $arrival_airport_route;
584
+}
585
+?>');</script>
515 586
 			</fieldset>
516 587
 			<fieldset>
517 588
 				<legend>Altitude</legend>
@@ -561,19 +632,33 @@  discard block
 block discarded – undo
561 632
 				<div class="form-group">
562 633
 					<label class="control-label col-sm-2"><?php echo _("Latitude"); ?></label>
563 634
 					<div class="col-sm-10">
564
-						<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) print $origlat; ?>" />
635
+						<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) {
636
+	print $origlat;
637
+}
638
+?>" />
565 639
 					</div>
566 640
 				</div>
567 641
 				<div class="form-group">
568 642
 					<label class="control-label col-sm-2"><?php echo _("Longitude"); ?></label>
569 643
 					<div class="col-sm-10">
570
-						<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) print $origlon; ?>" />
644
+						<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) {
645
+	print $origlon;
646
+}
647
+?>" />
571 648
 					</div>
572 649
 				</div>
573 650
 				<div class="form-group">
574
-					<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label>
651
+					<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) {
652
+	print $globalDistanceUnit;
653
+} else {
654
+	print 'km';
655
+}
656
+print ')'; ?></label>
575 657
 					<div class="col-sm-10">
576
-						<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) print $distance; ?>" />
658
+						<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) {
659
+	print $distance;
660
+}
661
+?>" />
577 662
 					</div>
578 663
 				</div>
579 664
 			</fieldset>
@@ -584,7 +669,10 @@  discard block
 block discarded – undo
584 669
 				<div class="form-group">
585 670
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
586 671
 					<div class="col-sm-10">
587
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
672
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
673
+	print $callsign;
674
+}
675
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
588 676
 					</div>
589 677
 				</div>
590 678
 			</fieldset>
@@ -595,7 +683,10 @@  discard block
 block discarded – undo
595 683
 				<div class="form-group">
596 684
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
597 685
 					<div class="col-sm-10">
598
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
686
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
687
+	print $callsign;
688
+}
689
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
599 690
 					</div>
600 691
 				</div>
601 692
 			</fieldset>
@@ -606,7 +697,10 @@  discard block
 block discarded – undo
606 697
 				<div class="form-group">
607 698
 					<label class="control-label col-sm-2"><?php echo _("Captain id"); ?></label> 
608 699
 					<div class="col-sm-10">
609
-						<input type="text" name="captain_id" class="form-control" value="<?php if (isset($_GET['captain_id'])) print $captain_id; ?>" size="8" placeholder="<?php echo _("Captain id"); ?>" />
700
+						<input type="text" name="captain_id" class="form-control" value="<?php if (isset($_GET['captain_id'])) {
701
+	print $captain_id;
702
+}
703
+?>" size="8" placeholder="<?php echo _("Captain id"); ?>" />
610 704
 					</div>
611 705
 				</div>
612 706
 			</fieldset>
@@ -614,7 +708,10 @@  discard block
 block discarded – undo
614 708
 				<div class="form-group">
615 709
 					<label class="control-label col-sm-2"><?php echo _("Captain name"); ?></label> 
616 710
 					<div class="col-sm-10">
617
-						<input type="text" name="captain_name" class="form-control" value="<?php if (isset($_GET['captain_name'])) print $captain_name; ?>" size="8" placeholder="<?php echo _("Captain name"); ?>" />
711
+						<input type="text" name="captain_name" class="form-control" value="<?php if (isset($_GET['captain_name'])) {
712
+	print $captain_name;
713
+}
714
+?>" size="8" placeholder="<?php echo _("Captain name"); ?>" />
618 715
 					</div>
619 716
 				</div>
620 717
 			</fieldset>
@@ -622,7 +719,10 @@  discard block
 block discarded – undo
622 719
 				<div class="form-group">
623 720
 					<label class="control-label col-sm-2"><?php echo _("Race id"); ?></label> 
624 721
 					<div class="col-sm-10">
625
-						<input type="text" name="race_id" class="form-control" value="<?php if (isset($_GET['race_id'])) print $race_id; ?>" size="8" placeholder="<?php echo _("Race id"); ?>" />
722
+						<input type="text" name="race_id" class="form-control" value="<?php if (isset($_GET['race_id'])) {
723
+	print $race_id;
724
+}
725
+?>" size="8" placeholder="<?php echo _("Race id"); ?>" />
626 726
 					</div>
627 727
 				</div>
628 728
 			</fieldset>
@@ -630,7 +730,10 @@  discard block
 block discarded – undo
630 730
 				<div class="form-group">
631 731
 					<label class="control-label col-sm-2"><?php echo _("Race name"); ?></label> 
632 732
 					<div class="col-sm-10">
633
-						<input type="text" name="race_name" class="form-control" value="<?php if (isset($_GET['race_name'])) print $race_name; ?>" size="8" placeholder="<?php echo _("Race name"); ?>" />
733
+						<input type="text" name="race_name" class="form-control" value="<?php if (isset($_GET['race_name'])) {
734
+	print $race_name;
735
+}
736
+?>" size="8" placeholder="<?php echo _("Race name"); ?>" />
634 737
 					</div>
635 738
 				</div>
636 739
 			</fieldset>
@@ -641,7 +744,10 @@  discard block
 block discarded – undo
641 744
 				<div class="form-group">
642 745
 					<label class="control-label col-sm-2"><?php echo _("MMSI"); ?></label> 
643 746
 					<div class="col-sm-10">
644
-						<input type="text" name="mmsi" class="form-control" value="<?php if (isset($_GET['mmsi'])) print $mmsi; ?>" size="8" placeholder="<?php echo _("MMSI"); ?>" />
747
+						<input type="text" name="mmsi" class="form-control" value="<?php if (isset($_GET['mmsi'])) {
748
+	print $mmsi;
749
+}
750
+?>" size="8" placeholder="<?php echo _("MMSI"); ?>" />
645 751
 					</div>
646 752
 				</div>
647 753
 			</fieldset>
@@ -649,7 +755,10 @@  discard block
 block discarded – undo
649 755
 				<div class="form-group">
650 756
 					<label class="control-label col-sm-2"><?php echo _("IMO"); ?></label> 
651 757
 					<div class="col-sm-10">
652
-						<input type="text" name="imo" class="form-control" value="<?php if (isset($_GET['imo'])) print $imo; ?>" size="8" placeholder="<?php echo _("IMO"); ?>" />
758
+						<input type="text" name="imo" class="form-control" value="<?php if (isset($_GET['imo'])) {
759
+	print $imo;
760
+}
761
+?>" size="8" placeholder="<?php echo _("IMO"); ?>" />
653 762
 					</div>
654 763
 				</div>
655 764
 			</fieldset>
@@ -663,7 +772,10 @@  discard block
 block discarded – undo
663 772
 					<label class="control-label col-sm-2"><?php echo _("Start Date"); ?></label>
664 773
 					<div class="col-sm-10">
665 774
 						<div class='input-group date' id='datetimepicker1'>
666
-							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date']) && $_GET['start_date'] != '') print $start_date; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
775
+							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date']) && $_GET['start_date'] != '') {
776
+	print $start_date;
777
+}
778
+?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
667 779
 							<span class="input-group-addon">
668 780
 								<span class="glyphicon glyphicon-calendar"></span>
669 781
 							</span>
@@ -674,7 +786,10 @@  discard block
 block discarded – undo
674 786
 					<label class="control-label col-sm-2"><?php echo _("End Date"); ?></label>
675 787
 					<div class="col-sm-10">
676 788
 						<div class='input-group date' id='datetimepicker2'>
677
-						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date']) && $_GET['end_date'] != '') print $end_date; ?>" placeholder="<?php echo _("End Date/Time"); ?>" />
789
+						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date']) && $_GET['end_date'] != '') {
790
+	print $end_date;
791
+}
792
+?>" placeholder="<?php echo _("End Date/Time"); ?>" />
678 793
 						<span class="input-group-addon">
679 794
 							<span class="glyphicon glyphicon-calendar"></span>
680 795
 						</span>
Please login to merge, or discard this patch.
weather-json.php 2 patches
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,9 @@  discard block
 block discarded – undo
11 11
 header('Content-Type: text/javascript');
12 12
 $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
13 13
 $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
14
-if ($latitude == '' || $longitude == '') return '';
14
+if ($latitude == '' || $longitude == '') {
15
+	return '';
16
+}
15 17
 //echo 'latitude : '.$latitude.' - longitude : '.$longitude."\n";
16 18
 $airports = $Spotter->closestAirports($latitude,$longitude,300);
17 19
 //print_r($airports);
@@ -20,7 +22,9 @@  discard block
 block discarded – undo
20 22
 $i = 0;
21 23
 $ew = true;
22 24
 $dtf = false;
23
-if (empty($airports)) $ew = false;
25
+if (empty($airports)) {
26
+	$ew = false;
27
+}
24 28
 while($ew) {
25 29
 	$met = $METAR->getMETAR($airports[$i]['icao']);
26 30
 	//print_r($met);
@@ -43,8 +47,12 @@  discard block
 block discarded – undo
43 47
 		}
44 48
 	}
45 49
 	$i++;
46
-	if ($i >= count($airports)) $ew = false;
50
+	if ($i >= count($airports)) {
51
+		$ew = false;
52
+	}
53
+	}
54
+if ($dtf === false) {
55
+	echo json_encode($Weather->openweathermap($latitude,$longitude));
47 56
 }
48
-if ($dtf === false) echo json_encode($Weather->openweathermap($latitude,$longitude));
49 57
 
50 58
 ?>
51 59
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
 	header('Content-disposition: attachment; filename="weather.json"');
10 10
 }
11 11
 header('Content-Type: text/javascript');
12
-$latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
13
-$longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
12
+$latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
13
+$longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
14 14
 if ($latitude == '' || $longitude == '') return '';
15 15
 //echo 'latitude : '.$latitude.' - longitude : '.$longitude."\n";
16
-$airports = $Spotter->closestAirports($latitude,$longitude,300);
16
+$airports = $Spotter->closestAirports($latitude, $longitude, 300);
17 17
 //print_r($airports);
18 18
 $METAR = new METAR();
19 19
 $Weather = new Weather();
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $ew = true;
22 22
 $dtf = false;
23 23
 if (empty($airports)) $ew = false;
24
-while($ew) {
24
+while ($ew) {
25 25
 	$met = $METAR->getMETAR($airports[$i]['icao']);
26 26
 	//print_r($met);
27 27
 	if (!empty($met)) {
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 		//print_r($parsed);
30 30
 		$rain = array();
31 31
 		if (isset($parsed['temperature'])) {
32
-			$rain = array_merge($rain,array('temp' => $parsed['temperature']));
32
+			$rain = array_merge($rain, array('temp' => $parsed['temperature']));
33 33
 		}
34 34
 		if (isset($parsed['rh'])) {
35
-			$rain = array_merge($rain,array('rh' => $parsed['rh']));
35
+			$rain = array_merge($rain, array('rh' => $parsed['rh']));
36 36
 		}
37 37
 		if (isset($parsed['weather']) && $parsed['weather'] == 'CAVOK') {
38
-			echo json_encode(array('clouds' => array(),'rain' => array()));
38
+			echo json_encode(array('clouds' => array(), 'rain' => array()));
39 39
 			$ew  = false;
40 40
 			$dtf = true;
41 41
 		} elseif (isset($parsed['cloud'])) {
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 			if (!empty($result)) {
44 44
 				//print_r($met);
45 45
 				//print_r($parsed);
46
-				echo json_encode(array('clouds' => $result,'rain' => $rain));
46
+				echo json_encode(array('clouds' => $result, 'rain' => $rain));
47 47
 				$ew = false;
48 48
 				$dtf = true;
49 49
 			}
@@ -52,6 +52,6 @@  discard block
 block discarded – undo
52 52
 	$i++;
53 53
 	if ($i >= count($airports)) $ew = false;
54 54
 }
55
-if ($dtf === false) echo json_encode($Weather->openweathermap($latitude,$longitude));
55
+if ($dtf === false) echo json_encode($Weather->openweathermap($latitude, $longitude));
56 56
 
57 57
 ?>
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
statistics-race.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Top 10 Races Number of Participants");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
10
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
9
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
10
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
11 11
 $type = 'marine';
12 12
 require_once('header.php');
13 13
 include('statistics-sub-menu.php');
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	</div>
19 19
 	<p>'._("Below are the <strong>Top 10</strong> races with the most number of participants.").'</p>';
20 20
 	  
21
-$race_array = $Marine->countAllCaptainsByRaces(true,$filter_name,$year,$month);
21
+$race_array = $Marine->countAllCaptainsByRaces(true, $filter_name, $year, $month);
22 22
 print '<div id="chart" class="chart" width="100%"></div><script>';
23 23
 $pilot_data = '';
24
-foreach($race_array as $race_item)
24
+foreach ($race_array as $race_item)
25 25
 {
26 26
 	$race_data .= '["'.$race_item['marine_race_name'].' ('.$race_item['marine_race_id'].')",'.$race_item['marine_captain_count'].'],';
27 27
 }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	print '</thead>';
47 47
 	print '<tbody>';
48 48
 	$i = 1;
49
-	foreach($race_array as $race_item)
49
+	foreach ($race_array as $race_item)
50 50
 	{
51 51
 		print '<tr>';
52 52
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
 $Marine = new Marine();
6 6
 $title = _("Statistics").' - '._("Top 10 Races Number of Participants");
7 7
 
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
10 12
 $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
11 13
 $type = 'marine';
Please login to merge, or discard this patch.
space-data.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 <button type="button" class="close">&times;</button>
10 10
 <?php
11 11
 
12
-$sat = filter_input(INPUT_GET,'sat',FILTER_SANITIZE_STRING);
12
+$sat = filter_input(INPUT_GET, 'sat', FILTER_SANITIZE_STRING);
13 13
 $sat = urldecode($sat);
14 14
 //$info = $Satellite->get_info(str_replace(' ','-',$sat));
15 15
 //print_r($info);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$aircraft_name = 'INTEGRAL';
49 49
 //	$ground_speed = 14970;
50 50
 	$launch_date = '17 October 2002';
51
-} elseif (strpos($sat,'IRIDIUM') !== false) {
51
+} elseif (strpos($sat, 'IRIDIUM') !== false) {
52 52
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/b/b6/Iridium_Satellite.jpg';
53 53
 	$image_copyright = 'Cliff';
54 54
 	$ident = 'Iridium satellite constellation';
@@ -56,23 +56,23 @@  discard block
 block discarded – undo
56 56
 	$aircraft_name = $sat;
57 57
 //	$ground_speed = 14970;
58 58
 //	$launch_date = '29 september 2011';
59
-} elseif (strpos($sat,'ORBCOMM') !== false) {
59
+} elseif (strpos($sat, 'ORBCOMM') !== false) {
60 60
 	$ident = 'Orbcomm';
61 61
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Orbcomm_(satellite)';
62 62
 	$aircraft_name = $sat;
63
-} elseif (strpos($sat,'GLOBALSTAR') !== false) {
63
+} elseif (strpos($sat, 'GLOBALSTAR') !== false) {
64 64
 	$ident = 'Globalstar';
65 65
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Globalstar';
66 66
 	$aircraft_name = $sat;
67
-	$satname = str_replace(array('[+]','[-]'),'',$sat);
68
-} elseif (strpos($sat,'OSCAR 7') !== false) {
67
+	$satname = str_replace(array('[+]', '[-]'), '', $sat);
68
+} elseif (strpos($sat, 'OSCAR 7') !== false) {
69 69
 	$image = 'https://upload.wikimedia.org/wikipedia/en/a/ad/AMSAT-OSCAR_7.jpg';
70 70
 	$image_copyright = 'Amsat.org';
71 71
 	$ident = 'AMSAT-OSCAR 7';
72 72
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/AMSAT-OSCAR_7';
73 73
 	$aircraft_name = $sat;
74 74
 	$launch_date = '15 November 1974';
75
-} elseif (strpos($sat,'santaclaus') !== false) {
75
+} elseif (strpos($sat, 'santaclaus') !== false) {
76 76
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/4/49/Jonathan_G_Meath_portrays_Santa_Claus.jpg';
77 77
 	$image_copyright = 'Jonathan G Meath';
78 78
 	$ident = 'Santa Claus';
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 //	$launch_date = '15 November 1974';
82 82
 } else {
83 83
 	$ident = $sat;
84
-	if (strpos($sat,'(')) $satname = $sat;
85
-	else $satname = str_replace(array(' '),'-',$sat);
84
+	if (strpos($sat, '(')) $satname = $sat;
85
+	else $satname = str_replace(array(' '), '-', $sat);
86 86
 }
87 87
 if (!isset($satname)) $satname = $sat;
88 88
 if ($satname != 'santaclaus') {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		print '<div><span>'._("Orbit").'</span>'.$info['orbit'].'</div>';
157 157
 	}
158 158
 	if ($info['launch_date'] != '') {
159
-		print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d',strtotime($info['launch_date'])).'</div>';
159
+		print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d', strtotime($info['launch_date'])).'</div>';
160 160
 	}
161 161
 	if ($info['launch_site'] != '') {
162 162
 		print '<div><span>'._("Launch Site").'</span>'.$info['launch_site'].'</div>';
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -81,10 +81,15 @@
 block discarded – undo
81 81
 //	$launch_date = '15 November 1974';
82 82
 } else {
83 83
 	$ident = $sat;
84
-	if (strpos($sat,'(')) $satname = $sat;
85
-	else $satname = str_replace(array(' '),'-',$sat);
84
+	if (strpos($sat,'(')) {
85
+		$satname = $sat;
86
+	} else {
87
+		$satname = str_replace(array(' '),'-',$sat);
88
+	}
89
+	}
90
+if (!isset($satname)) {
91
+	$satname = $sat;
86 92
 }
87
-if (!isset($satname)) $satname = $sat;
88 93
 if ($satname != 'santaclaus') {
89 94
 	$info = $Satellite->get_info(strtolower(trim($satname)));
90 95
 	$position = $Satellite->position($sat);
Please login to merge, or discard this patch.
require/class.Source.php 4 patches
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,9 @@  discard block
 block discarded – undo
18 18
 	public function __construct($dbc = null) {
19 19
 		$Connection = new Connection($dbc);
20 20
 		$this->db = $Connection->db;
21
-		if ($this->db === null) die('Error: No DB connection. (Source)');
21
+		if ($this->db === null) {
22
+			die('Error: No DB connection. (Source)');
23
+		}
22 24
 	}
23 25
 
24 26
 	public function getAllLocationInfo() {
@@ -83,7 +85,9 @@  discard block
 block discarded – undo
83 85
 			$query .= " AND source_location.latitude BETWEEN ".$minlat." AND ".$maxlat." AND source_location.longitude BETWEEN ".$minlong." AND ".$maxlong." AND source_location.latitude <> 0 AND source_location.longitude <> 0";
84 86
 		}
85 87
 		$query .= " ORDER BY last_seen DESC";
86
-		if ($limit) $query .= " LIMIT 1000";
88
+		if ($limit) {
89
+			$query .= " LIMIT 1000";
90
+		}
87 91
 		$query_values = array(':type' => $type);
88 92
 		try {
89 93
 			$sth = $this->db->prepare($query);
@@ -122,7 +126,9 @@  discard block
 block discarded – undo
122 126
 	}
123 127
 
124 128
 	public function addLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '', $description = '') {
125
-		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
129
+		if ($last_seen == '') {
130
+			$last_seen = date('Y-m-d H:i:s');
131
+		}
126 132
 		$query = "INSERT INTO source_location (name,latitude,longitude,altitude,country,city,logo,source,type,source_id,last_seen,location_id,description) VALUES (:name,:latitude,:longitude,:altitude,:country,:city,:logo,:source,:type,:source_id,:last_seen,:location_id,:description)";
127 133
 		$query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
128 134
 		try {
@@ -134,7 +140,9 @@  discard block
 block discarded – undo
134 140
 	}
135 141
 
136 142
 	public function updateLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '',$description = '') {
137
-		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
143
+		if ($last_seen == '') {
144
+			$last_seen = date('Y-m-d H:i:s');
145
+		}
138 146
 		$query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, source_id = :source_id, last_seen = :last_seen,location_id = :location_id, description = :description WHERE name = :name AND source = :source";
139 147
 		$query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
140 148
 		try {
@@ -157,7 +165,9 @@  discard block
 block discarded – undo
157 165
 	}
158 166
 
159 167
 	public function updateLocationByLocationID($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0, $location_id,$last_seen = '',$description = '') {
160
-		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
168
+		if ($last_seen == '') {
169
+			$last_seen = date('Y-m-d H:i:s');
170
+		}
161 171
 		$query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, last_seen = :last_seen, description = :description WHERE location_id = :location_id AND source = :source AND source_id = :source_id";
162 172
 		$query_values = array(':source_id' => $source_id,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
163 173
 		try {
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@
 block discarded – undo
60 60
 		return $all;
61 61
 	}
62 62
 
63
-    /**
64
-     * @param $name
65
-     * @return array
66
-     */
67
-    public function getLocationInfobySourceName($name) {
63
+	/**
64
+	 * @param $name
65
+	 * @return array
66
+	 */
67
+	public function getLocationInfobySourceName($name) {
68 68
 		$query = "SELECT * FROM source_location WHERE source = :name";
69 69
 		$query_values = array(':name' => $name);
70 70
 		try {
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -187,6 +187,9 @@
 block discarded – undo
187 187
 		return '';
188 188
 	}
189 189
 
190
+	/**
191
+	 * @param string $type
192
+	 */
190 193
 	public function deleteLocationByType($type) {
191 194
 		$query = "DELETE FROM source_location WHERE type = :type";
192 195
 		$query_values = array(':type' => $type);
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		try {
28 28
 			$sth = $this->db->prepare($query);
29 29
 			$sth->execute($query_values);
30
-		} catch(PDOException $e) {
30
+		} catch (PDOException $e) {
31 31
 			return "error : ".$e->getMessage();
32 32
 		}
33 33
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -40,20 +40,20 @@  discard block
 block discarded – undo
40 40
 		try {
41 41
 			$sth = $this->db->prepare($query);
42 42
 			$sth->execute($query_values);
43
-		} catch(PDOException $e) {
43
+		} catch (PDOException $e) {
44 44
 			return "error : ".$e->getMessage();
45 45
 		}
46 46
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
47 47
 		return $all;
48 48
 	}
49 49
 
50
-	public function getLocationInfobyNameType($name,$type) {
50
+	public function getLocationInfobyNameType($name, $type) {
51 51
 		$query = "SELECT * FROM source_location WHERE name = :name AND type = :type";
52
-		$query_values = array(':name' => $name,':type' => $type);
52
+		$query_values = array(':name' => $name, ':type' => $type);
53 53
 		try {
54 54
 			$sth = $this->db->prepare($query);
55 55
 			$sth->execute($query_values);
56
-		} catch(PDOException $e) {
56
+		} catch (PDOException $e) {
57 57
 			return "error : ".$e->getMessage();
58 58
 		}
59 59
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		try {
71 71
 			$sth = $this->db->prepare($query);
72 72
 			$sth->execute($query_values);
73
-		} catch(PDOException $e) {
73
+		} catch (PDOException $e) {
74 74
 			echo "error : ".$e->getMessage();
75 75
 			return array();
76 76
 		}
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 	public function getLocationInfoByType($type, $coord = array(), $limit = false) {
82 82
 		$query = "SELECT * FROM source_location WHERE type = :type";
83 83
 		if (is_array($coord) && !empty($coord) && count($coord) == 4) {
84
-			$minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
85
-			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
86
-			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
87
-			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
84
+			$minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
85
+			$minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
86
+			$maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
87
+			$maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
88 88
 			$query .= " AND source_location.latitude BETWEEN ".$minlat." AND ".$maxlat." AND source_location.longitude BETWEEN ".$minlong." AND ".$maxlong." AND source_location.latitude <> 0 AND source_location.longitude <> 0";
89 89
 		}
90 90
 		$query .= " ORDER BY last_seen DESC";
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		try {
94 94
 			$sth = $this->db->prepare($query);
95 95
 			$sth->execute($query_values);
96
-		} catch(PDOException $e) {
96
+		} catch (PDOException $e) {
97 97
 			return "error : ".$e->getMessage();
98 98
 		}
99 99
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		try {
107 107
 			$sth = $this->db->prepare($query);
108 108
 			$sth->execute($query_values);
109
-		} catch(PDOException $e) {
109
+		} catch (PDOException $e) {
110 110
 			return "error : ".$e->getMessage();
111 111
 		}
112 112
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -119,58 +119,58 @@  discard block
 block discarded – undo
119 119
 		try {
120 120
 			$sth = $this->db->prepare($query);
121 121
 			$sth->execute($query_values);
122
-		} catch(PDOException $e) {
122
+		} catch (PDOException $e) {
123 123
 			return "error : ".$e->getMessage();
124 124
 		}
125 125
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
126 126
 		return $all;
127 127
 	}
128 128
 
129
-	public function addLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '', $description = '') {
129
+	public function addLocation($name, $latitude, $longitude, $altitude, $city, $country, $source, $logo = 'antenna.png', $type = '', $source_id = 0, $location_id = 0, $last_seen = '', $description = '') {
130 130
 		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
131 131
 		$query = "INSERT INTO source_location (name,latitude,longitude,altitude,country,city,logo,source,type,source_id,last_seen,location_id,description) VALUES (:name,:latitude,:longitude,:altitude,:country,:city,:logo,:source,:type,:source_id,:last_seen,:location_id,:description)";
132
-		$query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
132
+		$query_values = array(':name' => $name, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':city' => $city, ':country' => $country, ':logo' => $logo, ':source' => $source, ':type' => $type, ':source_id' => $source_id, ':last_seen' => $last_seen, ':location_id' => $location_id, ':description' => $description);
133 133
 		try {
134 134
 			$sth = $this->db->prepare($query);
135 135
 			$sth->execute($query_values);
136
-		} catch(PDOException $e) {
136
+		} catch (PDOException $e) {
137 137
 			echo "error : ".$e->getMessage();
138 138
 		}
139 139
 	}
140 140
 
141
-	public function updateLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '',$description = '') {
141
+	public function updateLocation($name, $latitude, $longitude, $altitude, $city, $country, $source, $logo = 'antenna.png', $type = '', $source_id = 0, $location_id = 0, $last_seen = '', $description = '') {
142 142
 		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
143 143
 		$query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, source_id = :source_id, last_seen = :last_seen,location_id = :location_id, description = :description WHERE name = :name AND source = :source";
144
-		$query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
144
+		$query_values = array(':name' => $name, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':city' => $city, ':country' => $country, ':logo' => $logo, ':source' => $source, ':type' => $type, ':source_id' => $source_id, ':last_seen' => $last_seen, ':location_id' => $location_id, ':description' => $description);
145 145
 		try {
146 146
 			$sth = $this->db->prepare($query);
147 147
 			$sth->execute($query_values);
148
-		} catch(PDOException $e) {
148
+		} catch (PDOException $e) {
149 149
 			return "error : ".$e->getMessage();
150 150
 		}
151 151
 		return '';
152 152
 	}
153 153
 
154
-	public function updateLocationDescByName($name,$source,$source_id = 0,$description = '') {
154
+	public function updateLocationDescByName($name, $source, $source_id = 0, $description = '') {
155 155
 		$query = "UPDATE source_location SET description = :description WHERE source_id = :source_id AND name = :name AND source = :source";
156
-		$query_values = array(':name' => $name,':source' => $source,':source_id' => $source_id,':description' => $description);
156
+		$query_values = array(':name' => $name, ':source' => $source, ':source_id' => $source_id, ':description' => $description);
157 157
 		try {
158 158
 			$sth = $this->db->prepare($query);
159 159
 			$sth->execute($query_values);
160
-		} catch(PDOException $e) {
160
+		} catch (PDOException $e) {
161 161
 			return "error : ".$e->getMessage();
162 162
 		}
163 163
 		return '';
164 164
 	}
165 165
 
166
-	public function updateLocationByLocationID($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0, $location_id,$last_seen = '',$description = '') {
166
+	public function updateLocationByLocationID($name, $latitude, $longitude, $altitude, $city, $country, $source, $logo = 'antenna.png', $type = '', $source_id = 0, $location_id, $last_seen = '', $description = '') {
167 167
 		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
168 168
 		$query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, last_seen = :last_seen, description = :description WHERE location_id = :location_id AND source = :source AND source_id = :source_id";
169
-		$query_values = array(':source_id' => $source_id,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
169
+		$query_values = array(':source_id' => $source_id, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':city' => $city, ':country' => $country, ':logo' => $logo, ':source' => $source, ':type' => $type, ':last_seen' => $last_seen, ':location_id' => $location_id, ':description' => $description);
170 170
 		try {
171 171
 			$sth = $this->db->prepare($query);
172 172
 			$sth->execute($query_values);
173
-		} catch(PDOException $e) {
173
+		} catch (PDOException $e) {
174 174
 			echo "error : ".$e->getMessage();
175 175
 		}
176 176
 	}
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		try {
182 182
 			$sth = $this->db->prepare($query);
183 183
 			$sth->execute($query_values);
184
-		} catch(PDOException $e) {
184
+		} catch (PDOException $e) {
185 185
 			return "error : ".$e->getMessage();
186 186
 		}
187 187
 		return '';
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		try {
194 194
 			$sth = $this->db->prepare($query);
195 195
 			$sth->execute($query_values);
196
-		} catch(PDOException $e) {
196
+		} catch (PDOException $e) {
197 197
 			return "error : ".$e->getMessage();
198 198
 		}
199 199
 		return '';
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		try {
206 206
 			$sth = $this->db->prepare($query);
207 207
 			$sth->execute($query_values);
208
-		} catch(PDOException $e) {
208
+		} catch (PDOException $e) {
209 209
 			return "error : ".$e->getMessage();
210 210
 		}
211 211
 		return '';
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 		try {
217 217
 			$sth = $this->db->prepare($query);
218 218
 			$sth->execute();
219
-		} catch(PDOException $e) {
219
+		} catch (PDOException $e) {
220 220
 			return "error : ".$e->getMessage();
221 221
 		}
222 222
 		return '';
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 		try {
247 247
 			$sth = $this->db->prepare($query);
248 248
 			$sth->execute(array(':type' => $type));
249
-		} catch(PDOException $e) {
249
+		} catch (PDOException $e) {
250 250
 			return "error";
251 251
 		}
252 252
 		return "success";
Please login to merge, or discard this patch.
js/map.3d.js.php 2 patches
Braces   +53 added lines, -16 removed lines patch added patch discarded remove patch
@@ -57,21 +57,30 @@  discard block
 block discarded – undo
57 57
 
58 58
 document.cookie =  'MapFormat=3d; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
59 59
 <?php
60
-	if (isset($_COOKIE['MapType3D'])) $MapType = $_COOKIE['MapType3D'];
61
-	else $MapType = $globalMapProvider;
62
-//	unset($_COOKIE['MapType']);
60
+	if (isset($_COOKIE['MapType3D'])) {
61
+		$MapType = $_COOKIE['MapType3D'];
62
+	} else {
63
+		$MapType = $globalMapProvider;
64
+	}
65
+	//	unset($_COOKIE['MapType']);
63 66
 
64 67
 	if ($MapType != 'Mapbox' && $MapType != 'OpenStreetMap' && $MapType != 'Bing-Aerial' && $MapType != 'Bing-Hybrid' && $MapType != 'Bing-Road' && $MapType != 'offline' && $MapType != 'ArcGIS-Streetmap' && $MapType != 'ArcGIS-Satellite' && $MapType != 'NatGeo-Street') {
65
-		if (isset($globalBingMapKey) && $globalBingMapKey != '') $MapType = 'Bing-Aerial';
66
-		else $MapType = 'OpenStreetMap';
68
+		if (isset($globalBingMapKey) && $globalBingMapKey != '') {
69
+			$MapType = 'Bing-Aerial';
70
+		} else {
71
+			$MapType = 'OpenStreetMap';
72
+		}
67 73
 	}
68 74
 	if (($MapType == 'Bing-Aerial' || $MapType == 'Bing-Hybrid' || $MapType == 'Bing-Road') && (!isset($globalBingMapKey) || $globalBingMapKey == '')) {
69 75
 		$MapType = 'OpenStreetMap';
70 76
 	}
71 77
 	if ($MapType == 'Mapbox') {
72
-		if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId;
73
-		else $MapBoxId = $_COOKIE['MapType3DId'];
74
-?>
78
+		if ($_COOKIE['MapTypeId'] == 'default') {
79
+			$MapBoxId = $globalMapboxId;
80
+		} else {
81
+			$MapBoxId = $_COOKIE['MapType3DId'];
82
+		}
83
+		?>
75 84
 	var imProv = Cesium.MapboxImageryProvider({
76 85
 		credit: 'Map data © OpenStreetMap contributors, ' +
77 86
 	      'CC-BY-SA, ' +
@@ -153,13 +162,23 @@  discard block
 block discarded – undo
153 162
 		credit : 'Imagery courtesy Natural Earth'
154 163
 	});
155 164
 <?php
156
-	}  elseif (isset($globalMapCustomLayer[$MapType])) {
165
+	} elseif (isset($globalMapCustomLayer[$MapType])) {
157 166
 		$customid = $MapType;
158 167
 ?>
159 168
 	var imProv = Cesium.createOpenStreetMapImageryProvider({
160 169
 		url : '<?php print $globalMapCustomLayer[$customid]['url']; ?>',
161
-		maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '99'; ?>,
162
-		minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
170
+		maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
171
+	print $globalMapCustomLayer[$customid]['maxZoom'];
172
+} else {
173
+	print '99';
174
+}
175
+?>,
176
+		minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
177
+	print $globalMapCustomLayer[$customid]['minZoom'];
178
+} else {
179
+	print '0';
180
+}
181
+?>,
163 182
 		credit: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
164 183
 	});
165 184
 <?php
@@ -449,7 +468,12 @@  discard block
 block discarded – undo
449 468
 	imageryProvider : imProv,
450 469
 	timeline : archive,
451 470
 	animation : false,
452
-	shadows : <?php if ((isset($globalMap3DShadows) && $globalMap3DShadows === FALSE) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'true')) print 'false'; else print 'true'; ?>,
471
+	shadows : <?php if ((isset($globalMap3DShadows) && $globalMap3DShadows === FALSE) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'true')) {
472
+	print 'false';
473
+} else {
474
+	print 'true';
475
+}
476
+?>,
453 477
 	infoBox : false,
454 478
 	navigationHelpButton : false,
455 479
 	geocoder : false,
@@ -464,8 +488,11 @@  discard block
 block discarded – undo
464 488
 	if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) {
465 489
 		if (isset($_COOKIE['lastcentercoord'])) {
466 490
 			$lastcentercoord = explode(',',$_COOKIE['lastcentercoord']);
467
-			if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0;
468
-			else $zoom = $lastcentercoord[3];
491
+			if (!isset($lastcentercoord[3])) {
492
+				$zoom = $lastcentercoord[2]*1000000.0;
493
+			} else {
494
+				$zoom = $lastcentercoord[3];
495
+			}
469 496
 			$viewcenterlatitude = $lastcentercoord[0];
470 497
 			$viewcenterlongitude = $lastcentercoord[1];
471 498
 		} else {
@@ -597,7 +624,12 @@  discard block
 block discarded – undo
597 624
 ?>
598 625
 
599 626
 update_locationsLayer();
600
-setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
627
+setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) {
628
+	print $globalMapRefresh*1000*2;
629
+} else {
630
+	print '60000';
631
+}
632
+?>);
601 633
 
602 634
 var currentposition;
603 635
 viewer.camera.moveEnd.addEventListener(function() { 
@@ -755,5 +787,10 @@  discard block
 block discarded – undo
755 787
 			}
756 788
 		}
757 789
 	}
758
-	,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
790
+	,<?php if (isset($globalMapRefresh)) {
791
+	print $globalMapRefresh*1000;
792
+} else {
793
+	print '30000';
794
+}
795
+?>);
759 796
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 			break;
400 400
 		}
401 401
 	}
402
-	var tsk_geojson = Cesium.Resource.fetchJson("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php print filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); ?>");
402
+	var tsk_geojson = Cesium.Resource.fetchJson("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php print filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); ?>");
403 403
 	tsk_geojson.then(function(geojsondata) {
404 404
 		tsk = new Cesium.CustomDataSource('tsk');
405 405
 		for (var i =0;i < geojsondata.features.length; i++) {
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 <?php
479 479
 	if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) {
480 480
 		if (isset($_COOKIE['lastcentercoord'])) {
481
-			$lastcentercoord = explode(',',$_COOKIE['lastcentercoord']);
481
+			$lastcentercoord = explode(',', $_COOKIE['lastcentercoord']);
482 482
 			if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0;
483 483
 			else $zoom = $lastcentercoord[3];
484 484
 			$viewcenterlatitude = $lastcentercoord[0];
Please login to merge, or discard this patch.
races-geojson.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 }
9 9
 header('Content-Type: text/javascript');
10 10
 
11
-$race_id = filter_input(INPUT_GET,'race_id',FILTER_SANITIZE_NUMBER_INT);
11
+$race_id = filter_input(INPUT_GET, 'race_id', FILTER_SANITIZE_NUMBER_INT);
12 12
 if ($race_id != '') {
13 13
 	$race_array = $Marine->getRace($race_id);
14 14
 } else {
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 $output = '{"type": "FeatureCollection","features": [';
19 19
 if (!empty($race_array))
20 20
 {	
21
-	$course = json_decode($race_array['race_markers'],true);
21
+	$course = json_decode($race_array['race_markers'], true);
22 22
 	$i = 0;
23 23
 	$f = count($course);
24
-	foreach($course as $marker)
24
+	foreach ($course as $marker)
25 25
 	{
26 26
 		date_default_timezone_set('UTC');
27 27
 		$output .= '{"type": "Feature",';
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		$output .= '"type": "'.$marker['type'].'",';
34 34
 		if ($i == 0 || $i == 1) {
35 35
 			$output .= '"icon": "images/tsk/tsk-start.png",';
36
-		} elseif ($i == $f-1 || $i == $f-2) {
36
+		} elseif ($i == $f - 1 || $i == $f - 2) {
37 37
 			$output .= '"icon": "images/tsk/tsk-finish.png",';
38 38
 		} elseif ($marker['type'] == 4) {
39 39
 			$output .= '"icon": "images/kardinalstonne.png",';
Please login to merge, or discard this patch.