Completed
Push — master ( 73f088...7f17b6 )
by Yannick
07:13
created
statistics-route-airport.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             	["'._("Aircraft").'", "'._("# of times").'"], ';
24 24
 
25 25
 $route_data = '';
26
-foreach($route_array as $route_item)
26
+foreach ($route_array as $route_item)
27 27
 {
28 28
 	$route_data .= '[ "'.$route_item['airport_departure_icao'].' - '.$route_item['airport_arrival_icao'].'",'.$route_item['route_count'].'],';
29 29
 }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	print '</thead>';
60 60
 	print '<tbody>';
61 61
 	$i = 1;
62
-	foreach($route_array as $route_item)
62
+	foreach ($route_array as $route_item)
63 63
 	{
64 64
 		print '<tr>';
65 65
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
search-yaml.php 3 patches
Indentation   +104 added lines, -104 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);
@@ -94,70 +94,70 @@  discard block
 block discarded – undo
94 94
   foreach($spotter_array as $spotter_item)
95 95
   {
96 96
 	   	
97
-    $output .= ' - id: '.$spotter_item['spotter_id'];
98
-    $output .= "\n";
99
-    $output .= ' - ident: '.$spotter_item['ident'];
100
-    $output .= "\n";
101
-    $output .= ' - registration: '.$spotter_item['registration'];
102
-    $output .= "\n";
103
-    $output .= ' - aircraft_icao: '.$spotter_item['aircraft_type'];
104
-    $output .= "\n";
105
-    $output .= ' - aircraft_name: '.$spotter_item['aircraft_name'];
106
-    $output .= "\n";
107
-    $output .= ' - aircraft_manufacturer: '.$spotter_item['aircraft_manufacturer'];
108
-    $output .= "\n";
109
-    $output .= ' - airline_name: '.$spotter_item['airline_name'];
110
-    $output .= "\n";
111
-    $output .= ' - airline_icao: '.$spotter_item['airline_icao'];
112
-    $output .= "\n";
113
-    $output .= ' - airline_iata: '.$spotter_item['airline_iata'];
114
-    $output .= "\n";
115
-    $output .= ' - airline_country: '.$spotter_item['airline_country'];
116
-    $output .= "\n";
117
-    $output .= ' - airline_callsign: '.$spotter_item['airline_callsign'];
118
-    $output .= "\n";
119
-    $output .= ' - airline_type: '.$spotter_item['airline_type'];
120
-    $output .= "\n";
121
-    $output .= ' - departure_airport_city: '.$spotter_item['departure_airport_city'];
122
-    $output .= "\n";
123
-    $output .= ' - departure_airport_country: '.$spotter_item['departure_airport_country'];
124
-    $output .= "\n";
125
-    $output .= ' - departure_airport_iata: '.$spotter_item['departure_airport_iata'];
126
-    $output .= "\n";
127
-    $output .= ' - departure_airport_icao: '.$spotter_item['departure_airport_icao'];
128
-    $output .= "\n";
129
-    $output .= ' - departure_airport_latitude: '.$spotter_item['departure_airport_latitude'];
130
-    $output .= "\n";
131
-    $output .= ' - departure_airport_altitude: '.$spotter_item['departure_airport_altitude'];
132
-    $output .= "\n";
133
-    $output .= ' - arrival_airport_city: '.$spotter_item['arrival_airport_city'];
134
-    $output .= "\n";
135
-    $output .= ' - arrival_airport_country: '.$spotter_item['arrival_airport_country'];
136
-    $output .= "\n";
137
-    $output .= ' - arrival_airport_iata: '.$spotter_item['arrival_airport_iata'];
138
-    $output .= "\n";
139
-    $output .= ' - arrival_airport_icao: '.$spotter_item['arrival_airport_icao'];
140
-    $output .= "\n";
141
-    $output .= ' - arrival_airport_latitude: '.$spotter_item['arrival_airport_latitude'];
142
-    $output .= "\n";
143
-    $output .= ' - arrival_airport_altitude: '.$spotter_item['arrival_airport_altitude'];
144
-    $output .= "\n";    
145
-    $output .= ' - latitude: '.$spotter_item['latitude'];
146
-    $output .= "\n";
147
-    $output .= ' - longitude: '.$spotter_item['longitude'];
148
-    $output .= "\n";
149
-    $output .= ' - altitude: '.$spotter_item['altitude'];
150
-    $output .= "\n";
151
-    $output .= ' - ground_speed: '.$spotter_item['ground_speed'];
152
-    $output .= "\n";
153
-    $output .= ' - heading: '.$spotter_item['heading'];
154
-    $output .= "\n";
155
-    $output .= ' - heading_name: '.$spotter_item['heading_name'];
156
-    $output .= "\n";
157
-    $output .= ' - waypoints: '.$spotter_item['waypoints'];
158
-    $output .= "\n";
159
-    $output .= ' - date: '.date("c", strtotime($spotter_item['date_iso_8601']));
160
-    $output .= "\n\n";
97
+	$output .= ' - id: '.$spotter_item['spotter_id'];
98
+	$output .= "\n";
99
+	$output .= ' - ident: '.$spotter_item['ident'];
100
+	$output .= "\n";
101
+	$output .= ' - registration: '.$spotter_item['registration'];
102
+	$output .= "\n";
103
+	$output .= ' - aircraft_icao: '.$spotter_item['aircraft_type'];
104
+	$output .= "\n";
105
+	$output .= ' - aircraft_name: '.$spotter_item['aircraft_name'];
106
+	$output .= "\n";
107
+	$output .= ' - aircraft_manufacturer: '.$spotter_item['aircraft_manufacturer'];
108
+	$output .= "\n";
109
+	$output .= ' - airline_name: '.$spotter_item['airline_name'];
110
+	$output .= "\n";
111
+	$output .= ' - airline_icao: '.$spotter_item['airline_icao'];
112
+	$output .= "\n";
113
+	$output .= ' - airline_iata: '.$spotter_item['airline_iata'];
114
+	$output .= "\n";
115
+	$output .= ' - airline_country: '.$spotter_item['airline_country'];
116
+	$output .= "\n";
117
+	$output .= ' - airline_callsign: '.$spotter_item['airline_callsign'];
118
+	$output .= "\n";
119
+	$output .= ' - airline_type: '.$spotter_item['airline_type'];
120
+	$output .= "\n";
121
+	$output .= ' - departure_airport_city: '.$spotter_item['departure_airport_city'];
122
+	$output .= "\n";
123
+	$output .= ' - departure_airport_country: '.$spotter_item['departure_airport_country'];
124
+	$output .= "\n";
125
+	$output .= ' - departure_airport_iata: '.$spotter_item['departure_airport_iata'];
126
+	$output .= "\n";
127
+	$output .= ' - departure_airport_icao: '.$spotter_item['departure_airport_icao'];
128
+	$output .= "\n";
129
+	$output .= ' - departure_airport_latitude: '.$spotter_item['departure_airport_latitude'];
130
+	$output .= "\n";
131
+	$output .= ' - departure_airport_altitude: '.$spotter_item['departure_airport_altitude'];
132
+	$output .= "\n";
133
+	$output .= ' - arrival_airport_city: '.$spotter_item['arrival_airport_city'];
134
+	$output .= "\n";
135
+	$output .= ' - arrival_airport_country: '.$spotter_item['arrival_airport_country'];
136
+	$output .= "\n";
137
+	$output .= ' - arrival_airport_iata: '.$spotter_item['arrival_airport_iata'];
138
+	$output .= "\n";
139
+	$output .= ' - arrival_airport_icao: '.$spotter_item['arrival_airport_icao'];
140
+	$output .= "\n";
141
+	$output .= ' - arrival_airport_latitude: '.$spotter_item['arrival_airport_latitude'];
142
+	$output .= "\n";
143
+	$output .= ' - arrival_airport_altitude: '.$spotter_item['arrival_airport_altitude'];
144
+	$output .= "\n";    
145
+	$output .= ' - latitude: '.$spotter_item['latitude'];
146
+	$output .= "\n";
147
+	$output .= ' - longitude: '.$spotter_item['longitude'];
148
+	$output .= "\n";
149
+	$output .= ' - altitude: '.$spotter_item['altitude'];
150
+	$output .= "\n";
151
+	$output .= ' - ground_speed: '.$spotter_item['ground_speed'];
152
+	$output .= "\n";
153
+	$output .= ' - heading: '.$spotter_item['heading'];
154
+	$output .= "\n";
155
+	$output .= ' - heading_name: '.$spotter_item['heading_name'];
156
+	$output .= "\n";
157
+	$output .= ' - waypoints: '.$spotter_item['waypoints'];
158
+	$output .= "\n";
159
+	$output .= ' - date: '.date("c", strtotime($spotter_item['date_iso_8601']));
160
+	$output .= "\n\n";
161 161
   }
162 162
  }
163 163
 
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,29 +69,29 @@  discard block
 block discarded – undo
69 69
 
70 70
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
71 71
 else $sort = '';
72
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
75
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
76
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
77
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
78
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
79
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
80
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
81
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
82
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
83
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
84
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
85
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
86
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
87
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
88
-$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'');
72
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
73
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
74
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
75
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
76
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
77
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
78
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
79
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
80
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
81
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
82
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
83
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
84
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
85
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
86
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
87
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
88
+$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '');
89 89
        
90 90
 $output = "-flights:\n";
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
     $output .= ' - id: '.$spotter_item['spotter_id'];
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.
date-statistics-departure-airport-country.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  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
-$spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$spotter_array = $Spotter->getSpotterDataByDate($_GET['date'], "0,1", $sort);
8 8
 
9 9
 if (!empty($spotter_array))
10 10
 {
11
-	$title = sprintf(_("Most Common Departure Airports by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
11
+	$title = sprintf(_("Most Common Departure Airports by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
12 12
 
13 13
 	require_once('header.php');
14 14
 	print '<div class="select-item">';
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 	print '</div>';
21 21
 
22 22
 	print '<div class="info column">';
23
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
23
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
24 24
 	print '</div>';
25 25
 
26 26
 	include('date-sub-menu.php');
27 27
 	print '<div class="column">';
28 28
 	print '<h2>'._("Most Common Departure Airports by Country").'</h2>';
29
-	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
29
+	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
30 30
 	$airport_country_array = $Spotter->countAllDepartureAirportCountriesByDate($_GET['date']);
31 31
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
32 32
 	print '<div id="chartCountry" class="chart" width="100%"></div>
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             var data = google.visualization.arrayToDataTable([
38 38
             	["'._("Country").'", "'._("# of times").'"], ';
39 39
 	$country_data = '';
40
-	foreach($airport_country_array as $airport_item)
40
+	foreach ($airport_country_array as $airport_item)
41 41
 	{
42 42
 		$country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],';
43 43
 	}
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		print '</thead>';
72 72
 		print '<tbody>';
73 73
 		$i = 1;
74
-		foreach($airport_country_array as $airport_item)
74
+		foreach ($airport_country_array as $airport_item)
75 75
 		{
76 76
 			print '<tr>';
77 77
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
ident-statistics-registration.php 2 patches
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.
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
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
11
+$sort = filter_input(INPUT_GET, 'sort', 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 Aircraft by Registration of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Aircraft by Registration 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 Aircraft by Registration").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by Registration 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 aircraft by Registration of flights using the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 
29 29
 	$aircraft_array = $Spotter->countAllAircraftRegistrationByIdent($_GET['ident']);
30 30
 	
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		print '</thead>';
43 43
 		print '<tbody>';
44 44
 		$i = 1;
45
-		foreach($aircraft_array as $aircraft_item)
45
+		foreach ($aircraft_array as $aircraft_item)
46 46
 		{
47 47
 			print '<tr>';
48 48
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airspace-geojson.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 $Connection = new Connection();
12 12
 
13 13
 if (!$Connection->tableExists('airspace')) {
14
-    die;
14
+	die;
15 15
 }
16 16
 
17 17
 if (isset($_GET['coord'])) 
18 18
 {
19 19
 	$coords = explode(',',$_GET['coord']);
20
-        if ($globalDBdriver == 'mysql') {
20
+		if ($globalDBdriver == 'mysql') {
21 21
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))";
22 22
 		try {
23 23
 			$sth = $Connection->db->prepare($query);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		}
38 38
 	}
39 39
 } else {
40
-        if ($globalDBdriver == 'mysql') {
40
+		if ($globalDBdriver == 'mysql') {
41 41
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace";
42 42
 	} else {
43 43
 		$query = "SELECT *, ST_AsBinary(wkb_geometry,'NDR') AS wkb FROM airspace";
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 $geojson = array(
54
-    'type' => 'FeatureCollection',
55
-    'features' => array()
54
+	'type' => 'FeatureCollection',
55
+	'features' => array()
56 56
 );
57 57
 
58 58
 while ($row = $sth->fetch(PDO::FETCH_ASSOC))
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 			$geom = geoPHP::load(stream_get_contents($row['wkb']));
68 68
 		}
69 69
 		$feature = array(
70
-		    'type' => 'Feature',
71
-		    'geometry' => json_decode($geom->out('json')),
72
-		    'properties' => $properties
70
+			'type' => 'Feature',
71
+			'geometry' => json_decode($geom->out('json')),
72
+			'properties' => $properties
73 73
 		);
74 74
 		array_push($geojson['features'], $feature);
75 75
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
 if (isset($_GET['coord'])) 
18 18
 {
19
-	$coords = explode(',',$_GET['coord']);
19
+	$coords = explode(',', $_GET['coord']);
20 20
         if ($globalDBdriver == 'mysql') {
21 21
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))";
22 22
 		try {
23 23
 			$sth = $Connection->db->prepare($query);
24
-			$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3]));
24
+			$sth->execute(array(':minlon' => $coords[0], ':minlat' => $coords[1], ':maxlon' => $coords[2], ':maxlat' => $coords[3]));
25 25
 			//$sth->execute();
26
-		} catch(PDOException $e) {
26
+		} catch (PDOException $e) {
27 27
 			echo "error";
28 28
 		}
29 29
 	} else {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			$sth = $Connection->db->prepare($query);
33 33
 			//$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3]));
34 34
 			$sth->execute();
35
-		} catch(PDOException $e) {
35
+		} catch (PDOException $e) {
36 36
 			echo "error";
37 37
 		}
38 38
 	}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	try {
46 46
 		$sth = $Connection->db->prepare($query);
47 47
 		$sth->execute();
48
-	} catch(PDOException $e) {
48
+	} catch (PDOException $e) {
49 49
 		echo "error";
50 50
 	}
51 51
 }
Please login to merge, or discard this patch.
newest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,18 +13,18 @@  discard block
 block discarded – undo
13 13
 require_once('header.php');
14 14
 
15 15
 //calculuation for the pagination
16
-if(!isset($_GET['limit']))
16
+if (!isset($_GET['limit']))
17 17
 {
18 18
   $limit_start = 0;
19 19
   $limit_end = 25;
20 20
   $absolute_difference = 25;
21
-}  else {
21
+} else {
22 22
 	$limit_explode = explode(",", $_GET['limit']);
23 23
 	$limit_start = $limit_explode[0];
24 24
 	$limit_end = $limit_explode[1];
25 25
 }
26 26
 
27
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
27
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
28 28
 
29 29
 $absolute_difference = abs($limit_start - $limit_end);
30 30
 $limit_next = $limit_end + $absolute_difference;
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 {
36 36
 	$category = "aircraft";
37 37
 } else {
38
-	$category = filter_input(INPUT_GET,'category',FILTER_SANITIZE_STRING);
38
+	$category = filter_input(INPUT_GET, 'category', FILTER_SANITIZE_STRING);
39 39
 }
40 40
 
41 41
 $page_url = $globalURL.'/newest/'.$category;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
   $limit_start = 0;
19 19
   $limit_end = 25;
20 20
   $absolute_difference = 25;
21
-}  else {
21
+} else {
22 22
 	$limit_explode = explode(",", $_GET['limit']);
23 23
 	$limit_start = $limit_explode[0];
24 24
 	$limit_end = $limit_explode[1];
Please login to merge, or discard this patch.
statistics-owner.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@
 block discarded – undo
21 21
           function drawChart() {
22 22
             var data = google.visualization.arrayToDataTable([
23 23
             	["'._("Owner").'", "'._("# of times").'"], ';
24
-            	$owner_data = '';
24
+				$owner_data = '';
25 25
 		foreach($owner_array as $owner_item)
26 26
 		{
27 27
 			$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
28 28
 		}
29 29
 		$owner_data = substr($owner_data, 0, -1);
30 30
 		print $owner_data;
31
-            print ']);
31
+			print ']);
32 32
     
33 33
             var options = {
34 34
             	chartArea: {"width": "80%", "height": "60%"},
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             var data = google.visualization.arrayToDataTable([
23 23
             	["'._("Owner").'", "'._("# of times").'"], ';
24 24
             	$owner_data = '';
25
-		foreach($owner_array as $owner_item)
25
+		foreach ($owner_array as $owner_item)
26 26
 		{
27 27
 			$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
28 28
 		}
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	print '</thead>';
56 56
 	print '<tbody>';
57 57
 	$i = 1;
58
-	foreach($owner_array as $owner_item)
58
+	foreach ($owner_array as $owner_item)
59 59
 	{
60 60
 		print '<tr>';
61 61
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
ident-sub-menu.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 block discarded – undo
3 3
 </span>
4 4
 <div class="sub-menu sub-menu-container">
5 5
 	<ul class="nav nav-pills">
6
-		<li><a href="<?php print $globalURL; ?>/ident/<?php print $_GET['ident']; ?>" <?php if (strtolower($current_page) == "ident-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li>
6
+		<li><a href="<?php print $globalURL; ?>/ident/<?php print $_GET['ident']; ?>" <?php if (strtolower($current_page) == "ident-detailed") { print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li>
7 7
 		<li class="dropdown">
8
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "ident-statistics-aircraft" || strtolower($current_page) == "ident-statistics-registration" || strtolower($current_page) == "ident-statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
8
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "ident-statistics-aircraft" || strtolower($current_page) == "ident-statistics-registration" || strtolower($current_page) == "ident-statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#">
9 9
 		      <?php echo _("Aircraft"); ?> <span class="caret"></span>
10 10
 		    </a>
11 11
 		    <ul class="dropdown-menu" role="menu">
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		    </ul>
16 16
 		</li>
17 17
 		<li class="dropdown">
18
-		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "ident-statistics-departure-airport" || strtolower($current_page) == "ident-statistics-departure-airport-country" || strtolower($current_page) == "ident-statistics-arrival-airport" || strtolower($current_page) == "ident-statistics-arrival-airport-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#">
18
+		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "ident-statistics-departure-airport" || strtolower($current_page) == "ident-statistics-departure-airport-country" || strtolower($current_page) == "ident-statistics-arrival-airport" || strtolower($current_page) == "ident-statistics-arrival-airport-country") { print 'active'; } ?>" data-toggle="dropdown" href="#">
19 19
 		      <?php echo _("Airport"); ?> <span class="caret"></span>
20 20
 		    </a>
21 21
 		    <ul class="dropdown-menu" role="menu">
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 			  <li><a href="<?php print $globalURL; ?>/ident/statistics/arrival-airport-country/<?php print $_GET['ident']; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li>
26 26
 		    </ul>
27 27
 		</li>
28
-		<li><a href="<?php print $globalURL; ?>/ident/statistics/route/<?php print $_GET['ident']; ?>" <?php if (strtolower($current_page) == "ident-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li>
29
-		<li><a href="<?php print $globalURL; ?>/ident/statistics/time/<?php print $_GET['ident']; ?>" <?php if (strtolower($current_page) == "ident-statistics-time"){ print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li>
28
+		<li><a href="<?php print $globalURL; ?>/ident/statistics/route/<?php print $_GET['ident']; ?>" <?php if (strtolower($current_page) == "ident-statistics-route") { print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li>
29
+		<li><a href="<?php print $globalURL; ?>/ident/statistics/time/<?php print $_GET['ident']; ?>" <?php if (strtolower($current_page) == "ident-statistics-time") { print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li>
30 30
 	</ul>
31 31
 </div>
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
statistics-registration.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
           function drawChart() {
22 22
             var data = google.visualization.arrayToDataTable([
23 23
             	["'._("Aircraft Manufacturer").'", "'._("# of times").'"], ';
24
-            	$registration_data = '';
24
+				$registration_data = '';
25 25
 foreach($registration_array as $registration_item)
26 26
 {
27 27
 	$registration_data .= '[ "'.$registration_item['registration'].' - '.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')",'.$registration_item['aircraft_registration_count'].'],';
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             var data = google.visualization.arrayToDataTable([
23 23
             	["'._("Aircraft Manufacturer").'", "'._("# of times").'"], ';
24 24
             	$registration_data = '';
25
-foreach($registration_array as $registration_item)
25
+foreach ($registration_array as $registration_item)
26 26
 {
27 27
 	$registration_data .= '[ "'.$registration_item['registration'].' - '.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')",'.$registration_item['aircraft_registration_count'].'],';
28 28
 }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	print '</thead>';
58 58
 	print '<tbody>';
59 59
 	$i = 1;
60
-	foreach($registration_array as $registration_item)
60
+	foreach ($registration_array as $registration_item)
61 61
 	{
62 62
 		print '<tr>';
63 63
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.