Completed
Push — master ( d8c574...a11679 )
by Yannick
07:12
created
scripts/check_data.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 */
6 6
 require_once(dirname(__FILE__).'/../require/settings.php');
7 7
 if ($globalInstalled) {
8
-    echo '$globalInstalled must be set to FALSE in require/settings.php';
9
-    exit;
8
+	echo '$globalInstalled must be set to FALSE in require/settings.php';
9
+	exit;
10 10
 }
11 11
 
12 12
 require_once('../require/class.Connection.php');
Please login to merge, or discard this patch.
scripts/daemon-acars.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 require_once(dirname(__FILE__).'/../require/class.Connection.php');
12 12
 $schema = new Connection();
13 13
 if ($schema->latest() === false) {
14
-    echo "You MUST update to latest schema. Run install/index.php";
15
-    exit();
14
+	echo "You MUST update to latest schema. Run install/index.php";
15
+	exit();
16 16
 }
17 17
 
18 18
 $debug = true;
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
 date_default_timezone_set('UTC');
22 22
 // signal handler - playing nice with sockets and dump1090
23 23
 pcntl_signal(SIGINT,  function($signo) {
24
-    global $sock;
25
-    echo "\n\nctrl-c or kill signal received. Tidying up ... ";
26
-    socket_shutdown($sock, 0);
27
-    socket_close($sock);
28
-    die("Bye!\n");
24
+	global $sock;
25
+	echo "\n\nctrl-c or kill signal received. Tidying up ... ";
26
+	socket_shutdown($sock, 0);
27
+	socket_close($sock);
28
+	die("Bye!\n");
29 29
 });
30 30
 pcntl_signal_dispatch();
31 31
 
@@ -38,24 +38,24 @@  discard block
 block discarded – undo
38 38
 // Bind the source address
39 39
 if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) )
40 40
 {
41
-    $errorcode = socket_last_error();
42
-    $errormsg = socket_strerror($errorcode);
41
+	$errorcode = socket_last_error();
42
+	$errormsg = socket_strerror($errorcode);
43 43
      
44
-    die("Could not bind socket : [$errorcode] $errormsg \n");
44
+	die("Could not bind socket : [$errorcode] $errormsg \n");
45 45
 }
46 46
 
47 47
 echo "LISTEN UDP MODE \n\n";
48 48
 while(1) {
49
-    $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port);
50
-
51
-    // lets play nice and handle signals such as ctrl-c/kill properly
52
-    pcntl_signal_dispatch();
53
-    $dataFound = false;
54
-    //  (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1
55
-    echo $buffer."\n";
56
-    $ACARS->add(trim($buffer));
57
-    socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port);
58
-    $ACARS->deleteLiveAcarsData();
49
+	$r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port);
50
+
51
+	// lets play nice and handle signals such as ctrl-c/kill properly
52
+	pcntl_signal_dispatch();
53
+	$dataFound = false;
54
+	//  (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1
55
+	echo $buffer."\n";
56
+	$ACARS->add(trim($buffer));
57
+	socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port);
58
+	$ACARS->deleteLiveAcarsData();
59 59
 }
60 60
 pcntl_exec($_,$argv);
61 61
 ?>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 
18 18
 $debug = true;
19 19
 
20
-$ACARS=new ACARS();
20
+$ACARS = new ACARS();
21 21
 date_default_timezone_set('UTC');
22 22
 // signal handler - playing nice with sockets and dump1090
23
-pcntl_signal(SIGINT,  function($signo) {
23
+pcntl_signal(SIGINT, function($signo) {
24 24
     global $sock;
25 25
     echo "\n\nctrl-c or kill signal received. Tidying up ... ";
26 26
     socket_shutdown($sock, 0);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 $sock = socket_create(AF_INET, SOCK_DGRAM, 0) or die("Unable to create socket\n");
37 37
 
38 38
 // Bind the source address
39
-if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) )
39
+if (!socket_bind($sock, $globalACARSHost, $globalACARSPort))
40 40
 {
41 41
     $errorcode = socket_last_error();
42 42
     $errormsg = socket_strerror($errorcode);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 echo "LISTEN UDP MODE \n\n";
48
-while(1) {
48
+while (1) {
49 49
     $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port);
50 50
 
51 51
     // lets play nice and handle signals such as ctrl-c/kill properly
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     //  (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1
55 55
     echo $buffer."\n";
56 56
     $ACARS->add(trim($buffer));
57
-    socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port);
57
+    socket_sendto($sock, "OK ".$buffer, 100, 0, $remote_ip, $remote_port);
58 58
     $ACARS->deleteLiveAcarsData();
59 59
 }
60
-pcntl_exec($_,$argv);
60
+pcntl_exec($_, $argv);
61 61
 ?>
Please login to merge, or discard this patch.
statistics-manufacturer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             var data = google.visualization.arrayToDataTable([
23 23
             	["'._("Aircraft Manufacturer").'", "'._("# of times").'"], ';
24 24
 $manufacturer_data = '';
25
-foreach($manufacturers_array as $manufacturer_item)
25
+foreach ($manufacturers_array as $manufacturer_item)
26 26
 {
27 27
 	$manufacturer_data .= '[ "'.$manufacturer_item['aircraft_manufacturer'].'",'.$manufacturer_item['aircraft_manufacturer_count'].'],';
28 28
 }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	print '</thead>';
56 56
 	print '<tbody>';
57 57
 	$i = 1;
58
-	foreach($manufacturers_array as $manufacturer_item)
58
+	foreach ($manufacturers_array as $manufacturer_item)
59 59
 	{
60 60
 		print '<tr>';
61 61
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
ident-statistics-arrival-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 Arrival Airports by Country of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Arrival 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>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByIdent($ident);
29 29
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
30 30
 	print '<div id="chartCountry" class="chart" width="100%"></div>
@@ -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['arrival_airport_country'].'",'.$airport_item['airport_arrival_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.
statistics-time.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	date_default_timezone_set('UTC');
30 30
 }
31 31
 //print_r($hour_array);
32
-foreach($hour_array as $hour_item)
32
+foreach ($hour_array as $hour_item)
33 33
 {
34 34
 	$hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
35 35
 }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	print '</thead>';
67 67
 	print '<tbody>';
68 68
 	$i = 1;
69
-	foreach($hour_array as $hour_item)
69
+	foreach ($hour_array as $hour_item)
70 70
 	{
71 71
 		print '<tr>';
72 72
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
ident-statistics-arrival-airport.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 Arrival Airports of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Arrival Airports of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Arrival Airports").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 	$airport_airport_array = $Spotter->countAllArrivalAirportsByIdent($ident);
29 29
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
30 30
     	<script>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         	["'._("Airport").'", "'._("# of times").'"],';
40 40
 
41 41
 	$airport_data = '';
42
-	foreach($airport_airport_array as $airport_item)
42
+	foreach ($airport_airport_array as $airport_item)
43 43
 	{
44 44
 		$name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')';
45 45
 		$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.
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.
acars-archive.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 $page_url = $globalURL.'/acars-archive';
10 10
 
11
-if(!isset($_GET['limit']))
11
+if (!isset($_GET['limit']))
12 12
 {
13 13
 	$limit_start = 0;
14 14
 	$limit_end = 25;
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,12 @@
 block discarded – undo
36 36
 if (!empty($spotter_array)) {
37 37
 	include('table-output.php');
38 38
 	print '<div class="pagination">';
39
-	if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'/'.$_GET['sort'].'">&laquo;'._("Previous Page").'</a>';
40
-	if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'/'.$_GET['sort'].'">'._("Next Page").'&raquo;</a>';
39
+	if ($limit_previous_1 >= 0) {
40
+		print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'/'.$_GET['sort'].'">&laquo;'._("Previous Page").'</a>';
41
+	}
42
+	if ($spotter_array[0]['query_number_rows'] == $absolute_difference) {
43
+		print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'/'.$_GET['sort'].'">'._("Next Page").'&raquo;</a>';
44
+	}
41 45
 	print '</div>';
42 46
 }
43 47
 print '</div>';
Please login to merge, or discard this patch.
airport-data.php 3 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -48,73 +48,73 @@
 block discarded – undo
48 48
 print '</div>';
49 49
 print '<div><span>'._("Altitude").'</span>';
50 50
 if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
51
-        print $spotter_item['altitude'].'feet';
51
+		print $spotter_item['altitude'].'feet';
52 52
 } else {
53
-        print round($spotter_item['altitude']*0.3048).' m';
53
+		print round($spotter_item['altitude']*0.3048).' m';
54 54
 }
55 55
 print '</div>';
56 56
 print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
57 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
-    print '<div><span>'._("Links").'</span>';
60
-    print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
61
-    print ' - ';
62
-    print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
63
-    print '</div>';
59
+	print '<div><span>'._("Links").'</span>';
60
+	print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
61
+	print ' - ';
62
+	print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
63
+	print '</div>';
64 64
 } elseif (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '') {
65
-    print '<div><span>'._("Links").'</span>';
66
-    print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
67
-    print '</div>';
65
+	print '<div><span>'._("Links").'</span>';
66
+	print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>';
67
+	print '</div>';
68 68
 } elseif (isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') {
69
-    print '<div><span>'._("Links").'</span>';
70
-    print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
71
-    print '</div>';
69
+	print '<div><span>'._("Links").'</span>';
70
+	print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>';
71
+	print '</div>';
72 72
 }
73 73
 print '</div>';
74 74
 
75 75
 if (isset($metar_parse)) {
76
-    print '<div class="waypoints">';
77
-    print '<div><span>METAR</span>';
78
-    print '<i>'.$metar_info[0]['metar'].'</i><br />';
79
-    print '<b>'.$metar_info[0]['metar_date'].'</b><br />';
76
+	print '<div class="waypoints">';
77
+	print '<div><span>METAR</span>';
78
+	print '<i>'.$metar_info[0]['metar'].'</i><br />';
79
+	print '<b>'.$metar_info[0]['metar_date'].'</b><br />';
80 80
 //    print_r($metar_parse);
81
-    if (isset($metar_parse['wind'])) {
82
-        print _("Wind:").' ';
81
+	if (isset($metar_parse['wind'])) {
82
+		print _("Wind:").' ';
83 83
 	if (isset($metar_parse['wind']['direction'])) {
84
-	    $direction = $Spotter->parseDirection($metar_parse['wind']['direction']);
85
-	    print $direction[0]['direction_fullname'];
86
-	    print ' ('.$metar_parse['wind']['direction'].'°) ';
87
-        }
88
-        if (isset($metar_parse['wind']['speed'])) {
89
-	    print $metar_parse['wind']['speed'].' m/s';
90
-        }
84
+		$direction = $Spotter->parseDirection($metar_parse['wind']['direction']);
85
+		print $direction[0]['direction_fullname'];
86
+		print ' ('.$metar_parse['wind']['direction'].'°) ';
87
+		}
88
+		if (isset($metar_parse['wind']['speed'])) {
89
+		print $metar_parse['wind']['speed'].' m/s';
90
+		}
91 91
 	print '<br/>';
92
-    }
93
-    if (isset($metar_parse['visibility'])) {
94
-        print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>";
95
-    }
96
-    if (isset($metar_parse['weather'])) {
97
-        print _("Weather:").' '.$metar_parse['weather']."<br/>";
98
-    }
99
-    if (isset($metar_parse['temperature'])) {
100
-        print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>";
101
-    }
102
-    if (isset($metar_parse['dew'])) {
103
-        print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>";
104
-    }
105
-    if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
92
+	}
93
+	if (isset($metar_parse['visibility'])) {
94
+		print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>";
95
+	}
96
+	if (isset($metar_parse['weather'])) {
97
+		print _("Weather:").' '.$metar_parse['weather']."<br/>";
98
+	}
99
+	if (isset($metar_parse['temperature'])) {
100
+		print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>";
101
+	}
102
+	if (isset($metar_parse['dew'])) {
103
+		print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>";
104
+	}
105
+	if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
106 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
-    }
109
-    if (isset($metar_parse['QNH'])) {
110
-        print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>";
111
-    }
108
+	}
109
+	if (isset($metar_parse['QNH'])) {
110
+		print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>";
111
+	}
112 112
 /*
113 113
 if (isset($metar_parse['QNH'])) {
114 114
     print 'Pressure : '.$metar_parse['QNH'].' hPa'."<br/>";
115 115
 }
116 116
 */
117
-    print '</div>';
117
+	print '</div>';
118 118
 /*
119 119
 Wind: from the NNE (020 degrees) at 5 MPH (4 KT) (direction variable):0
120 120
 Visibility: greater than 7 mile(s):0
Please login to merge, or discard this patch.
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.
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   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@
 block discarded – undo
40 40
 		if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif'))
41 41
 		{
42 42
 			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" />';
43
-		}
44
-		elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
43
+		} elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
45 44
 		{
46 45
 			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" />';
47 46
 		}
Please login to merge, or discard this patch.