Completed
Push — master ( e17801...597a61 )
by Yannick
25:55
created
install/class.create_db.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@  discard block
 block discarded – undo
4 4
 
5 5
 class create_db {
6 6
 	public static function import_file($filename) {
7
-		$filename = filter_var($filename,FILTER_SANITIZE_STRING);
7
+		$filename = filter_var($filename, FILTER_SANITIZE_STRING);
8 8
 		$Connection = new Connection();
9 9
 		//Connection::$db->beginTransaction();
10 10
 		$templine = '';
11
-		$handle = @fopen($filename,"r");
11
+		$handle = @fopen($filename, "r");
12 12
 		if ($handle) {
13 13
 			//$lines = file($filename);
14 14
 			//foreach ($lines as $line)
15
-			while (($line = fgets($handle,4096)) !== false)
15
+			while (($line = fgets($handle, 4096)) !== false)
16 16
 			{
17
-				if (substr($line,0,2) == '--' || $line == '') continue;
17
+				if (substr($line, 0, 2) == '--' || $line == '') continue;
18 18
 				$templine .= $line;
19
-				if (substr(trim($line), -1,1) == ';')
19
+				if (substr(trim($line), -1, 1) == ';')
20 20
 				{
21 21
 					try {
22 22
 						$sth = $Connection->db->prepare($templine);
23 23
 						$sth->execute();
24
-					} catch(PDOException $e) {
24
+					} catch (PDOException $e) {
25 25
 						return "error (import ".$filename.") : ".$e->getMessage()."\n";
26 26
 					}
27 27
 					$templine = '';
@@ -38,27 +38,27 @@  discard block
 block discarded – undo
38 38
 		$error = '';
39 39
 		$dh = opendir($directory);
40 40
 		//foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename)
41
-		while(false !== ($filename = readdir($dh)))
41
+		while (false !== ($filename = readdir($dh)))
42 42
 		{
43
-			if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename);
43
+			if (preg_match('/\.sql$/', $filename)) $error .= create_db::import_file($directory.$filename);
44 44
 		}
45 45
 		return $error;
46 46
 	}
47 47
 
48
-	public static function create_database($root,$root_pass,$user,$pass,$db,$db_type,$host) {
49
-		$root = filter_var($root,FILTER_SANITIZE_STRING);
50
-		$root_pass = filter_var($root_pass,FILTER_SANITIZE_STRING);
51
-		$user = filter_var($user,FILTER_SANITIZE_STRING);
52
-		$password = filter_var($pass,FILTER_SANITIZE_STRING);
53
-		$db = filter_var($db,FILTER_SANITIZE_STRING);
54
-		$db_type = filter_var($db_type,FILTER_SANITIZE_STRING);
55
-		$host = filter_var($host,FILTER_SANITIZE_STRING);
48
+	public static function create_database($root, $root_pass, $user, $pass, $db, $db_type, $host) {
49
+		$root = filter_var($root, FILTER_SANITIZE_STRING);
50
+		$root_pass = filter_var($root_pass, FILTER_SANITIZE_STRING);
51
+		$user = filter_var($user, FILTER_SANITIZE_STRING);
52
+		$password = filter_var($pass, FILTER_SANITIZE_STRING);
53
+		$db = filter_var($db, FILTER_SANITIZE_STRING);
54
+		$db_type = filter_var($db_type, FILTER_SANITIZE_STRING);
55
+		$host = filter_var($host, FILTER_SANITIZE_STRING);
56 56
 		// Dirty hack
57 57
 		if ($host != 'localhost' && $host != '127.0.0.1') {
58 58
 			$grantright = $_SERVER['SERVER_ADDR'];
59 59
 		} else $grantright = 'localhost';
60 60
 		try {
61
-			$dbh = new PDO($db_type.':host='.$host,$root,$root_pass);
61
+			$dbh = new PDO($db_type.':host='.$host, $root, $root_pass);
62 62
 			$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
63 63
 			if ($db_type == 'mysql') {
64 64
 				$dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;");
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				$dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."';
69 69
 					GRANT ALL PRIVILEGES ON DATABASE ".$db." TO ".$user.";");
70 70
 			}
71
-		} catch(PDOException $e) {
71
+		} catch (PDOException $e) {
72 72
 			$dbh = null;
73 73
 			return "error : ".$e->getMessage();
74 74
 		}
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@  discard block
 block discarded – undo
14 14
 			//foreach ($lines as $line)
15 15
 			while (($line = fgets($handle,4096)) !== false)
16 16
 			{
17
-				if (substr($line,0,2) == '--' || $line == '') continue;
17
+				if (substr($line,0,2) == '--' || $line == '') {
18
+					continue;
19
+				}
18 20
 				$templine .= $line;
19 21
 				if (substr(trim($line), -1,1) == ';')
20 22
 				{
@@ -40,7 +42,9 @@  discard block
 block discarded – undo
40 42
 		//foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename)
41 43
 		while(false !== ($filename = readdir($dh)))
42 44
 		{
43
-			if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename);
45
+			if (preg_match('/\.sql$/',$filename)) {
46
+				$error .= create_db::import_file($directory.$filename);
47
+			}
44 48
 		}
45 49
 		return $error;
46 50
 	}
@@ -56,13 +60,17 @@  discard block
 block discarded – undo
56 60
 		// Dirty hack
57 61
 		if ($host != 'localhost' && $host != '127.0.0.1') {
58 62
 			$grantright = $_SERVER['SERVER_ADDR'];
59
-		} else $grantright = 'localhost';
63
+		} else {
64
+			$grantright = 'localhost';
65
+		}
60 66
 		try {
61 67
 			$dbh = new PDO($db_type.':host='.$host,$root,$root_pass);
62 68
 			$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
63 69
 			if ($db_type == 'mysql') {
64 70
 				$dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;");
65
-				if ($grantright == 'localhost') $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;");
71
+				if ($grantright == 'localhost') {
72
+					$dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;");
73
+				}
66 74
 			} else if ($db_type == 'pgsql') {
67 75
 				$dbh->exec("CREATE DATABASE ".$db.";");
68 76
 				$dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."';
Please login to merge, or discard this patch.
search-wkt.php 2 patches
Spacing   +35 added lines, -35 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,37 +20,37 @@  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'] != ""){
24
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
25
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
23
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
25
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
26 26
 		$sql_altitude = $start_altitude.",".$end_altitude;
27
-	} else if($_GET['highest_altitude'] != ""){
28
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
27
+	} else if ($_GET['highest_altitude'] != "") {
28
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
29 29
 		$sql_altitude = $end_altitude;
30
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
30
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",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
 	if (!isset($_GET['number_results'])) {
39 39
 		$limit_start = 0;
40 40
 		$limit_end = 25;
41 41
 		$absolute_difference = 25;
42 42
 	} else {
43
-		if ($_GET['number_results'] > 1000){
43
+		if ($_GET['number_results'] > 1000) {
44 44
 			$_GET['number_results'] = 1000;
45 45
 		}
46 46
 		$limit_start = 0;
47
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
47
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
48
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
49 49
 	}
50
-}  else {
50
+} else {
51 51
 	$limit_explode = explode(",", $_GET['limit']);
52
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
53
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
52
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
53
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
54 54
 }
55 55
 
56 56
 $absolute_difference = abs($limit_start - $limit_end);
@@ -67,30 +67,30 @@  discard block
 block discarded – undo
67 67
 
68 68
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
69 69
 else $sort = '';
70
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
71
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
72
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
73
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
74
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
75
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
76
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
77
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
78
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
79
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
80
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
81
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
82
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
83
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
84
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
85
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
86
-$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,'');
70
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
71
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
72
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
73
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
74
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
75
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
76
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
77
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
78
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
79
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
80
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
81
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
82
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
83
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
84
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
85
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
86
+$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, '');
87 87
        
88 88
 $i = 1;      
89 89
 //$output .= "oid;Line\n";
90 90
 $output = '';
91 91
 if (!empty($spotter_array))
92 92
 {
93
-	foreach($spotter_array as $spotter_item)
93
+	foreach ($spotter_array as $spotter_item)
94 94
 	{
95 95
 		if ($spotter_item['waypoints'] != '') {
96 96
 			$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 = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",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'])) {
@@ -47,7 +55,7 @@  discard block
 block discarded – undo
47 55
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48 56
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49 57
 	}
50
-}  else {
58
+} else {
51 59
 	$limit_explode = explode(",", $_GET['limit']);
52 60
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
53 61
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -65,8 +73,11 @@  discard block
 block discarded – undo
65 73
 
66 74
 header("Content-type: text/csv");
67 75
 
68
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
69
-else $sort = '';
76
+if (isset($_GET['sort'])) {
77
+	$sort = $_GET['sort'];
78
+} else {
79
+	$sort = '';
80
+}
70 81
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
71 82
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
72 83
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
archive-geojson.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 				}
91 91
 
92 92
 				//waypoint plotting
93
-                /*
93
+				/*
94 94
 				$output .= '{';
95 95
 					$output .= '"type": "Feature",';
96 96
 						$output .= '"properties": {';
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 					$output_time .= (strtotime($spotter_history['date'])*1000).',';
270 270
 				}
271 271
 				if (isset($output_time)) {
272
-				    $output_time  = substr($output_time, 0, -1);
273
-				    $output .= '"time": ['.$output_time.'],';
272
+					$output_time  = substr($output_time, 0, -1);
273
+					$output .= '"time": ['.$output_time.'],';
274 274
 				}
275 275
 
276 276
 
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
 						$output .= '"coordinates": [';
285 285
 						
286 286
 				if (isset($output_history)) {
287
-				    $output_history  = substr($output_history, 0, -1);
288
-				    $output .= $output_history;
287
+					$output_history  = substr($output_history, 0, -1);
288
+					$output .= $output_history;
289 289
 				}
290 290
 				
291 291
 						$output .= ']';
Please login to merge, or discard this patch.
country-statistics-departure-airport.php 1 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("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)));
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
10
+$country = ucwords(str_replace("-", " ", 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 Departure Airports from %s"),$country);
21
+	$title = sprintf(_("Most Common Departure Airports 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 {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	if ($_GET['country'] != "NA")
42 42
 	{
43 43
 		print '<div class="info column">';
44
-		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
44
+		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
45 45
 		print '</div>';
46 46
 	} else {
47 47
 		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>';
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	include('country-sub-menu.php');
51 51
 	print '<div class="column">';
52 52
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
53
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
53
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights of airports &amp; airlines from <strong>%s</strong>."), $country).'</p>';
54 54
 
55 55
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByCountry($country);
56 56
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	print '<script>';
61 61
 	print 'var series = [';
62 62
 	$airport_data = '';
63
-	foreach($airport_airport_array as $airport_item)
63
+	foreach ($airport_airport_array as $airport_item)
64 64
 	{
65 65
 		$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
66 66
 	}
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	print '</thead>';
115 115
 	print '<tbody>';
116 116
 	$i = 1;
117
-	foreach($airport_airport_array as $airport_item)
117
+	foreach ($airport_airport_array as $airport_item)
118 118
 	{
119 119
 		print '<tr>';
120 120
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
search-gpx.php 2 patches
Spacing   +35 added lines, -35 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,38 +20,38 @@  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'] != ""){
24
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
25
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
23
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
25
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
26 26
 		$sql_altitude = $start_altitude.",".$end_altitude;
27
-	} else if($_GET['highest_altitude'] != ""){
28
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
27
+	} else if ($_GET['highest_altitude'] != "") {
28
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
29 29
 		$sql_altitude = $end_altitude;
30
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
30
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",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
 		$limit_start = 0;
41 41
 		$limit_end = 25;
42 42
 		$absolute_difference = 25;
43 43
 	} else {
44
-		if ($_GET['number_results'] > 1000){
44
+		if ($_GET['number_results'] > 1000) {
45 45
 			$_GET['number_results'] = 1000;
46 46
 		}
47 47
 		$limit_start = 0;
48
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
49
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
50 50
 	}
51
-}  else {
51
+} else {
52 52
 	$limit_explode = explode(",", $_GET['limit']);
53
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
54
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
53
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
54
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
55 55
 }
56 56
 
57 57
 $absolute_difference = abs($limit_start - $limit_end);
@@ -68,29 +68,29 @@  discard block
 block discarded – undo
68 68
 
69 69
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
70 70
 else $sort = '';
71
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
72
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
73
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
74
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
75
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
76
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
77
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
78
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
79
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
80
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
81
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
82
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
83
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
84
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
85
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
86
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
87
-$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,'');
71
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
72
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
73
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
74
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
75
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
76
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
77
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
78
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
79
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
80
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
81
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
82
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
83
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
84
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
85
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
86
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
87
+$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, '');
88 88
 $output = '<?xml version="1.0" encoding="UTF-8"?>';
89 89
 $output .= '<gpx version="1.0">';
90 90
 $output .= '<name>FlightAirMap GPX Feed</name>';
91 91
 if (!empty($spotter_array))
92 92
 {
93
-	foreach($spotter_array as $spotter_item)
93
+	foreach ($spotter_array as $spotter_item)
94 94
 	{
95 95
 		$altitude = $spotter_item['altitude'].'00';
96 96
 		//waypoint plotting
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 = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",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']))
@@ -48,7 +56,7 @@  discard block
 block discarded – undo
48 56
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49 57
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
50 58
 	}
51
-}  else {
59
+} else {
52 60
 	$limit_explode = explode(",", $_GET['limit']);
53 61
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
54 62
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -66,8 +74,11 @@  discard block
 block discarded – undo
66 74
 
67 75
 header('Content-Type: text/xml');
68 76
 
69
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
70
-else $sort = '';
77
+if (isset($_GET['sort'])) {
78
+	$sort = $_GET['sort'];
79
+} else {
80
+	$sort = '';
81
+}
71 82
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
72 83
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
73 84
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
search-geojson.php 2 patches
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -2,17 +2,17 @@  discard block
 block discarded – undo
2 2
 require_once('require/class.Connection.php');
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5
-$Spotter=new Spotter();
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'] != ""){
24
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
25
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
23
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
25
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
26 26
 		$sql_altitude = $start_altitude.",".$end_altitude;
27
-	} else if($_GET['highest_altitude'] != ""){
28
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
27
+	} else if ($_GET['highest_altitude'] != "") {
28
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
29 29
 		$sql_altitude = $end_altitude;
30
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
30
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",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,17 +42,17 @@  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
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
50
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
50
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
51 51
 	}
52
-}  else {
52
+} else {
53 53
 	$limit_explode = explode(",", $_GET['limit']);
54
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
55
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
54
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
55
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
56 56
 }
57 57
 
58 58
 $absolute_difference = abs($limit_start - $limit_end);
@@ -69,29 +69,29 @@  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
 $output = '{';
91 91
 	$output .= '"type": "FeatureCollection",';
92 92
 	$output .= '"features": [';
93 93
 if (!empty($spotter_array)) {
94
-	foreach($spotter_array as $spotter_item) {
94
+	foreach ($spotter_array as $spotter_item) {
95 95
 		//waypoint plotting
96 96
 		$output .= '{';  
97 97
 		$output .= '"type": "Feature",';
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 			$waypoint_pieces = array_chunk($waypoint_pieces, 2);
139 139
 			foreach ($waypoint_pieces as $waypoint_coordinate) {
140 140
 				$output .= '[';
141
-				$output .=  $waypoint_coordinate[1].', ';	
142
-				$output .=  $waypoint_coordinate[0];
141
+				$output .= $waypoint_coordinate[1].', ';	
142
+				$output .= $waypoint_coordinate[0];
143 143
 				$output .= '],';
144 144
 			}
145 145
 			$output = substr($output, 0, -1);
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 		$output .= '"geometry": {';
189 189
 		$output .= '"type": "Point",';
190 190
 		$output .= '"coordinates": [';
191
-		$output .=  $spotter_item['longitude'].', ';	
192
-		$output .=  $spotter_item['latitude'];
191
+		$output .= $spotter_item['longitude'].', ';	
192
+		$output .= $spotter_item['latitude'];
193 193
 		$output .= ']';
194 194
 		$output .= '}';
195 195
 		$output .= '},';
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 = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",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 = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
50 58
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
51 59
 	}
52
-}  else {
60
+} else {
53 61
 	$limit_explode = explode(",", $_GET['limit']);
54 62
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
55 63
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -67,8 +75,11 @@  discard block
 block discarded – undo
67 75
 
68 76
 header('Content-Type: application/json');
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.
search-kml.php 2 patches
Spacing   +39 added lines, -39 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,38 +20,38 @@  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'] != ""){
24
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
25
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
23
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
25
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
26 26
 		$sql_altitude = $start_altitude.",".$end_altitude;
27
-	} else if($_GET['highest_altitude'] != ""){
28
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
27
+	} else if ($_GET['highest_altitude'] != "") {
28
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
29 29
 		$sql_altitude = $end_altitude;
30
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
30
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",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
 		$limit_start = 0;
41 41
 		$limit_end = 25;
42 42
 		$absolute_difference = 25;
43 43
 	} else {
44
-		if ($_GET['number_results'] > 1000){
44
+		if ($_GET['number_results'] > 1000) {
45 45
 			$_GET['number_results'] = 1000;
46 46
 		}
47 47
 		$limit_start = 0;
48
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
49
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
50 50
 	}
51
-}  else {
51
+} else {
52 52
 	$limit_explode = explode(",", $_GET['limit']);
53
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
54
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
53
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
54
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
55 55
 }
56 56
 
57 57
 $absolute_difference = abs($limit_start - $limit_end);
@@ -68,23 +68,23 @@  discard block
 block discarded – undo
68 68
 
69 69
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
70 70
 else $sort = '';
71
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
72
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
73
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
74
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
75
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
76
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
77
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
78
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
79
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
80
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
81
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
82
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
83
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
84
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
85
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
86
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
87
-$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,'');
71
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
72
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
73
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
74
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
75
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
76
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
77
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
78
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
79
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
80
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
81
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
82
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
83
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
84
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
85
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
86
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
87
+$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, '');
88 88
 
89 89
 $output = '<?xml version="1.0" encoding="UTF-8"?>';
90 90
 $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">';
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 $output .= '</Style>';
113 113
 
114 114
 if (!empty($spotter_array)) {
115
-	foreach($spotter_array as $spotter_item) {
115
+	foreach ($spotter_array as $spotter_item) {
116 116
 		$altitude = $spotter_item['altitude'].'00';
117 117
 		if ($spotter_item['waypoints'] != '') {
118 118
 			//waypoint plotting
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 			$waypoint_pieces = explode(' ', $spotter_item['waypoints']);
124 124
 			$waypoint_pieces = array_chunk($waypoint_pieces, 2);
125 125
 			foreach ($waypoint_pieces as $waypoint_coordinate) {
126
-				$output .=  $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' ';
126
+				$output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' ';
127 127
 			}
128 128
 			$output .= '</coordinates>';
129 129
 			$output .= '<altitudeMode>absolute</altitudeMode>';
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		$output .= ' ]]></description>';
168 168
 		$output .= '<styleUrl>#departureAirport</styleUrl>';
169 169
 		$output .= '<Point>';
170
-		$output .=  '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>';
170
+		$output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>';
171 171
 		$output .= '<altitudeMode>absolute</altitudeMode>';
172 172
 		$output .= '</Point>';
173 173
 		$output .= '</Placemark>'; 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 		$output .= ' ]]></description>';
209 209
 		$output .= '<styleUrl>#arrivalAirport</styleUrl>';
210 210
 		$output .= '<Point>';
211
-		$output .=  '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>';
211
+		$output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>';
212 212
 		$output .= '<altitudeMode>absolute</altitudeMode>';
213 213
 		$output .= '</Point>';
214 214
 		$output .= '</Placemark>'; 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 		$output .= ' ]]></description>';
253 253
 		$output .= '<styleUrl>#aircraft_'.$spotter_item['spotter_id'].'</styleUrl>';
254 254
 		$output .= '<Point>';
255
-		$output .=  '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>';
255
+		$output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>';
256 256
 		$output .= '<altitudeMode>absolute</altitudeMode>';
257 257
 		$output .= '</Point>';
258 258
 		$output .= '</Placemark>'; 
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 = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",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']))
@@ -48,7 +56,7 @@  discard block
 block discarded – undo
48 56
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49 57
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
50 58
 	}
51
-}  else {
59
+} else {
52 60
 	$limit_explode = explode(",", $_GET['limit']);
53 61
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
54 62
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -66,8 +74,11 @@  discard block
 block discarded – undo
66 74
 
67 75
 header('Content-Type: text/xml');
68 76
 
69
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
70
-else $sort = '';
77
+if (isset($_GET['sort'])) {
78
+	$sort = $_GET['sort'];
79
+} else {
80
+	$sort = '';
81
+}
71 82
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
72 83
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
73 84
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
search-xml.php 2 patches
Spacing   +35 added lines, -35 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,37 +20,37 @@  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'] != ""){
24
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
25
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
23
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
25
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
26 26
 		$sql_altitude = $start_altitude.",".$end_altitude;
27
-	} else if($_GET['highest_altitude'] != ""){
28
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
27
+	} else if ($_GET['highest_altitude'] != "") {
28
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
29 29
 		$sql_altitude = $end_altitude;
30
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
30
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",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
 	if (!isset($_GET['number_results'])) {
39 39
 		$limit_start = 0;
40 40
 		$limit_end = 25;
41 41
 		$absolute_difference = 25;
42 42
 	} else {
43
-		if ($_GET['number_results'] > 1000){
43
+		if ($_GET['number_results'] > 1000) {
44 44
 			$_GET['number_results'] = 1000;
45 45
 		}
46 46
 		$limit_start = 0;
47
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
47
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
48
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
49 49
 	}
50
-}  else {
50
+} else {
51 51
 	$limit_explode = explode(",", $_GET['limit']);
52
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
53
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
52
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
53
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
54 54
 }
55 55
 
56 56
 $absolute_difference = abs($limit_start - $limit_end);
@@ -67,23 +67,23 @@  discard block
 block discarded – undo
67 67
 
68 68
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
69 69
 else $sort = '';
70
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
71
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
72
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
73
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
74
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
75
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
76
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
77
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
78
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
79
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
80
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
81
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
82
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
83
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
84
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
85
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
86
-$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,'');
70
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
71
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
72
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
73
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
74
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
75
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
76
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
77
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
78
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
79
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
80
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
81
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
82
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
83
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
84
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
85
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
86
+$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, '');
87 87
 
88 88
 $output = '<?xml version="1.0" encoding="UTF-8" ?>';
89 89
 $output .= '<flightairmap>';
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 $output .= '<link>http://'.$_SERVER['HTTP_HOST'].$globalURL.'</link>';
92 92
 $output .= '<aircrafts>';
93 93
 if (!empty($spotter_array)) {
94
-	foreach($spotter_array as $spotter_item) {
94
+	foreach ($spotter_array as $spotter_item) {
95 95
 		$output .= '<aircraft>';
96 96
 		$output .= '<id>'.$spotter_item['spotter_id'].'</id>';
97 97
 		$output .= '<ident>'.$spotter_item['ident'].'</ident>';
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 = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",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'])) {
@@ -47,7 +55,7 @@  discard block
 block discarded – undo
47 55
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48 56
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49 57
 	}
50
-}  else {
58
+} else {
51 59
 	$limit_explode = explode(",", $_GET['limit']);
52 60
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
53 61
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -65,8 +73,11 @@  discard block
 block discarded – undo
65 73
 
66 74
 header('Content-Type: application/xml');
67 75
 
68
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
69
-else $sort = '';
76
+if (isset($_GET['sort'])) {
77
+	$sort = $_GET['sort'];
78
+} else {
79
+	$sort = '';
80
+}
70 81
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
71 82
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
72 83
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
search-yaml.php 2 patches
Spacing   +35 added lines, -35 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,37 +20,37 @@  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'] != ""){
24
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
25
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
23
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
25
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
26 26
 		$sql_altitude = $start_altitude.",".$end_altitude;
27
-	} else if($_GET['highest_altitude'] != ""){
28
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
27
+	} else if ($_GET['highest_altitude'] != "") {
28
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
29 29
 		$sql_altitude = $end_altitude;
30
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
30
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",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
 	if (!isset($_GET['number_results'])) {
39 39
 		$limit_start = 0;
40 40
 		$limit_end = 25;
41 41
 		$absolute_difference = 25;
42 42
 	} else {
43
-		if ($_GET['number_results'] > 1000){
43
+		if ($_GET['number_results'] > 1000) {
44 44
 			$_GET['number_results'] = 1000;
45 45
 		}
46 46
 		$limit_start = 0;
47
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
47
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
48
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
49 49
 	}
50
-}  else {
50
+} else {
51 51
 	$limit_explode = explode(",", $_GET['limit']);
52
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
53
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
52
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
53
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
54 54
 }
55 55
 
56 56
 $absolute_difference = abs($limit_start - $limit_end);
@@ -67,27 +67,27 @@  discard block
 block discarded – undo
67 67
 
68 68
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
69 69
 else $sort = '';
70
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
71
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
72
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
73
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
74
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
75
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
76
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
77
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
78
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
79
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
80
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
81
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
82
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
83
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
84
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
85
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
86
-$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,'');
70
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
71
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
72
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
73
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
74
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
75
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
76
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
77
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
78
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
79
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
80
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
81
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
82
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
83
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
84
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
85
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
86
+$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, '');
87 87
 
88 88
 $output = "-flights:\n";
89 89
 if (!empty($spotter_array)) {
90
-	foreach($spotter_array as $spotter_item) {
90
+	foreach ($spotter_array as $spotter_item) {
91 91
 		$output .= ' - id: '.$spotter_item['spotter_id'];
92 92
 		$output .= "\n";
93 93
 		$output .= ' - ident: '.$spotter_item['ident'];
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 = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",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'])) {
@@ -47,7 +55,7 @@  discard block
 block discarded – undo
47 55
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
48 56
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
49 57
 	}
50
-}  else {
58
+} else {
51 59
 	$limit_explode = explode(",", $_GET['limit']);
52 60
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
53 61
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -65,8 +73,11 @@  discard block
 block discarded – undo
65 73
 
66 74
 header("Content-type: text/yaml");
67 75
 
68
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
69
-else $sort = '';
76
+if (isset($_GET['sort'])) {
77
+	$sort = $_GET['sort'];
78
+} else {
79
+	$sort = '';
80
+}
70 81
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
71 82
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
72 83
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.