Completed
Push — master ( 005bcb...530ad5 )
by Yannick
54:27 queued 25:21
created
airline-statistics-time.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
 	header('Location: '.$globalURL.'/airline');
8 8
 	die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 	$alliance = true;
15 15
 } else {
16
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
16
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
17 17
 }
18 18
 
19 19
 
20 20
 if (!empty($spotter_array) || $alliance === true)
21 21
 {
22 22
 	if ($alliance) {
23
-		$title = sprintf(_("Most Common Time of Day from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
23
+		$title = sprintf(_("Most Common Time of Day from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
24 24
 	} else {
25
-		$title = sprintf(_("Most Common Time of Day from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
25
+		$title = sprintf(_("Most Common Time of Day from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
26 26
 	}
27 27
 	require_once('header.php');
28 28
 	print '<div class="select-item">';
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 	$alliances = $Spotter->getAllAllianceNames();
33 33
 	if (!empty($alliances)) {
34 34
 		foreach ($alliances as $al) {
35
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
36
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
35
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
36
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
37 37
 			} else {
38
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
38
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
39 39
 			}
40 40
 		}
41 41
 		print '<option disabled>────────────────</option>';
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	$Stats = new Stats();
44 44
 	$airline_names = $Stats->getAllAirlineNames();
45 45
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
46
-	foreach($airline_names as $airline_name)
46
+	foreach ($airline_names as $airline_name)
47 47
 	{
48
-		if($airline == $airline_name['airline_icao'])
48
+		if ($airline == $airline_name['airline_icao'])
49 49
 		{
50 50
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
51 51
 		} else {
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 			print '</div>';
80 80
 		} else {
81 81
 			print '<div class="info column">';
82
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
83
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
82
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
83
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
84 84
 			{
85
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
85
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
86 86
 			}
87
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
87
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
88 88
 			print '</div>';
89 89
 		}
90 90
 	} else {
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	print '<div class="column">';
96 96
 	print '<h2>'._("Most Common Time of Day").'</h2>';
97 97
 	if ($alliance) {
98
-		print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
98
+		print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
99 99
 	} else {
100
-		print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
100
+		print '<p>'.sprintf(_("The statistic below shows the most common time of day from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
101 101
 	}
102 102
 	/*
103 103
 	if ($alliance) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		$hour_array = $Spotter->countAllHoursByAirline($airline);
107 107
 	}
108 108
 	*/
109
-	$hour_array = $Stats->countAllHours('hour',true,$airline);
109
+	$hour_array = $Stats->countAllHours('hour', true, $airline);
110 110
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
111 111
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
112 112
 	print '<script type="text/javascript" src="'.$globalURL.'/js/c3.min.js"></script>';
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	$hour_data = '';
115 115
 	$hour_cnt = '';
116 116
 	$last = 0;
117
-	foreach($hour_array as $hour_item)
117
+	foreach ($hour_array as $hour_item)
118 118
 	{
119
-		while($last != $hour_item['hour_name']) {
119
+		while ($last != $hour_item['hour_name']) {
120 120
 			$hour_data .= '"'.$last.':00",';
121 121
 			$hour_cnt .= '0,';
122 122
 			$last++;
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 		$hour_cnt .= $hour_item['hour_count'].',';
127 127
 	}
128 128
 	$hour_data = "[".substr($hour_data, 0, -1)."]";
129
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
129
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
130 130
 	print 'c3.generate({
131 131
 	    bindto: "#chartHour",
132 132
 	    data: {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		print '</thead>';
147 147
 		print '<tbody>';
148 148
 		$i = 1;
149
-		foreach($hour_array as $hour_item)
149
+		foreach ($hour_array as $hour_item)
150 150
 		{
151 151
 			print '<tr>';
152 152
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
airline-statistics-arrival-airport.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
 	header('Location: '.$globalURL.'/airline');
8 8
 	die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 	$alliance = true;
15 15
 } else {
16
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
16
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
17 17
 }
18 18
 
19 19
 if (!empty($spotter_array) || $alliance === true)
20 20
 {
21 21
 	if ($alliance) {
22
-		$title = sprintf(_("Most Common Arrival Airports from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
22
+		$title = sprintf(_("Most Common Arrival Airports from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
23 23
 	} else {
24
-		$title = sprintf(_("Most Common Arrival Airports from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
24
+		$title = sprintf(_("Most Common Arrival Airports from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
25 25
 	}
26 26
 	require_once('header.php');
27 27
 	print '<div class="select-item">';
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	$alliances = $Spotter->getAllAllianceNames();
32 32
 	if (!empty($alliances)) {
33 33
 		foreach ($alliances as $al) {
34
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
35
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
34
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
35
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
36 36
 			} else {
37
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
37
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
38 38
 			}
39 39
 		}
40 40
 		print '<option disabled>─────────────────────</option>';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	$Stats = new Stats();
43 43
 	$airline_names = $Stats->getAllAirlineNames();
44 44
 	if (empty($ariline_names)) $airline_names = $Spotter->getAllAirlineNames();
45
-	foreach($airline_names as $airline_name)
45
+	foreach ($airline_names as $airline_name)
46 46
 	{
47
-		if($_GET['airline'] == $airline_name['airline_icao'])
47
+		if ($_GET['airline'] == $airline_name['airline_icao'])
48 48
 		{
49 49
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
50 50
 		} else {
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 			print '</div>';
79 79
 		} else {
80 80
 			print '<div class="info column">';
81
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
82
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
81
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
82
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
83 83
 			{
84
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
84
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
85 85
 			}
86
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
86
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
87 87
 			print '</div>';
88 88
 		}
89 89
 	} else {
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
 	print '<div class="column">';
95 95
 	print '<h2>'._("Most Common Arrival Airports").'</h2>';
96 96
 	if ($alliance) {
97
-		print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
97
+		print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
98 98
 	} else {
99
-		print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
99
+		print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
100 100
 	}
101 101
 	/*
102 102
 	if ($alliance) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		$airport_airport_array = $Spotter->countAllArrivalAirportsByAirline($airline);
106 106
 	}
107 107
 	*/
108
-	$airport_airport_array = $Stats->countAllArrivalAirports(true,$airline);
108
+	$airport_airport_array = $Stats->countAllArrivalAirports(true, $airline);
109 109
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
110 110
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
111 111
 	print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>';
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	print '<script>';
114 114
 	print 'var series = [';
115 115
 	$airport_data = '';
116
-	foreach($airport_airport_array as $airport_item)
116
+	foreach ($airport_airport_array as $airport_item)
117 117
 	{
118 118
 		$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_name'].' ('.$airport_item['airport_arrival_icao'].')",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
119 119
 	}
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	print '</thead>';
169 169
 	print '<tbody>';
170 170
 	$i = 1;
171
-	foreach($airport_airport_array as $airport_item)
171
+	foreach ($airport_airport_array as $airport_item)
172 172
 	{
173 173
 		print '<tr>';
174 174
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-route.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
 	header('Location: '.$globalURL.'/airline');
8 8
 	die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 	$alliance = true;
15 15
 } else {
16
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
16
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
17 17
 }
18 18
 
19 19
 if (!empty($spotter_array) || $alliance === true)
20 20
 {
21 21
 	if ($alliance) {
22
-		$title = sprintf(_("Most Common Routes from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
22
+		$title = sprintf(_("Most Common Routes from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
23 23
 	} else {
24
-		$title = sprintf(_("Most Common Routes from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
24
+		$title = sprintf(_("Most Common Routes from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
25 25
 	}
26 26
 	require_once('header.php');
27 27
 	print '<div class="select-item">';
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	$alliances = $Spotter->getAllAllianceNames();
32 32
 	if (!empty($alliances)) {
33 33
 		foreach ($alliances as $al) {
34
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
35
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
34
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
35
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
36 36
 			} else {
37
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
37
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
38 38
 			}
39 39
 		}
40 40
 		print '<option disabled>───────────────────</option>';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	$Stats = new Stats();
43 43
 	$airline_names = $Stats->getAllAirlineNames();
44 44
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
45
-	foreach($airline_names as $airline_name)
45
+	foreach ($airline_names as $airline_name)
46 46
 	{
47
-		if($airline == $airline_name['airline_icao'])
47
+		if ($airline == $airline_name['airline_icao'])
48 48
 		{
49 49
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
50 50
 		} else {
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 			print '</div>';
79 79
 		} else {
80 80
 			print '<div class="info column">';
81
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
82
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
81
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
82
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
83 83
 			{
84
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
84
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
85 85
 			}
86
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
86
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
87 87
 			print '</div>';
88 88
 		}
89 89
 	} else {
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 	 print '<div class="column">';
95 95
 	print '<h2>'._("Most Common Routes").'</h2>';
96 96
 	if ($alliance) {
97
-		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
97
+		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
98 98
 	} else {
99
-		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
99
+		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
100 100
 	}
101 101
 	if ($alliance) {
102
-		$route_array = $Spotter->countAllRoutesByAirline('',array('alliance' => str_replace('_',' ',str_replace('alliance_','',$airline))));
102
+		$route_array = $Spotter->countAllRoutesByAirline('', array('alliance' => str_replace('_', ' ', str_replace('alliance_', '', $airline))));
103 103
 	} else {
104 104
 		$route_array = $Spotter->countAllRoutesByAirline($airline);
105 105
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		print '</thead>';
118 118
 		print '<tbody>';
119 119
 		$i = 1;
120
-		foreach($route_array as $route_item)
120
+		foreach ($route_array as $route_item)
121 121
 		{
122 122
 			print '<tr>';
123 123
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-departure-airport-country.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airline');
8 8
         die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 	$alliance = true;
15 15
 } else {
16
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
16
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
17 17
 }
18 18
 
19 19
 if (!empty($spotter_array) || $alliance === true)
20 20
 {
21 21
 	if ($alliance) {
22
-		$title = sprintf(_("Most Common Departure Airports by Country from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
22
+		$title = sprintf(_("Most Common Departure Airports by Country from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
23 23
 	} else {
24
-		$title = sprintf(_("Most Common Departure Airports by Country from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
24
+		$title = sprintf(_("Most Common Departure Airports by Country from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
25 25
 	}
26 26
 	require_once('header.php');
27 27
 	print '<div class="select-item">';
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	$alliances = $Spotter->getAllAllianceNames();
32 32
 	if (!empty($alliances)) {
33 33
 		foreach ($alliances as $al) {
34
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
35
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
34
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
35
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
36 36
 			} else {
37
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
37
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
38 38
 			}
39 39
 		}
40 40
 		print '<option disabled>──────────────────</option>';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	$Stats = new Stats();
43 43
 	$airline_names = $Stats->getAllAirlineNames();
44 44
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
45
-	foreach($airline_names as $airline_name)
45
+	foreach ($airline_names as $airline_name)
46 46
 	{
47
-		if($airline == $airline_name['airline_icao'])
47
+		if ($airline == $airline_name['airline_icao'])
48 48
 		{
49 49
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
50 50
 		} else {
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 			print '</div>';
79 79
 		} else {
80 80
 			print '<div class="info column">';
81
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
82
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
81
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
82
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
83 83
 			{
84
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
84
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
85 85
 			}
86
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
86
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
87 87
 			print '</div>';
88 88
 		}
89 89
 	} else {
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
 	print '<div class="column">';
95 95
 	print '<h2>'._("Most Common Departure Airports by Country").'</h2>';
96 96
 	if ($alliance) {
97
-		print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
97
+		print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
98 98
 	} else {
99
-		print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
99
+		print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
100 100
 	}
101 101
 	/*
102 102
 	if ($alliance) {
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 		$airport_country_array = $Spotter->countAllDepartureAirportCountriesByAirline($airline);
106 106
 	}
107 107
 	*/
108
-	$airport_country_array = $Stats->countAllDepartureCountries(true,$airline);
108
+	$airport_country_array = $Stats->countAllDepartureCountries(true, $airline);
109 109
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
110 110
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
111 111
 	print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>';
112 112
 	print '<div id="chartCountry" class="chart" width="100%"></div><script>';
113 113
 	print 'var series = [';
114 114
 	$country_data = '';
115
-	foreach($airport_country_array as $airport_item)
115
+	foreach ($airport_country_array as $airport_item)
116 116
 	{
117 117
 		$country_data .= '[ "'.$airport_item['departure_airport_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],';
118 118
 	}
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		print '</thead>';
160 160
 		print '<tbody>';
161 161
 		$i = 1;
162
-		foreach($airport_country_array as $airport_item)
162
+		foreach ($airport_country_array as $airport_item)
163 163
 		{
164 164
 			print '<tr>';
165 165
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-registration.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
 	header('Location: '.$globalURL.'/airline');
8 8
 	die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 	$alliance = true;
15 15
 } else {
16
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
16
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
17 17
 }
18 18
 
19 19
 if (!empty($spotter_array) || $alliance === true)
20 20
 {
21 21
 	if ($alliance) {
22
-		$title = sprintf(_("Most Common Aircraft by Registration from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
22
+		$title = sprintf(_("Most Common Aircraft by Registration from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
23 23
 	} else {
24
-		$title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
24
+		$title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
25 25
 	}
26 26
 	require_once('header.php');
27 27
 
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 	$alliances = $Spotter->getAllAllianceNames();
33 33
 	if (!empty($alliances)) {
34 34
 		foreach ($alliances as $al) {
35
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
36
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
35
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
36
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
37 37
 			} else {
38
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
38
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
39 39
 			}
40 40
 		}
41 41
 		print '<option disabled>──────────────────</option>';
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	$Stats = new Stats();
44 44
 	$airline_names = $Stats->getAllAirlineNames();
45 45
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
46
-	foreach($airline_names as $airline_name)
46
+	foreach ($airline_names as $airline_name)
47 47
 	{
48
-		if($airline == $airline_name['airline_icao'])
48
+		if ($airline == $airline_name['airline_icao'])
49 49
 		{
50 50
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
51 51
 		} else {
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 			print '</div>';
80 80
 		} else {
81 81
 			print '<div class="info column">';
82
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
83
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
82
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
83
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
84 84
 			{
85
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
85
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
86 86
 			}
87
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
87
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
88 88
 			print '</div>';
89 89
 		}
90 90
 	} else {
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	print '<div class="column">';
96 96
 	print '<h2>'._("Most Common Aircraft by Registration").'</h2>';
97 97
 	if ($alliance) {
98
-		print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
98
+		print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
99 99
 	} else {
100
-		print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
100
+		print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
101 101
 	}
102 102
 	/*
103 103
 	if ($alliance) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		$aircraft_array = $Spotter->countAllAircraftRegistrationByAirline($airline);
107 107
 	}
108 108
 	*/
109
-	$aircraft_array = $Stats->countAllAircraftRegistrations(true,$airline);
109
+	$aircraft_array = $Stats->countAllAircraftRegistrations(true, $airline);
110 110
 	if (!empty($aircraft_array))
111 111
 	{
112 112
 		print '<div class="table-responsive">';
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		print '</thead>';
122 122
 		print '<tbody>';
123 123
 		$i = 1;
124
-		foreach($aircraft_array as $aircraft_item)
124
+		foreach ($aircraft_array as $aircraft_item)
125 125
 		{
126 126
 			print '<tr>';
127 127
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
airline-statistics-departure-airport.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
 	header('Location: '.$globalURL.'/airline');
8 8
 	die();
9 9
 }
10
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
10
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12 12
 $alliance = false;
13
-if (strpos($airline,'alliance_') !== FALSE) {
13
+if (strpos($airline, 'alliance_') !== FALSE) {
14 14
 	$alliance = true;
15 15
 } else {
16
-	$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");
16
+	$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");
17 17
 }
18 18
 
19 19
 if (!empty($spotter_array) || $alliance === true)
20 20
 {
21 21
 	if ($alliance) {
22
-		$title = sprintf(_("Most Common Departure Airports from %s"),str_replace('_',' ',str_replace('alliance_','',$airline)));
22
+		$title = sprintf(_("Most Common Departure Airports from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline)));
23 23
 	} else {
24
-		$title = sprintf(_("Most Common Departure Airports from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']);
24
+		$title = sprintf(_("Most Common Departure Airports from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']);
25 25
 	}
26 26
 	require_once('header.php');
27 27
 	print '<div class="select-item">';
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	$alliances = $Spotter->getAllAllianceNames();
32 32
 	if (!empty($alliances)) {
33 33
 		foreach ($alliances as $al) {
34
-			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) {
35
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>';
34
+			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) {
35
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>';
36 36
 			} else {
37
-				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>';
37
+				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>';
38 38
 			}
39 39
 		}
40 40
 		print '<option disabled>───────────────────</option>';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	$Stats = new Stats();
43 43
 	$airline_names = $Stats->getAllAirlineNames();
44 44
 	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
45
-	foreach($airline_names as $airline_name)
45
+	foreach ($airline_names as $airline_name)
46 46
 	{
47
-		if($airline == $airline_name['airline_icao'])
47
+		if ($airline == $airline_name['airline_icao'])
48 48
 		{
49 49
 			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>';
50 50
 		} else {
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 			print '</div>';
79 79
 		} else {
80 80
 			print '<div class="info column">';
81
-			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>';
82
-			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png'))
81
+			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>';
82
+			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png'))
83 83
 			{
84
-				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />';
84
+				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />';
85 85
 			}
86
-			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>';
86
+			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>';
87 87
 			print '</div>';
88 88
 		}
89 89
 	} else {
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
 	print '<div class="column">';
95 95
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
96 96
 	if ($alliance) {
97
-		print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>';
97
+		print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>';
98 98
 	} else {
99
-		print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>';
99
+		print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>';
100 100
 	}
101 101
 	/*
102 102
 	if ($alliance) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		$airport_airport_array = $Spotter->countAllDepartureAirportsByAirline($airline);
106 106
 	}
107 107
 	*/
108
-	$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline);
108
+	$airport_airport_array = $Stats->countAllDepartureAirports(true, $airline);
109 109
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
110 110
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
111 111
 	print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>';
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	print '<script>';
114 114
 	print 'var series = [';
115 115
 	$airport_data = '';
116
-	foreach($airport_airport_array as $airport_item)
116
+	foreach ($airport_airport_array as $airport_item)
117 117
 	{
118 118
 		$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_name'].' ('.$airport_item['airport_departure_icao'].')",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
119 119
 	}
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	print '</thead>';
169 169
 	print '<tbody>';
170 170
 	$i = 1;
171
-	foreach($airport_airport_array as $airport_item)
171
+	foreach ($airport_airport_array as $airport_item)
172 172
 	{
173 173
 		print '<tr>';
174 174
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
owner.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 
8 8
 if (isset($_POST['owner']))
9 9
 {
10
-	header('Location: '.$globalURL.'/owner/'.filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING));
10
+	header('Location: '.$globalURL.'/owner/'.filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING));
11 11
 //} else if (isset($_GET['airport'])){
12 12
 } else {
13
-	$Spotter= new Spotter();
13
+	$Spotter = new Spotter();
14 14
 	$Stats = new Stats();
15 15
 	$Common = new Common();
16 16
 	$title = _("Owners");
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 	ksort($owner_names);
25 25
 	$previous = null;
26 26
 	print '<div class="alphabet-legend">';
27
-	foreach($owner_names as $value) {
27
+	foreach ($owner_names as $value) {
28 28
 		$firstLetter = $Common->remove_accents(mb_strtoupper(mb_substr($value['owner_name'], 0, 1)));
29
-		if($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
29
+		if ($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
30 30
 		{
31
-			if ($previous !== null){
31
+			if ($previous !== null) {
32 32
 				print ' | ';
33 33
 			}
34 34
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 	print '</div>';
39 39
 	$previous = null;
40
-	foreach($owner_names as $value) {
40
+	foreach ($owner_names as $value) {
41 41
 		$firstLetter = $Common->remove_accents(mb_strtoupper(mb_substr($value['owner_name'], 0, 1)));
42 42
 		if ($firstLetter != "")
43 43
 		{
44
-			if($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
44
+			if ($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
45 45
 			{
46
-				if ($previous !== null){
46
+				if ($previous !== null) {
47 47
 					print '</div>';
48 48
 				}
49 49
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
pilot.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@  discard block
 block discarded – undo
6 6
 
7 7
 if (isset($_POST['pilot']))
8 8
 {
9
-	header('Location: '.$globalURL.'/pilot/'.filter_input(INPUT_POST,'pilot',FILTER_SANITIZE_STRING));
9
+	header('Location: '.$globalURL.'/pilot/'.filter_input(INPUT_POST, 'pilot', FILTER_SANITIZE_STRING));
10 10
 //} else if (isset($_GET['airport'])){
11 11
 } else {
12
-	$Spotter= new Spotter();
12
+	$Spotter = new Spotter();
13 13
 	$Stats = new Stats();
14 14
 	$title = _("Pilots");
15 15
 	require_once('header.php');
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 	//ksort($pilot_names);
23 23
 	$previous = null;
24 24
 	print '<div class="alphabet-legend">';
25
-	foreach($pilot_names as $value) {
25
+	foreach ($pilot_names as $value) {
26 26
 		$firstLetter = mb_strtoupper(mb_substr($value['pilot_name'], 0, 1));
27
-		if($previous !== $firstLetter && $firstLetter != "'")
27
+		if ($previous !== $firstLetter && $firstLetter != "'")
28 28
 		{
29
-			if ($previous !== null){
29
+			if ($previous !== null) {
30 30
 				print ' | ';
31 31
 			}
32 32
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 	print '</div>';
37 37
 	$previous = null;
38
-	foreach($pilot_names as $value) {
38
+	foreach ($pilot_names as $value) {
39 39
 		$firstLetter = mb_strtoupper(mb_substr($value['pilot_name'], 0, 1));
40 40
 		if ($firstLetter != "")
41 41
 		{
42
-			if($previous !== $firstLetter && $firstLetter != "'")
42
+			if ($previous !== $firstLetter && $firstLetter != "'")
43 43
 			{
44
-				if ($previous !== null){
44
+				if ($previous !== null) {
45 45
 					print '</div>';
46 46
 				}
47 47
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
require/class.ACARS.php 1 patch
Spacing   +255 added lines, -255 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
 	* @return String the icao
23 23
 	*/
24 24
 	public function ident2icao($ident) {
25
-		if (substr($ident,0,2) == 'AF') {
26
-			if (filter_var(substr($ident,2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $ident;
27
-			else $icao = 'AFR'.ltrim(substr($ident,2),'0');
25
+		if (substr($ident, 0, 2) == 'AF') {
26
+			if (filter_var(substr($ident, 2), FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $ident;
27
+			else $icao = 'AFR'.ltrim(substr($ident, 2), '0');
28 28
 		} else {
29 29
 			$Spotter = new Spotter($this->db);
30
-			$identicao = $Spotter->getAllAirlineInfo(substr($ident,0,2));
30
+			$identicao = $Spotter->getAllAirlineInfo(substr($ident, 0, 2));
31 31
 			if (isset($identicao[0])) {
32
-				$icao = $identicao[0]['icao'].ltrim(substr($ident,2),'0');
32
+				$icao = $identicao[0]['icao'].ltrim(substr($ident, 2), '0');
33 33
 			} else $icao = $ident;
34 34
 		}
35 35
 		return $icao;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 			$sth = $this->db->prepare($query);
55 55
 			$sth->execute();
56
-		} catch(PDOException $e) {
56
+		} catch (PDOException $e) {
57 57
 			return "error";
58 58
 		}
59 59
 		return "success";
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 			$sth = $this->db->prepare($query);
79 79
 			$sth->execute();
80
-		} catch(PDOException $e) {
80
+		} catch (PDOException $e) {
81 81
 			return "error";
82 82
 		}
83 83
 		return "success";
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
 		$ident = '';
103 103
 		$message = '';
104 104
 		$result = array();
105
-		$n = sscanf($data,'(null) %*d %*02d/%*02d/%*04d %*02d:%*02d:%*02d %*d %*[0-9-] %*[A-Z0-9] %7s %*c %2[0-9a-zA-Z_] %d %4[0-9A-Z] %6[0-9A-Z] %[^\r\n]',$registration,$label,$block_id,$msg_no,$ident,$message);
106
-		if ($n == 0) $n = sscanf($data,'AC%*c %7s %*c %2[0-9a-zA-Z_] %d %4[0-9A-Z] %6[0-9A-Z] %[^\r\n]',$registration,$label,$block_id,$msg_no,$ident,$message);
107
-		if ($n == 0) $n = sscanf($data,'%*04d-%*02d-%*02d,%*02d:%*02d:%*02d,%*7s,%*c,%6[0-9A-Z-],%*c,%2[0-9a-zA-Z_],%d,%4[0-9A-Z],%6[0-9A-Z],%[^\r\n]',$registration,$label,$block_id,$msg_no,$ident,$message);
108
-		if ($n == 0) $n = sscanf($data,'%*04d-%*02d-%*02d,%*02d:%*02d:%*02d,%*7s,%*c,%5[0-9A-Z],%*c,%2[0-9a-zA-Z_],%d,%4[0-9A-Z],%6[0-9A-Z],%[^\r\n]',$registration,$label,$block_id,$msg_no,$ident,$message);
105
+		$n = sscanf($data, '(null) %*d %*02d/%*02d/%*04d %*02d:%*02d:%*02d %*d %*[0-9-] %*[A-Z0-9] %7s %*c %2[0-9a-zA-Z_] %d %4[0-9A-Z] %6[0-9A-Z] %[^\r\n]', $registration, $label, $block_id, $msg_no, $ident, $message);
106
+		if ($n == 0) $n = sscanf($data, 'AC%*c %7s %*c %2[0-9a-zA-Z_] %d %4[0-9A-Z] %6[0-9A-Z] %[^\r\n]', $registration, $label, $block_id, $msg_no, $ident, $message);
107
+		if ($n == 0) $n = sscanf($data, '%*04d-%*02d-%*02d,%*02d:%*02d:%*02d,%*7s,%*c,%6[0-9A-Z-],%*c,%2[0-9a-zA-Z_],%d,%4[0-9A-Z],%6[0-9A-Z],%[^\r\n]', $registration, $label, $block_id, $msg_no, $ident, $message);
108
+		if ($n == 0) $n = sscanf($data, '%*04d-%*02d-%*02d,%*02d:%*02d:%*02d,%*7s,%*c,%5[0-9A-Z],%*c,%2[0-9a-zA-Z_],%d,%4[0-9A-Z],%6[0-9A-Z],%[^\r\n]', $registration, $label, $block_id, $msg_no, $ident, $message);
109 109
 		if ($n != 0) {
110
-			$registration = str_replace('.','',$registration);
111
-			$result = array('registration' => $registration, 'ident' => $ident,'label' => $label, 'block_id' => $block_id,'msg_no' => $msg_no,'message' => $message);
110
+			$registration = str_replace('.', '', $registration);
111
+			$result = array('registration' => $registration, 'ident' => $ident, 'label' => $label, 'block_id' => $block_id, 'msg_no' => $msg_no, 'message' => $message);
112 112
 			if ($globalDebug) echo "Reg. : ".$registration." - Ident : ".$ident." - Label : ".$label." - Message : ".$message."\n";
113 113
 		} else $message = $data;
114 114
 		$decode = array();
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
 				$temp = '';
129 129
 				$n = sscanf($message, "FST01%4c%4c%c%06d%c%07d%03d%*8[0-9a-zA-Z ]-%02dC", $dair, $darr, $lac, $la, $lnc, $ln, $alt, $temp);
130 130
 				if ($n > 5 && ($lac == 'N' || $lac == 'S') && ($lnc == 'E' || $lnc == 'W')) {
131
-					$latitude = $la / 10000.0;
132
-					$longitude = $ln / 10000.0;
131
+					$latitude = $la/10000.0;
132
+					$longitude = $ln/10000.0;
133 133
 					if ($lac == 'S') $latitude = '-'.$latitude;
134 134
 					if ($lnc == 'W') $longitude = '-'.$longitude;
135 135
 					// Temp not always available
136 136
 					if ($globalDebug) echo 'latitude : '.$latitude.' - longitude : '.$longitude.' - airport depart : '.$dair.' - airport arrival : '.$darr.' - température : '.$temp."°C\n";
137
-					if ($temp == '') $decode = array('Latitude' => $latitude, 'Longitude' =>  $longitude, 'Departure airport' => $dair, 'Arrival airport' => $darr,'Altitude' => $alt);
138
-					else $decode = array('Latitude' => $latitude, 'Longitude' =>  $longitude, 'Departure airport' => $dair, 'Arrival airport' => $darr, 'Altitude' => 'FL'.$alt,'Temperature' => $temp.'°C');
137
+					if ($temp == '') $decode = array('Latitude' => $latitude, 'Longitude' =>  $longitude, 'Departure airport' => $dair, 'Arrival airport' => $darr, 'Altitude' => $alt);
138
+					else $decode = array('Latitude' => $latitude, 'Longitude' =>  $longitude, 'Departure airport' => $dair, 'Arrival airport' => $darr, 'Altitude' => 'FL'.$alt, 'Temperature' => $temp.'°C');
139 139
 
140 140
 					//$icao = $Translation->checkTranslation($ident);
141 141
 					//$Schedule->addSchedule($icao,$dair,'',$darr,'','ACARS');
@@ -147,19 +147,19 @@  discard block
 block discarded – undo
147 147
 				$dhour = '';
148 148
 				$darr = '';
149 149
 				$ahour = '';
150
-				$n = sscanf($message, "ARR01 %4[A-Z]%4d %4[A-Z]%4d", $dair, $dhour, $darr,$ahour);
150
+				$n = sscanf($message, "ARR01 %4[A-Z]%4d %4[A-Z]%4d", $dair, $dhour, $darr, $ahour);
151 151
 				if ($n == 4 && strlen($darr) == 4) {
152
-					if ($dhour != '') $dhour = substr(sprintf('%04d',$dhour),0,2).':'.substr(sprintf('%04d',$dhour),2);
153
-					if ($ahour != '') $ahour = substr(sprintf('%04d',$ahour),0,2).':'.substr(sprintf('%04d',$ahour),2);
154
-					if ($globalDebug) echo 'departure airport : '.$dair.' - arrival airport : '. $darr.' - departure hour : '. $dhour.' - arrival hour : '.$ahour."\n";
152
+					if ($dhour != '') $dhour = substr(sprintf('%04d', $dhour), 0, 2).':'.substr(sprintf('%04d', $dhour), 2);
153
+					if ($ahour != '') $ahour = substr(sprintf('%04d', $ahour), 0, 2).':'.substr(sprintf('%04d', $ahour), 2);
154
+					if ($globalDebug) echo 'departure airport : '.$dair.' - arrival airport : '.$darr.' - departure hour : '.$dhour.' - arrival hour : '.$ahour."\n";
155 155
 					//$icao = ACARS->ident2icao($ident);
156 156
 					//$icao = $Translation->checkTranslation($ident);
157 157
 					//$Schedule->addSchedule($icao,$dair,$dhour,$darr,$ahour,'ACARS');
158 158
 					$decode = array('Departure airport' => $dair, 'Departure hour' => $dhour, 'Arrival airport' => $darr, 'Arrival hour' => $ahour);
159 159
 					$found = true;
160 160
 				}
161
-				elseif ($n == 2 || $n  == 4) {
162
-					if ($dhour != '') $dhour = substr(sprintf('%04d',$dhour),0,2).':'.substr(sprintf('%04d',$dhour),2);
161
+				elseif ($n == 2 || $n == 4) {
162
+					if ($dhour != '') $dhour = substr(sprintf('%04d', $dhour), 0, 2).':'.substr(sprintf('%04d', $dhour), 2);
163 163
 					if ($globalDebug) echo 'airport arrival : '.$dair.' - arrival hour : '.$dhour."\n";
164 164
 					//$icao = ACARS->ident2icao($ident);
165 165
 					//$icao = $Translation->checkTranslation($ident);
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 				$ahour = '';
218 218
 				$aair = '';
219 219
 				$apiste = '';
220
-				$n = sscanf(str_replace(array("\r\n", "\n", "\r"),'',$message), "%*[0-9A-Z]/%*3d/%4s/%*cSCH/%6[0-9A-Z ]/%4c/%4c/%5s/%4d%*3c/%4d/%4c/%[0-9A-Z ]/", $airicao,$aident,$dair, $darr, $ddate, $dhour,$ahour, $aair, $apiste);
220
+				$n = sscanf(str_replace(array("\r\n", "\n", "\r"), '', $message), "%*[0-9A-Z]/%*3d/%4s/%*cSCH/%6[0-9A-Z ]/%4c/%4c/%5s/%4d%*3c/%4d/%4c/%[0-9A-Z ]/", $airicao, $aident, $dair, $darr, $ddate, $dhour, $ahour, $aair, $apiste);
221 221
 				if ($n > 8) {
222
-					if ($globalDebug) echo 'airicao : '. $airicao.' - ident : '.$aident.' - departure airport : '.$dair.' - arrival airport : '. $darr.' - date depart : '.$ddate.' - departure hour : '. $dhour.' - arrival hour : '.$ahour.' - arrival airport : '.$aair.' - arrival piste : '.$apiste."\n";
223
-					if ($dhour != '') $dhour = substr(sprintf('%04d',$dhour),0,2).':'.substr(sprintf('%04d',$dhour),2);
224
-					if ($ahour != '') $ahour = substr(sprintf('%04d',$ahour),0,2).':'.substr(sprintf('%04d',$ahour),2);
222
+					if ($globalDebug) echo 'airicao : '.$airicao.' - ident : '.$aident.' - departure airport : '.$dair.' - arrival airport : '.$darr.' - date depart : '.$ddate.' - departure hour : '.$dhour.' - arrival hour : '.$ahour.' - arrival airport : '.$aair.' - arrival piste : '.$apiste."\n";
223
+					if ($dhour != '') $dhour = substr(sprintf('%04d', $dhour), 0, 2).':'.substr(sprintf('%04d', $dhour), 2);
224
+					if ($ahour != '') $ahour = substr(sprintf('%04d', $ahour), 0, 2).':'.substr(sprintf('%04d', $ahour), 2);
225 225
 					$icao = trim($aident);
226 226
 
227 227
 					//$decode = 'Departure airport : '.$dair.' ('.$ddate.' at '.$dhour.') - Arrival Airport : '.$aair.' (at '.$ahour.') way '.$apiste;
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 				if ($n == 10 && ($lac == 'N' || $lac == 'S') && ($lnc == 'E' || $lnc == 'W')) {
247 247
 					$las = $las.'.'.$lass;
248 248
 					$lns = $lns.'.'.$lns;
249
-					$latitude = $las / 1000.0;
250
-					$longitude = $lns / 1000.0;
249
+					$latitude = $las/1000.0;
250
+					$longitude = $lns/1000.0;
251 251
 					if ($lac == 'S') $latitude = '-'.$latitude;
252 252
 					if ($lnc == 'W') $longitude = '-'.$longitude;
253 253
 					if ($globalDebug) echo 'latitude : '.$latitude.' - longitude : '.$longitude."\n";
@@ -342,17 +342,17 @@  discard block
 block discarded – undo
342 342
 				$alt = '';
343 343
 				$fuel = '';
344 344
 				$speed = '';
345
-				$n = sscanf(str_replace(array("\r\n", "\n", "\r"),'',$message), "#DFB(POS-%s -%4d%c%5d%c/%*d F%dRMK/FUEL %f M%f", $aident, $las, $lac, $lns, $lnc, $alt, $fuel, $speed);
345
+				$n = sscanf(str_replace(array("\r\n", "\n", "\r"), '', $message), "#DFB(POS-%s -%4d%c%5d%c/%*d F%dRMK/FUEL %f M%f", $aident, $las, $lac, $lns, $lnc, $alt, $fuel, $speed);
346 346
 				if ($n == 9) {
347 347
 					//if (self->$debug) echo 'airport depart : '.$dair.' - airport arrival : '.$darr."\n";
348 348
 					$icao = trim($aident);
349 349
 					$decode['icao'] = $icao;
350
-					$latitude = $las / 100.0;
351
-					$longitude = $lns / 100.0;
350
+					$latitude = $las/100.0;
351
+					$longitude = $lns/100.0;
352 352
 					if ($lac == 'S') $latitude = '-'.$latitude;
353 353
 					if ($lnc == 'W') $longitude = '-'.$longitude;
354 354
 
355
-					$decode = array('Latitude' => $latitude,'Longitude' => $longitude,'Altitude' => 'FL'.$alt,'Fuel' => $fuel,'speed' => $speed);
355
+					$decode = array('Latitude' => $latitude, 'Longitude' => $longitude, 'Altitude' => 'FL'.$alt, 'Fuel' => $fuel, 'speed' => $speed);
356 356
 					$found = true;
357 357
 				}
358 358
 			}
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 					if ($lac == 'S') $latitude = '-'.$latitude;
372 372
 					if ($lnc == 'W') $longitude = '-'.$longitude;
373 373
 
374
-					$decode = array('Latitude' => $latitude,'Longitude' => $longitude);
374
+					$decode = array('Latitude' => $latitude, 'Longitude' => $longitude);
375 375
 					$found = true;
376 376
 				}
377 377
 			}
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 				$dair = '';
405 405
 				$darr = '';
406 406
 				$aident = '';
407
-				$n = sscanf(str_replace(array("\r\n", "\n", "\r"),'',$message), "%*[0-9A-Z],,%*[0-9A-Z],%*[0-9A-Z],%4s,%4s,.%*6s,%*4[A-Z],%[0-9A-Z],", $dair, $darr, $aident);
407
+				$n = sscanf(str_replace(array("\r\n", "\n", "\r"), '', $message), "%*[0-9A-Z],,%*[0-9A-Z],%*[0-9A-Z],%4s,%4s,.%*6s,%*4[A-Z],%[0-9A-Z],", $dair, $darr, $aident);
408 408
 				if ($n == 8) {
409 409
 					if ($globalDebug) echo 'airport depart : '.$dair.' - airport arrival : '.$darr."\n";
410 410
 					$icao = trim($aident);
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 				*/
437 437
 				$dair = '';
438 438
 				$darr = '';
439
-				$n = sscanf($message,'%4[A-Z]%4[A-Z]%*4d',$dair,$darr);
439
+				$n = sscanf($message, '%4[A-Z]%4[A-Z]%*4d', $dair, $darr);
440 440
 				if ($n == 3) {
441 441
 					if ($globalDebug) echo 'airport depart : '.$dair.' - airport arrival : '.$darr."\n";
442 442
 					//$icao = $Translation->checkTranslation($ident);
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 				*/
452 452
 				$dair = '';
453 453
 				$darr = '';
454
-				$n = sscanf($message,'3J01 DSPTCH %*d/%*d %4s/%4s .%*6s',$dair,$darr);
454
+				$n = sscanf($message, '3J01 DSPTCH %*d/%*d %4s/%4s .%*6s', $dair, $darr);
455 455
 				if ($n == 3) {
456 456
 					if ($globalDebug) echo 'airport depart : '.$dair.' - airport arrival : '.$darr."\n";
457 457
 					//$icao = $Translation->checkTranslation($ident);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 				}
462 462
 			}
463 463
 			if (!$found) {
464
-				$n = sscanf($message,'MET01%4c',$airport);
464
+				$n = sscanf($message, 'MET01%4c', $airport);
465 465
 				if ($n == 1) {
466 466
 					if ($globalDebug) echo 'airport name : '.$airport;
467 467
 					$decode = array('Airport/Waypoint name' => $airport);
@@ -469,241 +469,241 @@  discard block
 block discarded – undo
469 469
 				}
470 470
 			}
471 471
 			if ($label == 'H1') {
472
-				if (preg_match('/^#CFBFLR/',$message) || preg_match('/^#CFBWRN/',$message)) {
473
-					$decode = array_merge(array('Message nature' => 'Equipment failure'),$decode);
472
+				if (preg_match('/^#CFBFLR/', $message) || preg_match('/^#CFBWRN/', $message)) {
473
+					$decode = array_merge(array('Message nature' => 'Equipment failure'), $decode);
474 474
 				}
475
-				elseif (preg_match('/^#DFB\*TKO/',$message) || preg_match('/^#DFBTKO/',$message)) {
476
-					$decode = array_merge(array('Message nature' => 'Take off performance data'),$decode);
475
+				elseif (preg_match('/^#DFB\*TKO/', $message) || preg_match('/^#DFBTKO/', $message)) {
476
+					$decode = array_merge(array('Message nature' => 'Take off performance data'), $decode);
477 477
 				}
478
-				elseif (preg_match('/^#DFB\*CRZ/',$message) || preg_match('/^#DFBCRZ/',$message)) {
479
-					$decode = array_merge(array('Message nature' => 'Cruise performance data'),$decode);
478
+				elseif (preg_match('/^#DFB\*CRZ/', $message) || preg_match('/^#DFBCRZ/', $message)) {
479
+					$decode = array_merge(array('Message nature' => 'Cruise performance data'), $decode);
480 480
 				}
481
-				elseif (preg_match('/^#DFB\*WOB/',$message) || preg_match('/^#DFBWOB/',$message)) {
482
-					$decode = array_merge(array('Message nature' => 'Weather observation'),$decode);
481
+				elseif (preg_match('/^#DFB\*WOB/', $message) || preg_match('/^#DFBWOB/', $message)) {
482
+					$decode = array_merge(array('Message nature' => 'Weather observation'), $decode);
483 483
 				}
484
-				elseif (preg_match(':^#DFB/PIREP:',$message)) {
485
-					$decode = array_merge(array('Message nature' => 'Pilot Report'),$decode);
484
+				elseif (preg_match(':^#DFB/PIREP:', $message)) {
485
+					$decode = array_merge(array('Message nature' => 'Pilot Report'), $decode);
486 486
 				}
487
-				elseif (preg_match('/^#DFBEDA/',$message) || preg_match('/^#DFBENG/',$message)) {
488
-					$decode = array_merge(array('Message nature' => 'Engine Data'),$decode);
487
+				elseif (preg_match('/^#DFBEDA/', $message) || preg_match('/^#DFBENG/', $message)) {
488
+					$decode = array_merge(array('Message nature' => 'Engine Data'), $decode);
489 489
 				}
490
-				elseif (preg_match(':^#M1AAEP:',$message)) {
491
-					$decode = array_merge(array('Message nature' => 'Position/Weather Report'),$decode);
490
+				elseif (preg_match(':^#M1AAEP:', $message)) {
491
+					$decode = array_merge(array('Message nature' => 'Position/Weather Report'), $decode);
492 492
 				}
493
-				elseif (preg_match(':^#M2APWD:',$message)) {
494
-					$decode = array_merge(array('Message nature' => 'Flight plan predicted wind data'),$decode);
493
+				elseif (preg_match(':^#M2APWD:', $message)) {
494
+					$decode = array_merge(array('Message nature' => 'Flight plan predicted wind data'), $decode);
495 495
 				}
496
-				elseif (preg_match(':^#M1BREQPWI:',$message)) {
497
-					$decode = array_merge(array('Message nature' => 'Predicted wind info request'),$decode);
496
+				elseif (preg_match(':^#M1BREQPWI:', $message)) {
497
+					$decode = array_merge(array('Message nature' => 'Predicted wind info request'), $decode);
498 498
 				}
499
-				elseif (preg_match(':^#CF:',$message)) {
500
-					$decode = array_merge(array('Message nature' => 'Central Fault Display'),$decode);
499
+				elseif (preg_match(':^#CF:', $message)) {
500
+					$decode = array_merge(array('Message nature' => 'Central Fault Display'), $decode);
501 501
 				}
502
-				elseif (preg_match(':^#DF:',$message)) {
503
-					$decode = array_merge(array('Message nature' => 'Digital Flight Data Acquisition Unit'),$decode);
502
+				elseif (preg_match(':^#DF:', $message)) {
503
+					$decode = array_merge(array('Message nature' => 'Digital Flight Data Acquisition Unit'), $decode);
504 504
 				}
505
-				elseif (preg_match(':^#EC:',$message)) {
506
-					$decode = array_merge(array('Message nature' => 'Engine Display System'),$decode);
505
+				elseif (preg_match(':^#EC:', $message)) {
506
+					$decode = array_merge(array('Message nature' => 'Engine Display System'), $decode);
507 507
 				}
508
-				elseif (preg_match(':^#EI:',$message)) {
509
-					$decode = array_merge(array('Message nature' => 'Engine Report'),$decode);
508
+				elseif (preg_match(':^#EI:', $message)) {
509
+					$decode = array_merge(array('Message nature' => 'Engine Report'), $decode);
510 510
 				}
511
-				elseif (preg_match(':^#H1:',$message)) {
512
-					$decode = array_merge(array('Message nature' => 'HF Data Radio - Left'),$decode);
511
+				elseif (preg_match(':^#H1:', $message)) {
512
+					$decode = array_merge(array('Message nature' => 'HF Data Radio - Left'), $decode);
513 513
 				}
514
-				elseif (preg_match(':^#H2:',$message)) {
515
-					$decode = array_merge(array('Message nature' => 'HF Data Radio - Right'),$decode);
514
+				elseif (preg_match(':^#H2:', $message)) {
515
+					$decode = array_merge(array('Message nature' => 'HF Data Radio - Right'), $decode);
516 516
 				}
517
-				elseif (preg_match(':^#HD:',$message)) {
518
-					$decode = array_merge(array('Message nature' => 'HF Data Radio - Selected'),$decode);
517
+				elseif (preg_match(':^#HD:', $message)) {
518
+					$decode = array_merge(array('Message nature' => 'HF Data Radio - Selected'), $decode);
519 519
 				}
520
-				elseif (preg_match(':^#M1:',$message)) {
521
-					$decode = array_merge(array('Message nature' => 'Flight Management Computer - Left'),$decode);
520
+				elseif (preg_match(':^#M1:', $message)) {
521
+					$decode = array_merge(array('Message nature' => 'Flight Management Computer - Left'), $decode);
522 522
 				}
523
-				elseif (preg_match(':^#M2:',$message)) {
524
-					$decode = array_merge(array('Message nature' => 'Flight Management Computer - Right'),$decode);
523
+				elseif (preg_match(':^#M2:', $message)) {
524
+					$decode = array_merge(array('Message nature' => 'Flight Management Computer - Right'), $decode);
525 525
 				}
526
-				elseif (preg_match(':^#M3:',$message)) {
527
-					$decode = array_merge(array('Message nature' => 'Flight Management Computer - Center'),$decode);
526
+				elseif (preg_match(':^#M3:', $message)) {
527
+					$decode = array_merge(array('Message nature' => 'Flight Management Computer - Center'), $decode);
528 528
 				}
529
-				elseif (preg_match(':^#MD:',$message)) {
530
-					$decode = array_merge(array('Message nature' => 'Flight Management Computer - Selected'),$decode);
529
+				elseif (preg_match(':^#MD:', $message)) {
530
+					$decode = array_merge(array('Message nature' => 'Flight Management Computer - Selected'), $decode);
531 531
 				}
532
-				elseif (preg_match(':^#PS:',$message)) {
533
-					$decode = array_merge(array('Message nature' => 'Keyboard/Display Unit'),$decode);
532
+				elseif (preg_match(':^#PS:', $message)) {
533
+					$decode = array_merge(array('Message nature' => 'Keyboard/Display Unit'), $decode);
534 534
 				}
535
-				elseif (preg_match(':^#S1:',$message)) {
536
-					$decode = array_merge(array('Message nature' => 'SDU - Left'),$decode);
535
+				elseif (preg_match(':^#S1:', $message)) {
536
+					$decode = array_merge(array('Message nature' => 'SDU - Left'), $decode);
537 537
 				}
538
-				elseif (preg_match(':^#S2:',$message)) {
539
-					$decode = array_merge(array('Message nature' => 'SDU - Right'),$decode);
538
+				elseif (preg_match(':^#S2:', $message)) {
539
+					$decode = array_merge(array('Message nature' => 'SDU - Right'), $decode);
540 540
 				}
541
-				elseif (preg_match(':^#SD:',$message)) {
542
-					$decode = array_merge(array('Message nature' => 'SDU - Selected'),$decode);
541
+				elseif (preg_match(':^#SD:', $message)) {
542
+					$decode = array_merge(array('Message nature' => 'SDU - Selected'), $decode);
543 543
 				}
544
-				elseif (preg_match(':^#T[0-8]:',$message)) {
545
-					$decode = array_merge(array('Message nature' => 'Cabin Terminal Messages'),$decode);
544
+				elseif (preg_match(':^#T[0-8]:', $message)) {
545
+					$decode = array_merge(array('Message nature' => 'Cabin Terminal Messages'), $decode);
546 546
 				}
547
-				elseif (preg_match(':^#WO:',$message)) {
548
-					$decode = array_merge(array('Message nature' => 'Weather Observation Report'),$decode);
547
+				elseif (preg_match(':^#WO:', $message)) {
548
+					$decode = array_merge(array('Message nature' => 'Weather Observation Report'), $decode);
549 549
 				}
550
-				elseif (preg_match(':^#A1:',$message)) {
551
-					$decode = array_merge(array('Message nature' => 'Oceanic Clearance'),$decode);
550
+				elseif (preg_match(':^#A1:', $message)) {
551
+					$decode = array_merge(array('Message nature' => 'Oceanic Clearance'), $decode);
552 552
 				}
553
-				elseif (preg_match(':^#A3:',$message)) {
554
-					$decode = array_merge(array('Message nature' => 'Departure Clearance Response'),$decode);
553
+				elseif (preg_match(':^#A3:', $message)) {
554
+					$decode = array_merge(array('Message nature' => 'Departure Clearance Response'), $decode);
555 555
 				}
556
-				elseif (preg_match(':^#A4:',$message)) {
557
-					$decode = array_merge(array('Message nature' => 'Flight Systems Message'),$decode);
556
+				elseif (preg_match(':^#A4:', $message)) {
557
+					$decode = array_merge(array('Message nature' => 'Flight Systems Message'), $decode);
558 558
 				}
559
-				elseif (preg_match(':^#A6:',$message)) {
560
-					$decode = array_merge(array('Message nature' => 'Request ADS Reports'),$decode);
559
+				elseif (preg_match(':^#A6:', $message)) {
560
+					$decode = array_merge(array('Message nature' => 'Request ADS Reports'), $decode);
561 561
 				}
562
-				elseif (preg_match(':^#A8:',$message)) {
563
-					$decode = array_merge(array('Message nature' => 'Deliver Departure Slot'),$decode);
562
+				elseif (preg_match(':^#A8:', $message)) {
563
+					$decode = array_merge(array('Message nature' => 'Deliver Departure Slot'), $decode);
564 564
 				}
565
-				elseif (preg_match(':^#A9:',$message)) {
566
-					$decode = array_merge(array('Message nature' => 'ATIS report'),$decode);
565
+				elseif (preg_match(':^#A9:', $message)) {
566
+					$decode = array_merge(array('Message nature' => 'ATIS report'), $decode);
567 567
 				}
568
-				elseif (preg_match(':^#A0:',$message)) {
569
-					$decode = array_merge(array('Message nature' => 'ATIS Facility Notification (AFN)'),$decode);
568
+				elseif (preg_match(':^#A0:', $message)) {
569
+					$decode = array_merge(array('Message nature' => 'ATIS Facility Notification (AFN)'), $decode);
570 570
 				}
571
-				elseif (preg_match(':^#AA:',$message)) {
572
-					$decode = array_merge(array('Message nature' => 'ATCComm'),$decode);
571
+				elseif (preg_match(':^#AA:', $message)) {
572
+					$decode = array_merge(array('Message nature' => 'ATCComm'), $decode);
573 573
 				}
574
-				elseif (preg_match(':^#AB:',$message)) {
575
-					$decode = array_merge(array('Message nature' => 'TWIP Report'),$decode);
574
+				elseif (preg_match(':^#AB:', $message)) {
575
+					$decode = array_merge(array('Message nature' => 'TWIP Report'), $decode);
576 576
 				}
577
-				elseif (preg_match(':^#AC:',$message)) {
578
-					$decode = array_merge(array('Message nature' => 'Pushback Clearance'),$decode);
577
+				elseif (preg_match(':^#AC:', $message)) {
578
+					$decode = array_merge(array('Message nature' => 'Pushback Clearance'), $decode);
579 579
 				}
580
-				elseif (preg_match(':^#AD:',$message)) {
581
-					$decode = array_merge(array('Message nature' => 'Expected Taxi Clearance'),$decode);
580
+				elseif (preg_match(':^#AD:', $message)) {
581
+					$decode = array_merge(array('Message nature' => 'Expected Taxi Clearance'), $decode);
582 582
 				}
583
-				elseif (preg_match(':^#AF:',$message)) {
584
-					$decode = array_merge(array('Message nature' => 'CPC Command/Response'),$decode);
583
+				elseif (preg_match(':^#AF:', $message)) {
584
+					$decode = array_merge(array('Message nature' => 'CPC Command/Response'), $decode);
585 585
 				}
586
-				elseif (preg_match(':^#B1:',$message)) {
587
-					$decode = array_merge(array('Message nature' => 'Request Oceanic Clearance'),$decode);
586
+				elseif (preg_match(':^#B1:', $message)) {
587
+					$decode = array_merge(array('Message nature' => 'Request Oceanic Clearance'), $decode);
588 588
 				}
589
-				elseif (preg_match(':^#B2:',$message)) {
590
-					$decode = array_merge(array('Message nature' => 'Oceanic Clearance Readback'),$decode);
589
+				elseif (preg_match(':^#B2:', $message)) {
590
+					$decode = array_merge(array('Message nature' => 'Oceanic Clearance Readback'), $decode);
591 591
 				}
592
-				elseif (preg_match(':^#B3:',$message)) {
593
-					$decode = array_merge(array('Message nature' => 'Request Departure Clearance'),$decode);
592
+				elseif (preg_match(':^#B3:', $message)) {
593
+					$decode = array_merge(array('Message nature' => 'Request Departure Clearance'), $decode);
594 594
 				}
595
-				elseif (preg_match(':^#B4:',$message)) {
596
-					$decode = array_merge(array('Message nature' => 'Departure Clearance Readback'),$decode);
595
+				elseif (preg_match(':^#B4:', $message)) {
596
+					$decode = array_merge(array('Message nature' => 'Departure Clearance Readback'), $decode);
597 597
 				}
598
-				elseif (preg_match(':^#B6:',$message)) {
599
-					$decode = array_merge(array('Message nature' => 'Provide ADS Report'),$decode);
598
+				elseif (preg_match(':^#B6:', $message)) {
599
+					$decode = array_merge(array('Message nature' => 'Provide ADS Report'), $decode);
600 600
 				}
601
-				elseif (preg_match(':^#B8:',$message)) {
602
-					$decode = array_merge(array('Message nature' => 'Request Departure Slot'),$decode);
601
+				elseif (preg_match(':^#B8:', $message)) {
602
+					$decode = array_merge(array('Message nature' => 'Request Departure Slot'), $decode);
603 603
 				}
604
-				elseif (preg_match(':^#B9:',$message)) {
605
-					$decode = array_merge(array('Message nature' => 'Request ATIS Report'),$decode);
604
+				elseif (preg_match(':^#B9:', $message)) {
605
+					$decode = array_merge(array('Message nature' => 'Request ATIS Report'), $decode);
606 606
 				}
607
-				elseif (preg_match(':^#B0:',$message)) {
608
-					$decode = array_merge(array('Message nature' => 'ATS Facility Notification'),$decode);
607
+				elseif (preg_match(':^#B0:', $message)) {
608
+					$decode = array_merge(array('Message nature' => 'ATS Facility Notification'), $decode);
609 609
 				}
610
-				elseif (preg_match(':^#BA:',$message)) {
611
-					$decode = array_merge(array('Message nature' => 'ATCComm'),$decode);
610
+				elseif (preg_match(':^#BA:', $message)) {
611
+					$decode = array_merge(array('Message nature' => 'ATCComm'), $decode);
612 612
 				}
613
-				elseif (preg_match(':^#BB:',$message)) {
614
-					$decode = array_merge(array('Message nature' => 'Request TWIP Report'),$decode);
613
+				elseif (preg_match(':^#BB:', $message)) {
614
+					$decode = array_merge(array('Message nature' => 'Request TWIP Report'), $decode);
615 615
 				}
616
-				elseif (preg_match(':^#BC:',$message)) {
617
-					$decode = array_merge(array('Message nature' => 'Pushback Clearance Request'),$decode);
616
+				elseif (preg_match(':^#BC:', $message)) {
617
+					$decode = array_merge(array('Message nature' => 'Pushback Clearance Request'), $decode);
618 618
 				}
619
-				elseif (preg_match(':^#BD:',$message)) {
620
-					$decode = array_merge(array('Message nature' => 'Expected Taxi Clearance Request'),$decode);
619
+				elseif (preg_match(':^#BD:', $message)) {
620
+					$decode = array_merge(array('Message nature' => 'Expected Taxi Clearance Request'), $decode);
621 621
 				}
622
-				elseif (preg_match(':^#BE:',$message)) {
623
-					$decode = array_merge(array('Message nature' => 'CPC Aircraft Log-On/Off Request'),$decode);
622
+				elseif (preg_match(':^#BE:', $message)) {
623
+					$decode = array_merge(array('Message nature' => 'CPC Aircraft Log-On/Off Request'), $decode);
624 624
 				}
625
-				elseif (preg_match(':^#BF:',$message)) {
626
-					$decode = array_merge(array('Message nature' => 'CPC WILCO/UNABLE Response'),$decode);
625
+				elseif (preg_match(':^#BF:', $message)) {
626
+					$decode = array_merge(array('Message nature' => 'CPC WILCO/UNABLE Response'), $decode);
627 627
 				}
628
-				elseif (preg_match(':^#H3:',$message)) {
629
-					$decode = array_merge(array('Message nature' => 'Icing Report'),$decode);
628
+				elseif (preg_match(':^#H3:', $message)) {
629
+					$decode = array_merge(array('Message nature' => 'Icing Report'), $decode);
630 630
 				}
631 631
 			}
632 632
 			if ($label == '10') {
633
-				if (preg_match(':^DTO01:',$message)) {
634
-					$decode = array_merge(array('Message nature' => 'Delayed Takeoff Report'),$decode);
633
+				if (preg_match(':^DTO01:', $message)) {
634
+					$decode = array_merge(array('Message nature' => 'Delayed Takeoff Report'), $decode);
635 635
 				}
636
-				elseif (preg_match(':^AIS01:',$message)) {
637
-					$decode = array_merge(array('Message nature' => 'AIS Request'),$decode);
636
+				elseif (preg_match(':^AIS01:', $message)) {
637
+					$decode = array_merge(array('Message nature' => 'AIS Request'), $decode);
638 638
 				}
639
-				elseif (preg_match(':^FTX01:',$message)) {
640
-					$decode = array_merge(array('Message nature' => 'Free Text Downlink'),$decode);
639
+				elseif (preg_match(':^FTX01:', $message)) {
640
+					$decode = array_merge(array('Message nature' => 'Free Text Downlink'), $decode);
641 641
 				}
642
-				elseif (preg_match(':^FPL01:',$message)) {
643
-					$decode = array_merge(array('Message nature' => 'Flight Plan Request'),$decode);
642
+				elseif (preg_match(':^FPL01:', $message)) {
643
+					$decode = array_merge(array('Message nature' => 'Flight Plan Request'), $decode);
644 644
 				}
645
-				elseif (preg_match(':^WAB01:',$message)) {
646
-					$decode = array_merge(array('Message nature' => 'Weight & Balance Request'),$decode);
645
+				elseif (preg_match(':^WAB01:', $message)) {
646
+					$decode = array_merge(array('Message nature' => 'Weight & Balance Request'), $decode);
647 647
 				}
648
-				elseif (preg_match(':^MET01:',$message)) {
649
-					$decode = array_merge(array('Message nature' => 'Weather Data Request'),$decode);
648
+				elseif (preg_match(':^MET01:', $message)) {
649
+					$decode = array_merge(array('Message nature' => 'Weather Data Request'), $decode);
650 650
 				}
651
-				elseif (preg_match(':^WAB02:',$message)) {
652
-					$decode = array_merge(array('Message nature' => 'Weight and Balance Acknowledgement'),$decode);
651
+				elseif (preg_match(':^WAB02:', $message)) {
652
+					$decode = array_merge(array('Message nature' => 'Weight and Balance Acknowledgement'), $decode);
653 653
 				}
654 654
 			}
655 655
 			if ($label == '15') {
656
-				if (preg_match(':^FST01:',$message)) {
657
-					$decode = array_merge(array('Message nature' => 'Flight Status Report'),$decode);
656
+				if (preg_match(':^FST01:', $message)) {
657
+					$decode = array_merge(array('Message nature' => 'Flight Status Report'), $decode);
658 658
 				}
659 659
 			}
660 660
 			if (!$found && $label == 'SA') {
661
-				$n = sscanf($message, "%d%c%c%6[0-9]", $version,$state,$type,$at);
661
+				$n = sscanf($message, "%d%c%c%6[0-9]", $version, $state, $type, $at);
662 662
 				if ($n == 4) {
663 663
 					$vsta = array('Version' => $version);
664 664
 					if ($state == 'E') {
665
-						$vsta = array_merge($vsta,array('Link state' => 'Established'));
665
+						$vsta = array_merge($vsta, array('Link state' => 'Established'));
666 666
 					}
667 667
 					elseif ($state == 'L') {
668
-						$vsta = array_merge($vsta,array('Link state' => 'Lost'));
668
+						$vsta = array_merge($vsta, array('Link state' => 'Lost'));
669 669
 					}
670 670
 					else {
671
-						$vsta = array_merge($vsta,array('Link state' => 'Unknown'));
671
+						$vsta = array_merge($vsta, array('Link state' => 'Unknown'));
672 672
 					}
673 673
 					if ($type == 'V') {
674
-						$vsta = array_merge($vsta,array('Link type' => 'VHF ACARS'));
674
+						$vsta = array_merge($vsta, array('Link type' => 'VHF ACARS'));
675 675
 					}
676 676
 					elseif ($type == 'S') {
677
-						$vsta = array_merge($vsta,array('Link type' => 'Generic SATCOM'));
677
+						$vsta = array_merge($vsta, array('Link type' => 'Generic SATCOM'));
678 678
 					}
679 679
 					elseif ($type == 'H') {
680
-						$vsta = array_merge($vsta,array('Link type' => 'HF'));
680
+						$vsta = array_merge($vsta, array('Link type' => 'HF'));
681 681
 					}
682 682
 					elseif ($type == 'G') {
683
-						$vsta = array_merge($vsta,array('Link type' => 'GlobalStar SATCOM'));
683
+						$vsta = array_merge($vsta, array('Link type' => 'GlobalStar SATCOM'));
684 684
 					}
685 685
 					elseif ($type == 'C') {
686
-						$vsta = array_merge($vsta,array('Link type' => 'ICO SATCOM'));
686
+						$vsta = array_merge($vsta, array('Link type' => 'ICO SATCOM'));
687 687
 					}
688 688
 					elseif ($type == '2') {
689
-						$vsta = array_merge($vsta,array('Link type' => 'VDL Mode 2'));
689
+						$vsta = array_merge($vsta, array('Link type' => 'VDL Mode 2'));
690 690
 					}
691 691
 					elseif ($type == 'X') {
692
-						$vsta = array_merge($vsta,array('Link type' => 'Inmarsat Aero'));
692
+						$vsta = array_merge($vsta, array('Link type' => 'Inmarsat Aero'));
693 693
 					}
694 694
 					elseif ($type == 'I') {
695
-						$vsta = array_merge($vsta,array('Link type' => 'Irridium SATCOM'));
695
+						$vsta = array_merge($vsta, array('Link type' => 'Irridium SATCOM'));
696 696
 					}
697 697
 					else {
698
-						$vsta = array_merge($vsta,array('Link type' => 'Unknown'));
698
+						$vsta = array_merge($vsta, array('Link type' => 'Unknown'));
699 699
 					}
700
-					$vsta = array_merge($vsta,array('Event occured at' => implode(':',str_split($at,2))));
701
-					$decode = array_merge($vsta,$decode);
700
+					$vsta = array_merge($vsta, array('Event occured at' => implode(':', str_split($at, 2))));
701
+					$decode = array_merge($vsta, $decode);
702 702
 				}
703 703
 			}
704 704
 
705 705
 			$title = $this->getTitlefromLabel($label);
706
-			if ($title != '') $decode = array_merge(array('Message title' => $title),$decode);
706
+			if ($title != '') $decode = array_merge(array('Message title' => $title), $decode);
707 707
 			/*
708 708
 			// Business jets always use GS0001
709 709
 			if ($ident != 'GS0001') $info = $this->addModeSData($ident,$registration,$icao,$airicao,$latitude,$longitude);
@@ -731,13 +731,13 @@  discard block
 block discarded – undo
731 731
 		$Translation = new Translation($this->db);
732 732
 		$message = $this->parse($data);
733 733
 		if (isset($message['registration']) && $message['registration'] != '' && $message['ident'] != '' && $message['registration'] != '!') {
734
-			$ident = (string)$message['ident'];
734
+			$ident = (string) $message['ident'];
735 735
 			$label = $message['label'];
736 736
 			$block_id = $message['block_id'];
737 737
 			$msg_no = $message['msg_no'];
738 738
 			$msg = $message['message'];
739 739
 			$decode = $message['decode'];
740
-			$registration = (string)$message['registration'];
740
+			$registration = (string) $message['registration'];
741 741
 			if (isset($decode['latitude'])) $latitude = $decode['latitude'];
742 742
 			else $latitude = '';
743 743
 			if (isset($decode['longitude'])) $longitude = $decode['longitude'];
@@ -751,20 +751,20 @@  discard block
 block discarded – undo
751 751
 				$Image->addSpotterImage($registration);
752 752
 			}
753 753
 			// Business jets always use GS0001
754
-			if ($ident != 'GS0001') $info = $this->addModeSData($ident,$registration,$icao,$airicao,$latitude,$longitude);
754
+			if ($ident != 'GS0001') $info = $this->addModeSData($ident, $registration, $icao, $airicao, $latitude, $longitude);
755 755
 			if ($globalDebug && isset($info) && $info != '') echo $info;
756 756
 			if (count($decode) > 0) $decode_json = json_encode($decode);
757 757
 			else $decode_json = '';
758 758
 			if (isset($decode['Departure airport']) && isset($decode['Departure hour']) && isset($decode['Arrival airport']) && isset($decode['Arrival hour'])) {
759
-				$Schedule->addSchedule($icao,$decode['Departure airport'],$decode['Departure hour'],$decode['Arrival airport'],$decode['Arrival hour'],'ACARS');
759
+				$Schedule->addSchedule($icao, $decode['Departure airport'], $decode['Departure hour'], $decode['Arrival airport'], $decode['Arrival hour'], 'ACARS');
760 760
 			} elseif (isset($decode['Departure airport']) && isset($decode['Arrival airport'])) {
761
-				$Schedule->addSchedule($icao,$decode['Departure airport'],'',$decode['Arrival airport'],'','ACARS');
761
+				$Schedule->addSchedule($icao, $decode['Departure airport'], '', $decode['Arrival airport'], '', 'ACARS');
762 762
 			}
763
-			$result = $this->addLiveAcarsData($ident,$registration,$label,$block_id,$msg_no,$msg,$decode_json);
764
-			if (!isset($globalACARSArchive)) $globalACARSArchive = array('10','80','81','82','3F');
765
-			if ($result && in_array($label,$globalACARSArchive)) $this->addArchiveAcarsData($ident,$registration,$label,$block_id,$msg_no,$msg,$decode_json);
763
+			$result = $this->addLiveAcarsData($ident, $registration, $label, $block_id, $msg_no, $msg, $decode_json);
764
+			if (!isset($globalACARSArchive)) $globalACARSArchive = array('10', '80', '81', '82', '3F');
765
+			if ($result && in_array($label, $globalACARSArchive)) $this->addArchiveAcarsData($ident, $registration, $label, $block_id, $msg_no, $msg, $decode_json);
766 766
 			if ($globalDebug && count($decode) > 0) {
767
-				echo "Human readable data : ".implode(' - ',$decode)."\n";
767
+				echo "Human readable data : ".implode(' - ', $decode)."\n";
768 768
 			}
769 769
 		}
770 770
 	}
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 	* @param String $msg_no Number of the ACARS message
780 780
 	* @param String $message ACARS message
781 781
 	*/
782
-	public function addLiveAcarsData($ident,$registration,$label,$block_id,$msg_no,$message,$decode = '') {
782
+	public function addLiveAcarsData($ident, $registration, $label, $block_id, $msg_no, $message, $decode = '') {
783 783
 		global $globalDebug;
784 784
 		date_default_timezone_set('UTC');
785 785
 		if ($label != 'SQ' && $label != 'Q0' && $label != '_d' && $message != '') {
@@ -787,21 +787,21 @@  discard block
 block discarded – undo
787 787
 			$this->db = $Connection->db;
788 788
 			if ($globalDebug) echo "Test if not already in Live ACARS table...";
789 789
 			$query_test = "SELECT COUNT(*) as nb FROM acars_live WHERE ident = :ident AND registration = :registration AND message = :message";
790
-			$query_test_values = array(':ident' => $ident,':registration' => $registration, ':message' => $message);
790
+			$query_test_values = array(':ident' => $ident, ':registration' => $registration, ':message' => $message);
791 791
 			try {
792 792
 				$stht = $this->db->prepare($query_test);
793 793
 				$stht->execute($query_test_values);
794
-			} catch(PDOException $e) {
794
+			} catch (PDOException $e) {
795 795
 				return "error : ".$e->getMessage();
796 796
 			}
797 797
 			if ($stht->fetchColumn() == 0) {
798 798
 				if ($globalDebug) echo "Add Live ACARS data...";
799 799
 				$query = "INSERT INTO acars_live (ident,registration,label,block_id,msg_no,message,decode,date) VALUES (:ident,:registration,:label,:block_id,:msg_no,:message,:decode,:date)";
800
-				$query_values = array(':ident' => $ident,':registration' => $registration, ':label' => $label,':block_id' => $block_id, ':msg_no' => $msg_no, ':message' => $message, ':decode' => $decode,':date' => date("Y-m-d H:i:s"));
800
+				$query_values = array(':ident' => $ident, ':registration' => $registration, ':label' => $label, ':block_id' => $block_id, ':msg_no' => $msg_no, ':message' => $message, ':decode' => $decode, ':date' => date("Y-m-d H:i:s"));
801 801
 				try {
802 802
 					$sth = $this->db->prepare($query);
803 803
 					$sth->execute($query_values);
804
-				} catch(PDOException $e) {
804
+				} catch (PDOException $e) {
805 805
 					return "error : ".$e->getMessage();
806 806
 				}
807 807
 			} else {
@@ -823,10 +823,10 @@  discard block
 block discarded – undo
823 823
 	* @param String $msg_no Number of the ACARS message
824 824
 	* @param String $message ACARS message
825 825
 	*/
826
-	public function addArchiveAcarsData($ident,$registration,$label,$block_id,$msg_no,$message,$decode = '') {
826
+	public function addArchiveAcarsData($ident, $registration, $label, $block_id, $msg_no, $message, $decode = '') {
827 827
 		global $globalDebug;
828 828
 		date_default_timezone_set('UTC');
829
-		if ($label != 'SQ' && $label != 'Q0' && $label != '_d' && $message != '' && preg_match('/^MET0/',$message) === 0 && preg_match('/^ARR0/',$message) === 0 && preg_match('/^ETA/',$message) === 0 && preg_match('/^WXR/',$message) === 0 && preg_match('/^FTX01.FIC/',$message) === 0) {
829
+		if ($label != 'SQ' && $label != 'Q0' && $label != '_d' && $message != '' && preg_match('/^MET0/', $message) === 0 && preg_match('/^ARR0/', $message) === 0 && preg_match('/^ETA/', $message) === 0 && preg_match('/^WXR/', $message) === 0 && preg_match('/^FTX01.FIC/', $message) === 0) {
830 830
 			/*
831 831
 				    if ($globalDebug) echo "Test if not already in Archive ACARS table...";
832 832
 			    	    $query_test = "SELECT COUNT(*) as nb FROM acars_archive WHERE ident = :ident AND registration = :registration AND message = :message";
@@ -841,11 +841,11 @@  discard block
 block discarded – undo
841 841
 			*/
842 842
 			if ($globalDebug) echo "Add Live ACARS data...";
843 843
 			$query = "INSERT INTO acars_archive (ident,registration,label,block_id,msg_no,message,decode) VALUES (:ident,:registration,:label,:block_id,:msg_no,:message,:decode)";
844
-			$query_values = array(':ident' => $ident,':registration' => $registration, ':label' => $label,':block_id' => $block_id, ':msg_no' => $msg_no, ':message' => $message, ':decode' => $decode);
844
+			$query_values = array(':ident' => $ident, ':registration' => $registration, ':label' => $label, ':block_id' => $block_id, ':msg_no' => $msg_no, ':message' => $message, ':decode' => $decode);
845 845
 			try {
846 846
 				$sth = $this->db->prepare($query);
847 847
 				$sth->execute($query_values);
848
-			} catch(PDOException $e) {
848
+			} catch (PDOException $e) {
849 849
 				return "error : ".$e->getMessage();
850 850
 			}
851 851
 			if ($globalDebug) echo "Done\n";
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 		try {
867 867
 			$sth = $this->db->prepare($query);
868 868
 			$sth->execute($query_values);
869
-		} catch(PDOException $e) {
869
+		} catch (PDOException $e) {
870 870
 			echo "error : ".$e->getMessage();
871 871
 			return '';
872 872
 		}
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 		try {
887 887
 			$sth = $this->db->prepare($query);
888 888
 			$sth->execute($query_values);
889
-		} catch(PDOException $e) {
889
+		} catch (PDOException $e) {
890 890
 			echo "error : ".$e->getMessage();
891 891
 			return array();
892 892
 		}
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
 		try {
908 908
 			$sth = $this->db->prepare($query);
909 909
 			$sth->execute($query_values);
910
-		} catch(PDOException $e) {
910
+		} catch (PDOException $e) {
911 911
 			echo "error : ".$e->getMessage();
912 912
 			return array();
913 913
 		}
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 	*
922 922
 	* @return Array Return ACARS data in array
923 923
 	*/
924
-	public function getLatestAcarsData($limit = '',$label = '') {
924
+	public function getLatestAcarsData($limit = '', $label = '') {
925 925
 		global $globalURL, $globalDBdriver;
926 926
 		$Image = new Image($this->db);
927 927
 		$Spotter = new Spotter($this->db);
@@ -932,8 +932,8 @@  discard block
 block discarded – undo
932 932
 		if ($limit != "")
933 933
 		{
934 934
 			$limit_array = explode(",", $limit);
935
-			$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
936
-			$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
935
+			$limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT);
936
+			$limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT);
937 937
 			if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
938 938
 			{
939 939
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
@@ -949,46 +949,46 @@  discard block
 block discarded – undo
949 949
 		try {
950 950
 			$sth = $this->db->prepare($query);
951 951
 			$sth->execute($query_values);
952
-		} catch(PDOException $e) {
952
+		} catch (PDOException $e) {
953 953
 			return "error : ".$e->getMessage();
954 954
 		}
955 955
 		$i = 0;
956 956
 		while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
957 957
 			$data = array();
958 958
 			if ($row['registration'] != '') {
959
-				$row['registration'] = str_replace('.','',$row['registration']);
959
+				$row['registration'] = str_replace('.', '', $row['registration']);
960 960
 				$image_array = $Image->getSpotterImage($row['registration']);
961
-				if (count($image_array) > 0) $data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website']));
962
-				else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
963
-			} else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
961
+				if (count($image_array) > 0) $data = array_merge($data, array('image' => $image_array[0]['image'], 'image_thumbnail' => $image_array[0]['image_thumbnail'], 'image_copyright' => $image_array[0]['image_copyright'], 'image_source' => $image_array[0]['image_source'], 'image_source_website' => $image_array[0]['image_source_website']));
962
+				else $data = array_merge($data, array('image' => '', 'image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => ''));
963
+			} else $data = array_merge($data, array('image' => '', 'image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => ''));
964 964
 			if ($row['registration'] == '') $row['registration'] = 'NA';
965 965
 			if ($row['ident'] == '') $row['ident'] = 'NA';
966
-			$identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,2));
966
+			$identicao = $Spotter->getAllAirlineInfo(substr($row['ident'], 0, 2));
967 967
 			if (isset($identicao[0])) {
968
-				if (substr($row['ident'],0,2) == 'AF') {
969
-					if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident'];
970
-					else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0');
971
-				} else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0');
972
-				$data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name']));
968
+				if (substr($row['ident'], 0, 2) == 'AF') {
969
+					if (filter_var(substr($row['ident'], 2), FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident'];
970
+					else $icao = 'AFR'.ltrim(substr($row['ident'], 2), '0');
971
+				} else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'], 2), '0');
972
+				$data = array_merge($data, array('airline_icao' => $identicao[0]['icao'], 'airline_name' => $identicao[0]['name']));
973 973
 			} else $icao = $row['ident'];
974
-			$icao = $Translation->checkTranslation($icao,false);
975
-			$decode = json_decode($row['decode'],true);
974
+			$icao = $Translation->checkTranslation($icao, false);
975
+			$decode = json_decode($row['decode'], true);
976 976
 			$found = false;
977
-			if ($decode != '' && array_key_exists('Departure airport',$decode)) {
977
+			if ($decode != '' && array_key_exists('Departure airport', $decode)) {
978 978
 				$airport_info = $Spotter->getAllAirportInfo($decode['Departure airport']);
979 979
 				if (isset($airport_info[0]['icao'])) {
980 980
 					$decode['Departure airport'] = '<a href="'.$globalURL.'/airport/'.$airport_info[0]['icao'].'">'.$airport_info[0]['city'].','.$airport_info[0]['country'].' ('.$airport_info[0]['icao'].')</a>';
981 981
 					$found = true;
982 982
 				}
983 983
 			}
984
-			if ($decode != '' && array_key_exists('Arrival airport',$decode)) {
984
+			if ($decode != '' && array_key_exists('Arrival airport', $decode)) {
985 985
 				$airport_info = $Spotter->getAllAirportInfo($decode['Arrival airport']);
986 986
 				if (isset($airport_info[0]['icao'])) {
987 987
 					$decode['Arrival airport'] = '<a href="'.$globalURL.'/airport/'.$airport_info[0]['icao'].'">'.$airport_info[0]['city'].','.$airport_info[0]['country'].' ('.$airport_info[0]['icao'].')</a>';
988 988
 					$found = true;
989 989
 				}
990 990
 			}
991
-			if ($decode != '' && array_key_exists('Airport/Waypoint name',$decode)) {
991
+			if ($decode != '' && array_key_exists('Airport/Waypoint name', $decode)) {
992 992
 				$airport_info = $Spotter->getAllAirportInfo($decode['Airport/Waypoint name']);
993 993
 				if (isset($airport_info[0]['icao'])) {
994 994
 					$decode['Airport/Waypoint name'] = '<a href="'.$globalURL.'/airport/'.$airport_info[0]['icao'].'">'.$airport_info[0]['city'].','.$airport_info[0]['country'].' ('.$airport_info[0]['icao'].')</a>';
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 				}
997 997
 			}
998 998
 			if ($found) $row['decode'] = json_encode($decode);
999
-			$data = array_merge($data,array('registration' => $row['registration'],'message' => $row['message'], 'date' => $row['date'], 'ident' => $icao, 'decode' => $row['decode']));
999
+			$data = array_merge($data, array('registration' => $row['registration'], 'message' => $row['message'], 'date' => $row['date'], 'ident' => $icao, 'decode' => $row['decode']));
1000 1000
 			$result[] = $data;
1001 1001
 			$i++;
1002 1002
 		}
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
 	*
1013 1013
 	* @return Array Return ACARS data in array
1014 1014
 	*/
1015
-	public function getArchiveAcarsData($limit = '',$label = '') {
1015
+	public function getArchiveAcarsData($limit = '', $label = '') {
1016 1016
 		global $globalURL, $globalDBdriver;
1017 1017
 		$Image = new Image($this->db);
1018 1018
 		$Spotter = new Spotter($this->db);
@@ -1022,8 +1022,8 @@  discard block
 block discarded – undo
1022 1022
 		if ($limit != "")
1023 1023
 		{
1024 1024
 			$limit_array = explode(",", $limit);
1025
-			$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
1026
-			$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
1025
+			$limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT);
1026
+			$limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT);
1027 1027
 			if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
1028 1028
 			{
1029 1029
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
@@ -1044,43 +1044,43 @@  discard block
 block discarded – undo
1044 1044
 		try {
1045 1045
 			$sth = $this->db->prepare($query);
1046 1046
 			$sth->execute($query_values);
1047
-		} catch(PDOException $e) {
1047
+		} catch (PDOException $e) {
1048 1048
 			return "error : ".$e->getMessage();
1049 1049
 		}
1050
-		$i=0;
1050
+		$i = 0;
1051 1051
 		while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
1052 1052
 			$data = array();
1053 1053
 			if ($row['registration'] != '') {
1054
-				$row['registration'] = str_replace('.','',$row['registration']);
1054
+				$row['registration'] = str_replace('.', '', $row['registration']);
1055 1055
 				$image_array = $Image->getSpotterImage($row['registration']);
1056
-				if (count($image_array) > 0) $data = array_merge($data,array('image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website']));
1057
-				else $data = array_merge($data,array('image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
1058
-			} else $data = array_merge($data,array('image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => ''));
1056
+				if (count($image_array) > 0) $data = array_merge($data, array('image_thumbnail' => $image_array[0]['image_thumbnail'], 'image_copyright' => $image_array[0]['image_copyright'], 'image_source' => $image_array[0]['image_source'], 'image_source_website' => $image_array[0]['image_source_website']));
1057
+				else $data = array_merge($data, array('image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => ''));
1058
+			} else $data = array_merge($data, array('image_thumbnail' => '', 'image_copyright' => '', 'image_source' => '', 'image_source_website' => ''));
1059 1059
 			$icao = '';
1060 1060
 			if ($row['registration'] == '') $row['registration'] = 'NA';
1061 1061
 			if ($row['ident'] == '') $row['ident'] = 'NA';
1062
-			$identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,2));
1062
+			$identicao = $Spotter->getAllAirlineInfo(substr($row['ident'], 0, 2));
1063 1063
 			if (isset($identicao[0])) {
1064
-				if (substr($row['ident'],0,2) == 'AF') {
1065
-					if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident'];
1066
-					else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0');
1067
-				} else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0');
1068
-				$data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name']));
1064
+				if (substr($row['ident'], 0, 2) == 'AF') {
1065
+					if (filter_var(substr($row['ident'], 2), FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident'];
1066
+					else $icao = 'AFR'.ltrim(substr($row['ident'], 2), '0');
1067
+				} else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'], 2), '0');
1068
+				$data = array_merge($data, array('airline_icao' => $identicao[0]['icao'], 'airline_name' => $identicao[0]['name']));
1069 1069
 			} else $icao = $row['ident'];
1070 1070
 			$icao = $Translation->checkTranslation($icao);
1071
-			$decode = json_decode($row['decode'],true);
1071
+			$decode = json_decode($row['decode'], true);
1072 1072
 			$found = false;
1073
-			if ($decode != '' && array_key_exists('Departure airport',$decode)) {
1073
+			if ($decode != '' && array_key_exists('Departure airport', $decode)) {
1074 1074
 				$airport_info = $Spotter->getAllAirportInfo($decode['Departure airport']);
1075 1075
 				if (isset($airport_info[0]['icao'])) $decode['Departure airport'] = '<a href="'.$globalURL.'/airport/'.$airport_info[0]['icao'].'">'.$airport_info[0]['city'].','.$airport_info[0]['country'].' ('.$airport_info[0]['icao'].')</a>';
1076 1076
 				$found = true;
1077 1077
 			}
1078
-			if ($decode != '' && array_key_exists('Arrival airport',$decode)) {
1078
+			if ($decode != '' && array_key_exists('Arrival airport', $decode)) {
1079 1079
 				$airport_info = $Spotter->getAllAirportInfo($decode['Arrival airport']);
1080 1080
 				if (isset($airport_info[0]['icao'])) $decode['Arrival airport'] = '<a href="'.$globalURL.'/airport/'.$airport_info[0]['icao'].'">'.$airport_info[0]['city'].','.$airport_info[0]['country'].' ('.$airport_info[0]['icao'].')</a>';
1081 1081
 				$found = true;
1082 1082
 			}
1083
-			if ($decode != '' && array_key_exists('Airport/Waypoint name',$decode)) {
1083
+			if ($decode != '' && array_key_exists('Airport/Waypoint name', $decode)) {
1084 1084
 				$airport_info = $Spotter->getAllAirportInfo($decode['Airport/Waypoint name']);
1085 1085
 				if (isset($airport_info[0]['icao'])) {
1086 1086
 					$decode['Airport/Waypoint name'] = '<a href="'.$globalURL.'/airport/'.$airport_info[0]['icao'].'">'.$airport_info[0]['city'].','.$airport_info[0]['country'].' ('.$airport_info[0]['icao'].')</a>';
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 				}
1089 1089
 			}
1090 1090
 			if ($found) $row['decode'] = json_encode($decode);
1091
-			$data = array_merge($data,array('registration' => $row['registration'],'message' => $row['message'], 'date' => $row['date'], 'ident' => $icao, 'decode' => $row['decode']));
1091
+			$data = array_merge($data, array('registration' => $row['registration'], 'message' => $row['message'], 'date' => $row['date'], 'ident' => $icao, 'decode' => $row['decode']));
1092 1092
 			$result[] = $data;
1093 1093
 			$i++;
1094 1094
 		}
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
 	* @param String $icao
1107 1107
 	* @param String $ICAOTypeCode
1108 1108
 	*/
1109
-	public function addModeSData($ident,$registration,$icao = '',$ICAOTypeCode = '',$latitude = '', $longitude = '') {
1109
+	public function addModeSData($ident, $registration, $icao = '', $ICAOTypeCode = '', $latitude = '', $longitude = '') {
1110 1110
 		global $globalDebug, $globalDBdriver;
1111 1111
 		$ident = trim($ident);
1112 1112
 		$Translation = new Translation($this->db);
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 			if ($globalDebug) echo "Ident or registration null, exit\n";
1120 1120
 			return '';
1121 1121
 		}
1122
-		$registration = str_replace('.','',$registration);
1122
+		$registration = str_replace('.', '', $registration);
1123 1123
 		$ident = $Translation->ident2icao($ident);
1124 1124
 		// Check if a flight with same registration is flying now, if ok check if callsign = name in ACARS, else add it to translation
1125 1125
 		if ($globalDebug) echo "Check if needed to add translation ".$ident.'... ';
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
 		try {
1129 1129
 			$sthsi = $this->db->prepare($querysi);
1130 1130
 			$sthsi->execute($querysi_values);
1131
-		} catch(PDOException $e) {
1131
+		} catch (PDOException $e) {
1132 1132
 			if ($globalDebug) echo $e->getMessage();
1133 1133
 			return "error : ".$e->getMessage();
1134 1134
 		}
@@ -1138,8 +1138,8 @@  discard block
 block discarded – undo
1138 1138
 			$Translation = new Translation($this->db);
1139 1139
 			$trans_ident = $Translation->getOperator($resultsi['ident']);
1140 1140
 			if ($globalDebug) echo 'Add translation to table : '.$ident.' -> '.$resultsi['ident'].' ';
1141
-			if ($ident != $trans_ident) $Translation->addOperator($resultsi['ident'],$ident,'ACARS');
1142
-			elseif ($trans_ident == $ident) $Translation->updateOperator($resultsi['ident'],$ident,'ACARS');
1141
+			if ($ident != $trans_ident) $Translation->addOperator($resultsi['ident'], $ident, 'ACARS');
1142
+			elseif ($trans_ident == $ident) $Translation->updateOperator($resultsi['ident'], $ident, 'ACARS');
1143 1143
 		} else {
1144 1144
 			if ($registration != '' && $latitude != '' && $longitude != '') {
1145 1145
 				$query = "SELECT ModeS FROM aircraft_modes WHERE Registration = :registration LIMIT 1";
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 				try {
1148 1148
 					$sth = $this->db->prepare($query);
1149 1149
 					$sth->execute($query_values);
1150
-				} catch(PDOException $e) {
1150
+				} catch (PDOException $e) {
1151 1151
 					if ($globalDebug) echo $e->getMessage();
1152 1152
 					return "error : ".$e->getMessage();
1153 1153
 				}
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
 				$sth->closeCursor();
1156 1156
 				if (isset($result['modes'])) $hex = $result['modes'];
1157 1157
 				else $hex = '';
1158
-				$SI_data = array('hex' => $hex,'ident' => $ident,'aircraft_icao' => $ICAOTypeCode,'registration' => $registration,'latitude' => $latitude,'$longitude' => $longitude,'format_source' => 'ACARS');
1158
+				$SI_data = array('hex' => $hex, 'ident' => $ident, 'aircraft_icao' => $ICAOTypeCode, 'registration' => $registration, 'latitude' => $latitude, '$longitude' => $longitude, 'format_source' => 'ACARS');
1159 1159
 				$this->SI->add($SI_data);
1160 1160
 			}
1161 1161
 		}
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
 		try {
1166 1166
 			$sth = $this->db->prepare($query);
1167 1167
 			$sth->execute($query_values);
1168
-		} catch(PDOException $e) {
1168
+		} catch (PDOException $e) {
1169 1169
 			if ($globalDebug) echo $e->getMessage();
1170 1170
 			return "error : ".$e->getMessage();
1171 1171
 		}
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 			if (isset($result['ModeS'])) $ModeS = $result['ModeS'];
1176 1176
 			else $ModeS = '';
1177 1177
 			if ($ModeS == '') {
1178
-				$id = explode('-',$result['flightaware_id']);
1178
+				$id = explode('-', $result['flightaware_id']);
1179 1179
 				$ModeS = $id[0];
1180 1180
 			}
1181 1181
 			if ($ModeS != '') {
@@ -1185,20 +1185,20 @@  discard block
 block discarded – undo
1185 1185
 				try {
1186 1186
 					$sthc = $this->db->prepare($queryc);
1187 1187
 					$sthc->execute($queryc_values);
1188
-				} catch(PDOException $e) {
1188
+				} catch (PDOException $e) {
1189 1189
 					if ($globalDebug) echo $e->getMessage();
1190 1190
 					return "error : ".$e->getMessage();
1191 1191
 				}
1192 1192
 				$row = $sthc->fetch(PDO::FETCH_ASSOC);
1193 1193
 				$sthc->closeCursor();
1194
-				if (count($row) ==  0) {
1194
+				if (count($row) == 0) {
1195 1195
 					if ($globalDebug) echo " Add to ModeS table - ";
1196 1196
 					$queryi = "INSERT INTO aircraft_modes (ModeS,ModeSCountry,Registration,ICAOTypeCode,Source) VALUES (:ModeS,:ModeSCountry,:Registration, :ICAOTypeCode,'ACARS')";
1197
-					$queryi_values = array(':ModeS' => $ModeS,':ModeSCountry' => $country,':Registration' => $registration, ':ICAOTypeCode' => $ICAOTypeCode);
1197
+					$queryi_values = array(':ModeS' => $ModeS, ':ModeSCountry' => $country, ':Registration' => $registration, ':ICAOTypeCode' => $ICAOTypeCode);
1198 1198
 					try {
1199 1199
 						$sthi = $this->db->prepare($queryi);
1200 1200
 						$sthi->execute($queryi_values);
1201
-					} catch(PDOException $e) {
1201
+					} catch (PDOException $e) {
1202 1202
 						if ($globalDebug) echo $e->getMessage();
1203 1203
 						return "error : ".$e->getMessage();
1204 1204
 					}
@@ -1206,15 +1206,15 @@  discard block
 block discarded – undo
1206 1206
 					if ($globalDebug) echo " Update ModeS table - ";
1207 1207
 					if ($ICAOTypeCode != '') {
1208 1208
 						$queryi = "UPDATE aircraft_modes SET ModeSCountry = :ModeSCountry,Registration = :Registration,ICAOTypeCode = :ICAOTypeCode,Source = 'ACARS',LastModified = NOW() WHERE ModeS = :ModeS";
1209
-						$queryi_values = array(':ModeS' => $ModeS,':ModeSCountry' => $country,':Registration' => $registration, ':ICAOTypeCode' => $ICAOTypeCode);
1209
+						$queryi_values = array(':ModeS' => $ModeS, ':ModeSCountry' => $country, ':Registration' => $registration, ':ICAOTypeCode' => $ICAOTypeCode);
1210 1210
 					} else {
1211 1211
 						$queryi = "UPDATE aircraft_modes SET ModeSCountry = :ModeSCountry,Registration = :Registration,Source = 'ACARS',LastModified = NOW() WHERE ModeS = :ModeS";
1212
-						$queryi_values = array(':ModeS' => $ModeS,':ModeSCountry' => $country,':Registration' => $registration);
1212
+						$queryi_values = array(':ModeS' => $ModeS, ':ModeSCountry' => $country, ':Registration' => $registration);
1213 1213
 					}
1214 1214
 					try {
1215 1215
 						$sthi = $this->db->prepare($queryi);
1216 1216
 						$sthi->execute($queryi_values);
1217
-					} catch(PDOException $e) {
1217
+					} catch (PDOException $e) {
1218 1218
 						if ($globalDebug) echo $e->getMessage();
1219 1219
 						return "error : ".$e->getMessage();
1220 1220
 					}
@@ -1251,12 +1251,12 @@  discard block
 block discarded – undo
1251 1251
 					elseif ($globalDBdriver == 'pgsql') {
1252 1252
 						$queryi = "UPDATE spotter_output SET registration = :Registration WHERE ident = :ident AND date >= NOW() AT TIME ZONE 'UTC' - INTERVAL '1 HOUR'";
1253 1253
 					}
1254
-					$queryi_values = array(':Registration' => $registration,':ident' => $icao);
1254
+					$queryi_values = array(':Registration' => $registration, ':ident' => $icao);
1255 1255
 				}
1256 1256
 				try {
1257 1257
 					$sthi = $this->db->prepare($queryi);
1258 1258
 					$sthi->execute($queryi_values);
1259
-				} catch(PDOException $e) {
1259
+				} catch (PDOException $e) {
1260 1260
 					if ($globalDebug) echo $e->getMessage();
1261 1261
 					return "error : ".$e->getMessage();
1262 1262
 				}
Please login to merge, or discard this patch.