Completed
Push — master ( 93433b...e17801 )
by Yannick
30:26
created
airport-data.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 $Spotter = new Spotter();
7 7
 
8 8
 if (isset($_GET['airport_icao'])) {
9
-	$icao = filter_input(INPUT_GET,'airport_icao',FILTER_SANITIZE_STRING);
9
+	$icao = filter_input(INPUT_GET, 'airport_icao', FILTER_SANITIZE_STRING);
10 10
 	$spotter_array = $Spotter->getAllAirportInfo($icao);
11 11
 	if (isset($globalMETAR) && $globalMETAR) {
12 12
 		$METAR = new METAR();
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 }
55 55
 print '</div>';
56 56
 print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
57
-print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>';
57
+print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 3).', '.round($spotter_item['longitude'], 3).'</div>';
58 58
 if (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '' && isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') {
59 59
     print '<div><span>'._("Links").'</span>';
60 60
     print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>";
104 104
     }
105 105
     if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
106
-	$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
106
+	$humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1);
107 107
 	print _("Humidity:").' '.$humidity.'%'."<br/>";
108 108
     }
109 109
     if (isset($metar_parse['QNH'])) {
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -47,79 +47,79 @@
 block discarded – undo
47 47
 print '</div>';
48 48
 print '<div><span>'._("Altitude").'</span>';
49 49
 if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
50
-        print $spotter_item['altitude'].' feet';
50
+		print $spotter_item['altitude'].' feet';
51 51
 } else {
52
-        print round($spotter_item['altitude']*0.3048).' m';
52
+		print round($spotter_item['altitude']*0.3048).' m';
53 53
 }
54 54
 print '</div>';
55 55
 print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
56 56
 print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>';
57 57
 if (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '' && isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') {
58
-    print '<div><span>'._("Links").'</span>';
59
-    print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
60
-    print ' - ';
61
-    print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
62
-    print '</div>';
58
+	print '<div><span>'._("Links").'</span>';
59
+	print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
60
+	print ' - ';
61
+	print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
62
+	print '</div>';
63 63
 } elseif (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '') {
64
-    print '<div><span>'._("Links").'</span>';
65
-    print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
66
-    print '</div>';
64
+	print '<div><span>'._("Links").'</span>';
65
+	print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
66
+	print '</div>';
67 67
 } elseif (isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') {
68
-    print '<div><span>'._("Links").'</span>';
69
-    print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
70
-    print '</div>';
68
+	print '<div><span>'._("Links").'</span>';
69
+	print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
70
+	print '</div>';
71 71
 }
72 72
 if ($spotter_item['type'] == 'medium_airport' || $spotter_item['type'] == 'large_airport') {
73
-    print '<div><span>'._("Live Air Traffic").'</span>';
74
-    print '<a href="http://www.liveatc.net/search/?icao='.$spotter_item['icao'].'">LiveATC</a>';
75
-    print '</div>';
73
+	print '<div><span>'._("Live Air Traffic").'</span>';
74
+	print '<a href="http://www.liveatc.net/search/?icao='.$spotter_item['icao'].'">LiveATC</a>';
75
+	print '</div>';
76 76
 }
77 77
 
78 78
 print '</div>';
79 79
 
80 80
 if (isset($metar_parse)) {
81
-    print '<div class="waypoints">';
82
-    print '<div><span>METAR</span>';
83
-    print '<i>'.$metar_info[0]['metar'].'</i><br />';
84
-    print '<b>'.$metar_info[0]['metar_date'].'</b><br />';
81
+	print '<div class="waypoints">';
82
+	print '<div><span>METAR</span>';
83
+	print '<i>'.$metar_info[0]['metar'].'</i><br />';
84
+	print '<b>'.$metar_info[0]['metar_date'].'</b><br />';
85 85
 //    print_r($metar_parse);
86
-    if (isset($metar_parse['wind'])) {
87
-        print _("Wind:").' ';
86
+	if (isset($metar_parse['wind'])) {
87
+		print _("Wind:").' ';
88 88
 	if (isset($metar_parse['wind']['direction'])) {
89
-	    $direction = $Spotter->parseDirection($metar_parse['wind']['direction']);
90
-	    print $direction[0]['direction_fullname'];
91
-	    print ' ('.$metar_parse['wind']['direction'].'°) ';
92
-        }
93
-        if (isset($metar_parse['wind']['speed'])) {
94
-	    print $metar_parse['wind']['speed'].' m/s';
95
-        }
89
+		$direction = $Spotter->parseDirection($metar_parse['wind']['direction']);
90
+		print $direction[0]['direction_fullname'];
91
+		print ' ('.$metar_parse['wind']['direction'].'°) ';
92
+		}
93
+		if (isset($metar_parse['wind']['speed'])) {
94
+		print $metar_parse['wind']['speed'].' m/s';
95
+		}
96 96
 	print '<br/>';
97
-    }
98
-    if (isset($metar_parse['visibility'])) {
99
-        print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>";
100
-    }
101
-    if (isset($metar_parse['weather'])) {
102
-        print _("Weather:").' '.$metar_parse['weather']."<br/>";
103
-    }
104
-    if (isset($metar_parse['temperature'])) {
105
-        print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>";
106
-    }
107
-    if (isset($metar_parse['dew'])) {
108
-        print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>";
109
-    }
110
-    if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
97
+	}
98
+	if (isset($metar_parse['visibility'])) {
99
+		print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>";
100
+	}
101
+	if (isset($metar_parse['weather'])) {
102
+		print _("Weather:").' '.$metar_parse['weather']."<br/>";
103
+	}
104
+	if (isset($metar_parse['temperature'])) {
105
+		print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>";
106
+	}
107
+	if (isset($metar_parse['dew'])) {
108
+		print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>";
109
+	}
110
+	if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
111 111
 	$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
112 112
 	print _("Humidity:").' '.$humidity.'%'."<br/>";
113
-    }
114
-    if (isset($metar_parse['QNH'])) {
115
-        print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>";
116
-    }
113
+	}
114
+	if (isset($metar_parse['QNH'])) {
115
+		print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>";
116
+	}
117 117
 /*
118 118
 if (isset($metar_parse['QNH'])) {
119 119
     print 'Pressure : '.$metar_parse['QNH'].' hPa'."<br/>";
120 120
 }
121 121
 */
122
-    print '</div>';
122
+	print '</div>';
123 123
 /*
124 124
 Wind: from the NNE (020 degrees) at 5 MPH (4 KT) (direction variable):0
125 125
 Visibility: greater than 7 mile(s):0
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
 		$METAR = new METAR();
13 13
 		$metar_info = $METAR->getMETAR($icao);
14 14
 		//print_r($metar_info);
15
-		if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
15
+		if (isset($metar_info[0]['metar'])) {
16
+			$metar_parse = $METAR->parse($metar_info[0]['metar']);
17
+		}
16 18
 		//print_r($metar_parse);
17 19
 	}
18 20
  ?>
Please login to merge, or discard this patch.
archive-country.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$country = filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING);
8
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$country = filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING);
8
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
9 9
 
10 10
 $Spotter = new Spotter();
11
-if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
11
+if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
12 12
 else $spotter_array = array();
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Airlines by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
16
+	$title = sprintf(_("Most Common Airlines by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
17 17
 	require_once('header.php');
18 18
 	print '<div class="select-item">';
19 19
 	print '<form action="'.$globalURL.'/date" method="post">';
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
 	print '</div>';
25 25
 
26 26
 	print '<div class="info column">';
27
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
27
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
28 28
 	print '</div>';
29 29
 
30 30
 	include('date-sub-menu.php');
31 31
 	print '<div class="column">';
32 32
 	print '<h2>'._("Most Common Airlines by Country").'</h2>';
33
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
33
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
34 34
 
35 35
 	$airline_array = $Spotter->countAllAirlineCountriesByDate($date);
36 36
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             var data = google.visualization.arrayToDataTable([
43 43
             	["'._("Country").'", "'._("# of times").'"], ';
44 44
 	$country_data = '';
45
-	foreach($airline_array as $airline_item)
45
+	foreach ($airline_array as $airline_item)
46 46
 	{
47 47
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
48 48
 	}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		print '</thead>';
77 77
 		print '<tbody>';
78 78
 		$i = 1;
79
-		foreach($airline_array as $airline_item)
79
+		foreach ($airline_array as $airline_item)
80 80
 		{
81 81
 			print '<tr>';
82 82
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,11 @@
 block discarded – undo
8 8
 $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
9 9
 
10 10
 $Spotter = new Spotter();
11
-if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
12
-else $spotter_array = array();
11
+if (isset($_GET['date'])) {
12
+	$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
13
+} else {
14
+	$spotter_array = array();
15
+}
13 16
 
14 17
 if (!empty($spotter_array))
15 18
 {
Please login to merge, or discard this patch.
registration-statistics-departure-airport.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,11 @@
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 $registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING);
7 7
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
8
-if (isset($_GET['sort'])) $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
9
-else $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1");
8
+if (isset($_GET['sort'])) {
9
+	$spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
10
+} else {
11
+	$spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1");
12
+}
10 13
 $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration);
11 14
 
12 15
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING);
7
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
6
+$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
7
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
8 8
 if (isset($_GET['sort'])) $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
9 9
 else $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1");
10 10
 $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration);
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 if (!empty($spotter_array))
14 14
 {
15
-	$title = sprintf(_("Most Common Departure Airports of aircraft with registration %s"),$registration);
15
+	$title = sprintf(_("Most Common Departure Airports of aircraft with registration %s"), $registration);
16 16
 	require_once('header.php');
17 17
 
18 18
 	print '<div class="info column">';
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	print '<div class="column">';
27 27
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
28 28
 
29
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with aircraft registration <strong>%s</strong>."),$registration).'</p>';
29
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with aircraft registration <strong>%s</strong>."), $registration).'</p>';
30 30
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByRegistration($registration);
31 31
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
32 32
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	print '<script>';
36 36
 	print 'var series = [';
37 37
 	$airport_data = '';
38
-	foreach($airport_airport_array as $airport_item)
38
+	foreach ($airport_airport_array as $airport_item)
39 39
 	{
40 40
 		$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
41 41
 	}
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	print '</thead>';
90 90
 	print '<tbody>';
91 91
 	$i = 1;
92
-	foreach($airport_airport_array as $airport_item)
92
+	foreach ($airport_airport_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.
statistics-route-waypoint.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	print '</thead>';
28 28
 	print '<tbody>';
29 29
 	$i = 1;
30
-	foreach($route_array as $route_item)
30
+	foreach ($route_array as $route_item)
31 31
 	{
32 32
 		print '<tr>';
33 33
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 $title = _("Statistics").' - '._("Most common Route by Waypoint");
7 7
 require_once('header.php');
8
-if (!isset($filter_name)) $filter_name = '';
8
+if (!isset($filter_name)) {
9
+	$filter_name = '';
10
+}
9 11
 include('statistics-sub-menu.php'); 
10 12
 
11 13
 print '<div class="info">
Please login to merge, or discard this patch.
search-geojson.php 3 patches
Indentation   +126 added lines, -126 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);
@@ -90,69 +90,69 @@  discard block
 block discarded – undo
90 90
       
91 91
 $output = '{';
92 92
 	$output .= '"type": "FeatureCollection",';
93
-    $output .= '"features": [';
93
+	$output .= '"features": [';
94 94
             
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
 				
102 102
 				//waypoint plotting
103 103
 				$output .= '{';  
104 104
 					$output .= '"type": "Feature",';
105
-	      		$output .= '"properties": {';
106
-	          	    $output .= '"id": "'.$spotter_item['spotter_id'].'",';
107
-                    $output .= '"ident": "'.$spotter_item['ident'].'",';
108
-                    $output .= '"registration": "'.$spotter_item['registration'].'",';
109
-                    $output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",';
110
-                    $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",';
111
-                    $output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",';
112
-                    $output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
113
-                    $output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",';
114
-                    $output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",';
115
-                    $output .= '"airline_country": "'.$spotter_item['airline_country'].'",';
116
-                    $output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",';
117
-                    $output .= '"airline_type": "'.$spotter_item['airline_type'].'",';
118
-                    $output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",';
119
-                    $output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",';
120
-                    $output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",';
121
-                    $output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",';
122
-                    $output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",';
123
-                    $output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",';
124
-                    $output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; 
125
-                    $output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",';
126
-                    $output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",';
127
-                    $output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",';
128
-                    $output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",';
129
-                    $output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",';
130
-                    $output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",';
131
-                    $output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",';
132
-                    $output .= '"latitude": "'.$spotter_item['latitude'].'",';
133
-                    $output .= '"longitude": "'.$spotter_item['longitude'].'",';
134
-                    $output .= '"altitude": "'.$spotter_item['altitude'].'",';
135
-                    $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",';
136
-                    $output .= '"heading": "'.$spotter_item['heading'].'",';
137
-                    $output .= '"heading_name": "'.$spotter_item['heading_name'].'",';
138
-                    $output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"';
139
-	          $output .= '}';
140
-	          if ($spotter_item['waypoints'] != '') {
141
-	          $output .= ',"geometry": {';
142
-	          	$output .= '"type": "LineString",';
143
-	            	$output .= '"coordinates": [';
144
-		            	$waypoint_pieces = explode(' ', $spotter_item['waypoints']);
105
+		  		$output .= '"properties": {';
106
+			  		$output .= '"id": "'.$spotter_item['spotter_id'].'",';
107
+					$output .= '"ident": "'.$spotter_item['ident'].'",';
108
+					$output .= '"registration": "'.$spotter_item['registration'].'",';
109
+					$output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",';
110
+					$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",';
111
+					$output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",';
112
+					$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
113
+					$output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",';
114
+					$output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",';
115
+					$output .= '"airline_country": "'.$spotter_item['airline_country'].'",';
116
+					$output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",';
117
+					$output .= '"airline_type": "'.$spotter_item['airline_type'].'",';
118
+					$output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",';
119
+					$output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",';
120
+					$output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",';
121
+					$output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",';
122
+					$output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",';
123
+					$output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",';
124
+					$output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; 
125
+					$output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",';
126
+					$output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",';
127
+					$output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",';
128
+					$output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",';
129
+					$output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",';
130
+					$output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",';
131
+					$output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",';
132
+					$output .= '"latitude": "'.$spotter_item['latitude'].'",';
133
+					$output .= '"longitude": "'.$spotter_item['longitude'].'",';
134
+					$output .= '"altitude": "'.$spotter_item['altitude'].'",';
135
+					$output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",';
136
+					$output .= '"heading": "'.$spotter_item['heading'].'",';
137
+					$output .= '"heading_name": "'.$spotter_item['heading_name'].'",';
138
+					$output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"';
139
+			  $output .= '}';
140
+			  if ($spotter_item['waypoints'] != '') {
141
+			  $output .= ',"geometry": {';
142
+			  	$output .= '"type": "LineString",';
143
+					$output .= '"coordinates": [';
144
+						$waypoint_pieces = explode(' ', $spotter_item['waypoints']);
145 145
 									$waypoint_pieces = array_chunk($waypoint_pieces, 2);
146 146
 									    
147 147
 									foreach ($waypoint_pieces as $waypoint_coordinate)
148 148
 									{
149 149
 										$output .= '[';
150
-									        $output .=  $waypoint_coordinate[1].', ';	
151
-									        $output .=  $waypoint_coordinate[0];
150
+											$output .=  $waypoint_coordinate[1].', ';	
151
+											$output .=  $waypoint_coordinate[0];
152 152
 									  $output .= '],';
153 153
 									
154 154
 									}
155
-		            	$output = substr($output, 0, -1);
155
+						$output = substr($output, 0, -1);
156 156
 								$output .= ']';
157 157
 							$output .= '}';
158 158
 		}
@@ -161,50 +161,50 @@  discard block
 block discarded – undo
161 161
 				//location of aircraft
162 162
 				$output .= '{';  
163 163
 					$output .= '"type": "Feature",';
164
-	      		$output .= '"properties": {';
165
-	          	    $output .= '"id": "'.$spotter_item['spotter_id'].'",';
166
-                    $output .= '"ident": "'.$spotter_item['ident'].'",';
167
-                    $output .= '"registration": "'.$spotter_item['registration'].'",';
168
-                    $output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",';
169
-                    $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",';
170
-                    $output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",';
171
-                    $output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
172
-                    $output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",';
173
-                    $output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",';
174
-                    $output .= '"airline_country": "'.$spotter_item['airline_country'].'",';
175
-                    $output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",';
176
-                    $output .= '"airline_type": "'.$spotter_item['airline_type'].'",';
177
-                    $output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",';
178
-                    $output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",';
179
-                    $output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",';
180
-                    $output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",';
181
-                    $output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",';
182
-                    $output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",';
183
-                    $output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; 
184
-                    $output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",';
185
-                    $output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",';
186
-                    $output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",';
187
-                    $output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",';
188
-                    $output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",';
189
-                    $output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",';
190
-                    $output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",';
191
-                    $output .= '"latitude": "'.$spotter_item['latitude'].'",';
192
-                    $output .= '"longitude": "'.$spotter_item['longitude'].'",';
193
-                    $output .= '"altitude": "'.$spotter_item['altitude'].'",';
194
-                    $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",';
195
-                    $output .= '"heading": "'.$spotter_item['heading'].'",';
196
-                    $output .= '"heading_name": "'.$spotter_item['heading_name'].'",';
197
-                    $output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"';
198
-	          $output .= '},';
199
-	          $output .= '"geometry": {';
200
-	          	$output .= '"type": "Point",';
201
-	            	$output .= '"coordinates": [';
164
+		  		$output .= '"properties": {';
165
+			  		$output .= '"id": "'.$spotter_item['spotter_id'].'",';
166
+					$output .= '"ident": "'.$spotter_item['ident'].'",';
167
+					$output .= '"registration": "'.$spotter_item['registration'].'",';
168
+					$output .= '"aircraft_icao": "'.$spotter_item['aircraft_type'].'",';
169
+					$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].'",';
170
+					$output .= '"aircraft_manufacturer": "'.$spotter_item['aircraft_manufacturer'].'",';
171
+					$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
172
+					$output .= '"airline_icao": "'.$spotter_item['airline_icao'].'",';
173
+					$output .= '"airline_iata": "'.$spotter_item['airline_iata'].'",';
174
+					$output .= '"airline_country": "'.$spotter_item['airline_country'].'",';
175
+					$output .= '"airline_callsign": "'.$spotter_item['airline_callsign'].'",';
176
+					$output .= '"airline_type": "'.$spotter_item['airline_type'].'",';
177
+					$output .= '"departure_airport_city": "'.$spotter_item['departure_airport_city'].'",';
178
+					$output .= '"departure_airport_country": "'.$spotter_item['departure_airport_country'].'",';
179
+					$output .= '"departure_airport_iata": "'.$spotter_item['departure_airport_iata'].'",';
180
+					$output .= '"departure_airport_icao": "'.$spotter_item['departure_airport_icao'].'",';
181
+					$output .= '"departure_airport_latitude": "'.$spotter_item['departure_airport_latitude'].'",';
182
+					$output .= '"departure_airport_longitude": "'.$spotter_item['departure_airport_longitude'].'",';
183
+					$output .= '"departure_airport_altitude": "'.$spotter_item['departure_airport_altitude'].'",'; 
184
+					$output .= '"arrival_airport_city": "'.$spotter_item['arrival_airport_city'].'",';
185
+					$output .= '"arrival_airport_country": "'.$spotter_item['arrival_airport_country'].'",';
186
+					$output .= '"arrival_airport_iata": "'.$spotter_item['arrival_airport_iata'].'",';
187
+					$output .= '"departure_airport_icao": "'.$spotter_item['arrival_airport_icao'].'",';
188
+					$output .= '"arrival_airport_latitude": "'.$spotter_item['arrival_airport_latitude'].'",';
189
+					$output .= '"arrival_airport_longitude": "'.$spotter_item['arrival_airport_longitude'].'",';
190
+					$output .= '"arrival_airport_altitude": "'.$spotter_item['arrival_airport_altitude'].'",';
191
+					$output .= '"latitude": "'.$spotter_item['latitude'].'",';
192
+					$output .= '"longitude": "'.$spotter_item['longitude'].'",';
193
+					$output .= '"altitude": "'.$spotter_item['altitude'].'",';
194
+					$output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",';
195
+					$output .= '"heading": "'.$spotter_item['heading'].'",';
196
+					$output .= '"heading_name": "'.$spotter_item['heading_name'].'",';
197
+					$output .= '"date": "'.date("c", strtotime($spotter_item['date_iso_8601'])).'"';
198
+			  $output .= '},';
199
+			  $output .= '"geometry": {';
200
+			  	$output .= '"type": "Point",';
201
+					$output .= '"coordinates": [';
202 202
 										$output .=  $spotter_item['longitude'].', ';	
203 203
 									  $output .=  $spotter_item['latitude'];
204 204
 								$output .= ']';
205 205
 							$output .= '}';
206 206
 				$output .= '},';
207
-	    }
207
+		}
208 208
 	   }
209 209
 	   $output  = substr($output, 0, -1);
210 210
 	   
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -2,17 +2,17 @@  discard block
 block discarded – undo
2 2
 require_once('require/class.Connection.php');
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5
-$Spotter=new Spotter();
5
+$Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7 7
         //for the date manipulation into the query
8
-        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
8
+        if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
9 9
                 $start_date = $_GET['start_date'].":00";
10 10
                 $end_date = $_GET['end_date'].":00";
11 11
                 $sql_date = $start_date.",".$end_date;
12
-        } else if($_GET['start_date'] != ""){
12
+        } else if ($_GET['start_date'] != "") {
13 13
                 $start_date = $_GET['start_date'].":00";
14 14
                 $sql_date = $start_date;
15
-        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
15
+        } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
16 16
                 $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17 17
                 $sql_date = $end_date;
18 18
         } else $sql_date = '';
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22 22
         //for altitude manipulation
23
-        if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
23
+        if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24 24
                 $end_altitude = $_GET['highest_altitude'];
25 25
                 $start_altitude = $_GET['lowest_altitude'];
26 26
                 $sql_altitude = $start_altitude.",".$end_altitude;
27
-        } else if($_GET['highest_altitude'] != ""){
27
+        } else if ($_GET['highest_altitude'] != "") {
28 28
                 $end_altitude = $_GET['highest_altitude'];
29 29
                 $sql_altitude = $end_altitude;
30
-        } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
30
+        } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31 31
                 $start_altitude = $_GET['lowest_altitude'].",60000";
32 32
                 $sql_altitude = $start_altitude;
33 33
         } else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37
-if(!isset($_GET['limit']))
37
+if (!isset($_GET['limit']))
38 38
 {
39 39
         if (!isset($_GET['number_results']))
40 40
         {
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
                 $limit_end = 25;
43 43
                 $absolute_difference = 25;
44 44
         } else {
45
-                if ($_GET['number_results'] > 1000){
45
+                if ($_GET['number_results'] > 1000) {
46 46
                         $_GET['number_results'] = 1000;
47 47
                 }
48 48
                 $limit_start = 0;
49 49
                 $limit_end = $_GET['number_results'];
50 50
                 $absolute_difference = $_GET['number_results'];
51 51
         }
52
-}  else {
52
+} else {
53 53
         $limit_explode = explode(",", $_GET['limit']);
54 54
         $limit_start = $limit_explode[0];
55 55
         $limit_end = $limit_explode[1];
@@ -69,23 +69,23 @@  discard block
 block discarded – undo
69 69
 
70 70
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
71 71
 else $sort = '';
72
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
75
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
76
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
77
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
78
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
79
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
80
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
81
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
82
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
83
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
84
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
85
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
86
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
87
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
88
-$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'');
72
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
73
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
74
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
75
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
76
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
77
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
78
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
79
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
80
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
81
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
82
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
83
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
84
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
85
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
86
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
87
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
88
+$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '');
89 89
        
90 90
       
91 91
 $output = '{';
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     
96 96
     if (!empty($spotter_array))
97 97
 	  {	  
98
-	    foreach($spotter_array as $spotter_item)
98
+	    foreach ($spotter_array as $spotter_item)
99 99
 	    {
100 100
 				
101 101
 				
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 									foreach ($waypoint_pieces as $waypoint_coordinate)
148 148
 									{
149 149
 										$output .= '[';
150
-									        $output .=  $waypoint_coordinate[1].', ';	
151
-									        $output .=  $waypoint_coordinate[0];
150
+									        $output .= $waypoint_coordinate[1].', ';	
151
+									        $output .= $waypoint_coordinate[0];
152 152
 									  $output .= '],';
153 153
 									
154 154
 									}
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 	          $output .= '"geometry": {';
200 200
 	          	$output .= '"type": "Point",';
201 201
 	            	$output .= '"coordinates": [';
202
-										$output .=  $spotter_item['longitude'].', ';	
203
-									  $output .=  $spotter_item['latitude'];
202
+										$output .= $spotter_item['longitude'].', ';	
203
+									  $output .= $spotter_item['latitude'];
204 204
 								$output .= ']';
205 205
 							$output .= '}';
206 206
 				$output .= '},';
Please login to merge, or discard this patch.
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: application/json');
69 77
 
70
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
71
-else $sort = '';
78
+if (isset($_GET['sort'])) {
79
+	$sort = $_GET['sort'];
80
+} else {
81
+	$sort = '';
82
+}
72 83
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73 84
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74 85
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
tools-metar.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 $page_url = $globalURL.'/tools-metar';
12 12
 
13
-$message = filter_input(INPUT_POST,'metar_message',FILTER_SANITIZE_STRING);
13
+$message = filter_input(INPUT_POST, 'metar_message', FILTER_SANITIZE_STRING);
14 14
 
15 15
 print '<div class="info column">';
16 16
 print '<h1>'._("Parse METAR messages").'</h1>';
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			print '<b>'._("Dew point:").'</b> '.$metar_parse['dew'].' °C'." ";
72 72
 		}
73 73
 		if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
74
-			$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
74
+			$humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1);
75 75
 			print '<b>'._("Humidity:").'</b> '.$humidity.'%'." ";
76 76
 		}
77 77
 		if (isset($metar_parse['QNH'])) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@  discard block
 block discarded – undo
23 23
 print '<fieldset class="form-group">';
24 24
 print '<label for="metar_message">'._("METAR Message").'</label>';
25 25
 print '<textarea class="form-control" name="metar_message" id="metar_message" rows="5">';
26
-if ($message != '') print $message;
26
+if ($message != '') {
27
+	print $message;
28
+}
27 29
 print '</textarea>';
28 30
 print '</fieldset>';
29 31
 print '<button type="submit" class="btn btn-primary">Submit</button>';
@@ -59,7 +61,9 @@  discard block
 block discarded – undo
59 61
 		if (isset($metar_parse['cloud'])) {
60 62
 			print '<b>'._("Cloud:").'</b> ';
61 63
 			foreach ($metar_parse['cloud'] as $key => $cloud) {
62
-				if ($key > 0) print ' / ';
64
+				if ($key > 0) {
65
+					print ' / ';
66
+				}
63 67
 				print $cloud['type'].' at '.$cloud['level'].' m';
64 68
 			}
65 69
 			print " ";
Please login to merge, or discard this patch.
search-georss.php 3 patches
Indentation   +51 added lines, -51 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);
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 	print '<subtitle>The latest airplanes</subtitle>';
99 99
 	print '<updated>'.$date.'</updated>';
100 100
 	print '<author>';
101
-    	print '<name>FlightAirMap</name>';
102
-    	print '<email>[email protected]</email>';
101
+		print '<name>FlightAirMap</name>';
102
+		print '<email>[email protected]</email>';
103 103
 	print '</author>';
104 104
 	print '<id>FlightAirMap</id>';
105 105
 	
@@ -110,14 +110,14 @@  discard block
 block discarded – undo
110 110
 	
111 111
 	      
112 112
 		  print '<entry>';
113
-		    print '<title>'.$spotter_item['ident'].' '.$spotter_item['airline_name'].' | '.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | '.$spotter_item['departure_airport'].' - '.$spotter_item['arrival_airport'].'</title>';
114
-		    print '<link href="http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'"/>';
115
-		    print '<id>http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</id>';
116
-		    print '<content>Ident: '.$spotter_item['ident'].' | Registration: '.$spotter_item['registration'].' | Aircraft: '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | Airline: '.$spotter_item['airline_name'].' | Coming From: '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].') | Flying to: '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].') | Flew nearby on: '.date("M j, Y, g:i a T", strtotime($spotter_item['date_iso_8601'])).'</content>';
117
-		    print '<updated>'.$date.'</updated>';
118
-		    if ($spotter_item['waypoints'] != "")
119
-		    {
120
-			    print '<georss:where>';
113
+			print '<title>'.$spotter_item['ident'].' '.$spotter_item['airline_name'].' | '.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | '.$spotter_item['departure_airport'].' - '.$spotter_item['arrival_airport'].'</title>';
114
+			print '<link href="http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'"/>';
115
+			print '<id>http://www.flightairmap.fr/flightid/'.$spotter_item['spotter_id'].'</id>';
116
+			print '<content>Ident: '.$spotter_item['ident'].' | Registration: '.$spotter_item['registration'].' | Aircraft: '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].') | Airline: '.$spotter_item['airline_name'].' | Coming From: '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].') | Flying to: '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].') | Flew nearby on: '.date("M j, Y, g:i a T", strtotime($spotter_item['date_iso_8601'])).'</content>';
117
+			print '<updated>'.$date.'</updated>';
118
+			if ($spotter_item['waypoints'] != "")
119
+			{
120
+				print '<georss:where>';
121 121
 					print '<gml:LineString>';
122 122
 						print '<gml:posList>';
123 123
 							$waypoint_pieces = explode(' ', $spotter_item['waypoints']);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 							    
126 126
 							foreach ($waypoint_pieces as $waypoint_coordinate)
127 127
 							{
128
-							        print $waypoint_coordinate[0].' '.$waypoint_coordinate[1].' ';
128
+									print $waypoint_coordinate[0].' '.$waypoint_coordinate[1].' ';
129 129
 							
130 130
 							}
131 131
 						print '</gml:posList>';
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];
@@ -72,23 +72,23 @@  discard block
 block discarded – undo
72 72
 
73 73
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
74 74
 else $sort = '';
75
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
76
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
77
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
78
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
79
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
80
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
81
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
82
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
83
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
84
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
85
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
86
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
87
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
88
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
89
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
90
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
91
-$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'');
75
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
76
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
77
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
78
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
79
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
80
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
81
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
82
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
83
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
84
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
85
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
86
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
87
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
88
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
89
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
90
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
91
+$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '');
92 92
  
93 93
 print '<?xml version="1.0" encoding="UTF-8" ?>';
94 94
 print '<feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">';
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	
106 106
 	if (!empty($spotter_array))
107 107
 	{
108
-	foreach($spotter_array as $spotter_item)
108
+	foreach ($spotter_array as $spotter_item)
109 109
 	{
110 110
 	
111 111
 	      
Please login to merge, or discard this patch.
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];
@@ -70,8 +78,11 @@  discard block
 block discarded – undo
70 78
 
71 79
 $date = date("c", time());
72 80
 
73
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
74
-else $sort = '';
81
+if (isset($_GET['sort'])) {
82
+	$sort = $_GET['sort'];
83
+} else {
84
+	$sort = '';
85
+}
75 86
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
76 87
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
77 88
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
search-php.php 3 patches
Indentation   +69 added lines, -69 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);
@@ -95,39 +95,39 @@  discard block
 block discarded – undo
95 95
   {
96 96
 	  
97 97
 	array_push($flights, array(
98
-                            "id" => $spotter_item['spotter_id'], 
98
+							"id" => $spotter_item['spotter_id'], 
99 99
 							"ident" => $spotter_item['ident'], 
100 100
 							"registration" => $spotter_item['registration'], 
101 101
 							"aircraft_icao" => $spotter_item['aircraft_type'], 
102
-                            "aircraft_name" => $spotter_item['aircraft_name'], 
103
-                            "aircraft_manufacturer" => $spotter_item['aircraft_manufacturer'],
102
+							"aircraft_name" => $spotter_item['aircraft_name'], 
103
+							"aircraft_manufacturer" => $spotter_item['aircraft_manufacturer'],
104 104
 							"airline_name" => $spotter_item['airline_name'], 
105
-                            "airline_icao" => $spotter_item['airline_icao'], 
106
-                            "airline_iata" => $spotter_item['airline_iata'], 
107
-                            "airline_country" => $spotter_item['airline_country'], 
108
-                            "airline_callsign" => $spotter_item['airline_callsign'], 
109
-                            "airline_type" => $spotter_item['airline_type'],
110
-                            "departure_airport_city" => $spotter_item['departure_airport_city'], 
111
-                            "departure_airport_country" => $spotter_item['departure_airport_country'], 
112
-                            "departure_airport_iata" => $spotter_item['departure_airport_iata'], 
113
-                            "departure_airport_icao" => $spotter_item['departure_airport_icao'], 
114
-                            "departure_airport_latitude" => $spotter_item['departure_airport_latitude'], 
115
-                            "departure_airport_longitude" => $spotter_item['departure_airport_longitude'], 
116
-                            "departure_airport_altitude" => $spotter_item['departure_airport_altitude'], 
117
-                            "arrival_airport_city" => $spotter_item['arrival_airport_city'], 
118
-                            "arrival_airport_country" => $spotter_item['arrival_airport_country'], 
119
-                            "arrival_airport_iata" => $spotter_item['arrival_airport_iata'], 
120
-                            "arrival_airport_icao" => $spotter_item['arrival_airport_icao'], 
121
-                            "arrival_airport_latitude" => $spotter_item['arrival_airport_latitude'], 
122
-                            "arrival_airport_longitude" => $spotter_item['arrival_airport_longitude'], 
123
-                            "arrival_airport_altitude" => $spotter_item['arrival_airport_altitude'],
124
-                            "latitude" => $spotter_item['latitude'], 
125
-                            "longitude" => $spotter_item['longitude'], 
126
-                            "altitude" => $spotter_item['altitude'], 
127
-                            "ground_speed" => $spotter_item['ground_speed'], 
128
-                            "heading" => $spotter_item['heading'], 
129
-                            "heading_name" => $spotter_item['heading_name'], 
130
-                            "waypoints" => $spotter_item['waypoints'],
105
+							"airline_icao" => $spotter_item['airline_icao'], 
106
+							"airline_iata" => $spotter_item['airline_iata'], 
107
+							"airline_country" => $spotter_item['airline_country'], 
108
+							"airline_callsign" => $spotter_item['airline_callsign'], 
109
+							"airline_type" => $spotter_item['airline_type'],
110
+							"departure_airport_city" => $spotter_item['departure_airport_city'], 
111
+							"departure_airport_country" => $spotter_item['departure_airport_country'], 
112
+							"departure_airport_iata" => $spotter_item['departure_airport_iata'], 
113
+							"departure_airport_icao" => $spotter_item['departure_airport_icao'], 
114
+							"departure_airport_latitude" => $spotter_item['departure_airport_latitude'], 
115
+							"departure_airport_longitude" => $spotter_item['departure_airport_longitude'], 
116
+							"departure_airport_altitude" => $spotter_item['departure_airport_altitude'], 
117
+							"arrival_airport_city" => $spotter_item['arrival_airport_city'], 
118
+							"arrival_airport_country" => $spotter_item['arrival_airport_country'], 
119
+							"arrival_airport_iata" => $spotter_item['arrival_airport_iata'], 
120
+							"arrival_airport_icao" => $spotter_item['arrival_airport_icao'], 
121
+							"arrival_airport_latitude" => $spotter_item['arrival_airport_latitude'], 
122
+							"arrival_airport_longitude" => $spotter_item['arrival_airport_longitude'], 
123
+							"arrival_airport_altitude" => $spotter_item['arrival_airport_altitude'],
124
+							"latitude" => $spotter_item['latitude'], 
125
+							"longitude" => $spotter_item['longitude'], 
126
+							"altitude" => $spotter_item['altitude'], 
127
+							"ground_speed" => $spotter_item['ground_speed'], 
128
+							"heading" => $spotter_item['heading'], 
129
+							"heading_name" => $spotter_item['heading_name'], 
130
+							"waypoints" => $spotter_item['waypoints'],
131 131
 							"date" => date("c", strtotime($spotter_item['date_iso_8601']))
132 132
 						)
133 133
 			); 	
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
 $flights = array();
91 91
 
92 92
 if (!empty($spotter_array))
93 93
 {
94
-  foreach($spotter_array as $spotter_item)
94
+  foreach ($spotter_array as $spotter_item)
95 95
   {
96 96
 	  
97 97
 	array_push($flights, array(
Please login to merge, or discard this patch.
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/plain");
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.
aircraft-statistics-airline.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 
6 6
 if (!isset($_GET['aircraft_type'])) {
7
-        header('Location: '.$globalURL.'/aircraft');
8
-        die();
7
+		header('Location: '.$globalURL.'/aircraft');
8
+		die();
9 9
 }
10 10
 $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
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
 	$aircraft_types = $Stats->getAllAircraftTypes();
26
-	if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
26
+	if (empty($aircraft_types)) {
27
+		$aircraft_types = $Spotter->getAllAircraftTypes();
28
+	}
27 29
 	foreach($aircraft_types as $aircrafttype)
28 30
 	{
29 31
 		if($aircraft_type == $aircrafttype['aircraft_icao'])
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@  discard block
 block discarded – undo
8 8
         header('Location: '.$globalURL.'/aircraft');
9 9
         die();
10 10
 }
11
-$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING);
11
+$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING);
12 12
 $Spotter = new Spotter();
13
-$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1","");
13
+$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", "");
14 14
 
15 15
 
16 16
 if (!empty($spotter_array))
17 17
 {
18
-	$title = sprintf(_("Most Common Airlines from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']);
18
+	$title = sprintf(_("Most Common Airlines from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']);
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
21 21
 	print '<form action="'.$globalURL.'/aircraft" method="post">';
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 	$Stats = new Stats();
25 25
 	$aircraft_types = $Stats->getAllAircraftTypes();
26 26
 	if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
27
-	foreach($aircraft_types as $aircrafttype)
27
+	foreach ($aircraft_types as $aircrafttype)
28 28
 	{
29
-		if($aircraft_type == $aircrafttype['aircraft_icao'])
29
+		if ($aircraft_type == $aircrafttype['aircraft_icao'])
30 30
 		{
31 31
 			print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>';
32 32
 		} else {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	include('aircraft-sub-menu.php');
53 53
 	print '<div class="column">';
54 54
 	print '<h2>'._("Most Common Airlines").'</h2>';
55
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>';
55
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>';
56 56
 
57 57
 	$airline_array = $Spotter->countAllAirlinesByAircraft($aircraft_type);
58 58
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		print '</thead>';
71 71
 		print '<tbody>';
72 72
 		$i = 1;
73
-		foreach($airline_array as $airline_item)
73
+		foreach ($airline_array as $airline_item)
74 74
 		{
75 75
 			print '<tr>';
76 76
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.