Completed
Push — master ( 1fed4c...6bbecb )
by Yannick
05:53
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.
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.
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.
airline-statistics-arrival-airport.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['airline'])) {
6
-        header('Location: '.$globalURL.'/airline');
7
-        die();
6
+		header('Location: '.$globalURL.'/airline');
7
+		die();
8 8
 }
9 9
 $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     
73 73
         var data = google.visualization.arrayToDataTable([ 
74 74
         	["'._("Airport").'", "'._("# of times").'"],';
75
-        $airport_data = '';
75
+		$airport_data = '';
76 76
 	foreach($airport_airport_array as $airport_item)
77 77
 	{
78 78
 		$name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')';
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,22 +6,22 @@  discard block
 block discarded – undo
6 6
         header('Location: '.$globalURL.'/airline');
7 7
         die();
8 8
 }
9
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
11
-$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
11
+$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
12 12
 
13 13
 if (!empty($spotter_array))
14 14
 {
15
-	$title = sprintf(_("Most Common Arrival Airports from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
15
+	$title = sprintf(_("Most Common Arrival Airports from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
16 16
 	require_once('header.php');
17 17
 	print '<div class="select-item">';
18 18
 	print '<form action="'.$globalURL.'/airline" method="post">';
19 19
 	print '<select name="airline" class="selectpicker" data-live-search="true">';
20 20
 	print '<option></option>';
21 21
 	$airline_names = $Spotter->getAllAirlineNames();
22
-	foreach($airline_names as $airline_name)
22
+	foreach ($airline_names as $airline_name)
23 23
 	{
24
-		if($_GET['airline'] == $airline_name['airline_icao'])
24
+		if ($_GET['airline'] == $airline_name['airline_icao'])
25 25
 		{
26 26
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
27 27
 		} else {
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	include('airline-sub-menu.php');
60 60
 	print '<div class="column">';
61 61
 	print '<h2>'._("Most Common Arrival Airports").'</h2>';
62
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
62
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
63 63
 	$airport_airport_array = $Spotter->countAllArrivalAirportsByAirline($airline);
64 64
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
65 65
     	<script>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         var data = google.visualization.arrayToDataTable([ 
74 74
         	["'._("Airport").'", "'._("# of times").'"],';
75 75
         $airport_data = '';
76
-	foreach($airport_airport_array as $airport_item)
76
+	foreach ($airport_airport_array as $airport_item)
77 77
 	{
78 78
 		$name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')';
79 79
 		$name = str_replace("'", "", $name);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	print '</thead>';
113 113
 	print '<tbody>';
114 114
 	$i = 1;
115
-	foreach($airport_airport_array as $airport_item)
115
+	foreach ($airport_airport_array as $airport_item)
116 116
 	{
117 117
 		print '<tr>';
118 118
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 	print '<option></option>';
22 22
 	$Stats = new Stats();
23 23
 	$airline_names = $Stats->getAllAirlineNames();
24
-	if (empty($ariline_names)) $airline_names = $Spotter->getAllAirlineNames();
24
+	if (empty($ariline_names)) {
25
+		$airline_names = $Spotter->getAllAirlineNames();
26
+	}
25 27
 	foreach($airline_names as $airline_name)
26 28
 	{
27 29
 		if($_GET['airline'] == $airline_name['airline_icao'])
@@ -43,8 +45,7 @@  discard block
 block discarded – undo
43 45
 		if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif'))
44 46
 		{
45 47
 			print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
46
-		}
47
-		elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
48
+		} elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
48 49
 		{
49 50
 			print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
50 51
 		}
Please login to merge, or discard this patch.
airline-statistics-departure-airport.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['airline'])) {
6
-        header('Location: '.$globalURL.'/airline');
7
-        die();
6
+		header('Location: '.$globalURL.'/airline');
7
+		die();
8 8
 }
9 9
 $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
62 62
 	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
63 63
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByAirline($airline);
64
-    	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
64
+		print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
65 65
     	<script>
66 66
     	google.load("visualization", "1", {packages:["geochart"]});
67 67
     	google.setOnLoadCallback(drawCharts);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,22 +6,22 @@  discard block
 block discarded – undo
6 6
         header('Location: '.$globalURL.'/airline');
7 7
         die();
8 8
 }
9
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
9
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
10 10
 $Spotter = new Spotter();
11
-$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
11
+$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
12 12
 
13 13
 if (!empty($spotter_array))
14 14
 {
15
-	$title = sprintf(_("Most Common Departure Airports from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
15
+	$title = sprintf(_("Most Common Departure Airports from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
16 16
 	require_once('header.php');
17 17
 	print '<div class="select-item">';
18 18
 	print '<form action="'.$globalURL.'/airline" method="post">';
19 19
 	print '<select name="airline" class="selectpicker" data-live-search="true">';
20 20
 	print '<option></option>';
21 21
 	$airline_names = $Spotter->getAllAirlineNames();
22
-	foreach($airline_names as $airline_name)
22
+	foreach ($airline_names as $airline_name)
23 23
 	{
24
-		if($airline == $airline_name['airline_icao'])
24
+		if ($airline == $airline_name['airline_icao'])
25 25
 		{
26 26
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
27 27
 		} else {
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	include('airline-sub-menu.php');
60 60
 	print '<div class="column">';
61 61
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
62
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
62
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
63 63
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByAirline($airline);
64 64
     	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
65 65
     	<script>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         var data = google.visualization.arrayToDataTable([ 
74 74
         	["'._("Airport").'", "'._("# of times").'"],';
75 75
 	$airport_data = '';
76
-	foreach($airport_airport_array as $airport_item)
76
+	foreach ($airport_airport_array as $airport_item)
77 77
 	{
78 78
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
79 79
 		$name = str_replace("'", "", $name);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	print '</thead>';
113 113
 	print '<tbody>';
114 114
 	$i = 1;
115
-	foreach($airport_airport_array as $airport_item)
115
+	foreach ($airport_airport_array as $airport_item)
116 116
 	{
117 117
 		print '<tr>';
118 118
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@  discard block
 block discarded – undo
22 22
 	print '<option></option>';
23 23
 	$Stats = new Stats();
24 24
 	$airline_names = $Stats->getAllAirlineNames();
25
-	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
25
+	if (empty($airline_names)) {
26
+		$airline_names = $Spotter->getAllAirlineNames();
27
+	}
26 28
 	foreach($airline_names as $airline_name)
27 29
 	{
28 30
 		if($airline == $airline_name['airline_icao'])
@@ -44,8 +46,7 @@  discard block
 block discarded – undo
44 46
 			if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif'))
45 47
 			{
46 48
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
47
-			}
48
-			elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
49
+			} elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
49 50
 			{
50 51
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
51 52
 			}
Please login to merge, or discard this patch.
airport.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
 if (isset($_POST['airport']))
8 8
 {
9 9
 	header('Location: '.$globalURL.'/airport/'.$_POST['airport']);
10
-} else if (isset($_GET['airport'])){
10
+} else if (isset($_GET['airport'])) {
11 11
 	$Spotter = new Spotter();
12 12
 	//calculuation for the pagination
13
-	if($_GET['limit'] == "")
13
+	if ($_GET['limit'] == "")
14 14
 	{
15 15
 	  $limit_start = 0;
16 16
 	  $limit_end = 25;
17 17
 	  $absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	$limit_previous_1 = $limit_start - $absolute_difference;
30 30
 	$limit_previous_2 = $limit_end - $absolute_difference;
31 31
 	
32
-	$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
33
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
32
+	$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
33
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
34 34
 	$page_url = $globalURL.'/airport/'.$airport;
35
-	$spotter_array = $Spotter->getSpotterDataByAirport($airport,$limit_start.",".$absolute_difference, $sort);
35
+	$spotter_array = $Spotter->getSpotterDataByAirport($airport, $limit_start.",".$absolute_difference, $sort);
36 36
 	$airport_array = $Spotter->getAllAirportInfo($airport);
37 37
 	
38 38
 	if (!empty($airport_array))
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 		print '<option></option>';
47 47
 		$airport_names = $Spotter->getAllAirportNames();
48 48
 		ksort($airport_names);
49
-		foreach($airport_names as $airport_name)
49
+		foreach ($airport_names as $airport_name)
50 50
 		{
51
-			if($airport == $airport_name['airport_icao'])
51
+			if ($airport == $airport_name['airport_icao'])
52 52
 			{
53 53
 				print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
54 54
 			} else {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		print '<div class="table column">';
81 81
 		if ($airport_array[0]['iata'] != "NA")
82 82
 		{
83
-			print '<p>'.sprintf(_("The table below shows the route(s) aircrafts have used to/from <strong>%s</strong>, sorted by the most recent one."),$airport_array[0]['name']).'</p>';
83
+			print '<p>'.sprintf(_("The table below shows the route(s) aircrafts have used to/from <strong>%s</strong>, sorted by the most recent one."), $airport_array[0]['name']).'</p>';
84 84
 		}
85 85
 
86 86
 		include('table-output.php');  
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		print '<p>'._("Sorry, the airport does not exist in this database. :(").'</p>'; 
103 103
 	}
104 104
 } else {
105
-	$Spotter= new Spotter();
105
+	$Spotter = new Spotter();
106 106
 	$Stats = new Stats();
107 107
 	$title = _("Airports");
108 108
 	require_once('header.php');
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
 	ksort($airport_names);
114 114
 	$previous = null;
115 115
 	print '<div class="alphabet-legend">';
116
-	foreach($airport_names as $value) {
116
+	foreach ($airport_names as $value) {
117 117
 		$firstLetter = mb_strtoupper(mb_substr($value['airport_city'], 0, 1));
118
-		if($previous !== $firstLetter)
118
+		if ($previous !== $firstLetter)
119 119
 		{
120
-			if ($previous !== null){
120
+			if ($previous !== null) {
121 121
 				print ' | ';
122 122
 			}
123 123
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
 	}
127 127
 	print '</div>';
128 128
 	$previous = null;
129
-	foreach($airport_names as $value) {
129
+	foreach ($airport_names as $value) {
130 130
 		$firstLetter = mb_strtoupper(mb_substr($value['airport_city'], 0, 1));
131 131
 		if ($firstLetter != "")
132 132
 		{
133
-			if($previous !== $firstLetter)
133
+			if ($previous !== $firstLetter)
134 134
 			{
135
-				if ($previous !== null){
135
+				if ($previous !== null) {
136 136
 					print '</div>';
137 137
 				}
138 138
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	  $limit_start = 0;
14 14
 	  $limit_end = 25;
15 15
 	  $absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		$limit_start = $limit_explode[0];
19 19
 		$limit_end = $limit_explode[1];
Please login to merge, or discard this patch.
ident-statistics-departure-airport-country.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Departure Airports by Country of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Departure Airports by Country of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	include('ident-sub-menu.php');
24 24
 	print '<div class="column">';
25 25
 	print '<h2>'._("Most Common Departure Airports by Country").'</h2>';
26
-	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
26
+	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
27 27
 
28 28
 	$airport_country_array = $Spotter->countAllDepartureAirportCountriesByIdent($ident);
29 29
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             var data = google.visualization.arrayToDataTable([
36 36
             	["'._("Country").'", "'._("# of times").'"], ';
37 37
 	$country_data = '';
38
-	foreach($airport_country_array as $airport_item)
38
+	foreach ($airport_country_array as $airport_item)
39 39
 	{
40 40
 		$country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],';
41 41
 	}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		print '</thead>';
70 70
 		print '<tbody>';
71 71
 		$i = 1;
72
-		foreach($airport_country_array as $airport_item)
72
+		foreach ($airport_country_array as $airport_item)
73 73
 		{
74 74
 			print '<tr>';
75 75
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['ident'])) {
6
-        header('Location: '.$globalURL.'/ident');
7
-        die();
6
+		header('Location: '.$globalURL.'/ident');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
country-statistics-arrival-airport.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)));
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
10
+$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)));
11
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
12 12
 $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);
13 13
 
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Arrival Airports from %s"),$country);
17
+	$title = sprintf(_("Most Common Arrival Airports from %s"), $country);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	print '<select name="country" class="selectpicker" data-live-search="true">';
23 23
 	print '<option></option>';
24 24
 	$all_countries = $Spotter->getAllCountries();
25
-	foreach($all_countries as $all_country)
25
+	foreach ($all_countries as $all_country)
26 26
 	{
27
-		if($country == $all_country['country'])
27
+		if ($country == $all_country['country'])
28 28
 		{
29 29
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
30 30
 		} else {
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	if ($_GET['country'] != "NA")
40 40
 	{
41 41
 		print '<div class="info column">';
42
-		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
42
+		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
43 43
 		print '</div>';
44 44
 	} else {
45 45
 		print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>';
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	include('country-sub-menu.php');
49 49
 	print '<div class="column">';
50 50
 	print '<h2>'._("Most Common Arrival Airports").'</h2>';
51
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
51
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights of airports &amp; airlines from <strong>%s</strong>."), $country).'</p>';
52 52
 	$airport_airport_array = $Spotter->countAllArrivalAirportsByCountry($country);
53 53
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
54 54
     	<script>
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         	["'._("Airport").'", "'._("# of times").'"],';
64 64
 
65 65
 	$airport_data = '';
66
-	foreach($airport_airport_array as $airport_item)
66
+	foreach ($airport_airport_array as $airport_item)
67 67
 	{
68 68
 		$name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')';
69 69
 		$name = str_replace("'", "", $name);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	print '</thead>';
102 102
 	print '<tbody>';
103 103
 	$i = 1;
104
-	foreach($airport_airport_array as $airport_item)
104
+	foreach ($airport_airport_array as $airport_item)
105 105
 	{
106 106
 		print '<tr>';
107 107
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
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.
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
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING);
7
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
6
+$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
7
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
8 8
 if (isset($_GET['sort'])) $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
9 9
 else $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1");
10 10
 $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration);
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 if (!empty($spotter_array))
14 14
 {
15
-	$title = sprintf(_("Most Common Departure Airports of aircraft with registration %s"),$registration);
15
+	$title = sprintf(_("Most Common Departure Airports of aircraft with registration %s"), $registration);
16 16
 	require_once('header.php');
17 17
 
18 18
 	print '<div class="info column">';
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	print '<div class="column">';
27 27
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
28 28
 
29
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with aircraft registration <strong>%s</strong>."),$registration).'</p>';
29
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with aircraft registration <strong>%s</strong>."), $registration).'</p>';
30 30
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByRegistration($registration);
31 31
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
32 32
     	<script>
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         var data = google.visualization.arrayToDataTable([ 
41 41
         	["'._("Airport").'", "'._("# of times").'"],';
42 42
 	$airport_data = '';
43
-	foreach($airport_airport_array as $airport_item)
43
+	foreach ($airport_airport_array as $airport_item)
44 44
 	{
45 45
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
46 46
 		$name = str_replace("'", "", $name);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	print '</thead>';
79 79
 	print '<tbody>';
80 80
 	$i = 1;
81
-	foreach($airport_airport_array as $airport_item)
81
+	foreach ($airport_airport_array as $airport_item)
82 82
 	{
83 83
 		print '<tr>';
84 84
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
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.
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 Airport");
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 '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
Please login to merge, or discard this patch.