Completed
Push — master ( 1fed4c...6bbecb )
by Yannick
05:53
created
manufacturer-statistics-time.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['aircraft_manufacturer'])) {
6
-        header('Location: '.$globalURL.'/manufacturer');
7
-        die();
6
+		header('Location: '.$globalURL.'/manufacturer');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
           function drawChart() {
54 54
             var data = google.visualization.arrayToDataTable([
55 55
             	["'._("Hour").'", "'._("# of Flights").'"], ';
56
-            	$hour_data = '';
56
+				$hour_data = '';
57 57
 	foreach($hour_array as $hour_item)
58 58
 	{
59 59
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
10
+$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING)));
11 11
 
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Time of Day from %s"),$manufacturer);
17
+	$title = sprintf(_("Most Common Time of Day from %s"), $manufacturer);
18 18
 	require_once('header.php');
19 19
 	print '<div class="select-item">';
20 20
 	print '<form action="'.$globalURL.'/manufacturer" method="post">';
21 21
 	print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
22 22
 	print '<option></option>';
23 23
 	$all_manufacturers = $Spotter->getAllManufacturers();
24
-	foreach($all_manufacturers as $all_manufacturer)
24
+	foreach ($all_manufacturers as $all_manufacturer)
25 25
 	{
26
-		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
26
+		if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
27 27
 		{
28 28
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
29 29
 		} else {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	include('manufacturer-sub-menu.php');
43 43
 	print '<div class="column">';
44 44
 	print '<h2>'._("Most Common Time of Day").'</h2>';
45
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),$manufacturer).'</p>';
45
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), $manufacturer).'</p>';
46 46
 
47 47
 	$hour_array = $Spotter->countAllHoursByManufacturer($manufacturer);
48 48
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             var data = google.visualization.arrayToDataTable([
55 55
             	["'._("Hour").'", "'._("# of Flights").'"], ';
56 56
             	$hour_data = '';
57
-	foreach($hour_array as $hour_item)
57
+	foreach ($hour_array as $hour_item)
58 58
 	{
59 59
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
60 60
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 	print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
24 24
 	$Stats = new Stats();
25 25
 	$all_manufacturers = $Stats->getAllManufacturers();
26
-	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
26
+	if (empty($all_manufacturers)) {
27
+		$all_manufacturers = $Spotter->getAllManufacturers();
28
+	}
27 29
 	foreach($all_manufacturers as $all_manufacturer)
28 30
 	{
29 31
 		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
Please login to merge, or discard this patch.
ident-statistics-airline.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$isent = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$isent = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Airlines of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Airlines of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Airlines").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights using the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 
29 29
 	$airline_array = $Spotter->countAllAirlinesByIdent($_GET['ident']);
30 30
 	if (!empty($airline_array))
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		print '</thead>';
42 42
 		print '<tbody>';
43 43
 		$i = 1;
44
-		foreach($airline_array as $airline_item)
44
+		foreach ($airline_array as $airline_item)
45 45
 		{
46 46
 			print '<tr>';
47 47
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['ident'])) {
6
-        header('Location: '.$globalURL.'/ident');
7
-        die();
6
+		header('Location: '.$globalURL.'/ident');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
search-json.php 3 patches
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -4,55 +4,55 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7
-        //for the date manipulation into the query
8
-        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
-                $start_date = $_GET['start_date'].":00";
10
-                $end_date = $_GET['end_date'].":00";
11
-                $sql_date = $start_date.",".$end_date;
12
-        } else if($_GET['start_date'] != ""){
13
-                $start_date = $_GET['start_date'].":00";
14
-                $sql_date = $start_date;
15
-        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
-                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
-                $sql_date = $end_date;
18
-        } else $sql_date = '';
7
+		//for the date manipulation into the query
8
+		if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
+				$start_date = $_GET['start_date'].":00";
10
+				$end_date = $_GET['end_date'].":00";
11
+				$sql_date = $start_date.",".$end_date;
12
+		} else if($_GET['start_date'] != ""){
13
+				$start_date = $_GET['start_date'].":00";
14
+				$sql_date = $start_date;
15
+		} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
+				$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
+				$sql_date = $end_date;
18
+		} else $sql_date = '';
19 19
 } else $sql_date = '';
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22
-        //for altitude manipulation
23
-        if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
-                $end_altitude = $_GET['highest_altitude'];
25
-                $start_altitude = $_GET['lowest_altitude'];
26
-                $sql_altitude = $start_altitude.",".$end_altitude;
27
-        } else if($_GET['highest_altitude'] != ""){
28
-                $end_altitude = $_GET['highest_altitude'];
29
-                $sql_altitude = $end_altitude;
30
-        } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-                $start_altitude = $_GET['lowest_altitude'].",60000";
32
-                $sql_altitude = $start_altitude;
33
-        } else $sql_altitude = '';
22
+		//for altitude manipulation
23
+		if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
+				$end_altitude = $_GET['highest_altitude'];
25
+				$start_altitude = $_GET['lowest_altitude'];
26
+				$sql_altitude = $start_altitude.",".$end_altitude;
27
+		} else if($_GET['highest_altitude'] != ""){
28
+				$end_altitude = $_GET['highest_altitude'];
29
+				$sql_altitude = $end_altitude;
30
+		} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
+				$start_altitude = $_GET['lowest_altitude'].",60000";
32
+				$sql_altitude = $start_altitude;
33
+		} else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37 37
 if(!isset($_GET['limit']))
38 38
 {
39
-        if (!isset($_GET['number_results']))
40
-        {
41
-                $limit_start = 0;
42
-                $limit_end = 25;
43
-                $absolute_difference = 25;
44
-        } else {
45
-                if ($_GET['number_results'] > 1000){
46
-                        $_GET['number_results'] = 1000;
47
-                }
48
-                $limit_start = 0;
49
-                $limit_end = $_GET['number_results'];
50
-                $absolute_difference = $_GET['number_results'];
51
-        }
39
+		if (!isset($_GET['number_results']))
40
+		{
41
+				$limit_start = 0;
42
+				$limit_end = 25;
43
+				$absolute_difference = 25;
44
+		} else {
45
+				if ($_GET['number_results'] > 1000){
46
+						$_GET['number_results'] = 1000;
47
+				}
48
+				$limit_start = 0;
49
+				$limit_end = $_GET['number_results'];
50
+				$absolute_difference = $_GET['number_results'];
51
+		}
52 52
 }  else {
53
-        $limit_explode = explode(",", $_GET['limit']);
54
-        $limit_start = $limit_explode[0];
55
-        $limit_end = $limit_explode[1];
53
+		$limit_explode = explode(",", $_GET['limit']);
54
+		$limit_start = $limit_explode[0];
55
+		$limit_end = $limit_explode[1];
56 56
 }
57 57
 
58 58
 $absolute_difference = abs($limit_start - $limit_end);
@@ -89,52 +89,52 @@  discard block
 block discarded – undo
89 89
        
90 90
 $output = '{';
91 91
   $output .= '"flightairmap": {';
92
-    $output .= '"title": "FlightAirMap JSON Feed",';
93
-    $output .= '"link": "http://www.flightairmap.fr",';
94
-    $output .= '"aircraft": [';
92
+	$output .= '"title": "FlightAirMap JSON Feed",';
93
+	$output .= '"link": "http://www.flightairmap.fr",';
94
+	$output .= '"aircraft": [';
95 95
     
96
-    if (!empty($spotter_array))
96
+	if (!empty($spotter_array))
97 97
 	  {
98
-	    foreach($spotter_array as $spotter_item)
99
-	    {
98
+		foreach($spotter_array as $spotter_item)
99
+		{
100 100
 				
101 101
 				$output .= '{';    	
102
-		            $output .= '"id": "'.$spotter_item['spotter_id'].'",';
103
-                    $output .= '"ident": "'.$spotter_item['ident'].'",';
104
-                    $output .= '"registration": "'.$spotter_item['registration'].'",';
105
-                    $output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",';
106
-                    $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",';
107
-                    $output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",';
108
-                    $output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
109
-                    $output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",';
110
-                    $output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",';
111
-                    $output .= '"airline_country": "'.$spotter_item['airline_country'].'",';
112
-                    $output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",';
113
-                    $output .= '"airline_type": "'.$spotter_item['airline_type'].'",';
114
-                    $output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",';
115
-                    $output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",';
116
-                    $output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",';
117
-                    $output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",';
118
-                    $output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",';
119
-                    $output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",';
120
-                    $output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; 
121
-                    $output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",';
122
-                    $output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",';
123
-                    $output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",';
124
-                    $output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",';
125
-                    $output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",';
126
-                    $output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",';
127
-                    $output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",';
128
-                    $output .= '"latitude": "'.$spotter_item['latitude'].'",';
129
-                    $output .= '"longitude": "'.$spotter_item['longitude'].'",';
130
-                    $output .= '"altitude": "'.$spotter_item['altitude'].'",';
131
-                    $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",';
132
-                    $output .= '"heading": "'.$spotter_item['heading'].'",';
133
-                    $output .= '"heading_name": "'.$spotter_item['heading_name'].'",';
134
-                    $output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
135
-                    $output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"';
102
+					$output .= '"id": "'.$spotter_item['spotter_id'].'",';
103
+					$output .= '"ident": "'.$spotter_item['ident'].'",';
104
+					$output .= '"registration": "'.$spotter_item['registration'].'",';
105
+					$output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",';
106
+					$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",';
107
+					$output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",';
108
+					$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
109
+					$output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",';
110
+					$output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",';
111
+					$output .= '"airline_country": "'.$spotter_item['airline_country'].'",';
112
+					$output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",';
113
+					$output .= '"airline_type": "'.$spotter_item['airline_type'].'",';
114
+					$output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",';
115
+					$output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",';
116
+					$output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",';
117
+					$output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",';
118
+					$output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",';
119
+					$output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",';
120
+					$output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; 
121
+					$output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",';
122
+					$output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",';
123
+					$output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",';
124
+					$output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",';
125
+					$output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",';
126
+					$output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",';
127
+					$output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",';
128
+					$output .= '"latitude": "'.$spotter_item['latitude'].'",';
129
+					$output .= '"longitude": "'.$spotter_item['longitude'].'",';
130
+					$output .= '"altitude": "'.$spotter_item['altitude'].'",';
131
+					$output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",';
132
+					$output .= '"heading": "'.$spotter_item['heading'].'",';
133
+					$output .= '"heading_name": "'.$spotter_item['heading_name'].'",';
134
+					$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
135
+					$output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"';
136 136
 				$output .= '},';
137
-	    }
137
+		}
138 138
 	   }
139 139
 	   $output  = substr($output, 0, -1);
140 140
 		 $output .= ']';
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7 7
         //for the date manipulation into the query
8
-        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
8
+        if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
9 9
                 $start_date = $_GET['start_date'].":00";
10 10
                 $end_date = $_GET['end_date'].":00";
11 11
                 $sql_date = $start_date.",".$end_date;
12
-        } else if($_GET['start_date'] != ""){
12
+        } else if ($_GET['start_date'] != "") {
13 13
                 $start_date = $_GET['start_date'].":00";
14 14
                 $sql_date = $start_date;
15
-        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
15
+        } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
16 16
                 $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17 17
                 $sql_date = $end_date;
18 18
         } else $sql_date = '';
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22 22
         //for altitude manipulation
23
-        if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
23
+        if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24 24
                 $end_altitude = $_GET['highest_altitude'];
25 25
                 $start_altitude = $_GET['lowest_altitude'];
26 26
                 $sql_altitude = $start_altitude.",".$end_altitude;
27
-        } else if($_GET['highest_altitude'] != ""){
27
+        } else if ($_GET['highest_altitude'] != "") {
28 28
                 $end_altitude = $_GET['highest_altitude'];
29 29
                 $sql_altitude = $end_altitude;
30
-        } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
30
+        } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31 31
                 $start_altitude = $_GET['lowest_altitude'].",60000";
32 32
                 $sql_altitude = $start_altitude;
33 33
         } else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37
-if(!isset($_GET['limit']))
37
+if (!isset($_GET['limit']))
38 38
 {
39 39
         if (!isset($_GET['number_results']))
40 40
         {
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
                 $limit_end = 25;
43 43
                 $absolute_difference = 25;
44 44
         } else {
45
-                if ($_GET['number_results'] > 1000){
45
+                if ($_GET['number_results'] > 1000) {
46 46
                         $_GET['number_results'] = 1000;
47 47
                 }
48 48
                 $limit_start = 0;
49 49
                 $limit_end = $_GET['number_results'];
50 50
                 $absolute_difference = $_GET['number_results'];
51 51
         }
52
-}  else {
52
+} else {
53 53
         $limit_explode = explode(",", $_GET['limit']);
54 54
         $limit_start = $limit_explode[0];
55 55
         $limit_end = $limit_explode[1];
@@ -69,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
 $output = '{';
91 91
   $output .= '"flightairmap": {';
@@ -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
 				$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 = $_GET['lowest_altitude'].",60000";
32 36
                 $sql_altitude = $start_altitude;
33
-        } else $sql_altitude = '';
34
-} else $sql_altitude = '';
37
+        } else {
38
+        	$sql_altitude = '';
39
+        }
40
+        } else {
41
+	$sql_altitude = '';
42
+}
35 43
 
36 44
 //calculuation for the pagination
37 45
 if(!isset($_GET['limit']))
@@ -49,7 +57,7 @@  discard block
 block discarded – undo
49 57
                 $limit_end = $_GET['number_results'];
50 58
                 $absolute_difference = $_GET['number_results'];
51 59
         }
52
-}  else {
60
+} else {
53 61
         $limit_explode = explode(",", $_GET['limit']);
54 62
         $limit_start = $limit_explode[0];
55 63
         $limit_end = $limit_explode[1];
@@ -67,8 +75,11 @@  discard block
 block discarded – undo
67 75
 
68 76
 header("Content-type: text/yaml");
69 77
 
70
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
71
-else $sort = '';
78
+if (isset($_GET['sort'])) {
79
+	$sort = $_GET['sort'];
80
+} else {
81
+	$sort = '';
82
+}
72 83
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73 84
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74 85
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
registration-statistics-route.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,15 +3,15 @@  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
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
8 8
 $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
9 9
 $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration);
10 10
 
11 11
 
12 12
 if (!empty($spotter_array))
13 13
 {
14
-	$title = sprintf(_("Most Common Routes from aircraft with registration %s"),$registration);
14
+	$title = sprintf(_("Most Common Routes from aircraft with registration %s"), $registration);
15 15
 
16 16
 	require_once('header.php');
17 17
 	print '<div class="info column">';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('registration-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Routes").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common routes of aircraft with registration <strong>%s</strong>."),$registration).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common routes of aircraft with registration <strong>%s</strong>."), $registration).'</p>';
28 28
 
29 29
 	$route_array = $Spotter->countAllRoutesByRegistration($registration);
30 30
 	if (!empty($route_array))
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		print '</thead>';
41 41
 		print '<tbody>';
42 42
 		$i = 1;
43
-		foreach($route_array as $route_item)
43
+		foreach ($route_array as $route_item)
44 44
 		{
45 45
 			print '<tr>';
46 46
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
manufacturer-statistics-arrival-airport-country.php 3 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 }
9 9
 
10 10
 $Spotter = new Spotter();
11
-$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
11
+$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING)));
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Arrival Airports by Country from %s"),$manufacturer);
17
+	$title = sprintf(_("Most Common Arrival Airports by Country from %s"), $manufacturer);
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="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
23 23
 	print '<option></option>';
24 24
 	$all_manufacturers = $Spotter->getAllManufacturers();
25
-	foreach($all_manufacturers as $all_manufacturer)
25
+	foreach ($all_manufacturers as $all_manufacturer)
26 26
 	{
27
-		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
27
+		if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
28 28
 		{
29 29
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
30 30
 		} else {
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	include('manufacturer-sub-menu.php');
44 44
 	print '<div class="column">';
45 45
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
46
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."),$manufacturer).'</p>';
46
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."), $manufacturer).'</p>';
47 47
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByManufacturer($manufacturer);
48 48
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
49 49
 	print '<div id="chartCountry" class="chart" width="100%"></div>
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             	["'._("Country").'", "'._("# of times").'"], ';
56 56
 
57 57
 	$country_data = '';
58
-	foreach($airport_country_array as $airport_item)
58
+	foreach ($airport_country_array as $airport_item)
59 59
 	{
60 60
 		$country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],';
61 61
 	}
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		print '</thead>';
90 90
 		print '<tbody>';
91 91
 		$i = 1;
92
-		foreach($airport_country_array as $airport_item)
92
+		foreach ($airport_country_array as $airport_item)
93 93
 		{
94 94
 			print '<tr>';
95 95
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['aircraft_manufacturer'])) {
6
-        header('Location: '.$globalURL.'/manufacturer');
7
-        die();
6
+		header('Location: '.$globalURL.'/manufacturer');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 	print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
24 24
 	$Stats = new Stats();
25 25
 	$all_manufacturers = $Stats->getAllManufacturers();
26
-	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
26
+	if (empty($all_manufacturers)) {
27
+		$all_manufacturers = $Spotter->getAllManufacturers();
28
+	}
27 29
 	foreach($all_manufacturers as $all_manufacturer)
28 30
 	{
29 31
 		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
Please login to merge, or discard this patch.
airport-statistics-departure-airport-country.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['airport'])) {
6
-        header('Location: '.$globalURL.'/airport');
7
-        die();
6
+		header('Location: '.$globalURL.'/airport');
7
+		die();
8 8
 }
9 9
 $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
           function drawChart() {
66 66
             var data = google.visualization.arrayToDataTable([
67 67
             	["'._("Country").'", "'._("# of times").'"], ';
68
-            	$country_data = '';
68
+				$country_data = '';
69 69
 	foreach($airport_country_array as $airport_item)
70 70
 	{
71 71
 		$country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],';
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
         header('Location: '.$globalURL.'/airport');
7 7
         die();
8 8
 }
9
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
9
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
11
-$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1","");
11
+$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", "");
12 12
 $airport_array = $Spotter->getAllAirportInfo($airport);
13 13
 
14 14
 if (!empty($airport_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Departure Airports by Country to %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
16
+	$title = sprintf(_("Most Common Departure Airports by Country to %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="select-item">';
19 19
 	print '<form action="'.$globalURL.'/airport" method="post">';
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	print '<option></option>';
22 22
 	$airport_names = $Spotter->getAllAirportNames();
23 23
 	ksort($airport_names);
24
-	foreach($airport_names as $airport_name)
24
+	foreach ($airport_names as $airport_name)
25 25
 	{
26
-		if($_GET['airport'] == $airport_name['airport_icao'])
26
+		if ($_GET['airport'] == $airport_name['airport_icao'])
27 27
 		{
28 28
 			print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
29 29
 		} else {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	include('airport-sub-menu.php');
55 55
 	print '<div class="column">';
56 56
 	print '<h2>'._("Most Common Departure Airports by Country").'</h2>';
57
-	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights to <strong>%s, %s, (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
57
+	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights to <strong>%s, %s, (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
58 58
 
59 59
 	$airport_country_array = $Spotter->countAllDepartureAirportCountriesByAirport($airport);
60 60
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             var data = google.visualization.arrayToDataTable([
67 67
             	["'._("Country").'", "'._("# of times").'"], ';
68 68
             	$country_data = '';
69
-	foreach($airport_country_array as $airport_item)
69
+	foreach ($airport_country_array as $airport_item)
70 70
 	{
71 71
 		$country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],';
72 72
 	}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		print '</thead>';
101 101
 		print '<tbody>';
102 102
 		$i = 1;
103
-		foreach($airport_country_array as $airport_item)
103
+		foreach ($airport_country_array as $airport_item)
104 104
 		{
105 105
 			print '<tr>';
106 106
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 	print '<option></option>';
24 24
 	$Stats = new Stats();
25 25
 	$airport_names = $tats->getAllAirportNames();
26
-	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
26
+	if (empty($airport_names)) {
27
+		$airport_names = $Spotter->getAllAirportNames();
28
+	}
27 29
 	ksort($airport_names);
28 30
 	foreach($airport_names as $airport_name)
29 31
 	{
Please login to merge, or discard this patch.
airport-geojson.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		date_default_timezone_set('UTC');
27 27
 		//waypoint plotting
28 28
 		$output .= '{"type": "Feature",';
29
-		    $output .= '"properties": {';
29
+			$output .= '"properties": {';
30 30
 			$output .= '"name": "'.str_replace('"',"'",$spotter_item['name']).'",';
31 31
 			$output .= '"city": "'.$spotter_item['city'].'",';
32 32
 			$output .= '"country": "'.$spotter_item['country'].'",';
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 			$output .= '"homepage": "'.$spotter_item['home_link'].'",';
50 50
 			$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
51 51
 //			$output .= '"photo": "'.$spotter_item['image_thumbnail'].'",';
52
-		    $output .= '},';
53
-		    $output .= '"geometry": {';
52
+			$output .= '},';
53
+			$output .= '"geometry": {';
54 54
 			$output .= '"type": "Point",';
55 55
 			$output .= '"coordinates": [';
56
-			    $output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
56
+				$output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
57 57
 			$output .= ']';
58
-		    $output .= '}';
58
+			$output .= '}';
59 59
 		$output .= '},';
60 60
 	}
61 61
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 if (isset($_GET['coord'])) 
13 13
 {
14
-	$coords = explode(',',$_GET['coord']);
14
+	$coords = explode(',', $_GET['coord']);
15 15
 	$spotter_array = $Spotter->getAllAirportInfobyCoord($coords);
16 16
 } else {
17 17
 	$spotter_array = $Spotter->getAllAirportInfo();
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
             
23 23
 if (!empty($spotter_array))
24 24
 {	  
25
-	foreach($spotter_array as $spotter_item)
25
+	foreach ($spotter_array as $spotter_item)
26 26
 	{
27 27
 		date_default_timezone_set('UTC');
28 28
 		//waypoint plotting
29 29
 		$output .= '{"type": "Feature",';
30 30
 		    $output .= '"properties": {';
31
-			$output .= '"name": "'.str_replace('"',"'",$spotter_item['name']).'",';
32
-			$output .= '"city": "'.str_replace('"',"'",$spotter_item['city']).'",';
31
+			$output .= '"name": "'.str_replace('"', "'", $spotter_item['name']).'",';
32
+			$output .= '"city": "'.str_replace('"', "'", $spotter_item['city']).'",';
33 33
 			$output .= '"country": "'.$spotter_item['country'].'",';
34 34
 			$output .= '"altitude": "'.$spotter_item['altitude'].'",';
35
-			$output .= '"popupContent": "'.str_replace('"',"'",$spotter_item['name']).' : '.str_replace('"',"'",$spotter_item['city']).', '.$spotter_item['country'].'",';
35
+			$output .= '"popupContent": "'.str_replace('"', "'", $spotter_item['name']).' : '.str_replace('"', "'", $spotter_item['city']).', '.$spotter_item['country'].'",';
36 36
 			if ($spotter_item['type'] == 'large_airport') {
37 37
 				$output .= '"icon": "'.$globalURL.'/images/airport.png",';
38 38
 			} elseif ($spotter_item['type'] == 'heliport') {
Please login to merge, or discard this patch.
airline-detailed.php 2 patches
Spacing   +11 added lines, -11 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
-if (!isset($_GET['airline'])){
6
+if (!isset($_GET['airline'])) {
7 7
 	header('Location: '.$globalURL.'/airline');
8
-} else{
8
+} else {
9 9
 	$Spotter = new Spotter();
10 10
 	//calculuation for the pagination
11
-	if(!isset($_GET['limit']) || $_GET['limit'] == "")
11
+	if (!isset($_GET['limit']) || $_GET['limit'] == "")
12 12
 	{
13 13
 		$limit_start = 0;
14 14
 		$limit_end = 25;
15 15
 		$absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		$limit_start = $limit_explode[0];
19 19
 		$limit_end = $limit_explode[1];
@@ -27,16 +27,16 @@  discard block
 block discarded – undo
27 27
 	$limit_previous_1 = $limit_start - $absolute_difference;
28 28
 	$limit_previous_2 = $limit_end - $absolute_difference;
29 29
 	
30
-	$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
30
+	$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
31 31
 	$page_url = $globalURL.'/airline/'.$airline;
32 32
 	
33
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
34
-	$spotter_array = $Spotter->getSpotterDataByAirline($_GET['airline'],$limit_start.",".$absolute_difference, $sort);
33
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
34
+	$spotter_array = $Spotter->getSpotterDataByAirline($_GET['airline'], $limit_start.",".$absolute_difference, $sort);
35 35
 	
36 36
 	if (!empty($spotter_array))
37 37
 	{
38 38
 		if (isset($spotter_array[0]['airline_name']) && isset($spotter_array[0]['airline_icao'])) {
39
-			$title = sprintf(_("Detailed View for %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
39
+			$title = sprintf(_("Detailed View for %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
40 40
 		} else $title = '';
41 41
 		require_once('header.php');
42 42
 	  
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 		print '<select name="airline" class="selectpicker" data-live-search="true">';
46 46
 		print '<option></option>';
47 47
 		$airline_names = $Spotter->getAllAirlineNames();
48
-		foreach($airline_names as $airline_name)
48
+		foreach ($airline_names as $airline_name)
49 49
 		{
50
-			if($_GET['airline'] == $airline_name['airline_icao'])
50
+			if ($_GET['airline'] == $airline_name['airline_icao'])
51 51
 			{
52 52
 				print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
53 53
 			} else {
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		include('airline-sub-menu.php');
85 85
 		print '<div class="table column">';
86 86
 		if (isset($spotter_array[0]['airline_name'])) {
87
-			print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
87
+			print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
88 88
 		}
89 89
 
90 90
 		include('table-output.php');  
Please login to merge, or discard this patch.
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 		$limit_start = 0;
15 15
 		$limit_end = 25;
16 16
 		$absolute_difference = 25;
17
-	}  else {
17
+	} else {
18 18
 		$limit_explode = explode(",", $_GET['limit']);
19 19
 		$limit_start = $limit_explode[0];
20 20
 		$limit_end = $limit_explode[1];
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
 	{
39 39
 		if (isset($spotter_array[0]['airline_name']) && isset($spotter_array[0]['airline_icao'])) {
40 40
 			$title = sprintf(_("Detailed View for %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
41
-		} else $title = '';
41
+		} else {
42
+			$title = '';
43
+		}
42 44
 		require_once('header.php');
43 45
 	  
44 46
 		print '<div class="select-item">';
@@ -47,7 +49,9 @@  discard block
 block discarded – undo
47 49
 		print '<option></option>';
48 50
 		$Stats = new Stats();
49 51
 		$airline_names = $Stats->getAllAirlineNames();
50
-		if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
52
+		if (empty($airline_names)) {
53
+			$airline_names = $Spotter->getAllAirlineNames();
54
+		}
51 55
 		foreach($airline_names as $airline_name)
52 56
 		{
53 57
 			if($_GET['airline'] == $airline_name['airline_icao'])
@@ -76,8 +80,12 @@  discard block
 block discarded – undo
76 80
 			print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['airline_name'].'</div>';
77 81
 			print '<div><span class="label">'._("Country").'</span>'.$spotter_array[0]['airline_country'].'</div>';
78 82
 			print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['airline_icao'].'</div>';
79
-			if (isset($spotter_array[0]['airline_iata'])) print '<div><span class="label">'._("IATA").'</span>'.$spotter_array[0]['airline_iata'].'</div>';
80
-			if (isset($spotter_array[0]['airline_callsign'])) print '<div><span class="label">'._("Callsign").'</span>'.$spotter_array[0]['airline_callsign'].'</div>'; 
83
+			if (isset($spotter_array[0]['airline_iata'])) {
84
+				print '<div><span class="label">'._("IATA").'</span>'.$spotter_array[0]['airline_iata'].'</div>';
85
+			}
86
+			if (isset($spotter_array[0]['airline_callsign'])) {
87
+				print '<div><span class="label">'._("Callsign").'</span>'.$spotter_array[0]['airline_callsign'].'</div>';
88
+			}
81 89
 			print '<div><span class="label">'._("Type").'</span>'.ucwords($spotter_array[0]['airline_type']).'</div>';
82 90
 			print '</div>';
83 91
 		} else {
Please login to merge, or discard this patch.
notam-geojson.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,9 @@
 block discarded – undo
54 54
 			$radius = $spotter_item['radius']*1852;
55 55
 			$output .= '"radiusm": "'.$radius.'",';
56 56
 			$output .= '"radiusnm": "'.$spotter_item['radius'].'",';
57
-			if ($radius > 25000) $radius = 25000;
57
+			if ($radius > 25000) {
58
+				$radius = 25000;
59
+			}
58 60
 			$output .= '"radius": "'.$radius.'"';
59 61
 		    $output .= '},';
60 62
 		    $output .= '"geometry": {';
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		date_default_timezone_set('UTC');
43 43
 		//waypoint plotting
44 44
 		$output .= '{"type": "Feature",';
45
-		    $output .= '"properties": {';
45
+			$output .= '"properties": {';
46 46
 			$output .= '"ref": "'.$spotter_item['ref'].'",';
47 47
 			$output .= '"title": "'.$spotter_item['title'].'",';
48 48
 			$output .= '"fir": "'.$spotter_item['fir'].'",';
@@ -61,28 +61,28 @@  discard block
 block discarded – undo
61 61
 //			$output .= '"photo": "'.$spotter_item['image_thumbnail'].'",';
62 62
 //			if ($spotter_item['radius'] > 30) $spotter_item['radius'] = 30;
63 63
 			if ($spotter_item['scope'] == 'Airport warning') {
64
-			    $output .= '"color": "#EACC04",';
64
+				$output .= '"color": "#EACC04",';
65 65
 			} elseif ($spotter_item['scope'] == 'Airport/Enroute warning') {
66
-			    $output .= '"color": "#EA7D00",';
66
+				$output .= '"color": "#EA7D00",';
67 67
 			} elseif ($spotter_item['scope'] == 'Airport/Navigation warning') {
68
-			    $output .= '"color": "#DBEA00",';
68
+				$output .= '"color": "#DBEA00",';
69 69
 			} elseif ($spotter_item['scope'] == 'Navigation warning') {
70
-			    $output .= '"color": "#BBEA00",';
70
+				$output .= '"color": "#BBEA00",';
71 71
 			} else {
72
-			    $output .= '"color": "#FF0000",';
72
+				$output .= '"color": "#FF0000",';
73 73
 			}
74 74
 			$radius = $spotter_item['radius']*1852;
75 75
 			$output .= '"radiusm": "'.$radius.'",';
76 76
 			$output .= '"radiusnm": "'.$spotter_item['radius'].'",';
77 77
 			if ($radius > 25000) $radius = 25000;
78 78
 			$output .= '"radius": '.$radius.'';
79
-		    $output .= '},';
80
-		    $output .= '"geometry": {';
79
+			$output .= '},';
80
+			$output .= '"geometry": {';
81 81
 			$output .= '"type": "Point",';
82 82
 			$output .= '"coordinates": [';
83
-			    $output .= $spotter_item['center_longitude'].', '.$spotter_item['center_latitude'];
83
+				$output .= $spotter_item['center_longitude'].', '.$spotter_item['center_latitude'];
84 84
 			$output .= ']';
85
-		    $output .= '}';
85
+			$output .= '}';
86 86
 		$output .= '},';
87 87
 	}
88 88
 	$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,24 +10,24 @@  discard block
 block discarded – undo
10 10
 
11 11
 if (isset($_GET['coord'])) 
12 12
 {
13
-	$coords = explode(',',$_GET['coord']);
13
+	$coords = explode(',', $_GET['coord']);
14 14
 	if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] != '' && $_COOKIE['notamscope'] != 'All') {
15
-		$scope = filter_var($_COOOKIE['notamscope'],FILTER_SANITIZE_STRING);
16
-		$spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords,$scope);
15
+		$scope = filter_var($_COOOKIE['notamscope'], FILTER_SANITIZE_STRING);
16
+		$spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords, $scope);
17 17
 	} elseif (isset($_GET['scope']) && $_GET['scope'] != '' && $_GET['scope'] != 'All') {
18
-		$scope = filter_input(INPUT_GET,'scope',FILTER_SANITIZE_STRING);
19
-		$spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords,$scope);
18
+		$scope = filter_input(INPUT_GET, 'scope', FILTER_SANITIZE_STRING);
19
+		$spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords, $scope);
20 20
 	} else {
21 21
 		$spotter_array = $NOTAM->getAllNOTAMbyCoord($coords);
22 22
 	}
23 23
 //	$spotter_array = $NOTAM->getAllNOTAM();
24 24
 } else {
25 25
 	if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] != '' && $_COOKIE['notamscope'] != 'All') {
26
-		$scope = filter_var($_COOKIE['notamscope'],FILTER_SANITIZE_STRING);
26
+		$scope = filter_var($_COOKIE['notamscope'], FILTER_SANITIZE_STRING);
27 27
 		$spotter_array = $NOTAM->getAllNOTAMbyScope($scope);
28 28
 	} elseif (isset($_GET['scope']) && $_GET['scope'] != '' && $_GET['scope'] != 'All') {
29
-		$scope = filter_input(INPUT_GET,'scope',FILTER_SANITIZE_STRING);
30
-		$spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords,$scope);
29
+		$scope = filter_input(INPUT_GET, 'scope', FILTER_SANITIZE_STRING);
30
+		$spotter_array = $NOTAM->getAllNOTAMbyCoordScope($coords, $scope);
31 31
 	} else {
32 32
 		$spotter_array = $NOTAM->getAllNOTAM();
33 33
 	}
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             
38 38
 if (!empty($spotter_array))
39 39
 {	  
40
-	foreach($spotter_array as $spotter_item)
40
+	foreach ($spotter_array as $spotter_item)
41 41
 	{
42 42
 		date_default_timezone_set('UTC');
43 43
 		//waypoint plotting
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 			$output .= '"ref": "'.$spotter_item['ref'].'",';
47 47
 			$output .= '"title": "'.$spotter_item['title'].'",';
48 48
 			$output .= '"fir": "'.$spotter_item['fir'].'",';
49
-			$output .= '"text": "'.str_replace(array("\r\n", "\r", "\n"),'<br />',str_replace(array('"',"\t"), '',$spotter_item['notam_text'])).'",';
49
+			$output .= '"text": "'.str_replace(array("\r\n", "\r", "\n"), '<br />', str_replace(array('"', "\t"), '', $spotter_item['notam_text'])).'",';
50 50
 			$output .= '"latitude": '.$spotter_item['center_latitude'].',';
51 51
 			$output .= '"longitude": '.$spotter_item['center_longitude'].',';
52 52
 			$output .= '"lower_limit": '.$spotter_item['lower_limit'].',';
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		    $output .= '}';
86 86
 		$output .= '},';
87 87
 	}
88
-	$output  = substr($output, 0, -1);
88
+	$output = substr($output, 0, -1);
89 89
 }
90 90
 $output .= ']}';
91 91
 
Please login to merge, or discard this patch.