Completed
Push — master ( e8aabf...bcd2cf )
by Yannick
07:24
created
route-statistics-time.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 require_once('require/class.Language.php');
10 10
 
11 11
 $Spotter = new Spotter();
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13 13
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
14 14
 	$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);
15 15
 } else $spotter_array = array();
16 16
 
17 17
 if (!empty($spotter_array))
18 18
 {
19
-	$title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']);
19
+	$title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']);
20 20
 	require_once('header.php');
21 21
 	print '<div class="info column">';
22 22
 	print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>';
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	include('route-sub-menu.php');
28 28
 	print '<div class="column">';
29 29
 	print '<h2>'._("Most Common Time of Day").'</h2>';
30
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>';
30
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>';
31 31
 
32 32
 	$hour_array = $Spotter->countAllHoursByRoute($_GET['departure_airport'], $_GET['arrival_airport']);
33 33
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             var data = google.visualization.arrayToDataTable([
40 40
             	["'._("Hour").'", "'._("# of Flights").'"], ';
41 41
             	$hour_data = '';
42
-	foreach($hour_array as $hour_item)
42
+	foreach ($hour_array as $hour_item)
43 43
 	{
44 44
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
45 45
 	}
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
           function drawChart() {
35 35
             var data = google.visualization.arrayToDataTable([
36 36
             	["'._("Hour").'", "'._("# of Flights").'"], ';
37
-            	$hour_data = '';
37
+				$hour_data = '';
38 38
 	foreach($hour_array as $hour_item)
39 39
 	{
40 40
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13 13
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
14 14
 	$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);
15
-} else $spotter_array = array();
15
+} else {
16
+	$spotter_array = array();
17
+}
16 18
   
17 19
 if (!empty($spotter_array))
18 20
 {
Please login to merge, or discard this patch.
ident-statistics-departure-airport.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Departure Airports of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Departure Airports of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByIdent($ident);
29 29
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
30 30
     	<script>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         	["'._("Airport").'", "'._("# of times").'"],';
40 40
 
41 41
 	$airport_data = '';
42
-	foreach($airport_airport_array as $airport_item)
42
+	foreach ($airport_airport_array as $airport_item)
43 43
 	{
44 44
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
45 45
 		$name = str_replace("'", "", $name);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	print '</thead>';
79 79
 	print '<tbody>';
80 80
 	$i = 1;
81
-	foreach($airport_airport_array as $airport_item)
81
+	foreach ($airport_airport_array as $airport_item)
82 82
 	{
83 83
 		print '<tr>';
84 84
 		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['ident'])) {
6
-        header('Location: '.$globalURL.'/ident');
7
-        die();
6
+		header('Location: '.$globalURL.'/ident');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
tools-notam.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 $page_url = $globalURL.'/tools-notam';
12 12
 
13
-$message = filter_input(INPUT_POST,'notam_message',FILTER_SANITIZE_STRING);
13
+$message = filter_input(INPUT_POST, 'notam_message', FILTER_SANITIZE_STRING);
14 14
 
15 15
 print '<div class="info column">';
16 16
 print '<h1>'._("Parse NOTAM messages").'</h1>';
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	if (!empty($notam_parse)) {
35 35
 		print '<p>'._("NOTAM message in human readable format:").'</p>';
36 36
 		foreach ($notam_parse as $key => $value) {
37
-			print '<b>'.strtoupper(str_replace('_',' ',$key)).'</b>: '.$value.'<br />';
37
+			print '<b>'.strtoupper(str_replace('_', ' ', $key)).'</b>: '.$value.'<br />';
38 38
 		}
39 39
 	} else {
40 40
 		print '<p>'._("This NOTAM message can't be translated in human readable format :(").'</p>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 print '<fieldset class="form-group">';
24 24
 print '<label for="notam_message">'._("NOTAM Message").'</label>';
25 25
 print '<textarea class="form-control" name="notam_message" id="notam_message" rows="5">';
26
-if ($message != '') print $message;
26
+if ($message != '') {
27
+	print $message;
28
+}
27 29
 print '</textarea>';
28 30
 print '</fieldset>';
29 31
 print '<button type="submit" class="btn btn-primary">Submit</button>';
Please login to merge, or discard this patch.
aircraft-statistics-airline-country.php 3 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 	header('Location: '.$globalURL.'/aircraft');
9 9
 	die();
10 10
 }
11
-$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1","");
11
+$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", "");
13 13
 
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Airlines by Country from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']);
17
+	$title = sprintf(_("Most Common Airlines by Country from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']);
18 18
 	require_once('header.php');
19 19
     
20 20
 	print '<div class="select-item">';
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	print '<select name="aircraft_type" class="selectpicker" data-live-search="true">';
23 23
     	print '<option></option>';
24 24
     	$aircraft_types = $Spotter->getAllAircraftTypes();
25
-    	foreach($aircraft_types as $aircrafttype)
25
+    	foreach ($aircraft_types as $aircrafttype)
26 26
     	{
27
-    		if($aircraft_type == $aircrafttype['aircraft_icao'])
27
+    		if ($aircraft_type == $aircrafttype['aircraft_icao'])
28 28
     		{
29 29
     			print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>';
30 30
     		} else {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	include('aircraft-sub-menu.php');
51 51
 	print '<div class="column">';
52 52
 	print '<h2>'._("Most Common Airlines by Country").'</h2>';
53
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>';
53
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>';
54 54
 
55 55
 	$airline_array = $Spotter->countAllAirlineCountriesByAircraft($aircraft_type);
56 56
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         	    var data = google.visualization.arrayToDataTable([
63 63
             		["Country", "# of times"], ';
64 64
             		$country_data = '';
65
-	foreach($airline_array as $airline_item)
65
+	foreach ($airline_array as $airline_item)
66 66
 	{
67 67
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
68 68
 	}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		print '</thead>';
94 94
 		print '<tbody>';
95 95
 		$i = 1;
96
-		foreach($airline_array as $airline_item)
96
+		foreach ($airline_array as $airline_item)
97 97
 		{
98 98
 			print '<tr>';
99 99
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
 	print '<div class="select-item">';
22 22
 	print '<form action="'.$globalURL.'/aircraft" method="post">';
23 23
 	print '<select name="aircraft_type" class="selectpicker" data-live-search="true">';
24
-    	print '<option></option>';
25
-    	$Stats = new Stats();
26
-    	$aircraft_types = $Stats->getAllAircraftTypes();
27
-    	if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
28
-    	foreach($aircraft_types as $aircrafttype)
29
-    	{
30
-    		if($aircraft_type == $aircrafttype['aircraft_icao'])
31
-    		{
32
-    			print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>';
33
-    		} else {
34
-    			print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>';
35
-    		}
24
+		print '<option></option>';
25
+		$Stats = new Stats();
26
+		$aircraft_types = $Stats->getAllAircraftTypes();
27
+		if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
28
+		foreach($aircraft_types as $aircrafttype)
29
+		{
30
+			if($aircraft_type == $aircrafttype['aircraft_icao'])
31
+			{
32
+				print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>';
33
+			} else {
34
+				print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>';
35
+			}
36 36
 	}
37 37
 	print '</select>';
38 38
 	print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>';
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         	function drawChart() {
65 65
         	    var data = google.visualization.arrayToDataTable([
66 66
             		["Country", "# of times"], ';
67
-            		$country_data = '';
67
+					$country_data = '';
68 68
 	foreach($airline_array as $airline_item)
69 69
 	{
70 70
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@
 block discarded – undo
24 24
     	print '<option></option>';
25 25
     	$Stats = new Stats();
26 26
     	$aircraft_types = $Stats->getAllAircraftTypes();
27
-    	if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
27
+    	if (empty($aircraft_types)) {
28
+    		$aircraft_types = $Spotter->getAllAircraftTypes();
29
+    	}
28 30
     	foreach($aircraft_types as $aircrafttype)
29 31
     	{
30 32
     		if($aircraft_type == $aircrafttype['aircraft_icao'])
Please login to merge, or discard this patch.
getImages.php 3 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,7 +63,10 @@
 block discarded – undo
63 63
     imagedestroy($image);
64 64
 } else {
65 65
     header('Content-type: image/png');
66
-    if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename);
67
-    else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename);
68
-}
66
+    if ($color == 'FF0000') {
67
+    	readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename);
68
+    } else {
69
+    	readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename);
70
+    }
71
+    }
69 72
 ?>
70 73
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -4,88 +4,88 @@
 block discarded – undo
4 4
 	$hex = str_replace("#", "", $hex);
5 5
 	$color = array();
6 6
 	if (strlen($hex) == 3) {
7
-	    $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1));
8
-	    $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1));
9
-	    $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1));
7
+		$color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1));
8
+		$color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1));
9
+		$color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1));
10 10
 	} else if (strlen($hex) == 6) {
11
-	    $color['r'] = hexdec(substr($hex, 0, 2));
12
-	    $color['g'] = hexdec(substr($hex, 2, 2));
13
-	    $color['b'] = hexdec(substr($hex, 4, 2));
11
+		$color['r'] = hexdec(substr($hex, 0, 2));
12
+		$color['g'] = hexdec(substr($hex, 2, 2));
13
+		$color['b'] = hexdec(substr($hex, 4, 2));
14 14
 	}
15 15
 	return $color;
16 16
 }
17 17
 
18 18
 
19 19
 if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { 
20
-    exit(0);
20
+	exit(0);
21 21
 }
22 22
 $color = $_GET['color'];
23 23
 if (!isset($_GET['filename']) || !preg_match('/^[a-z0-9-_]+\.png$/', strtolower($_GET['filename']))) {
24
-    echo "Incorrect filename";
25
-    exit(0);
24
+	echo "Incorrect filename";
25
+	exit(0);
26 26
 }
27 27
 $filename = $_GET['filename'];
28 28
 if (file_exists(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename)) {
29
-    header('Content-type: image/png');
30
-    readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename);
31
-    exit(0);
29
+	header('Content-type: image/png');
30
+	readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename);
31
+	exit(0);
32 32
 }
33 33
 $original = dirname(__FILE__).DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'aircrafts'.DIRECTORY_SEPARATOR.'new'.DIRECTORY_SEPARATOR.$filename;
34 34
 if (!file_exists($original)) {
35
-    echo "File not found";
35
+	echo "File not found";
36 36
 }
37 37
 
38 38
 if (extension_loaded('gd') && function_exists('gd_info')) {
39
-    $image = imagecreatefrompng($original);
40
-    $index = imagecolorexact($image,26,49,81);
41
-    if ($index < 0) {
39
+	$image = imagecreatefrompng($original);
40
+	$index = imagecolorexact($image,26,49,81);
41
+	if ($index < 0) {
42 42
 	$index = imagecolorexact($image,25,49,79);
43
-    }
44
-    if ($index < 0) {
43
+	}
44
+	if ($index < 0) {
45 45
 	$index = imagecolorexact($image,0,0,0);
46
-    }
47
-    $c = hexToRGB($color);
48
-    imagecolorset($image,$index,$c['r'],$c['g'],$c['b']);
46
+	}
47
+	$c = hexToRGB($color);
48
+	imagecolorset($image,$index,$c['r'],$c['g'],$c['b']);
49 49
  /*
50 50
     $ig = imagecolorat($image, 0, 0);
51 51
     imagecolortransparent($image, $ig);
52 52
    */
53 53
 
54
-    header('Content-type: image/png');
55
-    if (isset($_GET['resize']) && function_exists('imagecopyresampled')) {
54
+	header('Content-type: image/png');
55
+	if (isset($_GET['resize']) && function_exists('imagecopyresampled')) {
56 56
 	$resize = filter_input(INPUT_GET,'resize',FILTER_SANITIZE_NUMBER_INT);
57 57
 	$newimg = imagecreatetruecolor($resize,$resize);
58
-        imagealphablending($newimg, false);
58
+		imagealphablending($newimg, false);
59 59
 	imagesavealpha($newimg, true);
60 60
 	imagecopyresampled($newimg,$image,0,0,0,0,15,15,imagesx($image),imagesy($image));
61 61
 	if (isset($_GET['heading'])) {
62
-    	    $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT);
63
-    	    $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127));
64
-    	    imagealphablending($rotation, false);
65
-	    imagesavealpha($rotation, true);
66
-    	    imagepng($rotation);
67
-    	    imagedestroy($newimg);
68
-    	    imagedestroy($image);
69
-    	    imagedestroy($rotation);
62
+			$heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT);
63
+			$rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127));
64
+			imagealphablending($rotation, false);
65
+		imagesavealpha($rotation, true);
66
+			imagepng($rotation);
67
+			imagedestroy($newimg);
68
+			imagedestroy($image);
69
+			imagedestroy($rotation);
70 70
 	
71 71
 	} else {
72
-    	    imagepng($newimg);
73
-    	    imagedestroy($newimg);
74
-    	    imagedestroy($image);
75
-        }
76
-    } else {
72
+			imagepng($newimg);
73
+			imagedestroy($newimg);
74
+			imagedestroy($image);
75
+		}
76
+	} else {
77 77
 	imagealphablending($image, false);
78
-        imagesavealpha($image, true);
78
+		imagesavealpha($image, true);
79 79
 	imagepng($image);
80 80
 	imagepng($image);
81 81
 	if (is_writable('cache')) {
82
-    	    imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename);
82
+			imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename);
83
+	}
84
+		imagedestroy($image);
83 85
 	}
84
-        imagedestroy($image);
85
-    }
86 86
 } else {
87
-    header('Content-type: image/png');
88
-    if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename);
89
-    else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename);
87
+	header('Content-type: image/png');
88
+	if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename);
89
+	else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename);
90 90
 }
91 91
 ?>
92 92
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 	$hex = str_replace("#", "", $hex);
5 5
 	$color = array();
6 6
 	if (strlen($hex) == 3) {
7
-	    $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1));
8
-	    $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1));
9
-	    $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1));
7
+	    $color['r'] = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));
8
+	    $color['g'] = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));
9
+	    $color['b'] = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));
10 10
 	} else if (strlen($hex) == 6) {
11 11
 	    $color['r'] = hexdec(substr($hex, 0, 2));
12 12
 	    $color['g'] = hexdec(substr($hex, 2, 2));
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 }
17 17
 
18 18
 
19
-if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { 
19
+if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/', $_GET['color'])) { 
20 20
     exit(0);
21 21
 }
22 22
 $color = $_GET['color'];
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 
38 38
 if (extension_loaded('gd') && function_exists('gd_info')) {
39 39
     $image = imagecreatefrompng($original);
40
-    $index = imagecolorexact($image,26,49,81);
40
+    $index = imagecolorexact($image, 26, 49, 81);
41 41
     if ($index < 0) {
42
-	$index = imagecolorexact($image,25,49,79);
42
+	$index = imagecolorexact($image, 25, 49, 79);
43 43
     }
44 44
     if ($index < 0) {
45
-	$index = imagecolorexact($image,0,0,0);
45
+	$index = imagecolorexact($image, 0, 0, 0);
46 46
     }
47 47
     $c = hexToRGB($color);
48
-    imagecolorset($image,$index,$c['r'],$c['g'],$c['b']);
48
+    imagecolorset($image, $index, $c['r'], $c['g'], $c['b']);
49 49
  /*
50 50
     $ig = imagecolorat($image, 0, 0);
51 51
     imagecolortransparent($image, $ig);
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 
54 54
     header('Content-type: image/png');
55 55
     if (isset($_GET['resize']) && function_exists('imagecopyresampled')) {
56
-	$resize = filter_input(INPUT_GET,'resize',FILTER_SANITIZE_NUMBER_INT);
57
-	$newimg = imagecreatetruecolor($resize,$resize);
56
+	$resize = filter_input(INPUT_GET, 'resize', FILTER_SANITIZE_NUMBER_INT);
57
+	$newimg = imagecreatetruecolor($resize, $resize);
58 58
         imagealphablending($newimg, false);
59 59
 	imagesavealpha($newimg, true);
60
-	imagecopyresampled($newimg,$image,0,0,0,0,15,15,imagesx($image),imagesy($image));
60
+	imagecopyresampled($newimg, $image, 0, 0, 0, 0, 15, 15, imagesx($image), imagesy($image));
61 61
 	if (isset($_GET['heading'])) {
62
-    	    $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT);
63
-    	    $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127));
62
+    	    $heading = filter_input(INPUT_GET, 'heading', FILTER_SANITIZE_NUMBER_INT);
63
+    	    $rotation = imagerotate($newimg, $heading, imageColorAllocateAlpha($newimg, 0, 0, 0, 127));
64 64
     	    imagealphablending($rotation, false);
65 65
 	    imagesavealpha($rotation, true);
66 66
     	    imagepng($rotation);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	imagepng($image);
80 80
 	imagepng($image);
81 81
 	if (is_writable('cache')) {
82
-    	    imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename);
82
+    	    imagepng($image, dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename);
83 83
 	}
84 84
         imagedestroy($image);
85 85
     }
Please login to merge, or discard this patch.
getLatestData-tv.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 $output = '{';
11 11
 $output .= '"flights": [';
12 12
 if (!empty($spotter_array)) {
13
-	foreach($spotter_array as $spotter_item)
13
+	foreach ($spotter_array as $spotter_item)
14 14
 	{
15 15
 		$output .= '{';
16 16
 		$output .= '"flight_id": "'.$spotter_item['spotter_id'].'",';
Please login to merge, or discard this patch.
ident-statistics-route.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Routes of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Routes of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Routes").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common routes from flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common routes from flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 
29 29
 	$route_array = $Spotter->countAllRoutesByIdent($ident);
30 30
 	if (!empty($route_array))
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		print '</thead>';
42 42
 		print '<tbody>';
43 43
 		$i = 1;
44
-		foreach($route_array as $route_item)
44
+		foreach ($route_array as $route_item)
45 45
 		{
46 46
 			print '<tr>';
47 47
 			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['ident'])) {
6
-        header('Location: '.$globalURL.'/ident');
7
-        die();
6
+		header('Location: '.$globalURL.'/ident');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
airport-statistics-arrival-airport-country.php 3 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
         header('Location: '.$globalURL.'/airport');
7 7
         die();
8 8
 }
9
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
9
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
11
-$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1","");
11
+$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", "");
12 12
 $airport_array = $Spotter->getAllAirportInfo($airport);
13 13
 
14 14
 if (!empty($airport_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Arrival Airports by Country from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
16
+	$title = sprintf(_("Most Common Arrival Airports by Country from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="select-item">';
19 19
 	print '<form action="'.$globalURL.'/airport" method="post">';
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	print '<option></option>';
22 22
 	$airport_names = $Spotter->getAllAirportNames();
23 23
 	ksort($airport_names);
24
-	foreach($airport_names as $airport_name)
24
+	foreach ($airport_names as $airport_name)
25 25
 	{
26
-		if($airport == $airport_name['airport_icao'])
26
+		if ($airport == $airport_name['airport_icao'])
27 27
 		{
28 28
 			print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
29 29
 		} else {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	include('airport-sub-menu.php');
55 55
 	print '<div class="column">';
56 56
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
57
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
57
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
58 58
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByAirport($airport);
59 59
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
60 60
 	print '<div id="chartCountry" class="chart" width="100%"></div>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             var data = google.visualization.arrayToDataTable([
66 66
             	["'._("Country").'", "'._("# of times").'"], ';
67 67
             	$country_data = '';
68
-	foreach($airport_country_array as $airport_item)
68
+	foreach ($airport_country_array as $airport_item)
69 69
 	{
70 70
 		$country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],';
71 71
 	}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		print '</thead>';
100 100
 		print '<tbody>';
101 101
 		$i = 1;
102
-		foreach($airport_country_array as $airport_item)
102
+		foreach ($airport_country_array as $airport_item)
103 103
 		{
104 104
 			print '<tr>';
105 105
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
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['airport'])) {
6
-        header('Location: '.$globalURL.'/airport');
7
-        die();
6
+		header('Location: '.$globalURL.'/airport');
7
+		die();
8 8
 }
9 9
 $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
           function drawChart() {
66 66
             var data = google.visualization.arrayToDataTable([
67 67
             	["'._("Country").'", "'._("# of times").'"], ';
68
-            	$country_data = '';
68
+				$country_data = '';
69 69
 	foreach($airport_country_array as $airport_item)
70 70
 	{
71 71
 		$country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 	print '<option></option>';
24 24
 	$Stats = new Stats();
25 25
 	$airport_names = $tats->getAllAirportNames();
26
-	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
26
+	if (empty($airport_names)) {
27
+		$airport_names = $Spotter->getAllAirportNames();
28
+	}
27 29
 	ksort($airport_names);
28 30
 	foreach($airport_names as $airport_name)
29 31
 	{
Please login to merge, or discard this patch.
search-wkt.php 3 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -4,55 +4,55 @@
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7
-        //for the date manipulation into the query
8
-        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
-                $start_date = $_GET['start_date'].":00";
10
-                $end_date = $_GET['end_date'].":00";
11
-                $sql_date = $start_date.",".$end_date;
12
-        } else if($_GET['start_date'] != ""){
13
-                $start_date = $_GET['start_date'].":00";
14
-                $sql_date = $start_date;
15
-        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
-                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
-                $sql_date = $end_date;
18
-        } else $sql_date = '';
7
+		//for the date manipulation into the query
8
+		if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
+				$start_date = $_GET['start_date'].":00";
10
+				$end_date = $_GET['end_date'].":00";
11
+				$sql_date = $start_date.",".$end_date;
12
+		} else if($_GET['start_date'] != ""){
13
+				$start_date = $_GET['start_date'].":00";
14
+				$sql_date = $start_date;
15
+		} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
+				$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
+				$sql_date = $end_date;
18
+		} else $sql_date = '';
19 19
 } else $sql_date = '';
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22
-        //for altitude manipulation
23
-        if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
-                $end_altitude = $_GET['highest_altitude'];
25
-                $start_altitude = $_GET['lowest_altitude'];
26
-                $sql_altitude = $start_altitude.",".$end_altitude;
27
-        } else if($_GET['highest_altitude'] != ""){
28
-                $end_altitude = $_GET['highest_altitude'];
29
-                $sql_altitude = $end_altitude;
30
-        } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-                $start_altitude = $_GET['lowest_altitude'].",60000";
32
-                $sql_altitude = $start_altitude;
33
-        } else $sql_altitude = '';
22
+		//for altitude manipulation
23
+		if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
+				$end_altitude = $_GET['highest_altitude'];
25
+				$start_altitude = $_GET['lowest_altitude'];
26
+				$sql_altitude = $start_altitude.",".$end_altitude;
27
+		} else if($_GET['highest_altitude'] != ""){
28
+				$end_altitude = $_GET['highest_altitude'];
29
+				$sql_altitude = $end_altitude;
30
+		} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
+				$start_altitude = $_GET['lowest_altitude'].",60000";
32
+				$sql_altitude = $start_altitude;
33
+		} else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37 37
 if(!isset($_GET['limit']))
38 38
 {
39
-        if (!isset($_GET['number_results']))
40
-        {
41
-                $limit_start = 0;
42
-                $limit_end = 25;
43
-                $absolute_difference = 25;
44
-        } else {
45
-                if ($_GET['number_results'] > 1000){
46
-                        $_GET['number_results'] = 1000;
47
-                }
48
-                $limit_start = 0;
49
-                $limit_end = $_GET['number_results'];
50
-                $absolute_difference = $_GET['number_results'];
51
-        }
39
+		if (!isset($_GET['number_results']))
40
+		{
41
+				$limit_start = 0;
42
+				$limit_end = 25;
43
+				$absolute_difference = 25;
44
+		} else {
45
+				if ($_GET['number_results'] > 1000){
46
+						$_GET['number_results'] = 1000;
47
+				}
48
+				$limit_start = 0;
49
+				$limit_end = $_GET['number_results'];
50
+				$absolute_difference = $_GET['number_results'];
51
+		}
52 52
 }  else {
53
-        $limit_explode = explode(",", $_GET['limit']);
54
-        $limit_start = $limit_explode[0];
55
-        $limit_end = $limit_explode[1];
53
+		$limit_explode = explode(",", $_GET['limit']);
54
+		$limit_start = $limit_explode[0];
55
+		$limit_end = $limit_explode[1];
56 56
 }
57 57
 
58 58
 $absolute_difference = abs($limit_start - $limit_end);
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7 7
         //for the date manipulation into the query
8
-        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
8
+        if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
9 9
                 $start_date = $_GET['start_date'].":00";
10 10
                 $end_date = $_GET['end_date'].":00";
11 11
                 $sql_date = $start_date.",".$end_date;
12
-        } else if($_GET['start_date'] != ""){
12
+        } else if ($_GET['start_date'] != "") {
13 13
                 $start_date = $_GET['start_date'].":00";
14 14
                 $sql_date = $start_date;
15
-        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
15
+        } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
16 16
                 $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17 17
                 $sql_date = $end_date;
18 18
         } else $sql_date = '';
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22 22
         //for altitude manipulation
23
-        if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
23
+        if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24 24
                 $end_altitude = $_GET['highest_altitude'];
25 25
                 $start_altitude = $_GET['lowest_altitude'];
26 26
                 $sql_altitude = $start_altitude.",".$end_altitude;
27
-        } else if($_GET['highest_altitude'] != ""){
27
+        } else if ($_GET['highest_altitude'] != "") {
28 28
                 $end_altitude = $_GET['highest_altitude'];
29 29
                 $sql_altitude = $end_altitude;
30
-        } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
30
+        } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31 31
                 $start_altitude = $_GET['lowest_altitude'].",60000";
32 32
                 $sql_altitude = $start_altitude;
33 33
         } else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37
-if(!isset($_GET['limit']))
37
+if (!isset($_GET['limit']))
38 38
 {
39 39
         if (!isset($_GET['number_results']))
40 40
         {
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
                 $limit_end = 25;
43 43
                 $absolute_difference = 25;
44 44
         } else {
45
-                if ($_GET['number_results'] > 1000){
45
+                if ($_GET['number_results'] > 1000) {
46 46
                         $_GET['number_results'] = 1000;
47 47
                 }
48 48
                 $limit_start = 0;
49 49
                 $limit_end = $_GET['number_results'];
50 50
                 $absolute_difference = $_GET['number_results'];
51 51
         }
52
-}  else {
52
+} else {
53 53
         $limit_explode = explode(",", $_GET['limit']);
54 54
         $limit_start = $limit_explode[0];
55 55
         $limit_end = $limit_explode[1];
@@ -69,30 +69,30 @@  discard block
 block discarded – undo
69 69
 
70 70
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
71 71
 else $sort = '';
72
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
75
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
76
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
77
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
78
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
79
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
80
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
81
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
82
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
83
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
84
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
85
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
86
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
87
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
88
-$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,'');
72
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
73
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
74
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
75
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
76
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
77
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
78
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
79
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
80
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
81
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
82
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
83
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
84
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
85
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
86
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
87
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
88
+$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, '');
89 89
        
90 90
 $i = 1;      
91 91
 //$output .= "oid;Line\n";
92 92
 $output = '';
93 93
 if (!empty($spotter_array))
94 94
 {
95
-	foreach($spotter_array as $spotter_item)
95
+	foreach ($spotter_array as $spotter_item)
96 96
 	{
97 97
 		if ($spotter_item['waypoints'] != '') {
98 98
 			$waypoint_pieces = explode(' ', $spotter_item['waypoints']);
Please login to merge, or discard this patch.
Braces   +18 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,8 +15,12 @@  discard block
 block discarded – undo
15 15
         } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16 16
                 $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17 17
                 $sql_date = $end_date;
18
-        } else $sql_date = '';
19
-} else $sql_date = '';
18
+        } else {
19
+        	$sql_date = '';
20
+        }
21
+        } else {
22
+	$sql_date = '';
23
+}
20 24
 
21 25
 if (isset($_GET['highest_altitude'])) {
22 26
         //for altitude manipulation
@@ -30,8 +34,12 @@  discard block
 block discarded – undo
30 34
         } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31 35
                 $start_altitude = $_GET['lowest_altitude'].",60000";
32 36
                 $sql_altitude = $start_altitude;
33
-        } else $sql_altitude = '';
34
-} else $sql_altitude = '';
37
+        } else {
38
+        	$sql_altitude = '';
39
+        }
40
+        } else {
41
+	$sql_altitude = '';
42
+}
35 43
 
36 44
 //calculuation for the pagination
37 45
 if(!isset($_GET['limit']))
@@ -49,7 +57,7 @@  discard block
 block discarded – undo
49 57
                 $limit_end = $_GET['number_results'];
50 58
                 $absolute_difference = $_GET['number_results'];
51 59
         }
52
-}  else {
60
+} else {
53 61
         $limit_explode = explode(",", $_GET['limit']);
54 62
         $limit_start = $limit_explode[0];
55 63
         $limit_end = $limit_explode[1];
@@ -67,8 +75,11 @@  discard block
 block discarded – undo
67 75
 
68 76
 header("Content-type: text/yaml");
69 77
 
70
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
71
-else $sort = '';
78
+if (isset($_GET['sort'])) {
79
+	$sort = $_GET['sort'];
80
+} else {
81
+	$sort = '';
82
+}
72 83
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73 84
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74 85
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.