Completed
Push — master ( 7b2761...d4dde6 )
by Yannick
29:28
created
country-statistics-route.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
10
+$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))));
11
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
12 12
 
13 13
 if (isset($_GET['sort'])) {
14 14
 	$spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
 
19 19
 if (!empty($spotter_array))
20 20
 {
21
-	$title = sprintf(_("Most Common Routes from %s"),$country);
21
+	$title = sprintf(_("Most Common Routes from %s"), $country);
22 22
 	require_once('header.php');
23 23
 	print '<div class="select-item">';
24 24
 	print '<form action="'.$globalURL.'/country" method="post">';
25 25
 	print '<select name="country" class="selectpicker" data-live-search="true">';
26 26
 	print '<option></option>';
27 27
 	$all_countries = $Spotter->getAllCountries();
28
-	foreach($all_countries as $all_country)
28
+	foreach ($all_countries as $all_country)
29 29
 	{
30
-		if($country == $all_country['country'])
30
+		if ($country == $all_country['country'])
31 31
 		{
32 32
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
33 33
 		} else {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	if ($_GET['country'] != "NA")
43 43
 	{
44 44
 		print '<div class="info column">';
45
-		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
45
+		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
46 46
 		print '</div>';
47 47
 	} else {
48 48
 		print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>';
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	include('country-sub-menu.php');
52 52
 	print '<div class="column">';
53 53
 	print '<h2>'._("Most Common Routes").'</h2>';
54
-	print '<p>'.sprintf(_("The statistic below shows the most common routes of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
54
+	print '<p>'.sprintf(_("The statistic below shows the most common routes of airports &amp; airlines from <strong>%s</strong>."), $country).'</p>';
55 55
 	$route_array = $Spotter->countAllRoutesByCountry($country);
56 56
 	if (!empty($route_array))
57 57
 	{
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		print '</thead>';
67 67
 		print '<tbody>';
68 68
 		$i = 1;
69
-		foreach($route_array as $route_item)
69
+		foreach ($route_array as $route_item)
70 70
 		{
71 71
 			print '<tr>';
72 72
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['country'])) {
6
-        header('Location: '.$globalURL.'/country');
7
-        die();
6
+		header('Location: '.$globalURL.'/country');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
Please login to merge, or discard this patch.
country-statistics-arrival-airport-country.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['country'])) {
6
-        header('Location: '.$globalURL.'/country');
7
-        die();
6
+		header('Location: '.$globalURL.'/country');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	include('country-sub-menu.php');
52 52
 	print '<div class="column">';
53 53
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
54
-        print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
54
+		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
55 55
 
56 56
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country);
57 57
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
10
+$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))));
11
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
12 12
 
13 13
 if (isset($_GET['sort'])) {
14 14
 	$spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
 
19 19
 if (!empty($spotter_array))
20 20
 {
21
-	$title = sprintf(_("Most Common Arrival Airports by Country from %s"),$country);
21
+	$title = sprintf(_("Most Common Arrival Airports by Country from %s"), $country);
22 22
 	require_once('header.php');
23 23
 	print '<div class="select-item">';
24 24
 	print '<form action="'.$globalURL.'/country" method="post">';
25 25
 	print '<select name="country" class="selectpicker" data-live-search="true">';
26 26
 	print '<option></option>';
27 27
 	$all_countries = $Spotter->getAllCountries();
28
-	foreach($all_countries as $all_country)
28
+	foreach ($all_countries as $all_country)
29 29
 	{
30
-		if($country == $all_country['country'])
30
+		if ($country == $all_country['country'])
31 31
 		{
32 32
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
33 33
 		} else {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	if ($_GET['country'] != "NA")
43 43
 	{
44 44
 		print '<div class="info column">';
45
-		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
45
+		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
46 46
 		print '</div>';
47 47
 	} else {
48 48
 		print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>';
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	include('country-sub-menu.php');
52 52
 	print '<div class="column">';
53 53
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
54
-        print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
54
+        print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."), $country).'</p>';
55 55
 
56 56
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country);
57 57
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	print '<div id="chartCountry" class="chart" width="100%"></div><script>';
62 62
 	print 'var series = [';
63 63
 	$country_data = '';
64
-	foreach($airport_country_array as $airport_item)
64
+	foreach ($airport_country_array as $airport_item)
65 65
 	{
66 66
 		$country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],';
67 67
 	}
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		print '</thead>';
110 110
 		print '<tbody>';
111 111
 		$i = 1;
112
-		foreach($airport_country_array as $airport_item)
112
+		foreach ($airport_country_array as $airport_item)
113 113
 		{
114 114
 			print '<tr>';
115 115
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
registration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 
6 6
 if ($_POST['registration'] != "")
7 7
 {
8
-	$registration = filter_input(INPUT_POST,'registration',FILTER_SANITIZE_STRING);
8
+	$registration = filter_input(INPUT_POST, 'registration', FILTER_SANITIZE_STRING);
9 9
 	header('Location: '.$globalURL.'/registration/'.$registration);
10 10
 } else {
11 11
 	if ($globalURL == '') {
Please login to merge, or discard this patch.
manufacturer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
 
6 6
 if ($_POST['aircraft_manufacturer'] != "")
7 7
 {
8
-	$aircraft_manufacturer = filter_input(INPUT_POST,'aircraft_manufacturer',FILTER_SANITIZE_STRING);
8
+	$aircraft_manufacturer = filter_input(INPUT_POST, 'aircraft_manufacturer', FILTER_SANITIZE_STRING);
9 9
 	header('Location: '.$globalURL.'/manufacturer/'.$aircraft_manufacturer);
10 10
 } elseif ($_GET['aircraft_manufacturer'] != "")
11 11
 {
12
-	$aircraft_manufacturer = filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING);
12
+	$aircraft_manufacturer = filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING);
13 13
 	header('Location: '.$globalURL.'/manufacturer/'.$aircraft_manufacturer);
14 14
 } else {
15 15
 	if ($globalURL == '') {
Please login to merge, or discard this patch.
redirect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 if ($_GET['flightaware_id'] != "")
7 7
 {
8
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
8
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
9 9
 	$spotter_id = $Spotter->getSpotterIDBasedOnFlightAwareID($flightaware_id);
10 10
 	if ($spotter_id != "")
11 11
 	{
Please login to merge, or discard this patch.
country.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 if (isset($_POST['country']) && $_POST['country'] != "")
6 6
 {
7
-	$country = filter_input(INPUT_POST,'country',FILTER_SANITIZE_STRING);
7
+	$country = filter_input(INPUT_POST, 'country', FILTER_SANITIZE_STRING);
8 8
 	header('Location: '.$globalURL.'/country/'.$country);
9 9
 } else {
10 10
 	if ($globalURL == '') {
Please login to merge, or discard this patch.
live-czml.php 3 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -39,30 +39,30 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 function quaternionrotate($heading, $attitude = 0, $bank = 0) {
42
-    // Assuming the angles are in radians.
43
-    $c1 = cos($heading/2);
44
-    $s1 = sin($heading/2);
45
-    $c2 = cos($attitude/2);
46
-    $s2 = sin($attitude/2);
47
-    $c3 = cos($bank/2);
48
-    $s3 = sin($bank/2);
49
-    $c1c2 = $c1*$c2;
50
-    $s1s2 = $s1*$s2;
51
-    $w =$c1c2*$c3 - $s1s2*$s3;
52
-    $x =$c1c2*$s3 + $s1s2*$c3;
53
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
54
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
55
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
42
+	// Assuming the angles are in radians.
43
+	$c1 = cos($heading/2);
44
+	$s1 = sin($heading/2);
45
+	$c2 = cos($attitude/2);
46
+	$s2 = sin($attitude/2);
47
+	$c3 = cos($bank/2);
48
+	$s3 = sin($bank/2);
49
+	$c1c2 = $c1*$c2;
50
+	$s1s2 = $s1*$s2;
51
+	$w =$c1c2*$c3 - $s1s2*$s3;
52
+	$x =$c1c2*$s3 + $s1s2*$c3;
53
+	$y =$s1*$c2*$c3 + $c1*$s2*$s3;
54
+	$z =$c1*$s2*$c3 - $s1*$c2*$s3;
55
+	return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
56 56
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
57 57
 
58 58
 }
59 59
 
60 60
 
61 61
 if (isset($_GET['download'])) {
62
-    if ($_GET['download'] == "true")
63
-    {
62
+	if ($_GET['download'] == "true")
63
+	{
64 64
 	header('Content-disposition: attachment; filename="flightairmap.json"');
65
-    }
65
+	}
66 66
 }
67 67
 header('Content-Type: text/javascript');
68 68
 
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
 			$image = "images/placeholder_thumb.png";
253 253
 		}
254 254
 
255
-                if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
256
-                elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
257
-                elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
258
-                if ($prev_flightaware_id != $id) {
255
+				if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
256
+				elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
257
+				elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
258
+				if ($prev_flightaware_id != $id) {
259 259
 			if ($prev_flightaware_id != '') {
260 260
 				/*
261 261
 				if ($nblatlong == 1) {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
336 336
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
337 337
 						} else $aircraft_shadow = '';
338
-	    					$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
338
+							$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
339 339
 						if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
340 340
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
341 341
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
367 367
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
368 368
 						}
369
-    						$output .= '},';
369
+							$output .= '},';
370 370
 					} elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') {
371 371
 						$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : 1.0,"minimumPixelSize": 20';
372 372
 						$output .= ',"heightReference": "'.$heightrelative.'"';
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
375 375
 							$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
376 376
 						}
377
-    						$output .= '},';
377
+							$output .= '},';
378 378
 					} elseif ($aircraft_icao != '') {
379 379
 						$aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao);
380 380
 						if (isset($aircraft_info[0]['engine_type'])) {
Please login to merge, or discard this patch.
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
     $s3 = sin($bank/2);
49 49
     $c1c2 = $c1*$c2;
50 50
     $s1s2 = $s1*$s2;
51
-    $w =$c1c2*$c3 - $s1s2*$s3;
52
-    $x =$c1c2*$s3 + $s1s2*$c3;
53
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
54
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
55
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
51
+    $w = $c1c2*$c3 - $s1s2*$s3;
52
+    $x = $c1c2*$s3 + $s1s2*$c3;
53
+    $y = $s1*$c2*$c3 + $c1*$s2*$s3;
54
+    $z = $c1*$s2*$c3 - $s1*$c2*$s3;
55
+    return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w);
56 56
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
57 57
 
58 58
 }
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 $min = false;
74 74
 $allhistory = false;
75 75
 $filter['source'] = array();
76
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
77
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
78
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
79
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
80
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
81
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
82
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
83
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
84
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
85
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
86
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
76
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
77
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
78
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
79
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
80
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
81
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
82
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
83
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
84
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
85
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
86
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
87 87
 /*
88 88
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
89 89
 	$min = true;
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 	$from_archive = true;
131 131
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
132 132
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
133
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
134
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
135
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
136
-	$begindate = date('Y-m-d H:i:s',$begindate);
137
-	$enddate = date('Y-m-d H:i:s',$enddate);
138
-	$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
133
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
134
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
135
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
136
+	$begindate = date('Y-m-d H:i:s', $begindate);
137
+	$enddate = date('Y-m-d H:i:s', $enddate);
138
+	$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter);
139 139
 } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) {
140 140
 	$from_archive = true;
141 141
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
@@ -145,34 +145,34 @@  discard block
 block discarded – undo
145 145
 	$begindate = $_COOKIE['archive_begin'];
146 146
 	$enddate = $_COOKIE['archive_end'];
147 147
 
148
-	$archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT);
149
-	$begindate = date('Y-m-d H:i:s',$begindate);
150
-	$enddate = date('Y-m-d H:i:s',$enddate);
148
+	$archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT);
149
+	$begindate = date('Y-m-d H:i:s', $begindate);
150
+	$enddate = date('Y-m-d H:i:s', $enddate);
151 151
 //	echo 'Begin : '.$begindate.' - End : '.$enddate."\n";
152
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
152
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
153 153
 } elseif ($tracker) {
154 154
 	$coord = array();
155 155
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
156
-		$coord = explode(',',$_GET['coord']);
156
+		$coord = explode(',', $_GET['coord']);
157 157
 	}
158
-	$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true);
158
+	$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true);
159 159
 } elseif ($marine) {
160 160
 	$coord = array();
161 161
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
162
-		$coord = explode(',',$_GET['coord']);
162
+		$coord = explode(',', $_GET['coord']);
163 163
 	}
164
-	$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true);
164
+	$spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true);
165 165
 } else {
166 166
 	$coord = array();
167 167
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
168
-		$coord = explode(',',$_GET['coord']);
168
+		$coord = explode(',', $_GET['coord']);
169 169
 	}
170
-	$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true);
170
+	$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true);
171 171
 }
172 172
 //print_r($spotter_array);
173 173
 if (!empty($spotter_array) && isset($coord)) {
174 174
 	if (isset($_GET['archive'])) {
175
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
175
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
176 176
 	} elseif ($tracker) {
177 177
 		$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
178 178
 	} elseif ($marine) {
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
 	if ($flightcnt == '') $flightcnt = 0;
184 184
 } else $flightcnt = 0;
185 185
 
186
-$sqltime = round(microtime(true)-$begintime,2);
186
+$sqltime = round(microtime(true) - $begintime, 2);
187 187
 $minitime = time();
188 188
 $maxitime = 0;
189
-$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT);
189
+$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT);
190 190
 $modelsdb = array();
191 191
 if (file_exists(dirname(__FILE__).'/models/modelsdb')) {
192
-	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) {
193
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
194
-			if (isset($row[1]) ){
192
+	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) {
193
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
194
+			if (isset($row[1])) {
195 195
 				$model = $row[0];
196 196
 				$modelsdb[$model] = $row[1];
197 197
 			}
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
 }
202 202
 $modelsdb2 = array();
203 203
 if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) {
204
-	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) {
205
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
206
-			if (isset($row[1]) ){
204
+	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) {
205
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
206
+			if (isset($row[1])) {
207 207
 				$model = $row[0];
208 208
 				$modelsdb2[$model] = $row[1];
209 209
 			}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 if (!empty($spotter_array) && is_array($spotter_array))
242 242
 {
243 243
 	$nblatlong = 0;
244
-	foreach($spotter_array as $spotter_item)
244
+	foreach ($spotter_array as $spotter_item)
245 245
 	{
246 246
 		$j++;
247 247
 		//if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND';
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
 			$output .= '"lastupdate": "'.$lastupdate.'",';
284 284
 			$output .= '"format": "'.$spotter_item['format_source'].'",';
285 285
 			if ($tracker) {
286
-				$output.= '"type": "tracker"';
286
+				$output .= '"type": "tracker"';
287 287
 			} elseif ($marine) {
288
-				$output.= '"type": "marine"';
288
+				$output .= '"type": "marine"';
289 289
 			} else {
290 290
 				if (isset($globalMap3DLiveries) && $globalMap3DLiveries) {
291 291
 					$aircraft_icao = $spotter_item['aircraft_icao'];
@@ -299,14 +299,14 @@  discard block
 block discarded – undo
299 299
 						if (isset($airline_icao)) {
300 300
 							$imagefile = $aircraft_icao.'-'.$airline_icao.'.png';
301 301
 							if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) {
302
-								$output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
302
+								$output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
303 303
 							}
304 304
 						}
305 305
 					}
306
-					if ($ident != '') $output.= '"ident": "'.$ident.'",';
306
+					if ($ident != '') $output .= '"ident": "'.$ident.'",';
307 307
 				}
308
-				$output.= '"gltf2": %gltf2%,';
309
-				$output.= '"type": "flight"';
308
+				$output .= '"gltf2": %gltf2%,';
309
+				$output .= '"type": "flight"';
310 310
 			}
311 311
 			$output .= '},';
312 312
 
@@ -659,8 +659,8 @@  discard block
 block discarded – undo
659 659
 					$output .= '},';
660 660
 				}
661 661
 			}
662
-			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
663
-			else $output = str_replace('%onground%','false',$output);
662
+			if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output);
663
+			else $output = str_replace('%onground%', 'false', $output);
664 664
 
665 665
 	//		$output .= '"heightReference": "CLAMP_TO_GROUND",';
666 666
 			//$output .= '"heightReference": "'.$heightrelative.'",';
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 			$output .= '"cartographicDegrees": [';
676 676
 			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
677 677
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
678
-			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
678
+			$output .= '"'.date("c", strtotime($spotter_item['date'])).'", ';
679 679
 			$output .= $spotter_item['longitude'].', ';
680 680
 			$output .= $spotter_item['latitude'];
681 681
 			$prevlong = $spotter_item['longitude'];
@@ -703,8 +703,8 @@  discard block
 block discarded – undo
703 703
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
704 704
 			//$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
705 705
 		} else {
706
-			$nblatlong = $nblatlong+1;
707
-			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
706
+			$nblatlong = $nblatlong + 1;
707
+			$output .= ',"'.date("c", strtotime($spotter_item['date'])).'", ';
708 708
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
709 709
 			if ($spotter_item['ground_speed'] == 0) {
710 710
 				$output .= $prevlong.', ';
@@ -744,17 +744,17 @@  discard block
 block discarded – undo
744 744
 }
745 745
 $output .= ']';
746 746
 if (isset($globalArchive) && $globalArchive === TRUE) {
747
-	if ((time()-$globalLiveInterval) > $minitime) {
748
-		if (time()-$globalLiveInterval > $maxitime) {
749
-			$output = str_replace('%minitime%',date("c",$maxitime),$output);
747
+	if ((time() - $globalLiveInterval) > $minitime) {
748
+		if (time() - $globalLiveInterval > $maxitime) {
749
+			$output = str_replace('%minitime%', date("c", $maxitime), $output);
750 750
 		} else {
751
-			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
751
+			$output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output);
752 752
 		}
753 753
 	}
754
-	else $output = str_replace('%minitime%',date("c",$minitime),$output);
755
-} else $output = str_replace('%minitime%',date("c",$minitime),$output);
756
-$output = str_replace('%maxitime%',date("c",$maxitime),$output);
757
-if ($gltf2) $output = str_replace('%gltf2%','true',$output);
758
-else $output = str_replace('%gltf2%','false',$output);
754
+	else $output = str_replace('%minitime%', date("c", $minitime), $output);
755
+} else $output = str_replace('%minitime%', date("c", $minitime), $output);
756
+$output = str_replace('%maxitime%', date("c", $maxitime), $output);
757
+if ($gltf2) $output = str_replace('%gltf2%', 'true', $output);
758
+else $output = str_replace('%gltf2%', 'false', $output);
759 759
 print $output;
760 760
 ?>
Please login to merge, or discard this patch.
Braces   +119 added lines, -43 removed lines patch added patch discarded remove patch
@@ -8,8 +8,12 @@  discard block
 block discarded – undo
8 8
 }
9 9
 $tracker = false;
10 10
 $marine = false;
11
-if (isset($_GET['tracker'])) $tracker = true;
12
-if (isset($_GET['marine'])) $marine = true;
11
+if (isset($_GET['tracker'])) {
12
+	$tracker = true;
13
+}
14
+if (isset($_GET['marine'])) {
15
+	$marine = true;
16
+}
13 17
 if ($tracker) {
14 18
 	require_once('require/class.Tracker.php');
15 19
 	require_once('require/class.TrackerLive.php');
@@ -66,24 +70,49 @@  discard block
 block discarded – undo
66 70
 }
67 71
 header('Content-Type: text/javascript');
68 72
 
69
-if (!isset($globalJsonCompress)) $compress = true;
70
-else $compress = $globalJsonCompress;
73
+if (!isset($globalJsonCompress)) {
74
+	$compress = true;
75
+} else {
76
+	$compress = $globalJsonCompress;
77
+}
71 78
 
72 79
 $from_archive = false;
73 80
 $min = false;
74 81
 $allhistory = false;
75 82
 $filter['source'] = array();
76
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
77
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
78
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
79
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
80
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
81
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
82
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
83
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
84
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
85
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
86
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
83
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
84
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
85
+}
86
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
87
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
88
+}
89
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
90
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
91
+}
92
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
93
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
94
+}
95
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
96
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
97
+}
98
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
99
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
100
+}
101
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
102
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
103
+}
104
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
105
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
106
+}
107
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
108
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
109
+}
110
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
111
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
112
+}
113
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
114
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
115
+}
87 116
 /*
88 117
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
89 118
 	$min = true;
@@ -180,8 +209,12 @@  discard block
 block discarded – undo
180 209
 	} else {
181 210
 		$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
182 211
 	}
183
-	if ($flightcnt == '') $flightcnt = 0;
184
-} else $flightcnt = 0;
212
+	if ($flightcnt == '') {
213
+		$flightcnt = 0;
214
+	}
215
+	} else {
216
+	$flightcnt = 0;
217
+}
185 218
 
186 219
 $sqltime = round(microtime(true)-$begintime,2);
187 220
 $minitime = time();
@@ -217,7 +250,9 @@  discard block
 block discarded – undo
217 250
 $prev_flightaware_id = '';
218 251
 $speed = 1;
219 252
 $gltf2 = false;
220
-if (isset($archivespeed)) $speed = $archivespeed;
253
+if (isset($archivespeed)) {
254
+	$speed = $archivespeed;
255
+}
221 256
 $output = '[';
222 257
 if ($tracker) {
223 258
 	$output .= '{"id" : "document", "name" : "tracker","version" : "1.0"';
@@ -253,9 +288,13 @@  discard block
 block discarded – undo
253 288
 			$image = "images/placeholder_thumb.png";
254 289
 		}
255 290
 
256
-                if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
257
-                elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
258
-                elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
291
+                if (isset($spotter_item['flightaware_id'])) {
292
+                	$id = $spotter_item['flightaware_id'];
293
+                } elseif (isset($spotter_item['famtrackid'])) {
294
+                	$id = $spotter_item['famtrackid'];
295
+                } elseif (isset($spotter_item['fammarine_id'])) {
296
+                	$id = $spotter_item['fammarine_id'];
297
+                }
259 298
                 if ($prev_flightaware_id != $id) {
260 299
 			if ($prev_flightaware_id != '') {
261 300
 				/*
@@ -303,7 +342,9 @@  discard block
 block discarded – undo
303 342
 							}
304 343
 						}
305 344
 					}
306
-					if ($ident != '') $output.= '"ident": "'.$ident.'",';
345
+					if ($ident != '') {
346
+						$output.= '"ident": "'.$ident.'",';
347
+					}
307 348
 				}
308 349
 				$output.= '"gltf2": %gltf2%,';
309 350
 				$output.= '"type": "flight"';
@@ -335,7 +376,9 @@  discard block
 block discarded – undo
335 376
 							$spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
336 377
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
337 378
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
338
-						} else $aircraft_shadow = '';
379
+						} else {
380
+							$aircraft_shadow = '';
381
+						}
339 382
 	    					$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
340 383
 						if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
341 384
 							$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
@@ -343,7 +386,9 @@  discard block
 block discarded – undo
343 386
 						}
344 387
 						$output .= '},';
345 388
 					}
346
-				} else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjan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FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},';
389
+				} else {
390
+					$output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8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AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},';
391
+				}
347 392
 			} elseif ($one3dmodel) {
348 393
 				if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') {
349 394
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20';
@@ -383,7 +428,9 @@  discard block
 block discarded – undo
383 428
 							$spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
384 429
 							$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
385 430
 							$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
386
-						} else $aircraft_shadow = '';
431
+						} else {
432
+							$aircraft_shadow = '';
433
+						}
387 434
 						if ($aircraft_shadow != '') {
388 435
 							if (isset($modelsdb[$aircraft_shadow])) {
389 436
 								$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20';
@@ -520,7 +567,9 @@  discard block
 block discarded – undo
520 567
 								}
521 568
 								$output .= '},';
522 569
 								//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
523
-								if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
570
+								if ($spotter_item['aircraft_icao'] != '') {
571
+									$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
572
+								}
524 573
 								$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
525 574
 							}
526 575
 						} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
@@ -542,7 +591,9 @@  discard block
 block discarded – undo
542 591
 							}
543 592
 							$output .= '},';
544 593
 							//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
545
-							if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
594
+							if ($spotter_item['aircraft_icao'] != '') {
595
+								$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
596
+							}
546 597
 							$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
547 598
 						}
548 599
 					} else {
@@ -555,7 +606,9 @@  discard block
 block discarded – undo
555 606
 						}
556 607
 						$output .= '},';
557 608
 						//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
558
-						if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
609
+						if ($spotter_item['aircraft_icao'] != '') {
610
+							$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
611
+						}
559 612
 						$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
560 613
 					}
561 614
 				} elseif ($tracker && isset($spotter_item['type'])) {
@@ -659,8 +712,11 @@  discard block
 block discarded – undo
659 712
 					$output .= '},';
660 713
 				}
661 714
 			}
662
-			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
663
-			else $output = str_replace('%onground%','false',$output);
715
+			if (isset($onground) && $onground) {
716
+				$output = str_replace('%onground%','true',$output);
717
+			} else {
718
+				$output = str_replace('%onground%','false',$output);
719
+			}
664 720
 
665 721
 	//		$output .= '"heightReference": "CLAMP_TO_GROUND",';
666 722
 			//$output .= '"heightReference": "'.$heightrelative.'",';
@@ -673,8 +729,12 @@  discard block
 block discarded – undo
673 729
 	//		$output .= '"interpolationDegree" : 5,';
674 730
 	//		$output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", ';
675 731
 			$output .= '"cartographicDegrees": [';
676
-			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
677
-			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
732
+			if ($minitime > strtotime($spotter_item['date'])) {
733
+				$minitime = strtotime($spotter_item['date']);
734
+			}
735
+			if ($maxitime < strtotime($spotter_item['date'])) {
736
+				$maxitime = strtotime($spotter_item['date']);
737
+			}
678 738
 			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
679 739
 			$output .= $spotter_item['longitude'].', ';
680 740
 			$output .= $spotter_item['latitude'];
@@ -697,7 +757,9 @@  discard block
 block discarded – undo
697 757
 					$output .= ', '.round($spotter_item['altitude']*30.48);
698 758
 					$prevalt = round($spotter_item['altitude']*30.48);
699 759
 				}
700
-			} else $output .= ', 0';
760
+			} else {
761
+				$output .= ', 0';
762
+			}
701 763
 			//$orientation = '"orientation" : { ';
702 764
 			//$orientation .= '"unitQuaternion": [';
703 765
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
@@ -705,13 +767,18 @@  discard block
 block discarded – undo
705 767
 		} else {
706 768
 			$nblatlong = $nblatlong+1;
707 769
 			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
708
-			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
770
+			if ($maxitime < strtotime($spotter_item['date'])) {
771
+				$maxitime = strtotime($spotter_item['date']);
772
+			}
709 773
 			if ($spotter_item['ground_speed'] == 0) {
710 774
 				$output .= $prevlong.', ';
711 775
 				$output .= $prevlat;
712 776
 				//if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt;
713
-				if (!$marine) $output .= ', '.$prevalt;
714
-				else $output .= ', 0';
777
+				if (!$marine) {
778
+					$output .= ', '.$prevalt;
779
+				} else {
780
+					$output .= ', 0';
781
+				}
715 782
 			} else {
716 783
 				$output .= $spotter_item['longitude'].', ';
717 784
 				$output .= $spotter_item['latitude'];
@@ -724,14 +791,17 @@  discard block
 block discarded – undo
724 791
 							$output .= ', 0';
725 792
 						}
726 793
 					} else {
727
-						if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048);
728
-						elseif ($tracker) {
794
+						if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
795
+							$output .= ', '.round($spotter_item['real_altitude']*0.3048);
796
+						} elseif ($tracker) {
729 797
 							$output .= ', '.round($spotter_item['altitude']*0.3048);
730 798
 						} else {
731 799
 							$output .= ', '.round($spotter_item['altitude']*30.48);
732 800
 						}
733 801
 					}
734
-				} else $output .= ', 0';
802
+				} else {
803
+					$output .= ', 0';
804
+				}
735 805
 			}
736 806
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
737 807
 			//$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
@@ -750,11 +820,17 @@  discard block
 block discarded – undo
750 820
 		} else {
751 821
 			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
752 822
 		}
823
+	} else {
824
+		$output = str_replace('%minitime%',date("c",$minitime),$output);
753 825
 	}
754
-	else $output = str_replace('%minitime%',date("c",$minitime),$output);
755
-} else $output = str_replace('%minitime%',date("c",$minitime),$output);
826
+	} else {
827
+	$output = str_replace('%minitime%',date("c",$minitime),$output);
828
+}
756 829
 $output = str_replace('%maxitime%',date("c",$maxitime),$output);
757
-if ($gltf2) $output = str_replace('%gltf2%','true',$output);
758
-else $output = str_replace('%gltf2%','false',$output);
830
+if ($gltf2) {
831
+	$output = str_replace('%gltf2%','true',$output);
832
+} else {
833
+	$output = str_replace('%gltf2%','false',$output);
834
+}
759 835
 print $output;
760 836
 ?>
Please login to merge, or discard this patch.
pilot-detailed.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Language.php');
6 6
 require_once('require/class.SpotterArchive.php');
7 7
 
8
-if (!isset($_GET['pilot'])){
8
+if (!isset($_GET['pilot'])) {
9 9
 	header('Location: '.$globalURL.'/');
10 10
 } else {
11 11
 	$Spotter = new Spotter();
12 12
 	$SpotterArchive = new SpotterArchive();
13 13
 	//calculuation for the pagination
14
-	if(!isset($_GET['limit']))
14
+	if (!isset($_GET['limit']))
15 15
 	{
16 16
 		$limit_start = 0;
17 17
 		$limit_end = 25;
@@ -32,29 +32,29 @@  discard block
 block discarded – undo
32 32
 	
33 33
 	$page_url = $globalURL.'/pilot/'.$_GET['pilot'];
34 34
 	
35
-	$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING);
36
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
37
-	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38
-	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
35
+	$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING);
36
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
37
+	$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
38
+	$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
39 39
 	$filter = array();
40
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
41
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
40
+	if ($year != '') $filter = array_merge($filter, array('year' => $year));
41
+	if ($month != '') $filter = array_merge($filter, array('month' => $month));
42 42
 	if ($sort != '') 
43 43
 	{
44
-		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
44
+		$spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter);
45 45
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
46
-			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
46
+			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter);
47 47
 		}
48 48
 	} else {
49
-		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter);
49
+		$spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter);
50 50
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
51
-			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter);
51
+			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter);
52 52
 		}
53 53
 	}
54 54
 
55 55
 	if (!empty($spotter_array))
56 56
 	{
57
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']);
57
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['pilot_name']);
58 58
 		$ident = $spotter_array[0]['ident'];
59 59
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
60 60
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -115,23 +115,23 @@  discard block
 block discarded – undo
115 115
 			$Stats = new Stats();
116 116
 			$flights = $Stats->getStatsPilot($pilot);
117 117
 		} else $flights = 0;
118
-		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter);
118
+		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot, $filter);
119 119
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
120
-		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter));
120
+		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot, $filter));
121 121
 		print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>';
122
-		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot,$filter));
122
+		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot, $filter));
123 123
 		print '<div><span class="label">'._("Aircrafts").'</span>'.$aircraft_registration.'</div>';
124
-		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot,$filter));
124
+		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot, $filter));
125 125
 		print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>';
126
-		$airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter));
126
+		$airlines = count($Spotter->countAllAirlinesByPilot($pilot, $filter));
127 127
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
128
-		$duration = $Spotter->getFlightDurationByPilot($pilot,$filter);
128
+		$duration = $Spotter->getFlightDurationByPilot($pilot, $filter);
129 129
 		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
130 130
 		print '</div>';
131 131
 	
132 132
 		include('pilot-sub-menu.php');
133 133
 		print '<div class="table column">';
134
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>';
134
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>';
135 135
 
136 136
 		include('table-output.php'); 
137 137
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,8 +37,12 @@  discard block
 block discarded – undo
37 37
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38 38
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
39 39
 	$filter = array();
40
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
41
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
40
+	if ($year != '') {
41
+		$filter = array_merge($filter,array('year' => $year));
42
+	}
43
+	if ($month != '') {
44
+		$filter = array_merge($filter,array('month' => $month));
45
+	}
42 46
 	if ($sort != '') 
43 47
 	{
44 48
 		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -56,8 +60,12 @@  discard block
 block discarded – undo
56 60
 	{
57 61
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']);
58 62
 		$ident = $spotter_array[0]['ident'];
59
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
60
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
63
+		if (isset($spotter_array[0]['latitude'])) {
64
+			$latitude = $spotter_array[0]['latitude'];
65
+		}
66
+		if (isset($spotter_array[0]['longitude'])) {
67
+			$longitude = $spotter_array[0]['longitude'];
68
+		}
61 69
 		require_once('header.php');
62 70
 		/*
63 71
 		if (isset($globalArchive) && $globalArchive) {
@@ -110,12 +118,18 @@  discard block
 block discarded – undo
110 118
 		*/
111 119
 		print '<div class="info column">';
112 120
 		print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>';
113
-		if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>';
121
+		if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') {
122
+			print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>';
123
+		}
114 124
 		if ($year == '' && $month == '') {
115 125
 			$Stats = new Stats();
116 126
 			$flights = $Stats->getStatsPilot($pilot);
117
-		} else $flights = 0;
118
-		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter);
127
+		} else {
128
+			$flights = 0;
129
+		}
130
+		if ($flights == 0) {
131
+			$flights = $Spotter->countFlightsByPilot($pilot,$filter);
132
+		}
119 133
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
120 134
 		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter));
121 135
 		print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>';
@@ -126,7 +140,9 @@  discard block
 block discarded – undo
126 140
 		$airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter));
127 141
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
128 142
 		$duration = $Spotter->getFlightDurationByPilot($pilot,$filter);
129
-		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
143
+		if ($duration != '0') {
144
+			print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
145
+		}
130 146
 		print '</div>';
131 147
 	
132 148
 		include('pilot-sub-menu.php');
Please login to merge, or discard this patch.
route.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 
6 6
 if (isset($_POST['departure_airport']) && $_POST['departure_airport'] != '')
7 7
 {
8
-	$departure_airport = filter_input(INPUT_POST,'departure_airport',FILTER_SANITIZE_STRING);
9
-	$arrival_airport = filter_input(INPUT_POST,'arrival_airport',FILTER_SANITIZE_STRING);
8
+	$departure_airport = filter_input(INPUT_POST, 'departure_airport', FILTER_SANITIZE_STRING);
9
+	$arrival_airport = filter_input(INPUT_POST, 'arrival_airport', FILTER_SANITIZE_STRING);
10 10
 	header('Location: '.$globalURL.'/route/'.$departure_airport.'/'.$arrival_airport);
11 11
 } else {
12 12
 	if ($globalURL == '') {
Please login to merge, or discard this patch.