Completed
Push — master ( 73f088...7f17b6 )
by Yannick
07:13
created
search-yaml.php 1 patch
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.
ident-statistics-registration.php 1 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.
airspace-geojson.php 1 patch
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.
statistics-owner.php 1 patch
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.
statistics-registration.php 1 patch
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.
aircraft-statistics-departure-airport.php 1 patch
Indentation   +4 added lines, -4 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_type'])) {
6
-        header('Location: '.$globalURL.'/aircraft');
7
-        die();
6
+		header('Location: '.$globalURL.'/aircraft');
7
+		die();
8 8
 }
9 9
 $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
52 52
 	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>';
53 53
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByAircraft($aircraft_type);
54
-    	print '
54
+		print '
55 55
     	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
56 56
     	<script>
57 57
     	google.load("visualization", "1", {packages:["geochart"]});
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     
64 64
         var data = google.visualization.arrayToDataTable([ 
65 65
         	["'._("Airport").'", "'._("# of times").'"],';
66
-        $airport_data = '';
66
+		$airport_data = '';
67 67
 	foreach($airport_airport_array as $airport_item)
68 68
 	{
69 69
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
Please login to merge, or discard this patch.
airport-statistics-airline.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['airport'])) {
6
-        header('Location: '.$globalURL.'/airport');
7
-        die();
6
+		header('Location: '.$globalURL.'/airport');
7
+		die();
8 8
 }
9 9
 $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
           function drawChart() {
66 66
             var data = google.visualization.arrayToDataTable([
67 67
             	["'._("Aircraft").'", "'._("# of times").'"], ';
68
-            	$airline_data = '';
68
+				$airline_data = '';
69 69
 	foreach($airline_array as $airline_item)
70 70
 	{
71 71
 		$airline_data .= '[ "'.$airline_item['airline_name'].'",'.$airline_item['airline_count'].'],';
Please login to merge, or discard this patch.
registration-statistics-time.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
           function drawChart() {
35 35
             var data = google.visualization.arrayToDataTable([
36 36
             	["'._("Hour").'", "'._("# of Flights").'"], ';
37
-            	$hour_data = '';
37
+				$hour_data = '';
38 38
 	foreach($hour_array as $hour_item)
39 39
 	{
40 40
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
Please login to merge, or discard this patch.
country-statistics-registration.php 1 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['country'])) {
6
-        header('Location: '.$globalURL.'/country');
7
-        die();
6
+		header('Location: '.$globalURL.'/country');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)));
Please login to merge, or discard this patch.