@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
10 | +$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | |
13 | 13 | if (isset($_GET['sort'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Routes from %s"),$country); |
|
21 | + $title = sprintf(_("Most Common Routes from %s"), $country); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="select-item">'; |
24 | 24 | print '<form action="'.$globalURL.'/country" method="post">'; |
25 | 25 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
26 | 26 | print '<option></option>'; |
27 | 27 | $all_countries = $Spotter->getAllCountries(); |
28 | - foreach($all_countries as $all_country) |
|
28 | + foreach ($all_countries as $all_country) |
|
29 | 29 | { |
30 | - if($country == $all_country['country']) |
|
30 | + if ($country == $all_country['country']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
33 | 33 | } else { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if ($_GET['country'] != "NA") |
43 | 43 | { |
44 | 44 | print '<div class="info column">'; |
45 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
45 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
46 | 46 | print '</div>'; |
47 | 47 | } else { |
48 | 48 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('country-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Routes").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows the most common routes of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows the most common routes of airports & airlines from <strong>%s</strong>."), $country).'</p>'; |
|
55 | 55 | $route_array = $Spotter->countAllRoutesByCountry($country); |
56 | 56 | if (!empty($route_array)) |
57 | 57 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | print '</thead>'; |
67 | 67 | print '<tbody>'; |
68 | 68 | $i = 1; |
69 | - foreach($route_array as $route_item) |
|
69 | + foreach ($route_array as $route_item) |
|
70 | 70 | { |
71 | 71 | print '<tr>'; |
72 | 72 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
10 | +$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | |
13 | 13 | if (isset($_GET['sort'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Arrival Airports by Country from %s"),$country); |
|
21 | + $title = sprintf(_("Most Common Arrival Airports by Country from %s"), $country); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="select-item">'; |
24 | 24 | print '<form action="'.$globalURL.'/country" method="post">'; |
25 | 25 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
26 | 26 | print '<option></option>'; |
27 | 27 | $all_countries = $Spotter->getAllCountries(); |
28 | - foreach($all_countries as $all_country) |
|
28 | + foreach ($all_countries as $all_country) |
|
29 | 29 | { |
30 | - if($country == $all_country['country']) |
|
30 | + if ($country == $all_country['country']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
33 | 33 | } else { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if ($_GET['country'] != "NA") |
43 | 43 | { |
44 | 44 | print '<div class="info column">'; |
45 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
45 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
46 | 46 | print '</div>'; |
47 | 47 | } else { |
48 | 48 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('country-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports & airlines from <strong>%s</strong>."), $country).'</p>'; |
|
55 | 55 | |
56 | 56 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country); |
57 | 57 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
62 | 62 | print 'var series = ['; |
63 | 63 | $country_data = ''; |
64 | - foreach($airport_country_array as $airport_item) |
|
64 | + foreach ($airport_country_array as $airport_item) |
|
65 | 65 | { |
66 | 66 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
67 | 67 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | print '</thead>'; |
110 | 110 | print '<tbody>'; |
111 | 111 | $i = 1; |
112 | - foreach($airport_country_array as $airport_item) |
|
112 | + foreach ($airport_country_array as $airport_item) |
|
113 | 113 | { |
114 | 114 | print '<tr>'; |
115 | 115 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING)); |
|
12 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
13 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING)); |
|
12 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
13 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
14 | 14 | $filter = array(); |
15 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
16 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter); |
|
15 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
16 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
17 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter); |
|
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Routes of %s"),$spotter_array[0]['aircraft_owner']); |
|
21 | + $title = sprintf(_("Most Common Routes of %s"), $spotter_array[0]['aircraft_owner']); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="info column">'; |
24 | 24 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>'; |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | include('owner-sub-menu.php'); |
30 | 30 | print '<div class="column">'; |
31 | 31 | print '<h2>'._("Most Common Routes").'</h2>'; |
32 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from flights owner by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; |
|
32 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from flights owner by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; |
|
33 | 33 | |
34 | - $route_array = $Spotter->countAllRoutesByOwner($owner,$filter); |
|
34 | + $route_array = $Spotter->countAllRoutesByOwner($owner, $filter); |
|
35 | 35 | if (!empty($route_array)) |
36 | 36 | { |
37 | 37 | print '<div class="table-responsive">'; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | print '</thead>'; |
47 | 47 | print '<tbody>'; |
48 | 48 | $i = 1; |
49 | - foreach($route_array as $route_item) |
|
49 | + foreach ($route_array as $route_item) |
|
50 | 50 | { |
51 | 51 | print '<tr>'; |
52 | 52 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | $currentdate = date('Y-m-d'); |
35 | 35 | $sourcestat = $Stats->getStatsSource($currentdate); |
36 | 36 | if (!empty($sourcestat)) { |
37 | - foreach($sourcestat as $srcst) { |
|
37 | + foreach ($sourcestat as $srcst) { |
|
38 | 38 | $type = $srcst['stats_type']; |
39 | 39 | if ($type == 'polar' || $type == 'hist') { |
40 | 40 | $source = $srcst['source_name']; |
41 | 41 | $data = $srcst['source_data']; |
42 | - $this->stats[$currentdate][$source][$type] = json_decode($data,true); |
|
42 | + $this->stats[$currentdate][$source][$type] = json_decode($data, true); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | if (isset($globalGeoid) && $globalGeoid) { |
52 | 52 | try { |
53 | 53 | $GeoidClass = new GeoidHeight(); |
54 | - } catch(Exception $e) { |
|
54 | + } catch (Exception $e) { |
|
55 | 55 | if ($globalDebug) echo "Can't calculate geoid, check that you downloaded it via update_db.php (".$e.")\n"; |
56 | 56 | $GeoidClass = FALSE; |
57 | 57 | } |
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | - public function get_Schedule($id,$ident) { |
|
61 | + public function get_Schedule($id, $ident) { |
|
62 | 62 | global $globalDebug, $globalFork, $globalSchedulesFetch; |
63 | 63 | // Get schedule here, so it's done only one time |
64 | 64 | |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | $schedule = $Schedule->fetchSchedule($operator); |
84 | 84 | if (count($schedule) > 0 && isset($schedule['DepartureTime']) && isset($schedule['ArrivalTime'])) { |
85 | 85 | if ($globalDebug) echo "-> Schedule info for ".$operator." (".$ident.")\n"; |
86 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('departure_airport_time' => $schedule['DepartureTime'])); |
|
87 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('arrival_airport_time' => $schedule['ArrivalTime'])); |
|
86 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('departure_airport_time' => $schedule['DepartureTime'])); |
|
87 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('arrival_airport_time' => $schedule['ArrivalTime'])); |
|
88 | 88 | // Should also check if route schedule = route from DB |
89 | 89 | if ($schedule['DepartureAirportIATA'] != '') { |
90 | 90 | if ($this->all_flights[$id]['departure_airport'] != $Spotter->getAirportIcao($schedule['DepartureAirportIATA'])) { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | } |
106 | 106 | } |
107 | - $Schedule->addSchedule($operator,$this->all_flights[$id]['departure_airport'],$this->all_flights[$id]['departure_airport_time'],$this->all_flights[$id]['arrival_airport'],$this->all_flights[$id]['arrival_airport_time'],$schedule['Source']); |
|
107 | + $Schedule->addSchedule($operator, $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['arrival_airport_time'], $schedule['Source']); |
|
108 | 108 | } |
109 | 109 | } else $scheduleexist = true; |
110 | 110 | } else $scheduleexist = true; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if ($scheduleexist) { |
113 | 113 | if ($globalDebug) echo "-> get arrival/departure airport info for ".$ident."\n"; |
114 | 114 | $sch = $Schedule->getSchedule($operator); |
115 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('arrival_airport' => $sch['arrival_airport_icao'],'departure_airport' => $sch['departure_airport_icao'],'departure_airport_time' => $sch['departure_airport_time'],'arrival_airport_time' => $sch['arrival_airport_time'])); |
|
115 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('arrival_airport' => $sch['arrival_airport_icao'], 'departure_airport' => $sch['departure_airport_icao'], 'departure_airport_time' => $sch['departure_airport_time'], 'arrival_airport_time' => $sch['arrival_airport_time'])); |
|
116 | 116 | } |
117 | 117 | $Spotter->db = null; |
118 | 118 | $Schedule->db = null; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | //echo $this->all_flights[$key]['id'].' - '.$this->all_flights[$key]['latitude'].' '.$this->all_flights[$key]['longitude']."\n"; |
140 | 140 | $Spotter = new Spotter($this->db); |
141 | 141 | $real_arrival = $this->arrival($key); |
142 | - if (isset($this->all_flights[$key]['altitude']) && isset($this->all_flights[$key]['datetime'])) $Spotter->updateLatestSpotterData($this->all_flights[$key]['id'],$this->all_flights[$key]['ident'],$this->all_flights[$key]['latitude'],$this->all_flights[$key]['longitude'],$this->all_flights[$key]['altitude'],$this->all_flights[$key]['ground'],$this->all_flights[$key]['speed'],$this->all_flights[$key]['datetime'],$real_arrival['airport_icao'],$real_arrival['airport_time']); |
|
142 | + if (isset($this->all_flights[$key]['altitude']) && isset($this->all_flights[$key]['datetime'])) $Spotter->updateLatestSpotterData($this->all_flights[$key]['id'], $this->all_flights[$key]['ident'], $this->all_flights[$key]['latitude'], $this->all_flights[$key]['longitude'], $this->all_flights[$key]['altitude'], $this->all_flights[$key]['ground'], $this->all_flights[$key]['speed'], $this->all_flights[$key]['datetime'], $real_arrival['airport_icao'], $real_arrival['airport_time']); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $airport_time = ''; |
154 | 154 | if (!isset($globalClosestMinDist) || $globalClosestMinDist == '') $globalClosestMinDist = 50; |
155 | 155 | if ($this->all_flights[$key]['latitude'] != '' && $this->all_flights[$key]['longitude'] != '') { |
156 | - $closestAirports = $Spotter->closestAirports($this->all_flights[$key]['latitude'],$this->all_flights[$key]['longitude'],$globalClosestMinDist); |
|
156 | + $closestAirports = $Spotter->closestAirports($this->all_flights[$key]['latitude'], $this->all_flights[$key]['longitude'], $globalClosestMinDist); |
|
157 | 157 | if (isset($closestAirports[0])) { |
158 | 158 | if (isset($this->all_flights[$key]['arrival_airport']) && $this->all_flights[$key]['arrival_airport'] == $closestAirports[0]['icao']) { |
159 | 159 | $airport_icao = $closestAirports[0]['icao']; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | break; |
169 | 169 | } |
170 | 170 | } |
171 | - } elseif ($this->all_flights[$key]['altitude'] == 0 || ($this->all_flights[$key]['altitude_real'] != '' && ($closestAirports[0]['altitude'] < $this->all_flights[$key]['altitude_real'] && $this->all_flights[$key]['altitude_real'] < $closestAirports[0]['altitude']+5000))) { |
|
171 | + } elseif ($this->all_flights[$key]['altitude'] == 0 || ($this->all_flights[$key]['altitude_real'] != '' && ($closestAirports[0]['altitude'] < $this->all_flights[$key]['altitude_real'] && $this->all_flights[$key]['altitude_real'] < $closestAirports[0]['altitude'] + 5000))) { |
|
172 | 172 | $airport_icao = $closestAirports[0]['icao']; |
173 | 173 | $airport_time = $this->all_flights[$key]['datetime']; |
174 | 174 | } else { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } else { |
182 | 182 | if ($globalDebug) echo "---- No latitude or longitude. Ident : ".$this->all_flights[$key]['ident']."\n"; |
183 | 183 | } |
184 | - return array('airport_icao' => $airport_icao,'airport_time' => $airport_time); |
|
184 | + return array('airport_icao' => $airport_icao, 'airport_time' => $airport_time); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if ($globalDebug) echo 'Delete old values and update latest data...'."\n"; |
193 | 193 | foreach ($this->all_flights as $key => $flight) { |
194 | 194 | if (isset($flight['lastupdate'])) { |
195 | - if ($flight['lastupdate'] < (time()-5900)) { |
|
195 | + if ($flight['lastupdate'] < (time() - 5900)) { |
|
196 | 196 | $this->delKey($key); |
197 | 197 | } |
198 | 198 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $real_arrival = $this->arrival($key); |
209 | 209 | $Spotter = new Spotter($this->db); |
210 | 210 | if ($this->all_flights[$key]['latitude'] != '' && $this->all_flights[$key]['longitude'] != '') { |
211 | - $result = $Spotter->updateLatestSpotterData($this->all_flights[$key]['id'],$this->all_flights[$key]['ident'],$this->all_flights[$key]['latitude'],$this->all_flights[$key]['longitude'],$this->all_flights[$key]['altitude'],$this->all_flights[$key]['ground'],$this->all_flights[$key]['speed'],$this->all_flights[$key]['datetime'],$real_arrival['airport_icao'],$real_arrival['airport_time']); |
|
211 | + $result = $Spotter->updateLatestSpotterData($this->all_flights[$key]['id'], $this->all_flights[$key]['ident'], $this->all_flights[$key]['latitude'], $this->all_flights[$key]['longitude'], $this->all_flights[$key]['altitude'], $this->all_flights[$key]['ground'], $this->all_flights[$key]['speed'], $this->all_flights[$key]['datetime'], $real_arrival['airport_icao'], $real_arrival['airport_time']); |
|
212 | 212 | if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
213 | 213 | } |
214 | 214 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $send = false; |
242 | 242 | |
243 | 243 | // SBS format is CSV format |
244 | - if(is_array($line) && (isset($line['hex']) || isset($line['id']))) { |
|
244 | + if (is_array($line) && (isset($line['hex']) || isset($line['id']))) { |
|
245 | 245 | //print_r($line); |
246 | 246 | if (isset($line['hex'])) $line['hex'] = strtoupper($line['hex']); |
247 | 247 | if (isset($line['id']) || (isset($line['hex']) && $line['hex'] != '' && $line['hex'] != '00000' && $line['hex'] != '000000' && $line['hex'] != '111111' && ctype_xdigit($line['hex']) && strlen($line['hex']) === 6)) { |
@@ -277,25 +277,25 @@ discard block |
||
277 | 277 | if (!isset($this->all_flights[$id])) { |
278 | 278 | if ($globalDebug) echo 'New flight...'."\n"; |
279 | 279 | $this->all_flights[$id] = array(); |
280 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('addedSpotter' => 0)); |
|
281 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('ident' => '','departure_airport' => '', 'arrival_airport' => '','latitude' => '', 'longitude' => '', 'speed' => '', 'altitude' => '','altitude_real' => '','altitude_previous' => '', 'heading' => '','departure_airport_time' => '','arrival_airport_time' => '','squawk' => '','route_stop' => '','registration' => '','pilot_id' => '','pilot_name' => '','waypoints' => '','ground' => '0', 'format_source' => '','source_name' => '','over_country' => '','verticalrate' => '','noarchive' => false,'putinarchive' => true,'source_type' => '')); |
|
282 | - if (isset($globalDaemon) && $globalDaemon === FALSE) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('lastupdate' => time())); |
|
280 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('addedSpotter' => 0)); |
|
281 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('ident' => '', 'departure_airport' => '', 'arrival_airport' => '', 'latitude' => '', 'longitude' => '', 'speed' => '', 'altitude' => '', 'altitude_real' => '', 'altitude_previous' => '', 'heading' => '', 'departure_airport_time' => '', 'arrival_airport_time' => '', 'squawk' => '', 'route_stop' => '', 'registration' => '', 'pilot_id' => '', 'pilot_name' => '', 'waypoints' => '', 'ground' => '0', 'format_source' => '', 'source_name' => '', 'over_country' => '', 'verticalrate' => '', 'noarchive' => false, 'putinarchive' => true, 'source_type' => '')); |
|
282 | + if (isset($globalDaemon) && $globalDaemon === FALSE) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('lastupdate' => time())); |
|
283 | 283 | if (!isset($line['id'])) { |
284 | 284 | if (!isset($globalDaemon)) $globalDaemon = TRUE; |
285 | 285 | // if (isset($line['format_source']) && ($line['format_source'] == 'sbs' || $line['format_source'] == 'tsv' || $line['format_source'] == 'raw') && $globalDaemon) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'].'-'.date('YmdGi'))); |
286 | 286 | // if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs') && $globalDaemon) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.date('YmdHi'))); |
287 | - if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $id.'-'.date('YmdHi'))); |
|
287 | + if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $id.'-'.date('YmdHi'))); |
|
288 | 288 | //else $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
289 | - } else $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $line['id'])); |
|
289 | + } else $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $line['id'])); |
|
290 | 290 | if ($globalAllFlights !== FALSE) $dataFound = true; |
291 | 291 | } |
292 | 292 | if (isset($line['source_type']) && $line['source_type'] != '') { |
293 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('source_type' => $line['source_type'])); |
|
293 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('source_type' => $line['source_type'])); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | //print_r($this->all_flights); |
297 | 297 | if (isset($line['hex']) && !isset($this->all_flights[$id]['hex']) && ctype_xdigit($line['hex'])) { |
298 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('hex' => trim($line['hex']))); |
|
298 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('hex' => trim($line['hex']))); |
|
299 | 299 | //if (isset($line['datetime']) && preg_match('/^(\d{4}(?:\-\d{2}){2} \d{2}(?:\:\d{2}){2})$/',$line['datetime'])) { |
300 | 300 | //$this->all_flights[$id] = array_merge($this->all_flights[$id],array('datetime' => $line['datetime'])); |
301 | 301 | //} else $this->all_flights[$id] = array_merge($this->all_flights[$id],array('datetime' => date('Y-m-d H:i:s'))); |
@@ -304,20 +304,20 @@ discard block |
||
304 | 304 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
305 | 305 | $Spotter = new Spotter($this->db); |
306 | 306 | if (isset($this->all_flights[$id]['source_type'])) { |
307 | - $aircraft_icao = $Spotter->getAllAircraftType(trim($line['hex']),$this->all_flights[$id]['source_type']); |
|
307 | + $aircraft_icao = $Spotter->getAllAircraftType(trim($line['hex']), $this->all_flights[$id]['source_type']); |
|
308 | 308 | } else { |
309 | 309 | $aircraft_icao = $Spotter->getAllAircraftType(trim($line['hex'])); |
310 | 310 | } |
311 | 311 | $Spotter->db = null; |
312 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update getallaircrattype : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
313 | - if ($aircraft_icao != '') $this->all_flights[$id] = array_merge($this->all_flights[$id],array('aircraft_icao' => $aircraft_icao)); |
|
312 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update getallaircrattype : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
313 | + if ($aircraft_icao != '') $this->all_flights[$id] = array_merge($this->all_flights[$id], array('aircraft_icao' => $aircraft_icao)); |
|
314 | 314 | } |
315 | 315 | } |
316 | 316 | if ($globalAllFlights !== FALSE) $dataFound = true; |
317 | 317 | if ($globalDebug) echo "*********** New aircraft hex : ".$line['hex']." ***********\n"; |
318 | 318 | } |
319 | 319 | if (isset($line['id']) && !isset($line['hex'])) { |
320 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('hex' => '')); |
|
320 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('hex' => '')); |
|
321 | 321 | } |
322 | 322 | if (isset($line['aircraft_icao']) && $line['aircraft_icao'] != '') { |
323 | 323 | $icao = $line['aircraft_icao']; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | if (isset($Spotter->aircraft_correct_icaotype[$icao])) $icao = $Spotter->aircraft_correct_icaotype[$icao]; |
327 | 327 | $Spotter->db = null; |
328 | 328 | } |
329 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('aircraft_icao' => $icao)); |
|
329 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('aircraft_icao' => $icao)); |
|
330 | 330 | } |
331 | 331 | if (!isset($this->all_flights[$id]['aircraft_icao']) && isset($line['aircraft_name'])) { |
332 | 332 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | $Spotter = new Spotter($this->db); |
335 | 335 | $aircraft_icao = $Spotter->getAircraftIcao($line['aircraft_name']); |
336 | 336 | $Spotter->db = null; |
337 | - if ($aircraft_icao != '') $this->all_flights[$id] = array_merge($this->all_flights[$id],array('aircraft_icao' => $aircraft_icao)); |
|
337 | + if ($aircraft_icao != '') $this->all_flights[$id] = array_merge($this->all_flights[$id], array('aircraft_icao' => $aircraft_icao)); |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | if (!isset($this->all_flights[$id]['aircraft_icao']) && isset($line['aircraft_type'])) { |
@@ -342,15 +342,15 @@ discard block |
||
342 | 342 | elseif ($line['aircraft_type'] == 'HELICOPTER_ROTORCRAFT') $aircraft_icao = 'UHEL'; |
343 | 343 | elseif ($line['aircraft_type'] == 'TOW_PLANE') $aircraft_icao = 'TOWPLANE'; |
344 | 344 | elseif ($line['aircraft_type'] == 'POWERED_AIRCRAFT') $aircraft_icao = 'POWAIRC'; |
345 | - if (isset($aircraft_icao)) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('aircraft_icao' => $aircraft_icao)); |
|
345 | + if (isset($aircraft_icao)) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('aircraft_icao' => $aircraft_icao)); |
|
346 | 346 | } |
347 | 347 | if (!isset($this->all_flights[$id]['aircraft_icao'])) { |
348 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('aircraft_icao' => 'NA')); |
|
348 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('aircraft_icao' => 'NA')); |
|
349 | 349 | } |
350 | 350 | //if (isset($line['datetime']) && preg_match('/^(\d{4}(?:\-\d{2}){2} \d{2}(?:\:\d{2}){2})$/',$line['datetime'])) { |
351 | - if (isset($line['datetime']) && strtotime($line['datetime']) > time()-20*60 && strtotime($line['datetime']) < time()+20*60) { |
|
351 | + if (isset($line['datetime']) && strtotime($line['datetime']) > time() - 20*60 && strtotime($line['datetime']) < time() + 20*60) { |
|
352 | 352 | if (!isset($this->all_flights[$id]['datetime']) || strtotime($line['datetime']) >= strtotime($this->all_flights[$id]['datetime'])) { |
353 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('datetime' => $line['datetime'])); |
|
353 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('datetime' => $line['datetime'])); |
|
354 | 354 | } else { |
355 | 355 | if (strtotime($line['datetime']) == strtotime($this->all_flights[$id]['datetime']) && $globalDebug) echo "!!! Date is the same as previous data for ".$this->all_flights[$id]['hex']." - format : ".$line['format_source']."\n"; |
356 | 356 | elseif (strtotime($line['datetime']) > strtotime($this->all_flights[$id]['datetime']) && $globalDebug) echo "!!! Date previous latest data (".$line['datetime']." > ".$this->all_flights[$id]['datetime'].") !!! for ".$this->all_flights[$id]['hex']." - format : ".$line['format_source']."\n"; |
@@ -361,31 +361,31 @@ discard block |
||
361 | 361 | */ |
362 | 362 | return ''; |
363 | 363 | } |
364 | - } elseif (isset($line['datetime']) && strtotime($line['datetime']) < time()-20*60) { |
|
364 | + } elseif (isset($line['datetime']) && strtotime($line['datetime']) < time() - 20*60) { |
|
365 | 365 | if ($globalDebug) echo "!!! Date is too old ".$line['datetime']." for ".$this->all_flights[$id]['hex']." - format : ".$line['format_source']."!!!\n"; |
366 | 366 | return ''; |
367 | - } elseif (isset($line['datetime']) && strtotime($line['datetime']) > time()+20*60) { |
|
367 | + } elseif (isset($line['datetime']) && strtotime($line['datetime']) > time() + 20*60) { |
|
368 | 368 | if ($globalDebug) echo "!!! Date is in the future ".$line['datetime']." for ".$this->all_flights[$id]['hex']." - format : ".$line['format_source']."!!!\n"; |
369 | 369 | return ''; |
370 | 370 | } elseif (!isset($line['datetime'])) { |
371 | 371 | date_default_timezone_set('UTC'); |
372 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('datetime' => date('Y-m-d H:i:s'))); |
|
372 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('datetime' => date('Y-m-d H:i:s'))); |
|
373 | 373 | } else { |
374 | 374 | if ($globalDebug) echo "!!! Unknow date error ".$this->all_flights[$id]['hex']." - format : ".$line['format_source']."!!!"; |
375 | 375 | return ''; |
376 | 376 | } |
377 | 377 | |
378 | 378 | if (isset($line['registration']) && $line['registration'] != '' && $line['registration'] != 'z.NO-REG' && $line['registration'] != 'NA') { |
379 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('registration' => $line['registration'])); |
|
379 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('registration' => $line['registration'])); |
|
380 | 380 | } |
381 | 381 | if (isset($line['waypoints']) && $line['waypoints'] != '') { |
382 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('waypoints' => $line['waypoints'])); |
|
382 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('waypoints' => $line['waypoints'])); |
|
383 | 383 | } |
384 | 384 | if (isset($line['pilot_id']) && $line['pilot_id'] != '') { |
385 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('pilot_id' => trim($line['pilot_id']))); |
|
385 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('pilot_id' => trim($line['pilot_id']))); |
|
386 | 386 | } |
387 | 387 | if (isset($line['pilot_name']) && $line['pilot_name'] != '') { |
388 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('pilot_name' => trim($line['pilot_name']))); |
|
388 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('pilot_name' => trim($line['pilot_name']))); |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | if (isset($line['ident']) && $line['ident'] != '' && $line['ident'] != '????????' && $line['ident'] != '00000000' && ($this->all_flights[$id]['ident'] != trim($line['ident'])) && preg_match('/^[a-zA-Z0-9]+$/', $line['ident'])) { |
@@ -393,13 +393,13 @@ discard block |
||
393 | 393 | if ($this->all_flights[$id]['addedSpotter'] == 1) { |
394 | 394 | if ($globalVA !== TRUE && $globalIVAO !== TRUE && $globalVATSIM !== TRUE && $globalphpVMS !== TRUE && $globalVAM !== TRUE && $this->all_flights[$id]['lastupdate'] < time() - 1600) { |
395 | 395 | if ($globalDebug) echo '---!!!! New ident, reset aircraft data...'."\n"; |
396 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('addedSpotter' => 0)); |
|
397 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('forcenew' => 1)); |
|
398 | - if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $id.'-'.date('YmdHi'))); |
|
399 | - elseif (isset($line['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $line['id'])); |
|
400 | - elseif (isset($this->all_flights[$id]['ident'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
|
396 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('addedSpotter' => 0)); |
|
397 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('forcenew' => 1)); |
|
398 | + if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $id.'-'.date('YmdHi'))); |
|
399 | + elseif (isset($line['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $line['id'])); |
|
400 | + elseif (isset($this->all_flights[$id]['ident'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
|
401 | 401 | } else { |
402 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('ident' => trim($line['ident']))); |
|
402 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('ident' => trim($line['ident']))); |
|
403 | 403 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
404 | 404 | $timeelapsed = microtime(true); |
405 | 405 | $Spotter = new Spotter($this->db); |
@@ -409,13 +409,13 @@ discard block |
||
409 | 409 | elseif (isset($line['format_source']) && $line['format_source'] == 'whazzup') $fromsource = 'ivao'; |
410 | 410 | elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
411 | 411 | elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
412 | - $result = $Spotter->updateIdentSpotterData($this->all_flights[$id]['id'],$this->all_flights[$id]['ident'],$fromsource); |
|
412 | + $result = $Spotter->updateIdentSpotterData($this->all_flights[$id]['id'], $this->all_flights[$id]['ident'], $fromsource); |
|
413 | 413 | if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
414 | 414 | $Spotter->db = null; |
415 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update identspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
415 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update identspotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
416 | 416 | } |
417 | 417 | } |
418 | - } else $this->all_flights[$id] = array_merge($this->all_flights[$id],array('ident' => trim($line['ident']))); |
|
418 | + } else $this->all_flights[$id] = array_merge($this->all_flights[$id], array('ident' => trim($line['ident']))); |
|
419 | 419 | |
420 | 420 | /* |
421 | 421 | if (!isset($line['id'])) { |
@@ -425,25 +425,25 @@ discard block |
||
425 | 425 | else $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
426 | 426 | } else $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $line['id'])); |
427 | 427 | */ |
428 | - if (!isset($this->all_flights[$id]['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
|
428 | + if (!isset($this->all_flights[$id]['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
|
429 | 429 | |
430 | 430 | //$putinarchive = true; |
431 | 431 | if (isset($line['departure_airport_time']) && $line['departure_airport_time'] != 0) { |
432 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('departure_airport_time' => $line['departure_airport_time'])); |
|
432 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('departure_airport_time' => $line['departure_airport_time'])); |
|
433 | 433 | } |
434 | 434 | if (isset($line['arrival_airport_time']) && $line['arrival_airport_time'] != 0) { |
435 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('arrival_airport_time' => $line['arrival_airport_time'])); |
|
435 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('arrival_airport_time' => $line['arrival_airport_time'])); |
|
436 | 436 | } |
437 | 437 | if (isset($line['departure_airport_icao']) && isset($line['arrival_airport_icao'])) { |
438 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('departure_airport' => $line['departure_airport_icao'],'arrival_airport' => $line['arrival_airport_icao'],'route_stop' => '')); |
|
438 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('departure_airport' => $line['departure_airport_icao'], 'arrival_airport' => $line['arrival_airport_icao'], 'route_stop' => '')); |
|
439 | 439 | } elseif (isset($line['departure_airport_iata']) && isset($line['arrival_airport_iata'])) { |
440 | 440 | $timeelapsed = microtime(true); |
441 | 441 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
442 | 442 | $Spotter = new Spotter($this->db); |
443 | 443 | $line['departure_airport_icao'] = $Spotter->getAirportIcao($line['departure_airport_iata']); |
444 | 444 | $line['arrival_airport_icao'] = $Spotter->getAirportIcao($line['arrival_airport_iata']); |
445 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('departure_airport' => $line['departure_airport_icao'],'arrival_airport' => $line['arrival_airport_icao'],'route_stop' => '')); |
|
446 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update getAirportICAO : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
445 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('departure_airport' => $line['departure_airport_icao'], 'arrival_airport' => $line['arrival_airport_icao'], 'route_stop' => '')); |
|
446 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update getAirportICAO : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
447 | 447 | } |
448 | 448 | } elseif (!isset($line['format_source']) || $line['format_source'] != 'aprs') { |
449 | 449 | $timeelapsed = microtime(true); |
@@ -457,35 +457,35 @@ discard block |
||
457 | 457 | $Translation->db = null; |
458 | 458 | } |
459 | 459 | $Spotter->db = null; |
460 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update getrouteinfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
460 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update getrouteinfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
461 | 461 | } |
462 | 462 | if (isset($route['fromairport_icao']) && isset($route['toairport_icao'])) { |
463 | 463 | //if ($route['FromAirport_ICAO'] != $route['ToAirport_ICAO']) { |
464 | 464 | if ($route['fromairport_icao'] != $route['toairport_icao']) { |
465 | 465 | // $this->all_flights[$id] = array_merge($this->all_flights[$id],array('departure_airport' => $route['FromAirport_ICAO'],'arrival_airport' => $route['ToAirport_ICAO'],'route_stop' => $route['RouteStop'])); |
466 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('departure_airport' => $route['fromairport_icao'],'arrival_airport' => $route['toairport_icao'],'route_stop' => $route['routestop'])); |
|
466 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('departure_airport' => $route['fromairport_icao'], 'arrival_airport' => $route['toairport_icao'], 'route_stop' => $route['routestop'])); |
|
467 | 467 | } |
468 | 468 | } |
469 | 469 | if (!isset($globalFork)) $globalFork = TRUE; |
470 | 470 | if (!$globalVA && !$globalIVAO && !$globalVATSIM && !$globalphpVMS && !$globalVAM && (!isset($line['format_source']) || $line['format_source'] != 'aprs')) { |
471 | - if (!isset($this->all_flights[$id]['schedule_check']) || $this->all_flights[$id]['schedule_check'] === false) $this->get_Schedule($id,trim($line['ident'])); |
|
471 | + if (!isset($this->all_flights[$id]['schedule_check']) || $this->all_flights[$id]['schedule_check'] === false) $this->get_Schedule($id, trim($line['ident'])); |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | } |
475 | 475 | |
476 | 476 | if (isset($line['speed']) && $line['speed'] != '' && $line['speed'] != 0) { |
477 | 477 | // $this->all_flights[$id] = array_merge($this->all_flights[$id],array('speed' => $line[12])); |
478 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('speed' => round($line['speed']))); |
|
479 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('speed_fromsrc' => true)); |
|
478 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('speed' => round($line['speed']))); |
|
479 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('speed_fromsrc' => true)); |
|
480 | 480 | //$dataFound = true; |
481 | 481 | } else if (!isset($this->all_flights[$id]['speed_fromsrc']) && isset($this->all_flights[$id]['time_last_coord']) && $this->all_flights[$id]['time_last_coord'] != time() && isset($line['latitude']) && isset($line['longitude'])) { |
482 | - $distance = $Common->distance($line['latitude'],$line['longitude'],$this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],'m'); |
|
482 | + $distance = $Common->distance($line['latitude'], $line['longitude'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], 'm'); |
|
483 | 483 | if ($distance > 1000 && $distance < 10000) { |
484 | 484 | // use datetime |
485 | 485 | $speed = $distance/(time() - $this->all_flights[$id]['time_last_coord']); |
486 | 486 | $speed = $speed*3.6; |
487 | 487 | if ($speed < 1000) { |
488 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('speed' => round($speed))); |
|
488 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('speed' => round($speed))); |
|
489 | 489 | if ($globalDebug) echo "ø Calculated Speed for ".$this->all_flights[$id]['hex']." : ".round($speed)." - distance : ".$distance."\n"; |
490 | 490 | } else { |
491 | 491 | if ($globalDebug) echo "ø IGNORED : Calculated Speed for ".$this->all_flights[$id]['hex']." : ".round($speed)." - distance : ".$distance."\n"; |
@@ -500,9 +500,9 @@ discard block |
||
500 | 500 | if ($globalDebug) echo "/!\ Invalid latitude or/and longitude data : lat: ".$line['latitude']." - lng: ".$line['longitude']."\n"; |
501 | 501 | return false; |
502 | 502 | } |
503 | - if (isset($this->all_flights[$id]['time_last_coord'])) $timediff = round(time()-$this->all_flights[$id]['time_last_coord']); |
|
503 | + if (isset($this->all_flights[$id]['time_last_coord'])) $timediff = round(time() - $this->all_flights[$id]['time_last_coord']); |
|
504 | 504 | else unset($timediff); |
505 | - if (isset($this->all_flights[$id]['time_last_archive_coord'])) $timediff_archive = round(time()-$this->all_flights[$id]['time_last_archive_coord']); |
|
505 | + if (isset($this->all_flights[$id]['time_last_archive_coord'])) $timediff_archive = round(time() - $this->all_flights[$id]['time_last_archive_coord']); |
|
506 | 506 | else unset($timediff_archive); |
507 | 507 | if ($this->tmd > 5 |
508 | 508 | || (isset($line['format_source']) |
@@ -526,14 +526,14 @@ discard block |
||
526 | 526 | || ($timediff > 30 |
527 | 527 | && isset($this->all_flights[$id]['latitude']) |
528 | 528 | && isset($this->all_flights[$id]['longitude']) |
529 | - && $Common->withinThreshold($timediff,$Common->distance($line['latitude'],$line['longitude'],$this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],'m')) |
|
529 | + && $Common->withinThreshold($timediff, $Common->distance($line['latitude'], $line['longitude'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], 'm')) |
|
530 | 530 | ) |
531 | 531 | ) { |
532 | 532 | |
533 | 533 | if ((isset($timediff) && !isset($timediff_archive)) || (isset($this->all_flights[$id]['archive_latitude']) && isset($this->all_flights[$id]['archive_longitude']) && isset($this->all_flights[$id]['livedb_latitude']) && isset($this->all_flights[$id]['livedb_longitude']))) { |
534 | 534 | if ((isset($timediff_archive) && $timediff_archive > $globalAircraftMaxUpdate) |
535 | 535 | || (isset($line['format_source']) && $line['format_source'] == 'airwhere') |
536 | - || !$Common->checkLine($this->all_flights[$id]['archive_latitude'],$this->all_flights[$id]['archive_longitude'],$this->all_flights[$id]['livedb_latitude'],$this->all_flights[$id]['livedb_longitude'],$line['latitude'],$line['longitude'])) { |
|
536 | + || !$Common->checkLine($this->all_flights[$id]['archive_latitude'], $this->all_flights[$id]['archive_longitude'], $this->all_flights[$id]['livedb_latitude'], $this->all_flights[$id]['livedb_longitude'], $line['latitude'], $line['longitude'])) { |
|
537 | 537 | $this->all_flights[$id]['archive_latitude'] = $line['latitude']; |
538 | 538 | $this->all_flights[$id]['archive_longitude'] = $line['longitude']; |
539 | 539 | $this->all_flights[$id]['putinarchive'] = true; |
@@ -543,11 +543,11 @@ discard block |
||
543 | 543 | $timeelapsed = microtime(true); |
544 | 544 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
545 | 545 | $Spotter = new Spotter($this->db); |
546 | - $all_country = $Spotter->getCountryFromLatitudeLongitude($line['latitude'],$line['longitude']); |
|
546 | + $all_country = $Spotter->getCountryFromLatitudeLongitude($line['latitude'], $line['longitude']); |
|
547 | 547 | if (!empty($all_country)) $this->all_flights[$id]['over_country'] = $all_country['iso2']; |
548 | 548 | else $this->all_flights[$id]['over_country'] = ''; |
549 | 549 | $Spotter->db = null; |
550 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
550 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
551 | 551 | if ($globalDebug) echo 'FOUND : '.$this->all_flights[$id]['over_country'].' ---------------'."\n"; |
552 | 552 | } |
553 | 553 | } |
@@ -573,13 +573,13 @@ discard block |
||
573 | 573 | $this->all_flights[$id]['time_last_coord'] = time(); |
574 | 574 | } |
575 | 575 | //if (!isset($this->all_flights[$id]['livedb_latitude']) || abs($this->all_flights[$id]['livedb_latitude']-$line['latitude']) > $globalCoordMinChange || $this->all_flights[$id]['format_source'] == 'aprs' || ($this->all_flights[$id]['format_source'] == 'airwhere' && abs($this->all_flights[$id]['livedb_latitude']-$line['latitude']) > 0.0001)) { |
576 | - if (!isset($this->all_flights[$id]['livedb_latitude']) || abs($this->all_flights[$id]['livedb_latitude']-$line['latitude']) > $globalCoordMinChange || ($this->all_flights[$id]['format_source'] == 'airwhere' && abs($this->all_flights[$id]['livedb_latitude']-$line['latitude']) > 0.0001)) { |
|
576 | + if (!isset($this->all_flights[$id]['livedb_latitude']) || abs($this->all_flights[$id]['livedb_latitude'] - $line['latitude']) > $globalCoordMinChange || ($this->all_flights[$id]['format_source'] == 'airwhere' && abs($this->all_flights[$id]['livedb_latitude'] - $line['latitude']) > 0.0001)) { |
|
577 | 577 | $this->all_flights[$id]['livedb_latitude'] = $line['latitude']; |
578 | 578 | $dataFound = true; |
579 | 579 | $this->all_flights[$id]['time_last_coord'] = time(); |
580 | 580 | } |
581 | 581 | // elseif ($globalDebug) echo '!*!*! Ignore data, too close to previous one'."\n"; |
582 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('latitude' => $line['latitude'])); |
|
582 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('latitude' => $line['latitude'])); |
|
583 | 583 | /* |
584 | 584 | if (abs($this->all_flights[$id]['archive_latitude']-$this->all_flights[$id]['latitude']) > 0.3) { |
585 | 585 | $this->all_flights[$id]['archive_latitude'] = $line['latitude']; |
@@ -601,13 +601,13 @@ discard block |
||
601 | 601 | $this->all_flights[$id]['time_last_coord'] = time(); |
602 | 602 | } |
603 | 603 | //if (!isset($this->all_flights[$id]['livedb_longitude']) || abs($this->all_flights[$id]['livedb_longitude']-$line['longitude']) > $globalCoordMinChange || $this->all_flights[$id]['format_source'] == 'aprs' || ($this->all_flights[$id]['format_source'] == 'airwhere' && abs($this->all_flights[$id]['livedb_longitude']-$line['longitude']) > 0.0001)) { |
604 | - if (!isset($this->all_flights[$id]['livedb_longitude']) || abs($this->all_flights[$id]['livedb_longitude']-$line['longitude']) > $globalCoordMinChange || ($this->all_flights[$id]['format_source'] == 'airwhere' && abs($this->all_flights[$id]['livedb_longitude']-$line['longitude']) > 0.0001)) { |
|
604 | + if (!isset($this->all_flights[$id]['livedb_longitude']) || abs($this->all_flights[$id]['livedb_longitude'] - $line['longitude']) > $globalCoordMinChange || ($this->all_flights[$id]['format_source'] == 'airwhere' && abs($this->all_flights[$id]['livedb_longitude'] - $line['longitude']) > 0.0001)) { |
|
605 | 605 | $this->all_flights[$id]['livedb_longitude'] = $line['longitude']; |
606 | 606 | $dataFound = true; |
607 | 607 | $this->all_flights[$id]['time_last_coord'] = time(); |
608 | 608 | } |
609 | 609 | // elseif ($globalDebug) echo '!*!*! Ignore data, too close to previous one'."\n"; |
610 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('longitude' => $line['longitude'])); |
|
610 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('longitude' => $line['longitude'])); |
|
611 | 611 | /* |
612 | 612 | if (abs($this->all_flights[$id]['archive_longitude']-$this->all_flights[$id]['longitude']) > 0.3) { |
613 | 613 | $this->all_flights[$id]['archive_longitude'] = $line['longitude']; |
@@ -625,46 +625,46 @@ discard block |
||
625 | 625 | } else if ($globalDebug && $timediff > 30) { |
626 | 626 | $this->tmd = $this->tmd + 1; |
627 | 627 | echo '!!! Too much distance in short time... for '.$this->all_flights[$id]['ident']."\n"; |
628 | - echo 'Time : '.$timediff.'s - Distance : '.$Common->distance($line['latitude'],$line['longitude'],$this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],'m')."m -"; |
|
629 | - echo 'Speed : '.(($Common->distance($line['latitude'],$line['longitude'],$this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],'m')/$timediff)*3.6)." km/h - "; |
|
628 | + echo 'Time : '.$timediff.'s - Distance : '.$Common->distance($line['latitude'], $line['longitude'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], 'm')."m -"; |
|
629 | + echo 'Speed : '.(($Common->distance($line['latitude'], $line['longitude'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], 'm')/$timediff)*3.6)." km/h - "; |
|
630 | 630 | echo 'Lat : '.$line['latitude'].' - long : '.$line['longitude'].' - prev lat : '.$this->all_flights[$id]['latitude'].' - prev long : '.$this->all_flights[$id]['longitude']." \n"; |
631 | 631 | } |
632 | 632 | } |
633 | 633 | if (isset($line['last_update']) && $line['last_update'] != '') { |
634 | 634 | if (isset($this->all_flights[$id]['last_update']) && $this->all_flights[$id]['last_update'] != $line['last_update']) $dataFound = true; |
635 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('last_update' => $line['last_update'])); |
|
635 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('last_update' => $line['last_update'])); |
|
636 | 636 | } |
637 | 637 | if (isset($line['verticalrate']) && $line['verticalrate'] != '') { |
638 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('verticalrate' => $line['verticalrate'])); |
|
638 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('verticalrate' => $line['verticalrate'])); |
|
639 | 639 | //$dataFound = true; |
640 | 640 | } |
641 | 641 | if (isset($line['format_source']) && $line['format_source'] != '') { |
642 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('format_source' => $line['format_source'])); |
|
642 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('format_source' => $line['format_source'])); |
|
643 | 643 | } |
644 | 644 | if (isset($line['source_name']) && $line['source_name'] != '') { |
645 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('source_name' => $line['source_name'])); |
|
645 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('source_name' => $line['source_name'])); |
|
646 | 646 | } |
647 | 647 | if (isset($line['emergency']) && $line['emergency'] != '') { |
648 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('emergency' => $line['emergency'])); |
|
648 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('emergency' => $line['emergency'])); |
|
649 | 649 | //$dataFound = true; |
650 | 650 | } |
651 | 651 | if (isset($line['ground']) && $line['ground'] != '') { |
652 | 652 | if (isset($this->all_flights[$id]['ground']) && $this->all_flights[$id]['ground'] == 1 && $line['ground'] == 0) { |
653 | 653 | // Here we force archive of flight because after ground it's a new one (or should be) |
654 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('addedSpotter' => 0)); |
|
655 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('forcenew' => 1)); |
|
656 | - if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $id.'-'.date('YmdHi'))); |
|
657 | - elseif (isset($line['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $line['id'])); |
|
658 | - elseif (isset($this->all_flights[$id]['ident'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
|
654 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('addedSpotter' => 0)); |
|
655 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('forcenew' => 1)); |
|
656 | + if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $id.'-'.date('YmdHi'))); |
|
657 | + elseif (isset($line['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $line['id'])); |
|
658 | + elseif (isset($this->all_flights[$id]['ident'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
|
659 | 659 | } |
660 | 660 | if ($line['ground'] != 1) $line['ground'] = 0; |
661 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('ground' => $line['ground'])); |
|
661 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('ground' => $line['ground'])); |
|
662 | 662 | //$dataFound = true; |
663 | 663 | } |
664 | 664 | if (isset($line['squawk']) && $line['squawk'] != '') { |
665 | 665 | if (isset($this->all_flights[$id]['squawk']) && $this->all_flights[$id]['squawk'] != '7500' && $this->all_flights[$id]['squawk'] != '7600' && $this->all_flights[$id]['squawk'] != '7700' && isset($this->all_flights[$id]['id'])) { |
666 | 666 | if ($this->all_flights[$id]['squawk'] != $line['squawk']) $this->all_flights[$id]['putinarchive'] = true; |
667 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('squawk' => $line['squawk'])); |
|
667 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('squawk' => $line['squawk'])); |
|
668 | 668 | $highlight = ''; |
669 | 669 | if ($this->all_flights[$id]['squawk'] == '7500') $highlight = 'Squawk 7500 : Hijack at '.date('Y-m-d G:i').' UTC'; |
670 | 670 | if ($this->all_flights[$id]['squawk'] == '7600') $highlight = 'Squawk 7600 : Lost Comm (radio failure) at '.date('Y-m-d G:i').' UTC'; |
@@ -673,66 +673,66 @@ discard block |
||
673 | 673 | $timeelapsed = microtime(true); |
674 | 674 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
675 | 675 | $Spotter = new Spotter($this->db); |
676 | - $Spotter->setHighlightFlight($this->all_flights[$id]['id'],$highlight); |
|
676 | + $Spotter->setHighlightFlight($this->all_flights[$id]['id'], $highlight); |
|
677 | 677 | $Spotter->db = null; |
678 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update sethighlightflight : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
678 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update sethighlightflight : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
679 | 679 | } |
680 | 680 | //$putinarchive = true; |
681 | 681 | //$highlight = ''; |
682 | 682 | } |
683 | 683 | |
684 | - } else $this->all_flights[$id] = array_merge($this->all_flights[$id],array('squawk' => $line['squawk'])); |
|
684 | + } else $this->all_flights[$id] = array_merge($this->all_flights[$id], array('squawk' => $line['squawk'])); |
|
685 | 685 | //$dataFound = true; |
686 | 686 | } |
687 | 687 | |
688 | 688 | if (isset($line['altitude']) && $line['altitude'] != '') { |
689 | 689 | if (isset($line['altitude_relative']) && isset($GeoidClass) && is_object($GeoidClass)) { |
690 | 690 | if ($line['altitude_relative'] == 'AMSL' || $line['altitude_relative'] == 'MSL') { |
691 | - $geoid = round($GeoidClass->get($this->all_flights[$id]['livedb_latitude'],$this->all_flights[$id]['livedb_longitude'])*3.28084,2); |
|
691 | + $geoid = round($GeoidClass->get($this->all_flights[$id]['livedb_latitude'], $this->all_flights[$id]['livedb_longitude'])*3.28084, 2); |
|
692 | 692 | //if ($globalDebug) echo '=> Set altitude to WGS84 Ellipsoid, add '.$geoid.' to '.$line['altitude']."\n"; |
693 | 693 | $line['altitude'] = $line['altitude'] - $geoid; |
694 | 694 | } |
695 | 695 | } |
696 | 696 | //if (!isset($this->all_flights[$id]['altitude']) || $this->all_flights[$id]['altitude'] == '' || ($this->all_flights[$id]['altitude'] > 0 && $line['altitude'] != 0)) { |
697 | - if (is_int($this->all_flights[$id]['altitude']) && abs(round($line['altitude']/100)-$this->all_flights[$id]['altitude']) > 3) $this->all_flights[$id]['putinarchive'] = true; |
|
698 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('altitude' => round($line['altitude']/100))); |
|
699 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('altitude_real' => $line['altitude'])); |
|
697 | + if (is_int($this->all_flights[$id]['altitude']) && abs(round($line['altitude']/100) - $this->all_flights[$id]['altitude']) > 3) $this->all_flights[$id]['putinarchive'] = true; |
|
698 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('altitude' => round($line['altitude']/100))); |
|
699 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('altitude_real' => $line['altitude'])); |
|
700 | 700 | //$dataFound = true; |
701 | 701 | //} elseif ($globalDebug) echo "!!! Strange altitude data... not added.\n"; |
702 | 702 | if ($globalVA !== TRUE && $globalIVAO !== TRUE && $globalVATSIM !== TRUE && $globalphpVMS !== TRUE && $globalVAM !== TRUE) { |
703 | 703 | if (isset($this->all_flights[$id]['over_country']) && $this->all_flights[$id]['over_country'] != '' && isset($this->all_flights[$id]['altitude_previous']) && $this->all_flights[$id]['altitude_previous'] != '' && $this->all_flights[$id]['altitude_previous'] < $this->all_flights[$id]['altitude_real'] && isset($this->all_flights[$id]['lastupdate']) && $this->all_flights[$id]['lastupdate'] < time() - 1600) { |
704 | 704 | if ($globalDebug) echo '--- Reset because of altitude'."\n"; |
705 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('addedSpotter' => 0)); |
|
706 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('forcenew' => 1)); |
|
707 | - if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $id.'-'.date('YmdHi'))); |
|
708 | - elseif (isset($line['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $line['id'])); |
|
709 | - elseif (isset($this->all_flights[$id]['ident'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
|
705 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('addedSpotter' => 0)); |
|
706 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('forcenew' => 1)); |
|
707 | + if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $id.'-'.date('YmdHi'))); |
|
708 | + elseif (isset($line['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $line['id'])); |
|
709 | + elseif (isset($this->all_flights[$id]['ident'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $this->all_flights[$id]['hex'].'-'.$this->all_flights[$id]['ident'])); |
|
710 | 710 | } |
711 | 711 | } |
712 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('altitude_previous' => $line['altitude'])); |
|
712 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('altitude_previous' => $line['altitude'])); |
|
713 | 713 | } |
714 | 714 | |
715 | 715 | if (isset($line['noarchive']) && $line['noarchive'] === true) { |
716 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('noarchive' => true)); |
|
716 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('noarchive' => true)); |
|
717 | 717 | } |
718 | 718 | |
719 | 719 | if (isset($line['heading']) && $line['heading'] != '') { |
720 | - if (is_int($this->all_flights[$id]['heading']) && abs($this->all_flights[$id]['heading']-round($line['heading'])) > 10) $this->all_flights[$id]['putinarchive'] = true; |
|
721 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('heading' => round($line['heading']))); |
|
722 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('heading_fromsrc' => true)); |
|
720 | + if (is_int($this->all_flights[$id]['heading']) && abs($this->all_flights[$id]['heading'] - round($line['heading'])) > 10) $this->all_flights[$id]['putinarchive'] = true; |
|
721 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('heading' => round($line['heading']))); |
|
722 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('heading_fromsrc' => true)); |
|
723 | 723 | //$dataFound = true; |
724 | 724 | } elseif (!isset($this->all_flights[$id]['heading_fromsrc']) && isset($this->all_flights[$id]['archive_latitude']) && $this->all_flights[$id]['archive_latitude'] != $this->all_flights[$id]['latitude'] && isset($this->all_flights[$id]['archive_longitude']) && $this->all_flights[$id]['archive_longitude'] != $this->all_flights[$id]['longitude']) { |
725 | - $heading = $Common->getHeading($this->all_flights[$id]['archive_latitude'],$this->all_flights[$id]['archive_longitude'],$this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude']); |
|
726 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('heading' => round($heading))); |
|
727 | - if (abs($this->all_flights[$id]['heading']-round($heading)) > 10) $this->all_flights[$id]['putinarchive'] = true; |
|
725 | + $heading = $Common->getHeading($this->all_flights[$id]['archive_latitude'], $this->all_flights[$id]['archive_longitude'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude']); |
|
726 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('heading' => round($heading))); |
|
727 | + if (abs($this->all_flights[$id]['heading'] - round($heading)) > 10) $this->all_flights[$id]['putinarchive'] = true; |
|
728 | 728 | if ($globalDebug) echo "ø Calculated Heading for ".$this->all_flights[$id]['hex']." : ".$heading."\n"; |
729 | 729 | } elseif (isset($this->all_flights[$id]['format_source']) && $this->all_flights[$id]['format_source'] == 'ACARS') { |
730 | 730 | // If not enough messages and ACARS set heading to 0 |
731 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('heading' => 0)); |
|
731 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('heading' => 0)); |
|
732 | 732 | } |
733 | - if ($globalDaemon === TRUE && isset($globalSourcesupdate) && $globalSourcesupdate != '' && isset($this->all_flights[$id]['lastupdate']) && time()-$this->all_flights[$id]['lastupdate'] < $globalSourcesupdate) $dataFound = false; |
|
734 | - elseif ($globalDaemon === TRUE && isset($globalSBS1update) && $globalSBS1update != '' && isset($this->all_flights[$id]['lastupdate']) && time()-$this->all_flights[$id]['lastupdate'] < $globalSBS1update) $dataFound = false; |
|
735 | - elseif ($globalDaemon === TRUE && isset($globalAircraftMinUpdate) && $globalAircraftMinUpdate != '' && isset($this->all_flights[$id]['lastupdate']) && time()-$this->all_flights[$id]['lastupdate'] < $globalAircraftMinupdate) $dataFound = false; |
|
733 | + if ($globalDaemon === TRUE && isset($globalSourcesupdate) && $globalSourcesupdate != '' && isset($this->all_flights[$id]['lastupdate']) && time() - $this->all_flights[$id]['lastupdate'] < $globalSourcesupdate) $dataFound = false; |
|
734 | + elseif ($globalDaemon === TRUE && isset($globalSBS1update) && $globalSBS1update != '' && isset($this->all_flights[$id]['lastupdate']) && time() - $this->all_flights[$id]['lastupdate'] < $globalSBS1update) $dataFound = false; |
|
735 | + elseif ($globalDaemon === TRUE && isset($globalAircraftMinUpdate) && $globalAircraftMinUpdate != '' && isset($this->all_flights[$id]['lastupdate']) && time() - $this->all_flights[$id]['lastupdate'] < $globalAircraftMinupdate) $dataFound = false; |
|
736 | 736 | |
737 | 737 | // print_r($this->all_flights[$id]); |
738 | 738 | //gets the callsign from the last hour |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | if ($dataFound === true && isset($this->all_flights[$id]['id'])) { |
744 | 744 | $this->all_flights[$id]['lastupdate'] = time(); |
745 | 745 | if ((!isset($globalNoImport) || $globalNoImport === FALSE) && $this->all_flights[$id]['addedSpotter'] == 0) { |
746 | - if (!isset($globalDistanceIgnore['latitude']) || $this->all_flights[$id]['longitude'] == '' || $this->all_flights[$id]['latitude'] == '' || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
746 | + if (!isset($globalDistanceIgnore['latitude']) || $this->all_flights[$id]['longitude'] == '' || $this->all_flights[$id]['latitude'] == '' || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
747 | 747 | //print_r($this->all_flights); |
748 | 748 | //echo $this->all_flights[$id]['id'].' - '.$this->all_flights[$id]['addedSpotter']."\n"; |
749 | 749 | //$last_hour_ident = Spotter->getIdentFromLastHour($this->all_flights[$id]['ident']); |
@@ -754,61 +754,61 @@ discard block |
||
754 | 754 | $SpotterLive = new SpotterLive($this->db); |
755 | 755 | if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'radarvirtueljson' || $line['format_source'] === 'famaprs')) { |
756 | 756 | $recent_ident = $SpotterLive->checkModeSRecent($this->all_flights[$id]['hex']); |
757 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkModeSRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
757 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkModeSRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
758 | 758 | } elseif (isset($line['id'])) { |
759 | 759 | $recent_ident = $SpotterLive->checkIdRecent($line['id']); |
760 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
760 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
761 | 761 | } elseif (isset($this->all_flights[$id]['ident']) && $this->all_flights[$id]['ident'] != '') { |
762 | 762 | $recent_ident = $SpotterLive->checkIdentRecent($this->all_flights[$id]['ident']); |
763 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
763 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
764 | 764 | } else $recent_ident = ''; |
765 | - $SpotterLive->db=null; |
|
765 | + $SpotterLive->db = null; |
|
766 | 766 | if ($globalDebug && $recent_ident == '') echo " Not in DB.\n"; |
767 | 767 | elseif ($globalDebug && $recent_ident != '') echo " Already in DB.\n"; |
768 | 768 | } else $recent_ident = ''; |
769 | 769 | } else { |
770 | 770 | $recent_ident = ''; |
771 | - $this->all_flights[$id] = array_merge($this->all_flights[$id],array('forcenew' => 0)); |
|
771 | + $this->all_flights[$id] = array_merge($this->all_flights[$id], array('forcenew' => 0)); |
|
772 | 772 | } |
773 | 773 | //if there was no aircraft with the same callsign within the last hour and go post it into the archive |
774 | - if($recent_ident == "") |
|
774 | + if ($recent_ident == "") |
|
775 | 775 | { |
776 | 776 | if ($globalDebug) echo "\o/ Add ".$this->all_flights[$id]['ident']." in archive DB : "; |
777 | 777 | if ($this->all_flights[$id]['departure_airport'] == "") { $this->all_flights[$id]['departure_airport'] = "NA"; } |
778 | 778 | if ($this->all_flights[$id]['arrival_airport'] == "") { $this->all_flights[$id]['arrival_airport'] = "NA"; } |
779 | 779 | //adds the spotter data for the archive |
780 | 780 | $ignoreImport = false; |
781 | - foreach($globalAirportIgnore as $airportIgnore) { |
|
781 | + foreach ($globalAirportIgnore as $airportIgnore) { |
|
782 | 782 | if (($this->all_flights[$id]['departure_airport'] == $airportIgnore) || ($this->all_flights[$id]['arrival_airport'] == $airportIgnore)) { |
783 | 783 | $ignoreImport = true; |
784 | 784 | } |
785 | 785 | } |
786 | 786 | if (count($globalAirportAccept) > 0) { |
787 | 787 | $ignoreImport = true; |
788 | - foreach($globalAirportIgnore as $airportIgnore) { |
|
788 | + foreach ($globalAirportIgnore as $airportIgnore) { |
|
789 | 789 | if (($this->all_flights[$id]['departure_airport'] == $airportIgnore) || ($this->all_flights[$id]['arrival_airport'] == $airportIgnore)) { |
790 | 790 | $ignoreImport = false; |
791 | 791 | } |
792 | 792 | } |
793 | 793 | } |
794 | 794 | if (isset($globalAirlineIgnore) && is_array($globalAirlineIgnore)) { |
795 | - foreach($globalAirlineIgnore as $airlineIgnore) { |
|
796 | - if ((is_numeric(substr(substr($this->all_flights[$id]['ident'],0,4),-1,1)) && substr($this->all_flights[$id]['ident'],0,3) == $airlineIgnore) || (is_numeric(substr(substr($this->all_flights[$id]['ident'],0,3),-1,1)) && substr($this->all_flights[$id]['ident'],0,2) == $airlineIgnore)) { |
|
795 | + foreach ($globalAirlineIgnore as $airlineIgnore) { |
|
796 | + if ((is_numeric(substr(substr($this->all_flights[$id]['ident'], 0, 4), -1, 1)) && substr($this->all_flights[$id]['ident'], 0, 3) == $airlineIgnore) || (is_numeric(substr(substr($this->all_flights[$id]['ident'], 0, 3), -1, 1)) && substr($this->all_flights[$id]['ident'], 0, 2) == $airlineIgnore)) { |
|
797 | 797 | $ignoreImport = true; |
798 | 798 | } |
799 | 799 | } |
800 | 800 | } |
801 | 801 | if (isset($globalAirlineAccept) && count($globalAirlineAccept) > 0) { |
802 | 802 | $ignoreImport = true; |
803 | - foreach($globalAirlineAccept as $airlineAccept) { |
|
804 | - if ((is_numeric(substr(substr($this->all_flights[$id]['ident'],0,4),-1,1)) && substr($this->all_flights[$id]['ident'],0,3) == $airlineAccept) || (is_numeric(substr(substr($this->all_flights[$id]['ident'],0,3),-1,1)) && substr($this->all_flights[$id]['ident'],0,2) == $airlineAccept)) { |
|
803 | + foreach ($globalAirlineAccept as $airlineAccept) { |
|
804 | + if ((is_numeric(substr(substr($this->all_flights[$id]['ident'], 0, 4), -1, 1)) && substr($this->all_flights[$id]['ident'], 0, 3) == $airlineAccept) || (is_numeric(substr(substr($this->all_flights[$id]['ident'], 0, 3), -1, 1)) && substr($this->all_flights[$id]['ident'], 0, 2) == $airlineAccept)) { |
|
805 | 805 | $ignoreImport = false; |
806 | 806 | } |
807 | 807 | } |
808 | 808 | } |
809 | 809 | if (isset($globalPilotIdAccept) && count($globalPilotIdAccept) > 0) { |
810 | 810 | $ignoreImport = true; |
811 | - foreach($globalPilotIdAccept as $pilotIdAccept) { |
|
811 | + foreach ($globalPilotIdAccept as $pilotIdAccept) { |
|
812 | 812 | if ($this->all_flights[$id]['pilot_id'] == $pilotIdAccept) { |
813 | 813 | $ignoreImport = false; |
814 | 814 | } |
@@ -820,32 +820,32 @@ discard block |
||
820 | 820 | if ($this->all_flights[$id]['squawk'] == '7500') $highlight = 'Squawk 7500 : Hijack'; |
821 | 821 | if ($this->all_flights[$id]['squawk'] == '7600') $highlight = 'Squawk 7600 : Lost Comm (radio failure)'; |
822 | 822 | if ($this->all_flights[$id]['squawk'] == '7700') $highlight = 'Squawk 7700 : Emergency'; |
823 | - if (!isset($this->all_flights[$id]['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.date('YmdHi'))); |
|
823 | + if (!isset($this->all_flights[$id]['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $this->all_flights[$id]['hex'].'-'.date('YmdHi'))); |
|
824 | 824 | $timeelapsed = microtime(true); |
825 | 825 | if (!isset($globalNoImport) || $globalNoImport === FALSE) { |
826 | 826 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
827 | 827 | $Spotter = new Spotter($this->db); |
828 | - $result = $Spotter->addSpotterData($this->all_flights[$id]['id'], $this->all_flights[$id]['ident'], $this->all_flights[$id]['aircraft_icao'], $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $this->all_flights[$id]['waypoints'], $this->all_flights[$id]['altitude'],$this->all_flights[$id]['altitude_real'], $this->all_flights[$id]['heading'], $this->all_flights[$id]['speed'], $this->all_flights[$id]['datetime'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport_time'],$this->all_flights[$id]['squawk'],$this->all_flights[$id]['route_stop'],$highlight,$this->all_flights[$id]['hex'],$this->all_flights[$id]['registration'],$this->all_flights[$id]['pilot_id'],$this->all_flights[$id]['pilot_name'],$this->all_flights[$id]['verticalrate'],$this->all_flights[$id]['ground'],$this->all_flights[$id]['format_source'],$this->all_flights[$id]['source_name'],$this->all_flights[$id]['source_type']); |
|
828 | + $result = $Spotter->addSpotterData($this->all_flights[$id]['id'], $this->all_flights[$id]['ident'], $this->all_flights[$id]['aircraft_icao'], $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $this->all_flights[$id]['waypoints'], $this->all_flights[$id]['altitude'], $this->all_flights[$id]['altitude_real'], $this->all_flights[$id]['heading'], $this->all_flights[$id]['speed'], $this->all_flights[$id]['datetime'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport_time'], $this->all_flights[$id]['squawk'], $this->all_flights[$id]['route_stop'], $highlight, $this->all_flights[$id]['hex'], $this->all_flights[$id]['registration'], $this->all_flights[$id]['pilot_id'], $this->all_flights[$id]['pilot_name'], $this->all_flights[$id]['verticalrate'], $this->all_flights[$id]['ground'], $this->all_flights[$id]['format_source'], $this->all_flights[$id]['source_name'], $this->all_flights[$id]['source_type']); |
|
829 | 829 | $Spotter->db = null; |
830 | 830 | if ($globalDebug && isset($result)) echo $result."\n"; |
831 | 831 | } |
832 | 832 | } |
833 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
833 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
834 | 834 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
835 | 835 | |
836 | 836 | // Add source stat in DB |
837 | 837 | $Stats = new Stats($this->db); |
838 | 838 | if (!empty($this->stats)) { |
839 | 839 | if ($globalDebug) echo 'Add source stats : '; |
840 | - foreach($this->stats as $date => $data) { |
|
841 | - foreach($data as $source => $sourced) { |
|
840 | + foreach ($this->stats as $date => $data) { |
|
841 | + foreach ($data as $source => $sourced) { |
|
842 | 842 | //print_r($sourced); |
843 | - if (isset($sourced['polar'])) echo $Stats->addStatSource(json_encode($sourced['polar']),$source,'polar',$date); |
|
844 | - if (isset($sourced['hist'])) echo $Stats->addStatSource(json_encode($sourced['hist']),$source,'hist',$date); |
|
843 | + if (isset($sourced['polar'])) echo $Stats->addStatSource(json_encode($sourced['polar']), $source, 'polar', $date); |
|
844 | + if (isset($sourced['hist'])) echo $Stats->addStatSource(json_encode($sourced['hist']), $source, 'hist', $date); |
|
845 | 845 | if (isset($sourced['msg'])) { |
846 | 846 | if (time() - $sourced['msg']['date'] > 10) { |
847 | 847 | $nbmsg = round($sourced['msg']['nb']/(time() - $sourced['msg']['date'])); |
848 | - echo $Stats->addStatSource($nbmsg,$source,'msg',$date); |
|
848 | + echo $Stats->addStatSource($nbmsg, $source, 'msg', $date); |
|
849 | 849 | unset($this->stats[$date][$source]['msg']); |
850 | 850 | } |
851 | 851 | } |
@@ -883,14 +883,14 @@ discard block |
||
883 | 883 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
884 | 884 | $SpotterLive = new SpotterLive($this->db); |
885 | 885 | $SpotterLive->deleteLiveSpotterData(); |
886 | - $SpotterLive->db=null; |
|
886 | + $SpotterLive->db = null; |
|
887 | 887 | } |
888 | 888 | } |
889 | 889 | if ($globalDebug) echo " Done\n"; |
890 | 890 | $this->last_delete = time(); |
891 | 891 | } |
892 | 892 | } else { |
893 | - if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt'|| $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'famaprs' || $line['format_source'] === 'airwhere')) { |
|
893 | + if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'planeupdatefaa' || $line['format_source'] === 'aprs' || $line['format_source'] === 'aircraftlistjson' || $line['format_source'] === 'famaprs' || $line['format_source'] === 'airwhere')) { |
|
894 | 894 | $this->all_flights[$id]['id'] = $recent_ident; |
895 | 895 | $this->all_flights[$id]['addedSpotter'] = 1; |
896 | 896 | } |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | if (!isset($globalNoImport) || $globalNoImport === FALSE) { |
899 | 899 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
900 | 900 | $Spotter = new Spotter($this->db); |
901 | - $Spotter->updateLatestSpotterData($this->all_flights[$id]['id'],$this->all_flights[$id]['ident'],$this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],$this->all_flights[$id]['altitude'],$this->all_flights[$id]['altitude_real'],$this->all_flights[$id]['ground'],$this->all_flights[$id]['speed'],$this->all_flights[$id]['datetime'],$this->all_flights[$id]['arrival_airport'],$this->all_flights[$id]['arrival_airport_time']); |
|
901 | + $Spotter->updateLatestSpotterData($this->all_flights[$id]['id'], $this->all_flights[$id]['ident'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $this->all_flights[$id]['altitude'], $this->all_flights[$id]['altitude_real'], $this->all_flights[$id]['ground'], $this->all_flights[$id]['speed'], $this->all_flights[$id]['datetime'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['arrival_airport_time']); |
|
902 | 902 | $Spotter->db = null; |
903 | 903 | } |
904 | 904 | } |
@@ -924,37 +924,37 @@ discard block |
||
924 | 924 | if ($this->all_flights[$id]['departure_airport'] == "") { $this->all_flights[$id]['departure_airport'] = "NA"; } |
925 | 925 | if ($this->all_flights[$id]['arrival_airport'] == "") { $this->all_flights[$id]['arrival_airport'] = "NA"; } |
926 | 926 | |
927 | - foreach($globalAirportIgnore as $airportIgnore) { |
|
927 | + foreach ($globalAirportIgnore as $airportIgnore) { |
|
928 | 928 | if (($this->all_flights[$id]['departure_airport'] == $airportIgnore) || ($this->all_flights[$id]['arrival_airport'] == $airportIgnore)) { |
929 | 929 | $ignoreImport = true; |
930 | 930 | } |
931 | 931 | } |
932 | 932 | if (count($globalAirportAccept) > 0) { |
933 | 933 | $ignoreImport = true; |
934 | - foreach($globalAirportIgnore as $airportIgnore) { |
|
934 | + foreach ($globalAirportIgnore as $airportIgnore) { |
|
935 | 935 | if (($this->all_flights[$id]['departure_airport'] == $airportIgnore) || ($this->all_flights[$id]['arrival_airport'] == $airportIgnore)) { |
936 | 936 | $ignoreImport = false; |
937 | 937 | } |
938 | 938 | } |
939 | 939 | } |
940 | 940 | if (isset($globalAirlineIgnore) && is_array($globalAirlineIgnore)) { |
941 | - foreach($globalAirlineIgnore as $airlineIgnore) { |
|
942 | - if ((is_numeric(substr(substr($this->all_flights[$id]['ident'],0,4),-1,1)) && substr($this->all_flights[$id]['ident'],0,3) == $airlineIgnore) || (is_numeric(substr(substr($this->all_flights[$id]['ident'],0,3),-1,1)) && substr($this->all_flights[$id]['ident'],0,2) == $airlineIgnore)) { |
|
941 | + foreach ($globalAirlineIgnore as $airlineIgnore) { |
|
942 | + if ((is_numeric(substr(substr($this->all_flights[$id]['ident'], 0, 4), -1, 1)) && substr($this->all_flights[$id]['ident'], 0, 3) == $airlineIgnore) || (is_numeric(substr(substr($this->all_flights[$id]['ident'], 0, 3), -1, 1)) && substr($this->all_flights[$id]['ident'], 0, 2) == $airlineIgnore)) { |
|
943 | 943 | $ignoreImport = true; |
944 | 944 | } |
945 | 945 | } |
946 | 946 | } |
947 | 947 | if (isset($globalAirlineAccept) && count($globalAirlineAccept) > 0) { |
948 | 948 | $ignoreImport = true; |
949 | - foreach($globalAirlineAccept as $airlineAccept) { |
|
950 | - if ((is_numeric(substr(substr($this->all_flights[$id]['ident'],0,4),-1,1)) && substr($this->all_flights[$id]['ident'],0,3) == $airlineAccept) || (is_numeric(substr(substr($this->all_flights[$id]['ident'],0,3),-1,1)) && substr($this->all_flights[$id]['ident'],0,2) == $airlineAccept)) { |
|
949 | + foreach ($globalAirlineAccept as $airlineAccept) { |
|
950 | + if ((is_numeric(substr(substr($this->all_flights[$id]['ident'], 0, 4), -1, 1)) && substr($this->all_flights[$id]['ident'], 0, 3) == $airlineAccept) || (is_numeric(substr(substr($this->all_flights[$id]['ident'], 0, 3), -1, 1)) && substr($this->all_flights[$id]['ident'], 0, 2) == $airlineAccept)) { |
|
951 | 951 | $ignoreImport = false; |
952 | 952 | } |
953 | 953 | } |
954 | 954 | } |
955 | 955 | if (isset($globalPilotIdAccept) && count($globalPilotIdAccept) > 0) { |
956 | 956 | $ignoreImport = true; |
957 | - foreach($globalPilotIdAccept as $pilotIdAccept) { |
|
957 | + foreach ($globalPilotIdAccept as $pilotIdAccept) { |
|
958 | 958 | if ($this->all_flights[$id]['pilot_id'] == $pilotIdAccept) { |
959 | 959 | $ignoreImport = false; |
960 | 960 | } |
@@ -962,23 +962,23 @@ discard block |
||
962 | 962 | } |
963 | 963 | |
964 | 964 | if (!$ignoreImport) { |
965 | - if (!isset($globalDistanceIgnore['latitude']) || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
966 | - if (!isset($this->all_flights[$id]['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id],array('id' => $this->all_flights[$id]['hex'].'-'.date('YmdHi'))); |
|
965 | + if (!isset($globalDistanceIgnore['latitude']) || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
966 | + if (!isset($this->all_flights[$id]['id'])) $this->all_flights[$id] = array_merge($this->all_flights[$id], array('id' => $this->all_flights[$id]['hex'].'-'.date('YmdHi'))); |
|
967 | 967 | $timeelapsed = microtime(true); |
968 | 968 | if (!isset($globalNoImport) || $globalNoImport === FALSE) { |
969 | 969 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
970 | 970 | if ($globalDebug) echo "\o/ Add ".$this->all_flights[$id]['ident']." from ".$this->all_flights[$id]['format_source']." in Live DB : "; |
971 | 971 | $SpotterLive = new SpotterLive($this->db); |
972 | - $result = $SpotterLive->addLiveSpotterData($this->all_flights[$id]['id'], $this->all_flights[$id]['ident'], $this->all_flights[$id]['aircraft_icao'], $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $this->all_flights[$id]['waypoints'], $this->all_flights[$id]['altitude'],$this->all_flights[$id]['altitude_real'], $this->all_flights[$id]['heading'], $this->all_flights[$id]['speed'],$this->all_flights[$id]['datetime'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport_time'], $this->all_flights[$id]['squawk'],$this->all_flights[$id]['route_stop'],$this->all_flights[$id]['hex'],$this->all_flights[$id]['putinarchive'],$this->all_flights[$id]['registration'],$this->all_flights[$id]['pilot_id'],$this->all_flights[$id]['pilot_name'], $this->all_flights[$id]['verticalrate'], $this->all_flights[$id]['noarchive'], $this->all_flights[$id]['ground'],$this->all_flights[$id]['format_source'],$this->all_flights[$id]['source_name'],$this->all_flights[$id]['over_country']); |
|
972 | + $result = $SpotterLive->addLiveSpotterData($this->all_flights[$id]['id'], $this->all_flights[$id]['ident'], $this->all_flights[$id]['aircraft_icao'], $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $this->all_flights[$id]['waypoints'], $this->all_flights[$id]['altitude'], $this->all_flights[$id]['altitude_real'], $this->all_flights[$id]['heading'], $this->all_flights[$id]['speed'], $this->all_flights[$id]['datetime'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport_time'], $this->all_flights[$id]['squawk'], $this->all_flights[$id]['route_stop'], $this->all_flights[$id]['hex'], $this->all_flights[$id]['putinarchive'], $this->all_flights[$id]['registration'], $this->all_flights[$id]['pilot_id'], $this->all_flights[$id]['pilot_name'], $this->all_flights[$id]['verticalrate'], $this->all_flights[$id]['noarchive'], $this->all_flights[$id]['ground'], $this->all_flights[$id]['format_source'], $this->all_flights[$id]['source_name'], $this->all_flights[$id]['over_country']); |
|
973 | 973 | $SpotterLive->db = null; |
974 | 974 | if ($globalDebug) echo $result."\n"; |
975 | 975 | } |
976 | 976 | } |
977 | 977 | if (isset($globalServerAPRS) && $globalServerAPRS && $this->all_flights[$id]['putinarchive']) { |
978 | - $APRSSpotter->addLiveSpotterData($this->all_flights[$id]['id'], $this->all_flights[$id]['ident'], $this->all_flights[$id]['aircraft_icao'], $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $this->all_flights[$id]['waypoints'], $this->all_flights[$id]['altitude'], $this->all_flights[$id]['altitude_real'], $this->all_flights[$id]['heading'], $this->all_flights[$id]['speed'],$this->all_flights[$id]['datetime'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport_time'], $this->all_flights[$id]['squawk'],$this->all_flights[$id]['route_stop'],$this->all_flights[$id]['hex'],$this->all_flights[$id]['putinarchive'],$this->all_flights[$id]['registration'],$this->all_flights[$id]['pilot_id'],$this->all_flights[$id]['pilot_name'], $this->all_flights[$id]['verticalrate'], $this->all_flights[$id]['noarchive'], $this->all_flights[$id]['ground'],$this->all_flights[$id]['format_source'],$this->all_flights[$id]['source_name'],$this->all_flights[$id]['over_country']); |
|
978 | + $APRSSpotter->addLiveSpotterData($this->all_flights[$id]['id'], $this->all_flights[$id]['ident'], $this->all_flights[$id]['aircraft_icao'], $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $this->all_flights[$id]['waypoints'], $this->all_flights[$id]['altitude'], $this->all_flights[$id]['altitude_real'], $this->all_flights[$id]['heading'], $this->all_flights[$id]['speed'], $this->all_flights[$id]['datetime'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport_time'], $this->all_flights[$id]['squawk'], $this->all_flights[$id]['route_stop'], $this->all_flights[$id]['hex'], $this->all_flights[$id]['putinarchive'], $this->all_flights[$id]['registration'], $this->all_flights[$id]['pilot_id'], $this->all_flights[$id]['pilot_name'], $this->all_flights[$id]['verticalrate'], $this->all_flights[$id]['noarchive'], $this->all_flights[$id]['ground'], $this->all_flights[$id]['format_source'], $this->all_flights[$id]['source_name'], $this->all_flights[$id]['over_country']); |
|
979 | 979 | } |
980 | 980 | $this->all_flights[$id]['putinarchive'] = false; |
981 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addlivespotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
981 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update addlivespotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
982 | 982 | |
983 | 983 | // Put statistics in $this->stats variable |
984 | 984 | //if ($line['format_source'] != 'aprs') { |
@@ -997,19 +997,19 @@ discard block |
||
997 | 997 | $latitude = $globalCenterLatitude; |
998 | 998 | $longitude = $globalCenterLongitude; |
999 | 999 | } |
1000 | - $this->source_location[$source] = array('latitude' => $latitude,'longitude' => $longitude); |
|
1000 | + $this->source_location[$source] = array('latitude' => $latitude, 'longitude' => $longitude); |
|
1001 | 1001 | } else { |
1002 | 1002 | $latitude = $this->source_location[$source]['latitude']; |
1003 | 1003 | $longitude = $this->source_location[$source]['longitude']; |
1004 | 1004 | } |
1005 | - $stats_heading = $Common->getHeading($latitude,$longitude,$this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude']); |
|
1005 | + $stats_heading = $Common->getHeading($latitude, $longitude, $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude']); |
|
1006 | 1006 | //$stats_heading = $stats_heading%22.5; |
1007 | 1007 | $stats_heading = round($stats_heading/22.5); |
1008 | - $stats_distance = $Common->distance($latitude,$longitude,$this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude']); |
|
1008 | + $stats_distance = $Common->distance($latitude, $longitude, $this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude']); |
|
1009 | 1009 | $current_date = date('Y-m-d'); |
1010 | 1010 | if ($stats_heading == 16) $stats_heading = 0; |
1011 | 1011 | if (!isset($this->stats[$current_date][$source]['polar'][1])) { |
1012 | - for ($i=0;$i<=15;$i++) { |
|
1012 | + for ($i = 0; $i <= 15; $i++) { |
|
1013 | 1013 | $this->stats[$current_date][$source]['polar'][$i] = 0; |
1014 | 1014 | } |
1015 | 1015 | $this->stats[$current_date][$source]['polar'][$stats_heading] = $stats_distance; |
@@ -1024,9 +1024,9 @@ discard block |
||
1024 | 1024 | if (!isset($this->stats[$current_date][$source]['hist'][$distance])) { |
1025 | 1025 | if (isset($this->stats[$current_date][$source]['hist'][0])) { |
1026 | 1026 | end($this->stats[$current_date][$source]['hist']); |
1027 | - $mini = key($this->stats[$current_date][$source]['hist'])+10; |
|
1027 | + $mini = key($this->stats[$current_date][$source]['hist']) + 10; |
|
1028 | 1028 | } else $mini = 0; |
1029 | - for ($i=$mini;$i<=$distance;$i+=10) { |
|
1029 | + for ($i = $mini; $i <= $distance; $i += 10) { |
|
1030 | 1030 | $this->stats[$current_date][$source]['hist'][$i] = 0; |
1031 | 1031 | } |
1032 | 1032 | $this->stats[$current_date][$source]['hist'][$distance] = 1; |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | $this->all_flights[$id]['lastupdate'] = time(); |
1040 | 1040 | if ($this->all_flights[$id]['putinarchive']) $send = true; |
1041 | 1041 | //if ($globalDebug) echo "Distance : ".Common->distance($this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude'])."\n"; |
1042 | - } elseif (isset($this->all_flights[$id]['latitude']) && isset($globalDistanceIgnore['latitude']) && $globalDebug) echo "!! Too far -> Distance : ".$Common->distance($this->all_flights[$id]['latitude'],$this->all_flights[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude'])."\n"; |
|
1042 | + } elseif (isset($this->all_flights[$id]['latitude']) && isset($globalDistanceIgnore['latitude']) && $globalDebug) echo "!! Too far -> Distance : ".$Common->distance($this->all_flights[$id]['latitude'], $this->all_flights[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude'])."\n"; |
|
1043 | 1043 | //$this->del(); |
1044 | 1044 | |
1045 | 1045 | if ($this->last_delete_hourly == 0 || time() - $this->last_delete_hourly > 900) { |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | if ($_POST['registration'] != "") |
7 | 7 | { |
8 | - $registration = filter_input(INPUT_POST,'registration',FILTER_SANITIZE_STRING); |
|
8 | + $registration = filter_input(INPUT_POST, 'registration', FILTER_SANITIZE_STRING); |
|
9 | 9 | header('Location: '.$globalURL.'/registration/'.$registration); |
10 | 10 | } else { |
11 | 11 | if ($globalURL == '') { |
@@ -5,7 +5,7 @@ |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if ($_GET['flightaware_id'] != "") |
7 | 7 | { |
8 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
8 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
9 | 9 | $spotter_id = $Spotter->getSpotterIDBasedOnFlightAwareID($flightaware_id); |
10 | 10 | if ($spotter_id != "") |
11 | 11 | { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | if (isset($_POST['country']) && $_POST['country'] != "") |
6 | 6 | { |
7 | - $country = filter_input(INPUT_POST,'country',FILTER_SANITIZE_STRING); |
|
7 | + $country = filter_input(INPUT_POST, 'country', FILTER_SANITIZE_STRING); |
|
8 | 8 | header('Location: '.$globalURL.'/country/'.$country); |
9 | 9 | } else { |
10 | 10 | if ($globalURL == '') { |
@@ -5,17 +5,17 @@ discard block |
||
5 | 5 | require_once('require/class.Stats.php'); |
6 | 6 | require_once('require/class.METAR.php'); |
7 | 7 | |
8 | -if (!isset($_GET['airport'])){ |
|
8 | +if (!isset($_GET['airport'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/airport'); |
10 | 10 | } else { |
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | //calculation for the pagination |
13 | - if(!isset($_GET['limit'])) |
|
13 | + if (!isset($_GET['limit'])) |
|
14 | 14 | { |
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -28,15 +28,15 @@ discard block |
||
28 | 28 | $limit_next = $limit_end + $absolute_difference; |
29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
31 | - $airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
31 | + $airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $airport = $airport_icao; |
33 | 33 | $page_url = $globalURL.'/airport/'.$airport_icao; |
34 | 34 | |
35 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
35 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
36 | 36 | if ($sort != '') { |
37 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $sort); |
|
37 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $sort); |
|
38 | 38 | } else { |
39 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, ''); |
|
39 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, ''); |
|
40 | 40 | } |
41 | 41 | $airport_array = $Spotter->getAllAirportInfo($airport_icao); |
42 | 42 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | //print_r($metar_parse); |
52 | 52 | } |
53 | 53 | |
54 | - $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
54 | + $title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
55 | 55 | |
56 | 56 | require_once('header.php'); |
57 | 57 | |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | $airport_names = $Stats->getAllAirportNames(); |
64 | 64 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
65 | 65 | ksort($airport_names); |
66 | - foreach($airport_names as $airport_name) |
|
66 | + foreach ($airport_names as $airport_name) |
|
67 | 67 | { |
68 | - if($airport_icao == $airport_name['airport_icao']) |
|
68 | + if ($airport_icao == $airport_name['airport_icao']) |
|
69 | 69 | { |
70 | 70 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
71 | 71 | } else { |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | $date_data = ''; |
112 | 112 | $departure_data = ''; |
113 | 113 | $arrival_data = ''; |
114 | - foreach($all_data as $data) |
|
114 | + foreach ($all_data as $data) |
|
115 | 115 | { |
116 | 116 | $date_data .= '"'.$data['date'].'",'; |
117 | 117 | $departure_data .= $data['departure'].','; |
118 | 118 | $arrival_data .= $data['arrival'].','; |
119 | 119 | } |
120 | - $date_data = "['x',".substr($date_data,0,-1)."]"; |
|
121 | - $departure_data = "['departure',".substr($departure_data,0,-1)."]"; |
|
122 | - $arrival_data = "['arrival',".substr($arrival_data,0,-1)."]"; |
|
120 | + $date_data = "['x',".substr($date_data, 0, -1)."]"; |
|
121 | + $departure_data = "['departure',".substr($departure_data, 0, -1)."]"; |
|
122 | + $arrival_data = "['arrival',".substr($arrival_data, 0, -1)."]"; |
|
123 | 123 | print 'c3.generate({ |
124 | 124 | bindto: "#chart", |
125 | 125 | data: { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | print _("Dew point:").' '.$metar_parse['dew'].' °C'." - "; |
177 | 177 | } |
178 | 178 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
179 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
179 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
180 | 180 | print _("Humidity:").' '.$humidity.'%'." - "; |
181 | 181 | } |
182 | 182 | if (isset($metar_parse['QNH'])) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | print '<div class="table column">'; |
193 | 193 | if ($airport_array[0]['iata'] != "NA") |
194 | 194 | { |
195 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
195 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
196 | 196 | } |
197 | 197 | include('table-output.php'); |
198 | 198 | print '<div class="pagination">'; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | require_once(dirname(__FILE__).'/class.create_db.php'); |
23 | 23 | require_once(dirname(__FILE__).'/class.update_schema.php'); |
24 | 24 | require_once(dirname(__FILE__).'/class.settings.php'); |
25 | -$title="Install"; |
|
25 | +$title = "Install"; |
|
26 | 26 | require(dirname(__FILE__).'/../require/settings.php'); |
27 | 27 | require_once(dirname(__FILE__).'/../require/class.Common.php'); |
28 | 28 | require(dirname(__FILE__).'/header.php'); |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | if (!extension_loaded('curl')) { |
93 | 93 | $error[] = "Curl is not loaded."; |
94 | 94 | } |
95 | - if(function_exists('apache_get_modules') ){ |
|
96 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
95 | + if (function_exists('apache_get_modules')) { |
|
96 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
97 | 97 | $error[] = "mod_rewrite is not available."; |
98 | 98 | } |
99 | 99 | /* |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>'; |
110 | 110 | if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { |
111 | 111 | if (function_exists('get_headers')) { |
112 | - $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); |
|
113 | - if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { |
|
112 | + $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); |
|
113 | + if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { |
|
114 | 114 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>'; |
115 | 115 | } |
116 | 116 | } |
@@ -481,13 +481,13 @@ discard block |
||
481 | 481 | ?> |
482 | 482 | <tr> |
483 | 483 | <?php |
484 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
484 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
485 | 485 | ?> |
486 | 486 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
487 | 487 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
488 | 488 | <?php |
489 | 489 | } else { |
490 | - $hostport = explode(':',$source['host']); |
|
490 | + $hostport = explode(':', $source['host']); |
|
491 | 491 | if (isset($hostport[1])) { |
492 | 492 | $host = $hostport[0]; |
493 | 493 | $port = $hostport[1]; |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | <select name="timezones[]" id="timezones"> |
535 | 535 | <?php |
536 | 536 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
537 | - foreach($timezonelist as $timezones){ |
|
537 | + foreach ($timezonelist as $timezones) { |
|
538 | 538 | if (isset($source['timezone']) && $source['timezone'] == $timezones) { |
539 | 539 | print '<option selected>'.$timezones.'</option>'; |
540 | 540 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | <select name="timezones[]" id="timezones"> |
587 | 587 | <?php |
588 | 588 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
589 | - foreach($timezonelist as $timezones){ |
|
589 | + foreach ($timezonelist as $timezones) { |
|
590 | 590 | if ($timezones == 'UTC') { |
591 | 591 | print '<option selected>'.$timezones.'</option>'; |
592 | 592 | } else print '<option>'.$timezones.'</option>'; |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | <br /> |
928 | 928 | <p> |
929 | 929 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
930 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
930 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
931 | 931 | </p> |
932 | 932 | <br /> |
933 | 933 | <p> |
@@ -983,14 +983,14 @@ discard block |
||
983 | 983 | $error = ''; |
984 | 984 | |
985 | 985 | if (isset($_POST['dbtype'])) { |
986 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
987 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
988 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
989 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
990 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
991 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
992 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
993 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
986 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
987 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
988 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
989 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
990 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
991 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
992 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
993 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
994 | 994 | |
995 | 995 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
996 | 996 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -1010,49 +1010,49 @@ discard block |
||
1010 | 1010 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
1011 | 1011 | */ |
1012 | 1012 | |
1013 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
1013 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
1014 | 1014 | |
1015 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
1016 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
1017 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
1018 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
1019 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
1015 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
1016 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
1017 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
1018 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
1019 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
1020 | 1020 | |
1021 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
1022 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
1023 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
1024 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
1025 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
1026 | - $openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING); |
|
1027 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
1028 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
1029 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
1030 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
1021 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
1022 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
1023 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
1024 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
1025 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
1026 | + $openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING); |
|
1027 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
1028 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
1029 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
1030 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
1031 | 1031 | |
1032 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
1033 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
1034 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
1035 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
1036 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
1037 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
1032 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
1033 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
1034 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
1035 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
1036 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
1037 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
1038 | 1038 | |
1039 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
1040 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
1039 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
1040 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
1041 | 1041 | |
1042 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
1043 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
1044 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
1042 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
1043 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
1044 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
1045 | 1045 | |
1046 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
1046 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
1047 | 1047 | if ($acars == 'acars') { |
1048 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
1048 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
1049 | 1049 | } else { |
1050 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
1050 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
1051 | 1051 | } |
1052 | 1052 | |
1053 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
1054 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
1055 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
1053 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
1054 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
1055 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
1056 | 1056 | |
1057 | 1057 | $source_name = $_POST['source_name']; |
1058 | 1058 | $source_latitude = $_POST['source_latitude']; |
@@ -1066,8 +1066,8 @@ discard block |
||
1066 | 1066 | |
1067 | 1067 | $sources = array(); |
1068 | 1068 | foreach ($source_name as $keys => $name) { |
1069 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1070 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1069 | + if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]); |
|
1070 | + else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]); |
|
1071 | 1071 | } |
1072 | 1072 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
1073 | 1073 | |
@@ -1080,27 +1080,27 @@ discard block |
||
1080 | 1080 | $sbsurl = $_POST['sbsurl']; |
1081 | 1081 | */ |
1082 | 1082 | |
1083 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
1084 | - $globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING); |
|
1085 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
1086 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
1087 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING); |
|
1088 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
1089 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
1090 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
1083 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
1084 | + $globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING); |
|
1085 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
1086 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
1087 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING); |
|
1088 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
1089 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
1090 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
1091 | 1091 | |
1092 | - $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
|
1093 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1094 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1095 | - $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
|
1096 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1097 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1098 | - $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
|
1099 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1100 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1101 | - $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING); |
|
1102 | - if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
1103 | - else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
1092 | + $globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING); |
|
1093 | + if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE')); |
|
1094 | + else $settings = array_merge($settings, array('globalAircraft' => 'FALSE')); |
|
1095 | + $globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING); |
|
1096 | + if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE')); |
|
1097 | + else $settings = array_merge($settings, array('globalTracker' => 'FALSE')); |
|
1098 | + $globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING); |
|
1099 | + if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE')); |
|
1100 | + else $settings = array_merge($settings, array('globalMarine' => 'FALSE')); |
|
1101 | + $globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING); |
|
1102 | + if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE')); |
|
1103 | + else $settings = array_merge($settings, array('globalSatellite' => 'FALSE')); |
|
1104 | 1104 | |
1105 | 1105 | /* |
1106 | 1106 | $globalSBS1Hosts = array(); |
@@ -1116,7 +1116,7 @@ discard block |
||
1116 | 1116 | } |
1117 | 1117 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
1118 | 1118 | */ |
1119 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
1119 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
1120 | 1120 | $host = $_POST['host']; |
1121 | 1121 | $port = $_POST['port']; |
1122 | 1122 | $name = $_POST['name']; |
@@ -1133,113 +1133,113 @@ discard block |
||
1133 | 1133 | else $cov = 'FALSE'; |
1134 | 1134 | if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
1135 | 1135 | else $arch = 'FALSE'; |
1136 | - if (strpos($format[$key],'_callback')) { |
|
1137 | - $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
|
1136 | + if (strpos($format[$key], '_callback')) { |
|
1137 | + $gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE'); |
|
1138 | 1138 | } elseif ($h != '' || $name[$key] != '') { |
1139 | - $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
|
1139 | + $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE'); |
|
1140 | 1140 | } |
1141 | 1141 | if ($format[$key] == 'airwhere') $forcepilots = true; |
1142 | 1142 | } |
1143 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
1143 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
1144 | 1144 | |
1145 | 1145 | /* |
1146 | 1146 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
1147 | 1147 | $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
1148 | 1148 | */ |
1149 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
1150 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
1151 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
1149 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
1150 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
1151 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
1152 | 1152 | |
1153 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
1154 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
1153 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
1154 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
1155 | 1155 | |
1156 | - $customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING); |
|
1157 | - $settings = array_merge($settings,array('globalCustomCSS' => $customcss)); |
|
1156 | + $customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING); |
|
1157 | + $settings = array_merge($settings, array('globalCustomCSS' => $customcss)); |
|
1158 | 1158 | |
1159 | - $map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING); |
|
1160 | - $settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile)); |
|
1159 | + $map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING); |
|
1160 | + $settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile)); |
|
1161 | 1161 | |
1162 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
1163 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
1164 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
1165 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
1162 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
1163 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
1164 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
1165 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
1166 | 1166 | |
1167 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
1168 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
1169 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
1167 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
1168 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
1169 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
1170 | 1170 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1171 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
1172 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1171 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
1172 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
1173 | 1173 | |
1174 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
1175 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
1176 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
1177 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
1178 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
1179 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
1180 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
1181 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
1174 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
1175 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
1176 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
1177 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
1178 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
1179 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
1180 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
1181 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
1182 | 1182 | |
1183 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
1184 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
1183 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
1184 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
1185 | 1185 | |
1186 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
1187 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
1186 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
1187 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
1188 | 1188 | |
1189 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
1189 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
1190 | 1190 | if ($archiveyear == "archiveyear") { |
1191 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
1191 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
1192 | 1192 | } else { |
1193 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
1193 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
1194 | 1194 | } |
1195 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1196 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1197 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1198 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1195 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1196 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1197 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1198 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1199 | 1199 | |
1200 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
1201 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
1202 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
1203 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
1200 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
1201 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
1202 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
1203 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
1204 | 1204 | |
1205 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
1206 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
1207 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
1205 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
1206 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
1207 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
1208 | 1208 | |
1209 | 1209 | // Create in settings.php keys not yet configurable if not already here |
1210 | 1210 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1211 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1211 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
1212 | 1212 | |
1213 | - $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
|
1213 | + $resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING); |
|
1214 | 1214 | if ($resetyearstats == 'resetyearstats') { |
1215 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE')); |
|
1215 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE')); |
|
1216 | 1216 | } else { |
1217 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE')); |
|
1217 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE')); |
|
1218 | 1218 | } |
1219 | 1219 | |
1220 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
1220 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
1221 | 1221 | if ($archive == 'archive') { |
1222 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
1222 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
1223 | 1223 | } else { |
1224 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
1224 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
1225 | 1225 | } |
1226 | - $archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING); |
|
1226 | + $archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING); |
|
1227 | 1227 | if ($archiveresults == 'archiveresults') { |
1228 | - $settings = array_merge($settings,array('globalArchiveResults' => 'TRUE')); |
|
1228 | + $settings = array_merge($settings, array('globalArchiveResults' => 'TRUE')); |
|
1229 | 1229 | } else { |
1230 | - $settings = array_merge($settings,array('globalArchiveResults' => 'FALSE')); |
|
1230 | + $settings = array_merge($settings, array('globalArchiveResults' => 'FALSE')); |
|
1231 | 1231 | } |
1232 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
1232 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
1233 | 1233 | if ($daemon == 'daemon') { |
1234 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
1234 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
1235 | 1235 | } else { |
1236 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
1236 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
1237 | 1237 | } |
1238 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
1238 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
1239 | 1239 | if ($schedules == 'schedules') { |
1240 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
1240 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
1241 | 1241 | } else { |
1242 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
1242 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
1243 | 1243 | } |
1244 | 1244 | |
1245 | 1245 | /* |
@@ -1250,245 +1250,245 @@ discard block |
||
1250 | 1250 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
1251 | 1251 | } |
1252 | 1252 | */ |
1253 | - $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
|
1254 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1255 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1256 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1257 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1253 | + $settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); |
|
1254 | + if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); |
|
1255 | + else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); |
|
1256 | + if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); |
|
1257 | + else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); |
|
1258 | 1258 | $va = false; |
1259 | 1259 | if ($globalivao == 'ivao') { |
1260 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
1260 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
1261 | 1261 | $va = true; |
1262 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1262 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
1263 | 1263 | if ($globalvatsim == 'vatsim') { |
1264 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
1264 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
1265 | 1265 | $va = true; |
1266 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1266 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
1267 | 1267 | if ($globalphpvms == 'phpvms') { |
1268 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
1268 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
1269 | 1269 | $va = true; |
1270 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1270 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
1271 | 1271 | if ($globalvam == 'vam') { |
1272 | - $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
|
1272 | + $settings = array_merge($settings, array('globalVAM' => 'TRUE')); |
|
1273 | 1273 | $va = true; |
1274 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1274 | + } else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); |
|
1275 | 1275 | if ($va) { |
1276 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
1277 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1276 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
1277 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
1278 | 1278 | if ($globalva == 'va' || $va) { |
1279 | - $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
|
1280 | - $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1279 | + $settings = array_merge($settings, array('globalVA' => 'TRUE')); |
|
1280 | + $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
1281 | 1281 | } else { |
1282 | - $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
|
1283 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1284 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1282 | + $settings = array_merge($settings, array('globalVA' => 'FALSE')); |
|
1283 | + if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
1284 | + else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE')); |
|
1285 | 1285 | } |
1286 | 1286 | |
1287 | 1287 | |
1288 | 1288 | |
1289 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
1289 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
1290 | 1290 | if ($notam == 'notam') { |
1291 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
1291 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
1292 | 1292 | } else { |
1293 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
1293 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
1294 | 1294 | } |
1295 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
1295 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
1296 | 1296 | if ($owner == 'owner') { |
1297 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
1297 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
1298 | 1298 | } else { |
1299 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
1299 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
1300 | 1300 | } |
1301 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING); |
|
1301 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING); |
|
1302 | 1302 | if ($map3d == 'map3d') { |
1303 | - $settings = array_merge($settings,array('globalMap3D' => 'TRUE')); |
|
1303 | + $settings = array_merge($settings, array('globalMap3D' => 'TRUE')); |
|
1304 | 1304 | } else { |
1305 | - $settings = array_merge($settings,array('globalMap3D' => 'FALSE')); |
|
1305 | + $settings = array_merge($settings, array('globalMap3D' => 'FALSE')); |
|
1306 | 1306 | } |
1307 | - $crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING); |
|
1307 | + $crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING); |
|
1308 | 1308 | if ($crash == 'crash') { |
1309 | - $settings = array_merge($settings,array('globalAccidents' => 'TRUE')); |
|
1309 | + $settings = array_merge($settings, array('globalAccidents' => 'TRUE')); |
|
1310 | 1310 | } else { |
1311 | - $settings = array_merge($settings,array('globalAccidents' => 'FALSE')); |
|
1311 | + $settings = array_merge($settings, array('globalAccidents' => 'FALSE')); |
|
1312 | 1312 | } |
1313 | - $fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING); |
|
1313 | + $fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING); |
|
1314 | 1314 | if ($fires == 'fires') { |
1315 | - $settings = array_merge($settings,array('globalMapFires' => 'TRUE')); |
|
1315 | + $settings = array_merge($settings, array('globalMapFires' => 'TRUE')); |
|
1316 | 1316 | } else { |
1317 | - $settings = array_merge($settings,array('globalMapFires' => 'FALSE')); |
|
1317 | + $settings = array_merge($settings, array('globalMapFires' => 'FALSE')); |
|
1318 | 1318 | } |
1319 | - $firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING); |
|
1319 | + $firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING); |
|
1320 | 1320 | if ($firessupport == 'firessupport') { |
1321 | - $settings = array_merge($settings,array('globalFires' => 'TRUE')); |
|
1321 | + $settings = array_merge($settings, array('globalFires' => 'TRUE')); |
|
1322 | 1322 | } else { |
1323 | - $settings = array_merge($settings,array('globalFires' => 'FALSE')); |
|
1323 | + $settings = array_merge($settings, array('globalFires' => 'FALSE')); |
|
1324 | 1324 | } |
1325 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING); |
|
1325 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING); |
|
1326 | 1326 | if ($mapsatellites == 'mapsatellites') { |
1327 | - $settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); |
|
1327 | + $settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); |
|
1328 | 1328 | } else { |
1329 | - $settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); |
|
1329 | + $settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); |
|
1330 | 1330 | } |
1331 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING); |
|
1331 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING); |
|
1332 | 1332 | if ($map3ddefault == 'map3ddefault') { |
1333 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); |
|
1333 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); |
|
1334 | 1334 | } else { |
1335 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); |
|
1335 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); |
|
1336 | 1336 | } |
1337 | - $map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING); |
|
1337 | + $map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING); |
|
1338 | 1338 | if ($map3dliveries == 'map3dliveries') { |
1339 | - $settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE')); |
|
1339 | + $settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE')); |
|
1340 | 1340 | } else { |
1341 | - $settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE')); |
|
1341 | + $settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE')); |
|
1342 | 1342 | } |
1343 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
1343 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
1344 | 1344 | if ($translate == 'translate') { |
1345 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
1345 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
1346 | 1346 | } else { |
1347 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
1347 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
1348 | 1348 | } |
1349 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING); |
|
1349 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING); |
|
1350 | 1350 | if ($realairlines == 'realairlines') { |
1351 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); |
|
1351 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); |
|
1352 | 1352 | } else { |
1353 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); |
|
1353 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); |
|
1354 | 1354 | } |
1355 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
1355 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
1356 | 1356 | if ($estimation == 'estimation') { |
1357 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
1357 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
1358 | 1358 | } else { |
1359 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
1359 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
1360 | 1360 | } |
1361 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
1361 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
1362 | 1362 | if ($metar == 'metar') { |
1363 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
1363 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
1364 | 1364 | } else { |
1365 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
1365 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
1366 | 1366 | } |
1367 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
1367 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
1368 | 1368 | if ($metarcycle == 'metarcycle') { |
1369 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
1369 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
1370 | 1370 | } else { |
1371 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
1371 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
1372 | 1372 | } |
1373 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
1373 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
1374 | 1374 | if ($fork == 'fork') { |
1375 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
1375 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
1376 | 1376 | } else { |
1377 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
1377 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
1378 | 1378 | } |
1379 | 1379 | |
1380 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
1380 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
1381 | 1381 | if ($colormap == 'colormap') { |
1382 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
1382 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
1383 | 1383 | } else { |
1384 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
1384 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
1385 | 1385 | } |
1386 | 1386 | |
1387 | 1387 | if (isset($_POST['aircrafticoncolor'])) { |
1388 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
1389 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
1388 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
1389 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
1390 | 1390 | } |
1391 | 1391 | |
1392 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
1393 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
1392 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
1393 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
1394 | 1394 | |
1395 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
1396 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
1397 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
1398 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
1399 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
1400 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
1395 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
1396 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
1397 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
1398 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
1399 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
1400 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
1401 | 1401 | |
1402 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
1402 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
1403 | 1403 | if ($mappopup == 'mappopup') { |
1404 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
1404 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
1405 | 1405 | } else { |
1406 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
1406 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
1407 | 1407 | } |
1408 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
1408 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
1409 | 1409 | if ($airportpopup == 'airportpopup') { |
1410 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
1410 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
1411 | 1411 | } else { |
1412 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
1412 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
1413 | 1413 | } |
1414 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
1414 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
1415 | 1415 | if ($maphistory == 'maphistory') { |
1416 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
1416 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
1417 | 1417 | } else { |
1418 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
1418 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
1419 | 1419 | } |
1420 | - $maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING); |
|
1420 | + $maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING); |
|
1421 | 1421 | if ($maptooltip == 'maptooltip') { |
1422 | - $settings = array_merge($settings,array('globalMapTooltip' => 'TRUE')); |
|
1422 | + $settings = array_merge($settings, array('globalMapTooltip' => 'TRUE')); |
|
1423 | 1423 | } else { |
1424 | - $settings = array_merge($settings,array('globalMapTooltip' => 'FALSE')); |
|
1424 | + $settings = array_merge($settings, array('globalMapTooltip' => 'FALSE')); |
|
1425 | 1425 | } |
1426 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
1426 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
1427 | 1427 | if ($flightroute == 'flightroute') { |
1428 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
1428 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
1429 | 1429 | } else { |
1430 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
1430 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
1431 | 1431 | } |
1432 | - $flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING); |
|
1432 | + $flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING); |
|
1433 | 1433 | if ($flightremainingroute == 'flightremainingroute') { |
1434 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE')); |
|
1434 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE')); |
|
1435 | 1435 | } else { |
1436 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE')); |
|
1436 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE')); |
|
1437 | 1437 | } |
1438 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING); |
|
1438 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING); |
|
1439 | 1439 | if ($allflights == 'allflights') { |
1440 | - $settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); |
|
1440 | + $settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); |
|
1441 | 1441 | } else { |
1442 | - $settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); |
|
1442 | + $settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); |
|
1443 | 1443 | } |
1444 | - $bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING); |
|
1444 | + $bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING); |
|
1445 | 1445 | if ($bbox == 'bbox') { |
1446 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE')); |
|
1446 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE')); |
|
1447 | 1447 | } else { |
1448 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE')); |
|
1448 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE')); |
|
1449 | 1449 | } |
1450 | - $groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING); |
|
1450 | + $groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING); |
|
1451 | 1451 | if ($groundaltitude == 'groundaltitude') { |
1452 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE')); |
|
1452 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE')); |
|
1453 | 1453 | } else { |
1454 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE')); |
|
1454 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE')); |
|
1455 | 1455 | } |
1456 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING); |
|
1456 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING); |
|
1457 | 1457 | if ($waypoints == 'waypoints') { |
1458 | - $settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); |
|
1458 | + $settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); |
|
1459 | 1459 | } else { |
1460 | - $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
|
1460 | + $settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); |
|
1461 | 1461 | } |
1462 | - $geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING); |
|
1462 | + $geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING); |
|
1463 | 1463 | if ($geoid == 'geoid') { |
1464 | - $settings = array_merge($settings,array('globalGeoid' => 'TRUE')); |
|
1464 | + $settings = array_merge($settings, array('globalGeoid' => 'TRUE')); |
|
1465 | 1465 | } else { |
1466 | - $settings = array_merge($settings,array('globalGeoid' => 'FALSE')); |
|
1466 | + $settings = array_merge($settings, array('globalGeoid' => 'FALSE')); |
|
1467 | 1467 | } |
1468 | - $geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING); |
|
1469 | - $settings = array_merge($settings,array('globalGeoidSource' => $geoid_source)); |
|
1468 | + $geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING); |
|
1469 | + $settings = array_merge($settings, array('globalGeoidSource' => $geoid_source)); |
|
1470 | 1470 | |
1471 | - $noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING); |
|
1471 | + $noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING); |
|
1472 | 1472 | if ($noairlines == 'noairlines') { |
1473 | - $settings = array_merge($settings,array('globalNoAirlines' => 'TRUE')); |
|
1473 | + $settings = array_merge($settings, array('globalNoAirlines' => 'TRUE')); |
|
1474 | 1474 | } else { |
1475 | - $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
|
1475 | + $settings = array_merge($settings, array('globalNoAirlines' => 'FALSE')); |
|
1476 | 1476 | } |
1477 | 1477 | |
1478 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1478 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
1479 | 1479 | |
1480 | 1480 | // Set some defaults values... |
1481 | 1481 | if (!isset($globalAircraftImageSources)) { |
1482 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1483 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1482 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
1483 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1484 | 1484 | } |
1485 | 1485 | |
1486 | 1486 | if (!isset($globalSchedulesSources)) { |
1487 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1488 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1487 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
1488 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1489 | 1489 | } |
1490 | 1490 | |
1491 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
1491 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
1492 | 1492 | |
1493 | 1493 | if ($error == '') settings::modify_settings($settings); |
1494 | 1494 | if ($error == '') settings::comment_settings($settings_comment); |