Completed
Push — master ( 7bb360...c01d59 )
by Yannick
22:07
created
country-statistics-arrival-airport.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  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
 $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);
13 13
 
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Arrival Airports from %s"),$country);
17
+	$title = sprintf(_("Most Common Arrival Airports from %s"), $country);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	print '<select name="country" class="selectpicker" data-live-search="true">';
23 23
 	print '<option></option>';
24 24
 	$all_countries = $Spotter->getAllCountries();
25
-	foreach($all_countries as $all_country)
25
+	foreach ($all_countries as $all_country)
26 26
 	{
27
-		if($country == $all_country['country'])
27
+		if ($country == $all_country['country'])
28 28
 		{
29 29
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
30 30
 		} else {
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	if ($_GET['country'] != "NA")
40 40
 	{
41 41
 		print '<div class="info column">';
42
-		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
42
+		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
43 43
 		print '</div>';
44 44
 	} else {
45 45
 		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>';
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	include('country-sub-menu.php');
49 49
 	print '<div class="column">';
50 50
 	print '<h2>'._("Most Common Arrival Airports").'</h2>';
51
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
51
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights of airports &amp; airlines from <strong>%s</strong>."), $country).'</p>';
52 52
 	$airport_airport_array = $Spotter->countAllArrivalAirportsByCountry($country);
53 53
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
54 54
     	<script>
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         	["'._("Airport").'", "'._("# of times").'"],';
64 64
 
65 65
 	$airport_data = '';
66
-	foreach($airport_airport_array as $airport_item)
66
+	foreach ($airport_airport_array as $airport_item)
67 67
 	{
68 68
 		$name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')';
69 69
 		$name = str_replace("'", "", $name);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	print '</thead>';
102 102
 	print '<tbody>';
103 103
 	$i = 1;
104
-	foreach($airport_airport_array as $airport_item)
104
+	foreach ($airport_airport_array as $airport_item)
105 105
 	{
106 106
 		print '<tr>';
107 107
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
archive-country.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$country = filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING);
8
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$country = filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING);
8
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
9 9
 
10 10
 $Spotter = new Spotter();
11
-if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
11
+if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
12 12
 else $spotter_array = array();
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Airlines by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
16
+	$title = sprintf(_("Most Common Airlines by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
17 17
 	require_once('header.php');
18 18
 	print '<div class="select-item">';
19 19
 	print '<form action="'.$globalURL.'/date" method="post">';
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
 	print '</div>';
25 25
 
26 26
 	print '<div class="info column">';
27
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
27
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
28 28
 	print '</div>';
29 29
 
30 30
 	include('date-sub-menu.php');
31 31
 	print '<div class="column">';
32 32
 	print '<h2>'._("Most Common Airlines by Country").'</h2>';
33
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
33
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
34 34
 
35 35
 	$airline_array = $Spotter->countAllAirlineCountriesByDate($date);
36 36
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             var data = google.visualization.arrayToDataTable([
43 43
             	["'._("Country").'", "'._("# of times").'"], ';
44 44
 	$country_data = '';
45
-	foreach($airline_array as $airline_item)
45
+	foreach ($airline_array as $airline_item)
46 46
 	{
47 47
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
48 48
 	}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		print '</thead>';
77 77
 		print '<tbody>';
78 78
 		$i = 1;
79
-		foreach($airline_array as $airline_item)
79
+		foreach ($airline_array as $airline_item)
80 80
 		{
81 81
 			print '<tr>';
82 82
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
registration-statistics-departure-airport.php 1 patch
Spacing   +6 added lines, -6 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
 $Spotter = new Spotter();
6
-$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING);
7
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
6
+$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
7
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
8 8
 if (isset($_GET['sort'])) $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
9 9
 else $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1");
10 10
 $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration);
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 if (!empty($spotter_array))
14 14
 {
15
-	$title = sprintf(_("Most Common Departure Airports of aircraft with registration %s"),$registration);
15
+	$title = sprintf(_("Most Common Departure Airports of aircraft with registration %s"), $registration);
16 16
 	require_once('header.php');
17 17
 
18 18
 	print '<div class="info column">';
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	print '<div class="column">';
27 27
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
28 28
 
29
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with aircraft registration <strong>%s</strong>."),$registration).'</p>';
29
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with aircraft registration <strong>%s</strong>."), $registration).'</p>';
30 30
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByRegistration($registration);
31 31
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
32 32
     	<script>
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         var data = google.visualization.arrayToDataTable([ 
41 41
         	["'._("Airport").'", "'._("# of times").'"],';
42 42
 	$airport_data = '';
43
-	foreach($airport_airport_array as $airport_item)
43
+	foreach ($airport_airport_array as $airport_item)
44 44
 	{
45 45
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
46 46
 		$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.
statistics-route-waypoint.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	print '</thead>';
28 28
 	print '<tbody>';
29 29
 	$i = 1;
30
-	foreach($route_array as $route_item)
30
+	foreach ($route_array as $route_item)
31 31
 	{
32 32
 		print '<tr>';
33 33
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
search-geojson.php 1 patch
Spacing   +32 added lines, -32 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'] != ""){
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,23 +69,23 @@  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
       
91 91
 $output = '{';
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     
96 96
     if (!empty($spotter_array))
97 97
 	  {	  
98
-	    foreach($spotter_array as $spotter_item)
98
+	    foreach ($spotter_array as $spotter_item)
99 99
 	    {
100 100
 				
101 101
 				
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 									foreach ($waypoint_pieces as $waypoint_coordinate)
148 148
 									{
149 149
 										$output .= '[';
150
-									        $output .=  $waypoint_coordinate[1].', ';	
151
-									        $output .=  $waypoint_coordinate[0];
150
+									        $output .= $waypoint_coordinate[1].', ';	
151
+									        $output .= $waypoint_coordinate[0];
152 152
 									  $output .= '],';
153 153
 									
154 154
 									}
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 	          $output .= '"geometry": {';
200 200
 	          	$output .= '"type": "Point",';
201 201
 	            	$output .= '"coordinates": [';
202
-										$output .=  $spotter_item['longitude'].', ';	
203
-									  $output .=  $spotter_item['latitude'];
202
+										$output .= $spotter_item['longitude'].', ';	
203
+									  $output .= $spotter_item['latitude'];
204 204
 								$output .= ']';
205 205
 							$output .= '}';
206 206
 				$output .= '},';
Please login to merge, or discard this patch.
tools-metar.php 1 patch
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-metar';
12 12
 
13
-$message = filter_input(INPUT_POST,'metar_message',FILTER_SANITIZE_STRING);
13
+$message = filter_input(INPUT_POST, 'metar_message', FILTER_SANITIZE_STRING);
14 14
 
15 15
 print '<div class="info column">';
16 16
 print '<h1>'._("Parse METAR messages").'</h1>';
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			print '<b>'._("Dew point:").'</b> '.$metar_parse['dew'].' °C'." ";
72 72
 		}
73 73
 		if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
74
-			$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
74
+			$humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1);
75 75
 			print '<b>'._("Humidity:").'</b> '.$humidity.'%'." ";
76 76
 		}
77 77
 		if (isset($metar_parse['QNH'])) {
Please login to merge, or discard this patch.
search-georss.php 1 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];
@@ -72,23 +72,23 @@  discard block
 block discarded – undo
72 72
 
73 73
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
74 74
 else $sort = '';
75
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
76
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
77
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
78
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
79
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
80
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
81
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
82
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
83
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
84
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
85
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
86
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
87
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
88
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
89
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
90
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
91
-$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,'');
75
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
76
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
77
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
78
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
79
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
80
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
81
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
82
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
83
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
84
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
85
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
86
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
87
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
88
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
89
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
90
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
91
+$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, '');
92 92
  
93 93
 print '<?xml version="1.0" encoding="UTF-8" ?>';
94 94
 print '<feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">';
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	
106 106
 	if (!empty($spotter_array))
107 107
 	{
108
-	foreach($spotter_array as $spotter_item)
108
+	foreach ($spotter_array as $spotter_item)
109 109
 	{
110 110
 	
111 111
 	      
Please login to merge, or discard this patch.
search-php.php 1 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,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
 $flights = array();
91 91
 
92 92
 if (!empty($spotter_array))
93 93
 {
94
-  foreach($spotter_array as $spotter_item)
94
+  foreach ($spotter_array as $spotter_item)
95 95
   {
96 96
 	  
97 97
 	array_push($flights, array(
Please login to merge, or discard this patch.
search-ajax.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,19 +6,19 @@  discard block
 block discarded – undo
6 6
 $Spotter = new Spotter();
7 7
 $orderby = $Spotter->getOrderBy();
8 8
 
9
-$ask = filter_input(INPUT_GET,'ask',FILTER_SANITIZE_STRING);
9
+$ask = filter_input(INPUT_GET, 'ask', FILTER_SANITIZE_STRING);
10 10
 if ($ask == 'manufacturer') {
11 11
 	$manufacturers = $Spotter->getAllManufacturers();
12 12
 	$all_manufacturers = array();
13
-	foreach($manufacturers as $manufacturer)
13
+	foreach ($manufacturers as $manufacturer)
14 14
 	{
15
-		$all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ','-',$manufacturer['aircraft_manufacturer'])));
15
+		$all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ', '-', $manufacturer['aircraft_manufacturer'])));
16 16
 	}
17 17
 	echo json_encode($all_manufacturers);
18 18
 } elseif ($ask == 'aircrafttypes') {
19 19
 	$aircraft_types = $Spotter->getAllAircraftTypes();
20 20
 	$all_aircraft_types = array();
21
-	foreach($aircraft_types as $aircraft_type)
21
+	foreach ($aircraft_types as $aircraft_type)
22 22
 	{
23 23
 		$all_aircraft_types[] = array('id' => $aircraft_type['aircraft_icao'], 'value' => $aircraft_type['aircraft_name'].' ('.$aircraft_type['aircraft_icao'].')');
24 24
 	}
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 } elseif ($ask == 'airlinenames') {
27 27
 	$airline_names = $Spotter->getAllAirlineNames();
28 28
 	$all_airline_names = array();
29
-	foreach($airline_names as $airline_name)
29
+	foreach ($airline_names as $airline_name)
30 30
 	{
31 31
 		$all_airline_names[] = array('id' => $airline_name['airline_icao'], 'value' => $airline_name['airline_name'].' ('.$airline_name['airline_icao'].')');
32 32
 	}
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 } elseif ($ask == 'airlinecountries') {
35 35
 	$airline_countries = $Spotter->getAllAirlineCountries();
36 36
 	$all_airline_countries = array();
37
-	foreach($airline_countries as $airline_country)
37
+	foreach ($airline_countries as $airline_country)
38 38
 	{
39 39
 		$all_airline_countries[] = array('id' => $airline_country['airline_country'], 'value' => $airline_country['airline_country']);
40 40
 	}
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	$airport_names = $Spotter->getAllAirportNames();
44 44
 	ksort($airport_names);
45 45
 	$all_airport_names = array();
46
-	foreach($airport_names as $airport_name)
46
+	foreach ($airport_names as $airport_name)
47 47
 	{
48 48
 		$all_airport_names[] = array('id' => $airport_name['airport_icao'], 'value' => $airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')');
49 49
 	}
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 } elseif ($ask == 'airportcountries') {
52 52
 	$airport_countries = $Spotter->getAllAirportCountries();
53 53
 	$all_airport_countries = array();
54
-	foreach($airport_countries as $airport_country)
54
+	foreach ($airport_countries as $airport_country)
55 55
 	{
56 56
 		$all_airport_countries[] = array('id' => $airport_country['airport_country'], 'value' => $airport_country['airport_country']);
57 57
 	}
Please login to merge, or discard this patch.