@@ -17,33 +17,33 @@ discard block |
||
| 17 | 17 | * @param Array $filter the filter |
| 18 | 18 | * @return Array the SQL part |
| 19 | 19 | */ |
| 20 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
| 20 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
| 21 | 21 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
| 22 | 22 | $filters = array(); |
| 23 | 23 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
| 24 | 24 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
| 25 | 25 | $filters = $globalStatsFilters[$globalFilterName]; |
| 26 | 26 | } else { |
| 27 | - $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
|
| 27 | + $filter = array_merge($filter, $globalStatsFilters[$globalFilterName]); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | if (isset($filter[0]['source'])) { |
| 31 | - $filters = array_merge($filters,$filter); |
|
| 31 | + $filters = array_merge($filters, $filter); |
|
| 32 | 32 | } |
| 33 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 33 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
| 34 | 34 | $filter_query_join = ''; |
| 35 | 35 | $filter_query_where = ''; |
| 36 | - foreach($filters as $flt) { |
|
| 36 | + foreach ($filters as $flt) { |
|
| 37 | 37 | if (isset($flt['idents']) && !empty($flt['idents'])) { |
| 38 | 38 | if (isset($flt['source'])) { |
| 39 | - $filter_query_join .= " INNER JOIN (SELECT fammarine_id FROM marine_output WHERE marine_output.ident IN ('".implode("','",$flt['idents'])."') AND marine_output.format_source IN ('".implode("','",$flt['source'])."')) spid ON spid.fammarine_id = marine_live.fammarine_id"; |
|
| 39 | + $filter_query_join .= " INNER JOIN (SELECT fammarine_id FROM marine_output WHERE marine_output.ident IN ('".implode("','", $flt['idents'])."') AND marine_output.format_source IN ('".implode("','", $flt['source'])."')) spid ON spid.fammarine_id = marine_live.fammarine_id"; |
|
| 40 | 40 | } else { |
| 41 | - $filter_query_join .= " INNER JOIN (SELECT fammarine_id FROM marine_output WHERE marine_output.ident IN ('".implode("','",$flt['idents'])."')) spid ON spid.fammarine_id = marine_live.fammarine_id"; |
|
| 41 | + $filter_query_join .= " INNER JOIN (SELECT fammarine_id FROM marine_output WHERE marine_output.ident IN ('".implode("','", $flt['idents'])."')) spid ON spid.fammarine_id = marine_live.fammarine_id"; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 46 | - $filter_query_where .= " AND format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 46 | + $filter_query_where .= " AND format_source IN ('".implode("','", $filter['source'])."')"; |
|
| 47 | 47 | } |
| 48 | 48 | if (isset($filter['ident']) && !empty($filter['ident'])) { |
| 49 | 49 | $filter_query_where .= " AND ident = '".$filter['ident']."'"; |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | $filter_query_date .= " AND EXTRACT(DAY FROM marine_output.date) = '".$filter['day']."'"; |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | - $filter_query_join .= " INNER JOIN (SELECT fammarine_id FROM marine_output".preg_replace('/^ AND/',' WHERE',$filter_query_date).") sd ON sd.fammarine_id = marine_live.fammarine_id"; |
|
| 81 | + $filter_query_join .= " INNER JOIN (SELECT fammarine_id FROM marine_output".preg_replace('/^ AND/', ' WHERE', $filter_query_date).") sd ON sd.fammarine_id = marine_live.fammarine_id"; |
|
| 82 | 82 | } |
| 83 | 83 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 84 | - $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 84 | + $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 85 | 85 | } |
| 86 | 86 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
| 87 | 87 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
| 88 | 88 | if ($filter_query_where != '') { |
| 89 | - $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
|
| 89 | + $filter_query_where = preg_replace('/^ AND/', ' WHERE', $filter_query_where); |
|
| 90 | 90 | } |
| 91 | 91 | $filter_query = $filter_query_join.$filter_query_where; |
| 92 | 92 | return $filter_query; |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | if ($limit != '') |
| 110 | 110 | { |
| 111 | 111 | $limit_array = explode(',', $limit); |
| 112 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 113 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 112 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 113 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 114 | 114 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 115 | 115 | { |
| 116 | 116 | $limit_query = ' LIMIT '.$limit_array[1].' OFFSET '.$limit_array[0]; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $orderby_query = ' '.$search_orderby_array[$sort]['sql']; |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | - if ($orderby_query == '') $orderby_query= ' ORDER BY date DESC'; |
|
| 128 | + if ($orderby_query == '') $orderby_query = ' ORDER BY date DESC'; |
|
| 129 | 129 | |
| 130 | 130 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 131 | 131 | if ($globalDBdriver == 'mysql') { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } else { |
| 135 | 135 | $query = "SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate".$filter_query.$orderby_query; |
| 136 | 136 | } |
| 137 | - $spotter_array = $Marine->getDataFromDB($query.$limit_query,array(),'',true); |
|
| 137 | + $spotter_array = $Marine->getDataFromDB($query.$limit_query, array(), '', true); |
|
| 138 | 138 | |
| 139 | 139 | return $spotter_array; |
| 140 | 140 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | global $globalDBdriver, $globalLiveInterval; |
| 151 | 151 | date_default_timezone_set('UTC'); |
| 152 | 152 | |
| 153 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 153 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 154 | 154 | |
| 155 | 155 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 156 | 156 | if ($globalDBdriver == 'mysql') { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | try { |
| 165 | 165 | $sth = $this->db->prepare($query); |
| 166 | 166 | $sth->execute(); |
| 167 | - } catch(PDOException $e) { |
|
| 167 | + } catch (PDOException $e) { |
|
| 168 | 168 | echo $e->getMessage(); |
| 169 | 169 | die; |
| 170 | 170 | } |
@@ -179,19 +179,19 @@ discard block |
||
| 179 | 179 | * @return Array the spotter information |
| 180 | 180 | * |
| 181 | 181 | */ |
| 182 | - public function getMinLastLiveMarineData($coord = array(),$filter = array(), $limit = false) |
|
| 182 | + public function getMinLastLiveMarineData($coord = array(), $filter = array(), $limit = false) |
|
| 183 | 183 | { |
| 184 | 184 | global $globalDBdriver, $globalLiveInterval, $globalMap3DMarinesLimit, $globalArchive; |
| 185 | 185 | date_default_timezone_set('UTC'); |
| 186 | 186 | $usecoord = false; |
| 187 | 187 | if (is_array($coord) && !empty($coord)) { |
| 188 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 189 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 190 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 191 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 188 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 189 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 190 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 191 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 192 | 192 | $usecoord = true; |
| 193 | 193 | } |
| 194 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 194 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 195 | 195 | |
| 196 | 196 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 197 | 197 | if (!isset($globalMap3DMarinesLimit) || $globalMap3DMarinesLimit == '') $globalMap3DMarinesLimit = '300'; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | try { |
| 241 | 241 | $sth = $this->db->prepare($query); |
| 242 | 242 | $sth->execute(); |
| 243 | - } catch(PDOException $e) { |
|
| 243 | + } catch (PDOException $e) { |
|
| 244 | 244 | echo $e->getMessage(); |
| 245 | 245 | die; |
| 246 | 246 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | public function getLiveMarineCount($filter = array()) |
| 258 | 258 | { |
| 259 | 259 | global $globalDBdriver, $globalLiveInterval; |
| 260 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 260 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 261 | 261 | |
| 262 | 262 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 263 | 263 | if ($globalDBdriver == 'mysql') { |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | try { |
| 269 | 269 | $sth = $this->db->prepare($query); |
| 270 | 270 | $sth->execute(); |
| 271 | - } catch(PDOException $e) { |
|
| 271 | + } catch (PDOException $e) { |
|
| 272 | 272 | echo $e->getMessage(); |
| 273 | 273 | die; |
| 274 | 274 | } |
@@ -291,10 +291,10 @@ discard block |
||
| 291 | 291 | $filter_query = $this->getFilter($filter); |
| 292 | 292 | |
| 293 | 293 | if (is_array($coord)) { |
| 294 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 295 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 296 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 297 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 294 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 295 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 296 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 297 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 298 | 298 | } else return array(); |
| 299 | 299 | if ($globalDBdriver == 'mysql') { |
| 300 | 300 | $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate AND marine_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND marine_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY marine_live.fammarine_id ORDER BY date DESC'.$filter_query; |
@@ -316,13 +316,13 @@ discard block |
||
| 316 | 316 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
| 317 | 317 | $Marine = new Marine($this->db); |
| 318 | 318 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 319 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 319 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 320 | 320 | |
| 321 | 321 | if (is_array($coord)) { |
| 322 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 323 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 324 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 325 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 322 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 323 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 324 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 325 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 326 | 326 | } else return array(); |
| 327 | 327 | /* |
| 328 | 328 | if ($globalDBdriver == 'mysql') { |
@@ -337,13 +337,13 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | if ($globalDBdriver == 'mysql') { |
| 339 | 339 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 340 | - $query = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
|
| 340 | + $query = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
|
| 341 | 341 | FROM marine_live |
| 342 | 342 | '.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= marine_live.date |
| 343 | 343 | AND marine_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND marine_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' |
| 344 | 344 | AND marine_live.latitude <> 0 AND marine_live.longitude <> 0 ORDER BY date DESC'; |
| 345 | 345 | } else { |
| 346 | - $query = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
|
| 346 | + $query = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
|
| 347 | 347 | FROM marine_live |
| 348 | 348 | INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate |
| 349 | 349 | FROM marine_live l |
@@ -355,14 +355,14 @@ discard block |
||
| 355 | 355 | } |
| 356 | 356 | } else { |
| 357 | 357 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 358 | - $query = "SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
|
| 358 | + $query = "SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
|
| 359 | 359 | FROM marine_live |
| 360 | 360 | ".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date |
| 361 | 361 | AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." |
| 362 | 362 | AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." |
| 363 | 363 | AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' ORDER BY date DESC"; |
| 364 | 364 | } else { |
| 365 | - $query = "SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
|
| 365 | + $query = "SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
|
| 366 | 366 | FROM marine_live |
| 367 | 367 | INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate |
| 368 | 368 | FROM marine_live l |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | if ($interval == '1m') |
| 420 | 420 | { |
| 421 | 421 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= marine_live.date '; |
| 422 | - } else if ($interval == '15m'){ |
|
| 422 | + } else if ($interval == '15m') { |
|
| 423 | 423 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= marine_live.date '; |
| 424 | 424 | } |
| 425 | 425 | } |
@@ -427,14 +427,14 @@ discard block |
||
| 427 | 427 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= marine_live.date '; |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | - $query = "SELECT marine_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM marine_live |
|
| 430 | + $query = "SELECT marine_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM marine_live |
|
| 431 | 431 | WHERE marine_live.latitude <> '' |
| 432 | 432 | AND marine_live.longitude <> '' |
| 433 | 433 | ".$additional_query." |
| 434 | 434 | HAVING distance < :radius |
| 435 | 435 | ORDER BY distance"; |
| 436 | 436 | |
| 437 | - $spotter_array = $Marine->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius)); |
|
| 437 | + $spotter_array = $Marine->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng, ':radius' => $radius)); |
|
| 438 | 438 | |
| 439 | 439 | return $spotter_array; |
| 440 | 440 | } |
@@ -452,9 +452,9 @@ discard block |
||
| 452 | 452 | date_default_timezone_set('UTC'); |
| 453 | 453 | |
| 454 | 454 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 455 | - $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE l.ident = :ident GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate ORDER BY marine_live.date DESC'; |
|
| 455 | + $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE l.ident = :ident GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate ORDER BY marine_live.date DESC'; |
|
| 456 | 456 | |
| 457 | - $spotter_array = $Marine->getDataFromDB($query,array(':ident' => $ident),'',true); |
|
| 457 | + $spotter_array = $Marine->getDataFromDB($query, array(':ident' => $ident), '', true); |
|
| 458 | 458 | |
| 459 | 459 | return $spotter_array; |
| 460 | 460 | } |
@@ -465,14 +465,14 @@ discard block |
||
| 465 | 465 | * @return Array the spotter information |
| 466 | 466 | * |
| 467 | 467 | */ |
| 468 | - public function getDateLiveMarineDataByIdent($ident,$date) |
|
| 468 | + public function getDateLiveMarineDataByIdent($ident, $date) |
|
| 469 | 469 | { |
| 470 | 470 | $Marine = new Marine($this->db); |
| 471 | 471 | date_default_timezone_set('UTC'); |
| 472 | 472 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 473 | 473 | $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate ORDER BY marine_live.date DESC'; |
| 474 | - $date = date('c',$date); |
|
| 475 | - $spotter_array = $Marine->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
|
| 474 | + $date = date('c', $date); |
|
| 475 | + $spotter_array = $Marine->getDataFromDB($query, array(':ident' => $ident, ':date' => $date)); |
|
| 476 | 476 | return $spotter_array; |
| 477 | 477 | } |
| 478 | 478 | |
@@ -482,14 +482,14 @@ discard block |
||
| 482 | 482 | * @return Array the spotter information |
| 483 | 483 | * |
| 484 | 484 | */ |
| 485 | - public function getDateLiveMarineDataByMMSI($mmsi,$date) |
|
| 485 | + public function getDateLiveMarineDataByMMSI($mmsi, $date) |
|
| 486 | 486 | { |
| 487 | 487 | $Marine = new Marine($this->db); |
| 488 | 488 | date_default_timezone_set('UTC'); |
| 489 | 489 | $mmsi = filter_var($mmsi, FILTER_SANITIZE_NUMBER_INT); |
| 490 | 490 | $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE l.mmsi = :mmsi AND l.date <= :date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate ORDER BY marine_live.date DESC'; |
| 491 | - $date = date('c',$date); |
|
| 492 | - $spotter_array = $Marine->getDataFromDB($query,array(':mmsi' => $mmsi,':date' => $date)); |
|
| 491 | + $date = date('c', $date); |
|
| 492 | + $spotter_array = $Marine->getDataFromDB($query, array(':mmsi' => $mmsi, ':date' => $date)); |
|
| 493 | 493 | return $spotter_array; |
| 494 | 494 | } |
| 495 | 495 | |
@@ -505,9 +505,9 @@ discard block |
||
| 505 | 505 | date_default_timezone_set('UTC'); |
| 506 | 506 | |
| 507 | 507 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 508 | - $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE l.fammarine_id = :id GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate ORDER BY marine_live.date DESC'; |
|
| 508 | + $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE l.fammarine_id = :id GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate ORDER BY marine_live.date DESC'; |
|
| 509 | 509 | |
| 510 | - $spotter_array = $Marine->getDataFromDB($query,array(':id' => $id),'',true); |
|
| 510 | + $spotter_array = $Marine->getDataFromDB($query, array(':id' => $id), '', true); |
|
| 511 | 511 | |
| 512 | 512 | return $spotter_array; |
| 513 | 513 | } |
@@ -518,15 +518,15 @@ discard block |
||
| 518 | 518 | * @return Array the spotter information |
| 519 | 519 | * |
| 520 | 520 | */ |
| 521 | - public function getDateLiveMarineDataById($id,$date) |
|
| 521 | + public function getDateLiveMarineDataById($id, $date) |
|
| 522 | 522 | { |
| 523 | 523 | $Marine = new Marine($this->db); |
| 524 | 524 | date_default_timezone_set('UTC'); |
| 525 | 525 | |
| 526 | 526 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 527 | - $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE l.fammarine_id = :id AND l.date <= :date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate ORDER BY marine_live.date DESC'; |
|
| 528 | - $date = date('c',$date); |
|
| 529 | - $spotter_array = $Marine->getDataFromDB($query,array(':id' => $id,':date' => $date),'',true); |
|
| 527 | + $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE l.fammarine_id = :id AND l.date <= :date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate ORDER BY marine_live.date DESC'; |
|
| 528 | + $date = date('c', $date); |
|
| 529 | + $spotter_array = $Marine->getDataFromDB($query, array(':id' => $id, ':date' => $date), '', true); |
|
| 530 | 530 | |
| 531 | 531 | return $spotter_array; |
| 532 | 532 | } |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | * @return Array the spotter information |
| 539 | 539 | * |
| 540 | 540 | */ |
| 541 | - public function getAllLiveMarineDataById($id,$liveinterval = false) |
|
| 541 | + public function getAllLiveMarineDataById($id, $liveinterval = false) |
|
| 542 | 542 | { |
| 543 | 543 | global $globalDBdriver, $globalLiveInterval; |
| 544 | 544 | date_default_timezone_set('UTC'); |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | try { |
| 558 | 558 | $sth = $this->db->prepare($query); |
| 559 | 559 | $sth->execute(array(':id' => $id)); |
| 560 | - } catch(PDOException $e) { |
|
| 560 | + } catch (PDOException $e) { |
|
| 561 | 561 | echo $e->getMessage(); |
| 562 | 562 | die; |
| 563 | 563 | } |
@@ -575,12 +575,12 @@ discard block |
||
| 575 | 575 | { |
| 576 | 576 | date_default_timezone_set('UTC'); |
| 577 | 577 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 578 | - $query = self::$global_query.' WHERE marine_live.ident = :ident'; |
|
| 578 | + $query = self::$global_query.' WHERE marine_live.ident = :ident'; |
|
| 579 | 579 | try { |
| 580 | 580 | |
| 581 | 581 | $sth = $this->db->prepare($query); |
| 582 | 582 | $sth->execute(array(':ident' => $ident)); |
| 583 | - } catch(PDOException $e) { |
|
| 583 | + } catch (PDOException $e) { |
|
| 584 | 584 | echo $e->getMessage(); |
| 585 | 585 | die; |
| 586 | 586 | } |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | |
| 611 | 611 | $sth = $this->db->prepare($query); |
| 612 | 612 | $sth->execute(); |
| 613 | - } catch(PDOException $e) { |
|
| 613 | + } catch (PDOException $e) { |
|
| 614 | 614 | return "error"; |
| 615 | 615 | } |
| 616 | 616 | |
@@ -633,14 +633,14 @@ discard block |
||
| 633 | 633 | |
| 634 | 634 | $sth = $this->db->prepare($query); |
| 635 | 635 | $sth->execute(); |
| 636 | - } catch(PDOException $e) { |
|
| 636 | + } catch (PDOException $e) { |
|
| 637 | 637 | return "error"; |
| 638 | 638 | } |
| 639 | 639 | $query_delete = 'DELETE FROM marine_live WHERE fammarine_id IN ('; |
| 640 | 640 | $i = 0; |
| 641 | - $j =0; |
|
| 641 | + $j = 0; |
|
| 642 | 642 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 643 | - foreach($all as $row) |
|
| 643 | + foreach ($all as $row) |
|
| 644 | 644 | { |
| 645 | 645 | $i++; |
| 646 | 646 | $j++; |
@@ -648,9 +648,9 @@ discard block |
||
| 648 | 648 | if ($globalDebug) echo "."; |
| 649 | 649 | try { |
| 650 | 650 | |
| 651 | - $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
|
| 651 | + $sth = $this->db->prepare(substr($query_delete, 0, -1).")"); |
|
| 652 | 652 | $sth->execute(); |
| 653 | - } catch(PDOException $e) { |
|
| 653 | + } catch (PDOException $e) { |
|
| 654 | 654 | return "error"; |
| 655 | 655 | } |
| 656 | 656 | $query_delete = 'DELETE FROM marine_live WHERE fammarine_id IN ('; |
@@ -661,9 +661,9 @@ discard block |
||
| 661 | 661 | if ($i > 0) { |
| 662 | 662 | try { |
| 663 | 663 | |
| 664 | - $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
|
| 664 | + $sth = $this->db->prepare(substr($query_delete, 0, -1).")"); |
|
| 665 | 665 | $sth->execute(); |
| 666 | - } catch(PDOException $e) { |
|
| 666 | + } catch (PDOException $e) { |
|
| 667 | 667 | return "error"; |
| 668 | 668 | } |
| 669 | 669 | } |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | |
| 677 | 677 | $sth = $this->db->prepare($query); |
| 678 | 678 | $sth->execute(); |
| 679 | - } catch(PDOException $e) { |
|
| 679 | + } catch (PDOException $e) { |
|
| 680 | 680 | return "error"; |
| 681 | 681 | } |
| 682 | 682 | /* $query_delete = "DELETE FROM marine_live WHERE fammarine_id IN ("; |
@@ -724,13 +724,13 @@ discard block |
||
| 724 | 724 | public function deleteLiveMarineDataByIdent($ident) |
| 725 | 725 | { |
| 726 | 726 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 727 | - $query = 'DELETE FROM marine_live WHERE ident = :ident'; |
|
| 727 | + $query = 'DELETE FROM marine_live WHERE ident = :ident'; |
|
| 728 | 728 | |
| 729 | 729 | try { |
| 730 | 730 | |
| 731 | 731 | $sth = $this->db->prepare($query); |
| 732 | 732 | $sth->execute(array(':ident' => $ident)); |
| 733 | - } catch(PDOException $e) { |
|
| 733 | + } catch (PDOException $e) { |
|
| 734 | 734 | return "error"; |
| 735 | 735 | } |
| 736 | 736 | |
@@ -746,13 +746,13 @@ discard block |
||
| 746 | 746 | public function deleteLiveMarineDataById($id) |
| 747 | 747 | { |
| 748 | 748 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 749 | - $query = 'DELETE FROM marine_live WHERE fammarine_id = :id'; |
|
| 749 | + $query = 'DELETE FROM marine_live WHERE fammarine_id = :id'; |
|
| 750 | 750 | |
| 751 | 751 | try { |
| 752 | 752 | |
| 753 | 753 | $sth = $this->db->prepare($query); |
| 754 | 754 | $sth->execute(array(':id' => $id)); |
| 755 | - } catch(PDOException $e) { |
|
| 755 | + } catch (PDOException $e) { |
|
| 756 | 756 | return "error"; |
| 757 | 757 | } |
| 758 | 758 | |
@@ -770,13 +770,13 @@ discard block |
||
| 770 | 770 | { |
| 771 | 771 | global $globalDBdriver, $globalTimezone; |
| 772 | 772 | if ($globalDBdriver == 'mysql') { |
| 773 | - $query = 'SELECT marine_live.ident FROM marine_live |
|
| 773 | + $query = 'SELECT marine_live.ident FROM marine_live |
|
| 774 | 774 | WHERE marine_live.ident = :ident |
| 775 | 775 | AND marine_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) |
| 776 | 776 | AND marine_live.date < UTC_TIMESTAMP()'; |
| 777 | 777 | $query_data = array(':ident' => $ident); |
| 778 | 778 | } else { |
| 779 | - $query = "SELECT marine_live.ident FROM marine_live |
|
| 779 | + $query = "SELECT marine_live.ident FROM marine_live |
|
| 780 | 780 | WHERE marine_live.ident = :ident |
| 781 | 781 | AND marine_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 782 | 782 | AND marine_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -785,8 +785,8 @@ discard block |
||
| 785 | 785 | |
| 786 | 786 | $sth = $this->db->prepare($query); |
| 787 | 787 | $sth->execute($query_data); |
| 788 | - $ident_result=''; |
|
| 789 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 788 | + $ident_result = ''; |
|
| 789 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 790 | 790 | { |
| 791 | 791 | $ident_result = $row['ident']; |
| 792 | 792 | } |
@@ -803,13 +803,13 @@ discard block |
||
| 803 | 803 | { |
| 804 | 804 | global $globalDBdriver, $globalTimezone; |
| 805 | 805 | if ($globalDBdriver == 'mysql') { |
| 806 | - $query = 'SELECT marine_live.ident, marine_live.fammarine_id FROM marine_live |
|
| 806 | + $query = 'SELECT marine_live.ident, marine_live.fammarine_id FROM marine_live |
|
| 807 | 807 | WHERE marine_live.ident = :ident |
| 808 | 808 | AND marine_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE)'; |
| 809 | 809 | // AND marine_live.date < UTC_TIMESTAMP()"; |
| 810 | 810 | $query_data = array(':ident' => $ident); |
| 811 | 811 | } else { |
| 812 | - $query = "SELECT marine_live.ident, marine_live.fammarine_id FROM marine_live |
|
| 812 | + $query = "SELECT marine_live.ident, marine_live.fammarine_id FROM marine_live |
|
| 813 | 813 | WHERE marine_live.ident = :ident |
| 814 | 814 | AND marine_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '30 MINUTES'"; |
| 815 | 815 | // AND marine_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -818,8 +818,8 @@ discard block |
||
| 818 | 818 | |
| 819 | 819 | $sth = $this->db->prepare($query); |
| 820 | 820 | $sth->execute($query_data); |
| 821 | - $ident_result=''; |
|
| 822 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 821 | + $ident_result = ''; |
|
| 822 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 823 | 823 | { |
| 824 | 824 | $ident_result = $row['fammarine_id']; |
| 825 | 825 | } |
@@ -836,13 +836,13 @@ discard block |
||
| 836 | 836 | { |
| 837 | 837 | global $globalDBdriver, $globalTimezone; |
| 838 | 838 | if ($globalDBdriver == 'mysql') { |
| 839 | - $query = 'SELECT marine_live.ident, marine_live.fammarine_id FROM marine_live |
|
| 839 | + $query = 'SELECT marine_live.ident, marine_live.fammarine_id FROM marine_live |
|
| 840 | 840 | WHERE marine_live.fammarine_id = :id |
| 841 | 841 | AND marine_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 HOUR)'; |
| 842 | 842 | // AND marine_live.date < UTC_TIMESTAMP()"; |
| 843 | 843 | $query_data = array(':id' => $id); |
| 844 | 844 | } else { |
| 845 | - $query = "SELECT marine_live.ident, marine_live.fammarine_id FROM marine_live |
|
| 845 | + $query = "SELECT marine_live.ident, marine_live.fammarine_id FROM marine_live |
|
| 846 | 846 | WHERE marine_live.fammarine_id = :id |
| 847 | 847 | AND marine_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '10 HOUR'"; |
| 848 | 848 | // AND marine_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -851,8 +851,8 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | $sth = $this->db->prepare($query); |
| 853 | 853 | $sth->execute($query_data); |
| 854 | - $ident_result=''; |
|
| 855 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 854 | + $ident_result = ''; |
|
| 855 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 856 | 856 | { |
| 857 | 857 | $ident_result = $row['fammarine_id']; |
| 858 | 858 | } |
@@ -869,13 +869,13 @@ discard block |
||
| 869 | 869 | { |
| 870 | 870 | global $globalDBdriver, $globalTimezone; |
| 871 | 871 | if ($globalDBdriver == 'mysql') { |
| 872 | - $query = 'SELECT marine_live.fammarine_id FROM marine_live |
|
| 872 | + $query = 'SELECT marine_live.fammarine_id FROM marine_live |
|
| 873 | 873 | WHERE marine_live.mmsi = :mmsi |
| 874 | 874 | AND marine_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 HOUR)'; |
| 875 | 875 | // AND marine_live.date < UTC_TIMESTAMP()"; |
| 876 | 876 | $query_data = array(':mmsi' => $mmsi); |
| 877 | 877 | } else { |
| 878 | - $query = "SELECT marine_live.fammarine_id FROM marine_live |
|
| 878 | + $query = "SELECT marine_live.fammarine_id FROM marine_live |
|
| 879 | 879 | WHERE marine_live.mmsi = :mmsi |
| 880 | 880 | AND marine_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '10 HOUR'"; |
| 881 | 881 | // AND marine_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -884,8 +884,8 @@ discard block |
||
| 884 | 884 | |
| 885 | 885 | $sth = $this->db->prepare($query); |
| 886 | 886 | $sth->execute($query_data); |
| 887 | - $ident_result=''; |
|
| 888 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 887 | + $ident_result = ''; |
|
| 888 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 889 | 889 | { |
| 890 | 890 | $ident_result = $row['fammarine_id']; |
| 891 | 891 | } |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | * @return String success or false |
| 904 | 904 | * |
| 905 | 905 | */ |
| 906 | - public function addLiveMarineData($fammarine_id = '', $ident = '', $latitude = '', $longitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $mmsi = '',$type = '',$typeid = '',$imo = '', $callsign = '',$arrival_code = '',$arrival_date = '',$status = '',$statusid = '',$noarchive = false,$format_source = '', $source_name = '', $over_country = '') |
|
| 906 | + public function addLiveMarineData($fammarine_id = '', $ident = '', $latitude = '', $longitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $mmsi = '', $type = '', $typeid = '', $imo = '', $callsign = '', $arrival_code = '', $arrival_date = '', $status = '', $statusid = '', $noarchive = false, $format_source = '', $source_name = '', $over_country = '') |
|
| 907 | 907 | { |
| 908 | 908 | global $globalURL, $globalArchive, $globalDebug; |
| 909 | 909 | $Common = new Common(); |
@@ -955,29 +955,29 @@ discard block |
||
| 955 | 955 | if ($date == '') $date = date("Y-m-d H:i:s", time()); |
| 956 | 956 | |
| 957 | 957 | |
| 958 | - $fammarine_id = filter_var($fammarine_id,FILTER_SANITIZE_STRING); |
|
| 959 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 960 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 961 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 962 | - $heading = filter_var($heading,FILTER_SANITIZE_NUMBER_INT); |
|
| 963 | - $groundspeed = filter_var($groundspeed,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 964 | - $format_source = filter_var($format_source,FILTER_SANITIZE_STRING); |
|
| 965 | - $source_name = filter_var($source_name,FILTER_SANITIZE_STRING); |
|
| 966 | - $over_country = filter_var($over_country,FILTER_SANITIZE_STRING); |
|
| 967 | - $type = filter_var($type,FILTER_SANITIZE_STRING); |
|
| 968 | - $typeid = filter_var($typeid,FILTER_SANITIZE_NUMBER_INT); |
|
| 969 | - $mmsi = filter_var($mmsi,FILTER_SANITIZE_NUMBER_INT); |
|
| 970 | - $status = filter_var($status,FILTER_SANITIZE_STRING); |
|
| 971 | - $statusid = filter_var($statusid,FILTER_SANITIZE_NUMBER_INT); |
|
| 972 | - $imo = filter_var($imo,FILTER_SANITIZE_STRING); |
|
| 973 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
| 974 | - $arrival_code = filter_var($arrival_code,FILTER_SANITIZE_STRING); |
|
| 975 | - $arrival_date = filter_var($arrival_date,FILTER_SANITIZE_STRING); |
|
| 958 | + $fammarine_id = filter_var($fammarine_id, FILTER_SANITIZE_STRING); |
|
| 959 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 960 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 961 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 962 | + $heading = filter_var($heading, FILTER_SANITIZE_NUMBER_INT); |
|
| 963 | + $groundspeed = filter_var($groundspeed, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 964 | + $format_source = filter_var($format_source, FILTER_SANITIZE_STRING); |
|
| 965 | + $source_name = filter_var($source_name, FILTER_SANITIZE_STRING); |
|
| 966 | + $over_country = filter_var($over_country, FILTER_SANITIZE_STRING); |
|
| 967 | + $type = filter_var($type, FILTER_SANITIZE_STRING); |
|
| 968 | + $typeid = filter_var($typeid, FILTER_SANITIZE_NUMBER_INT); |
|
| 969 | + $mmsi = filter_var($mmsi, FILTER_SANITIZE_NUMBER_INT); |
|
| 970 | + $status = filter_var($status, FILTER_SANITIZE_STRING); |
|
| 971 | + $statusid = filter_var($statusid, FILTER_SANITIZE_NUMBER_INT); |
|
| 972 | + $imo = filter_var($imo, FILTER_SANITIZE_STRING); |
|
| 973 | + $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
| 974 | + $arrival_code = filter_var($arrival_code, FILTER_SANITIZE_STRING); |
|
| 975 | + $arrival_date = filter_var($arrival_date, FILTER_SANITIZE_STRING); |
|
| 976 | 976 | if ($typeid == '') $typeid = NULL; |
| 977 | 977 | if ($statusid == '') $statusid = NULL; |
| 978 | 978 | |
| 979 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
| 980 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
| 979 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 980 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 981 | 981 | if ($arrival_date == '') $arrival_date = NULL; |
| 982 | 982 | $query = ''; |
| 983 | 983 | if ($globalArchive) { |
@@ -986,19 +986,19 @@ discard block |
||
| 986 | 986 | } |
| 987 | 987 | $query .= 'INSERT INTO marine_live (fammarine_id, ident, latitude, longitude, heading, ground_speed, date, format_source, source_name, over_country, mmsi, type,type_id,status,status_id,imo,arrival_port_name,arrival_port_date) |
| 988 | 988 | VALUES (:fammarine_id,:ident,:latitude,:longitude,:heading,:groundspeed,:date,:format_source, :source_name, :over_country,:mmsi,:type,:typeid,:status,:statusid,:imo,:arrival_port_name,:arrival_port_date)'; |
| 989 | - $query_values = array(':fammarine_id' => $fammarine_id,':ident' => $ident,':latitude' => $latitude,':longitude' => $longitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date, ':format_source' => $format_source, ':source_name' => $source_name, ':over_country' => $over_country,':mmsi' => $mmsi,':type' => $type,':typeid' => $typeid,':status' => $status,':statusid' => $statusid,':imo' => $imo,':arrival_port_name' => $arrival_code,':arrival_port_date' => $arrival_date); |
|
| 989 | + $query_values = array(':fammarine_id' => $fammarine_id, ':ident' => $ident, ':latitude' => $latitude, ':longitude' => $longitude, ':heading' => $heading, ':groundspeed' => $groundspeed, ':date' => $date, ':format_source' => $format_source, ':source_name' => $source_name, ':over_country' => $over_country, ':mmsi' => $mmsi, ':type' => $type, ':typeid' => $typeid, ':status' => $status, ':statusid' => $statusid, ':imo' => $imo, ':arrival_port_name' => $arrival_code, ':arrival_port_date' => $arrival_date); |
|
| 990 | 990 | try { |
| 991 | 991 | $sth = $this->db->prepare($query); |
| 992 | 992 | $sth->execute($query_values); |
| 993 | 993 | $sth->closeCursor(); |
| 994 | - } catch(PDOException $e) { |
|
| 994 | + } catch (PDOException $e) { |
|
| 995 | 995 | return "error : ".$e->getMessage(); |
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
| 999 | 999 | if ($globalDebug) echo '(Add to Marine archive : '; |
| 1000 | 1000 | $MarineArchive = new MarineArchive($this->db); |
| 1001 | - $result = $MarineArchive->addMarineArchiveData($fammarine_id, $ident, $latitude, $longitude, $heading, $groundspeed, $date, $putinarchive, $mmsi,$type,$typeid,$imo, $callsign,$arrival_code,$arrival_date,$status,$statusid,$noarchive,$format_source, $source_name, $over_country); |
|
| 1001 | + $result = $MarineArchive->addMarineArchiveData($fammarine_id, $ident, $latitude, $longitude, $heading, $groundspeed, $date, $putinarchive, $mmsi, $type, $typeid, $imo, $callsign, $arrival_code, $arrival_date, $status, $statusid, $noarchive, $format_source, $source_name, $over_country); |
|
| 1002 | 1002 | if ($globalDebug) echo $result.')'; |
| 1003 | 1003 | } |
| 1004 | 1004 | return "success"; |
@@ -1006,7 +1006,7 @@ discard block |
||
| 1006 | 1006 | |
| 1007 | 1007 | public function getOrderBy() |
| 1008 | 1008 | { |
| 1009 | - $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY marine_live.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY marine_live.aircraft_icao DESC"),"manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY marine_live.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY marine_live.aircraft_manufacturer DESC"),"airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY marine_live.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY marine_live.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY marine_live.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY marine_live.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY marine_live.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY marine_live.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY marine_live.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY marine_live.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY marine_live.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY marine_live.date DESC")); |
|
| 1009 | + $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY marine_live.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY marine_live.aircraft_icao DESC"), "manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY marine_live.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY marine_live.aircraft_manufacturer DESC"), "airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY marine_live.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY marine_live.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY marine_live.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY marine_live.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY marine_live.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY marine_live.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY marine_live.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY marine_live.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY marine_live.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY marine_live.date DESC")); |
|
| 1010 | 1010 | return $orderby; |
| 1011 | 1011 | } |
| 1012 | 1012 | |
@@ -8,7 +8,9 @@ discard block |
||
| 8 | 8 | public function __construct($dbc = null) { |
| 9 | 9 | $Connection = new Connection($dbc); |
| 10 | 10 | $this->db = $Connection->db(); |
| 11 | - if ($this->db === null) die('Error: No DB connection. (MarineLive)'); |
|
| 11 | + if ($this->db === null) { |
|
| 12 | + die('Error: No DB connection. (MarineLive)'); |
|
| 13 | + } |
|
| 12 | 14 | } |
| 13 | 15 | |
| 14 | 16 | |
@@ -30,7 +32,9 @@ discard block |
||
| 30 | 32 | if (isset($filter[0]['source'])) { |
| 31 | 33 | $filters = array_merge($filters,$filter); |
| 32 | 34 | } |
| 33 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 35 | + if (is_array($globalFilter)) { |
|
| 36 | + $filter = array_merge($filter,$globalFilter); |
|
| 37 | + } |
|
| 34 | 38 | $filter_query_join = ''; |
| 35 | 39 | $filter_query_where = ''; |
| 36 | 40 | foreach($filters as $flt) { |
@@ -83,8 +87,11 @@ discard block |
||
| 83 | 87 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 84 | 88 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
| 85 | 89 | } |
| 86 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
| 87 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
| 90 | + if ($filter_query_where == '' && $where) { |
|
| 91 | + $filter_query_where = ' WHERE'; |
|
| 92 | + } elseif ($filter_query_where != '' && $and) { |
|
| 93 | + $filter_query_where .= ' AND'; |
|
| 94 | + } |
|
| 88 | 95 | if ($filter_query_where != '') { |
| 89 | 96 | $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
| 90 | 97 | } |
@@ -125,9 +132,13 @@ discard block |
||
| 125 | 132 | $orderby_query = ' '.$search_orderby_array[$sort]['sql']; |
| 126 | 133 | } |
| 127 | 134 | } |
| 128 | - if ($orderby_query == '') $orderby_query= ' ORDER BY date DESC'; |
|
| 135 | + if ($orderby_query == '') { |
|
| 136 | + $orderby_query= ' ORDER BY date DESC'; |
|
| 137 | + } |
|
| 129 | 138 | |
| 130 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 139 | + if (!isset($globalLiveInterval)) { |
|
| 140 | + $globalLiveInterval = '200'; |
|
| 141 | + } |
|
| 131 | 142 | if ($globalDBdriver == 'mysql') { |
| 132 | 143 | //$query = "SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate"; |
| 133 | 144 | $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate'.$filter_query.$orderby_query; |
@@ -152,7 +163,9 @@ discard block |
||
| 152 | 163 | |
| 153 | 164 | $filter_query = $this->getFilter($filter,true,true); |
| 154 | 165 | |
| 155 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 166 | + if (!isset($globalLiveInterval)) { |
|
| 167 | + $globalLiveInterval = '200'; |
|
| 168 | + } |
|
| 156 | 169 | if ($globalDBdriver == 'mysql') { |
| 157 | 170 | $query = 'SELECT marine_live.mmsi, marine_live.ident, marine_live.type,marine_live.fammarine_id, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
| 158 | 171 | FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate'.$filter_query." marine_live.latitude <> 0 AND marine_live.longitude <> 0"; |
@@ -193,48 +206,72 @@ discard block |
||
| 193 | 206 | } |
| 194 | 207 | $filter_query = $this->getFilter($filter,true,true); |
| 195 | 208 | |
| 196 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 197 | - if (!isset($globalMap3DMarinesLimit) || $globalMap3DMarinesLimit == '') $globalMap3DMarinesLimit = '300'; |
|
| 209 | + if (!isset($globalLiveInterval)) { |
|
| 210 | + $globalLiveInterval = '200'; |
|
| 211 | + } |
|
| 212 | + if (!isset($globalMap3DMarinesLimit) || $globalMap3DMarinesLimit == '') { |
|
| 213 | + $globalMap3DMarinesLimit = '300'; |
|
| 214 | + } |
|
| 198 | 215 | if ($globalDBdriver == 'mysql') { |
| 199 | 216 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 200 | 217 | $query = 'SELECT * FROM (SELECT marine_archive.ident, marine_archive.fammarine_id,marine_archive.type, marine_archive.latitude, marine_archive.longitude, marine_archive.heading, marine_archive.ground_speed, marine_archive.date, marine_archive.format_source |
| 201 | 218 | FROM marine_archive INNER JOIN (SELECT fammarine_id FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date) l ON l.fammarine_id = marine_archive.fammarine_id "; |
| 202 | - if ($usecoord) $query .= "AND marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
|
| 219 | + if ($usecoord) { |
|
| 220 | + $query .= "AND marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
|
| 221 | + } |
|
| 203 | 222 | $query .= "UNION |
| 204 | 223 | SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
| 205 | 224 | FROM marine_live".$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date"; |
| 206 | - if ($usecoord) $query .= " AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong; |
|
| 225 | + if ($usecoord) { |
|
| 226 | + $query .= " AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong; |
|
| 227 | + } |
|
| 207 | 228 | $query .= ") AS marine |
| 208 | 229 | WHERE latitude <> '0' AND longitude <> '0' |
| 209 | 230 | ORDER BY fammarine_id, date"; |
| 210 | - if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit; |
|
| 231 | + if ($limit) { |
|
| 232 | + $query .= " LIMIT ".$globalMap3DMarinesLimit; |
|
| 233 | + } |
|
| 211 | 234 | } else { |
| 212 | 235 | $query = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
| 213 | 236 | FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date "; |
| 214 | - if ($usecoord) $query .= "AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
|
| 237 | + if ($usecoord) { |
|
| 238 | + $query .= "AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
|
| 239 | + } |
|
| 215 | 240 | $query .= "AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' |
| 216 | 241 | ORDER BY marine_live.fammarine_id, marine_live.date"; |
| 217 | - if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit; |
|
| 242 | + if ($limit) { |
|
| 243 | + $query .= " LIMIT ".$globalMap3DMarinesLimit; |
|
| 244 | + } |
|
| 218 | 245 | } |
| 219 | 246 | } else { |
| 220 | 247 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 221 | 248 | $query = "SELECT * FROM (SELECT marine_archive.ident, marine_archive.fammarine_id, marine_archive.type,marine_archive.latitude, marine_archive.longitude, marine_archive.heading, marine_archive.ground_speed, marine_archive.date, marine_archive.format_source |
| 222 | 249 | FROM marine_archive INNER JOIN (SELECT fammarine_id FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date) l ON l.fammarine_id = marine_archive.fammarine_id "; |
| 223 | - if ($usecoord) $query .= "AND marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
|
| 250 | + if ($usecoord) { |
|
| 251 | + $query .= "AND marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
|
| 252 | + } |
|
| 224 | 253 | $query .= "UNION |
| 225 | 254 | SELECT marine_live.ident, marine_live.fammarine_id, marine_live.type,marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
| 226 | 255 | FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date"; |
| 227 | - if ($usecoord) $query .= " AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong; |
|
| 256 | + if ($usecoord) { |
|
| 257 | + $query .= " AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong; |
|
| 258 | + } |
|
| 228 | 259 | $query .= ") AS marine WHERE latitude <> '0' AND longitude <> '0' "; |
| 229 | 260 | $query .= "ORDER BY fammarine_id, date"; |
| 230 | - if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit; |
|
| 261 | + if ($limit) { |
|
| 262 | + $query .= " LIMIT ".$globalMap3DMarinesLimit; |
|
| 263 | + } |
|
| 231 | 264 | } else { |
| 232 | 265 | $query = "SELECT marine_live.ident, marine_live.fammarine_id, marine_live.type,marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
| 233 | 266 | FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date "; |
| 234 | - if ($usecoord) $query .= "AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
|
| 267 | + if ($usecoord) { |
|
| 268 | + $query .= "AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
|
| 269 | + } |
|
| 235 | 270 | $query .= "AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' |
| 236 | 271 | ORDER BY marine_live.fammarine_id, marine_live.date"; |
| 237 | - if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit; |
|
| 272 | + if ($limit) { |
|
| 273 | + $query .= " LIMIT ".$globalMap3DMarinesLimit; |
|
| 274 | + } |
|
| 238 | 275 | } |
| 239 | 276 | } |
| 240 | 277 | try { |
@@ -259,7 +296,9 @@ discard block |
||
| 259 | 296 | global $globalDBdriver, $globalLiveInterval; |
| 260 | 297 | $filter_query = $this->getFilter($filter,true,true); |
| 261 | 298 | |
| 262 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 299 | + if (!isset($globalLiveInterval)) { |
|
| 300 | + $globalLiveInterval = '200'; |
|
| 301 | + } |
|
| 263 | 302 | if ($globalDBdriver == 'mysql') { |
| 264 | 303 | $query = 'SELECT COUNT(DISTINCT marine_live.fammarine_id) as nb FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
| 265 | 304 | } else { |
@@ -287,7 +326,9 @@ discard block |
||
| 287 | 326 | { |
| 288 | 327 | global $globalDBdriver, $globalLiveInterval; |
| 289 | 328 | $Marine = new Marine($this->db); |
| 290 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 329 | + if (!isset($globalLiveInterval)) { |
|
| 330 | + $globalLiveInterval = '200'; |
|
| 331 | + } |
|
| 291 | 332 | $filter_query = $this->getFilter($filter); |
| 292 | 333 | |
| 293 | 334 | if (is_array($coord)) { |
@@ -295,7 +336,9 @@ discard block |
||
| 295 | 336 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 296 | 337 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 297 | 338 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 298 | - } else return array(); |
|
| 339 | + } else { |
|
| 340 | + return array(); |
|
| 341 | + } |
|
| 299 | 342 | if ($globalDBdriver == 'mysql') { |
| 300 | 343 | $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate AND marine_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND marine_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY marine_live.fammarine_id ORDER BY date DESC'.$filter_query; |
| 301 | 344 | } else { |
@@ -315,7 +358,9 @@ discard block |
||
| 315 | 358 | { |
| 316 | 359 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
| 317 | 360 | $Marine = new Marine($this->db); |
| 318 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 361 | + if (!isset($globalLiveInterval)) { |
|
| 362 | + $globalLiveInterval = '200'; |
|
| 363 | + } |
|
| 319 | 364 | $filter_query = $this->getFilter($filter,true,true); |
| 320 | 365 | |
| 321 | 366 | if (is_array($coord)) { |
@@ -323,7 +368,9 @@ discard block |
||
| 323 | 368 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 324 | 369 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 325 | 370 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 326 | - } else return array(); |
|
| 371 | + } else { |
|
| 372 | + return array(); |
|
| 373 | + } |
|
| 327 | 374 | /* |
| 328 | 375 | if ($globalDBdriver == 'mysql') { |
| 329 | 376 | $query = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
@@ -546,11 +593,15 @@ discard block |
||
| 546 | 593 | //$query = self::$global_query.' WHERE marine_live.fammarine_id = :id ORDER BY date'; |
| 547 | 594 | if ($globalDBdriver == 'mysql') { |
| 548 | 595 | $query = 'SELECT marine_live.* FROM marine_live WHERE marine_live.fammarine_id = :id'; |
| 549 | - if ($liveinterval) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
| 596 | + if ($liveinterval) { |
|
| 597 | + $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
| 598 | + } |
|
| 550 | 599 | $query .= ' ORDER BY date'; |
| 551 | 600 | } else { |
| 552 | 601 | $query = 'SELECT marine_live.* FROM marine_live WHERE marine_live.fammarine_id = :id'; |
| 553 | - if ($liveinterval) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
| 602 | + if ($liveinterval) { |
|
| 603 | + $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
| 604 | + } |
|
| 554 | 605 | $query .= ' ORDER BY date'; |
| 555 | 606 | } |
| 556 | 607 | |
@@ -645,7 +696,9 @@ discard block |
||
| 645 | 696 | $i++; |
| 646 | 697 | $j++; |
| 647 | 698 | if ($j == 30) { |
| 648 | - if ($globalDebug) echo "."; |
|
| 699 | + if ($globalDebug) { |
|
| 700 | + echo "."; |
|
| 701 | + } |
|
| 649 | 702 | try { |
| 650 | 703 | |
| 651 | 704 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
@@ -925,7 +978,9 @@ discard block |
||
| 925 | 978 | { |
| 926 | 979 | return false; |
| 927 | 980 | } |
| 928 | - } else return ''; |
|
| 981 | + } else { |
|
| 982 | + return ''; |
|
| 983 | + } |
|
| 929 | 984 | |
| 930 | 985 | if ($longitude != '') |
| 931 | 986 | { |
@@ -933,7 +988,9 @@ discard block |
||
| 933 | 988 | { |
| 934 | 989 | return false; |
| 935 | 990 | } |
| 936 | - } else return ''; |
|
| 991 | + } else { |
|
| 992 | + return ''; |
|
| 993 | + } |
|
| 937 | 994 | |
| 938 | 995 | |
| 939 | 996 | if ($heading != '') |
@@ -942,7 +999,9 @@ discard block |
||
| 942 | 999 | { |
| 943 | 1000 | return false; |
| 944 | 1001 | } |
| 945 | - } else $heading = 0; |
|
| 1002 | + } else { |
|
| 1003 | + $heading = 0; |
|
| 1004 | + } |
|
| 946 | 1005 | |
| 947 | 1006 | if ($groundspeed != '') |
| 948 | 1007 | { |
@@ -950,9 +1009,13 @@ discard block |
||
| 950 | 1009 | { |
| 951 | 1010 | return false; |
| 952 | 1011 | } |
| 953 | - } else $groundspeed = 0; |
|
| 1012 | + } else { |
|
| 1013 | + $groundspeed = 0; |
|
| 1014 | + } |
|
| 954 | 1015 | date_default_timezone_set('UTC'); |
| 955 | - if ($date == '') $date = date("Y-m-d H:i:s", time()); |
|
| 1016 | + if ($date == '') { |
|
| 1017 | + $date = date("Y-m-d H:i:s", time()); |
|
| 1018 | + } |
|
| 956 | 1019 | |
| 957 | 1020 | |
| 958 | 1021 | $fammarine_id = filter_var($fammarine_id,FILTER_SANITIZE_STRING); |
@@ -973,15 +1036,27 @@ discard block |
||
| 973 | 1036 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
| 974 | 1037 | $arrival_code = filter_var($arrival_code,FILTER_SANITIZE_STRING); |
| 975 | 1038 | $arrival_date = filter_var($arrival_date,FILTER_SANITIZE_STRING); |
| 976 | - if ($typeid == '') $typeid = NULL; |
|
| 977 | - if ($statusid == '') $statusid = NULL; |
|
| 1039 | + if ($typeid == '') { |
|
| 1040 | + $typeid = NULL; |
|
| 1041 | + } |
|
| 1042 | + if ($statusid == '') { |
|
| 1043 | + $statusid = NULL; |
|
| 1044 | + } |
|
| 978 | 1045 | |
| 979 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
| 980 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
| 981 | - if ($arrival_date == '') $arrival_date = NULL; |
|
| 1046 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) { |
|
| 1047 | + $groundspeed = 0; |
|
| 1048 | + } |
|
| 1049 | + if ($heading == '' || $Common->isInteger($heading) === false ) { |
|
| 1050 | + $heading = 0; |
|
| 1051 | + } |
|
| 1052 | + if ($arrival_date == '') { |
|
| 1053 | + $arrival_date = NULL; |
|
| 1054 | + } |
|
| 982 | 1055 | $query = ''; |
| 983 | 1056 | if ($globalArchive) { |
| 984 | - if ($globalDebug) echo '-- Delete previous data -- '; |
|
| 1057 | + if ($globalDebug) { |
|
| 1058 | + echo '-- Delete previous data -- '; |
|
| 1059 | + } |
|
| 985 | 1060 | $query .= 'DELETE FROM marine_live WHERE fammarine_id = :fammarine_id;'; |
| 986 | 1061 | } |
| 987 | 1062 | $query .= 'INSERT INTO marine_live (fammarine_id, ident, latitude, longitude, heading, ground_speed, date, format_source, source_name, over_country, mmsi, type,type_id,status,status_id,imo,arrival_port_name,arrival_port_date) |
@@ -996,10 +1071,14 @@ discard block |
||
| 996 | 1071 | } |
| 997 | 1072 | |
| 998 | 1073 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
| 999 | - if ($globalDebug) echo '(Add to Marine archive : '; |
|
| 1074 | + if ($globalDebug) { |
|
| 1075 | + echo '(Add to Marine archive : '; |
|
| 1076 | + } |
|
| 1000 | 1077 | $MarineArchive = new MarineArchive($this->db); |
| 1001 | 1078 | $result = $MarineArchive->addMarineArchiveData($fammarine_id, $ident, $latitude, $longitude, $heading, $groundspeed, $date, $putinarchive, $mmsi,$type,$typeid,$imo, $callsign,$arrival_code,$arrival_date,$status,$statusid,$noarchive,$format_source, $source_name, $over_country); |
| 1002 | - if ($globalDebug) echo $result.')'; |
|
| 1079 | + if ($globalDebug) { |
|
| 1080 | + echo $result.')'; |
|
| 1081 | + } |
|
| 1003 | 1082 | } |
| 1004 | 1083 | return "success"; |
| 1005 | 1084 | } |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | - * Get SQL query part for filter used |
|
| 14 | - * @param Array $filter the filter |
|
| 15 | - * @return Array the SQL part |
|
| 16 | - */ |
|
| 13 | + * Get SQL query part for filter used |
|
| 14 | + * @param Array $filter the filter |
|
| 15 | + * @return Array the SQL part |
|
| 16 | + */ |
|
| 17 | 17 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 18 | 18 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
| 19 | 19 | $filters = array(); |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | - * Gets all the spotter information based on a particular callsign |
|
| 163 | - * |
|
| 164 | - * @return Array the spotter information |
|
| 165 | - * |
|
| 166 | - */ |
|
| 162 | + * Gets all the spotter information based on a particular callsign |
|
| 163 | + * |
|
| 164 | + * @return Array the spotter information |
|
| 165 | + * |
|
| 166 | + */ |
|
| 167 | 167 | public function getLastArchiveSpotterDataByIdent($ident) { |
| 168 | 168 | $Spotter = new Spotter($this->db); |
| 169 | 169 | date_default_timezone_set('UTC'); |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | - * Gets last the spotter information based on a particular id |
|
| 183 | - * |
|
| 184 | - * @return Array the spotter information |
|
| 185 | - * |
|
| 186 | - */ |
|
| 182 | + * Gets last the spotter information based on a particular id |
|
| 183 | + * |
|
| 184 | + * @return Array the spotter information |
|
| 185 | + * |
|
| 186 | + */ |
|
| 187 | 187 | public function getLastArchiveSpotterDataById($id) { |
| 188 | 188 | $Spotter = new Spotter($this->db); |
| 189 | 189 | date_default_timezone_set('UTC'); |
@@ -209,11 +209,11 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | - * Gets all the spotter information based on a particular id |
|
| 213 | - * |
|
| 214 | - * @return Array the spotter information |
|
| 215 | - * |
|
| 216 | - */ |
|
| 212 | + * Gets all the spotter information based on a particular id |
|
| 213 | + * |
|
| 214 | + * @return Array the spotter information |
|
| 215 | + * |
|
| 216 | + */ |
|
| 217 | 217 | public function getAllArchiveSpotterDataById($id) { |
| 218 | 218 | date_default_timezone_set('UTC'); |
| 219 | 219 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
@@ -234,11 +234,11 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
| 237 | - * Gets coordinate & time spotter information based on a particular id |
|
| 238 | - * |
|
| 239 | - * @return Array the spotter information |
|
| 240 | - * |
|
| 241 | - */ |
|
| 237 | + * Gets coordinate & time spotter information based on a particular id |
|
| 238 | + * |
|
| 239 | + * @return Array the spotter information |
|
| 240 | + * |
|
| 241 | + */ |
|
| 242 | 242 | public function getCoordArchiveSpotterDataById($id) { |
| 243 | 243 | date_default_timezone_set('UTC'); |
| 244 | 244 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
@@ -255,11 +255,11 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
| 258 | - * Gets coordinate & time spotter information based on a particular id |
|
| 259 | - * |
|
| 260 | - * @return Array the spotter information |
|
| 261 | - * |
|
| 262 | - */ |
|
| 258 | + * Gets coordinate & time spotter information based on a particular id |
|
| 259 | + * |
|
| 260 | + * @return Array the spotter information |
|
| 261 | + * |
|
| 262 | + */ |
|
| 263 | 263 | public function getCoordArchiveSpotterDataByIdDate($id,$begindate,$enddate) { |
| 264 | 264 | date_default_timezone_set('UTC'); |
| 265 | 265 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
@@ -277,11 +277,11 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | |
| 279 | 279 | /** |
| 280 | - * Gets altitude information based on a particular callsign |
|
| 281 | - * |
|
| 282 | - * @return Array the spotter information |
|
| 283 | - * |
|
| 284 | - */ |
|
| 280 | + * Gets altitude information based on a particular callsign |
|
| 281 | + * |
|
| 282 | + * @return Array the spotter information |
|
| 283 | + * |
|
| 284 | + */ |
|
| 285 | 285 | public function getAltitudeArchiveSpotterDataByIdent($ident) { |
| 286 | 286 | |
| 287 | 287 | date_default_timezone_set('UTC'); |
@@ -302,11 +302,11 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | /** |
| 305 | - * Gets altitude information based on a particular id |
|
| 306 | - * |
|
| 307 | - * @return Array the spotter information |
|
| 308 | - * |
|
| 309 | - */ |
|
| 305 | + * Gets altitude information based on a particular id |
|
| 306 | + * |
|
| 307 | + * @return Array the spotter information |
|
| 308 | + * |
|
| 309 | + */ |
|
| 310 | 310 | public function getAltitudeArchiveSpotterDataById($id) { |
| 311 | 311 | |
| 312 | 312 | date_default_timezone_set('UTC'); |
@@ -327,11 +327,11 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | /** |
| 330 | - * Gets altitude & speed information based on a particular id |
|
| 331 | - * |
|
| 332 | - * @return Array the spotter information |
|
| 333 | - * |
|
| 334 | - */ |
|
| 330 | + * Gets altitude & speed information based on a particular id |
|
| 331 | + * |
|
| 332 | + * @return Array the spotter information |
|
| 333 | + * |
|
| 334 | + */ |
|
| 335 | 335 | public function getAltitudeSpeedArchiveSpotterDataById($id) { |
| 336 | 336 | date_default_timezone_set('UTC'); |
| 337 | 337 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
@@ -348,11 +348,11 @@ discard block |
||
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /** |
| 351 | - * Gets altitude information based on a particular callsign |
|
| 352 | - * |
|
| 353 | - * @return Array the spotter information |
|
| 354 | - * |
|
| 355 | - */ |
|
| 351 | + * Gets altitude information based on a particular callsign |
|
| 352 | + * |
|
| 353 | + * @return Array the spotter information |
|
| 354 | + * |
|
| 355 | + */ |
|
| 356 | 356 | public function getLastAltitudeArchiveSpotterDataByIdent($ident) { |
| 357 | 357 | date_default_timezone_set('UTC'); |
| 358 | 358 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
@@ -402,11 +402,11 @@ discard block |
||
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | /** |
| 405 | - * Gets Minimal Live Spotter data |
|
| 406 | - * |
|
| 407 | - * @return Array the spotter information |
|
| 408 | - * |
|
| 409 | - */ |
|
| 405 | + * Gets Minimal Live Spotter data |
|
| 406 | + * |
|
| 407 | + * @return Array the spotter information |
|
| 408 | + * |
|
| 409 | + */ |
|
| 410 | 410 | public function getMinLiveSpotterData($begindate,$enddate,$filter = array(),$part = 0) { |
| 411 | 411 | global $globalDBdriver, $globalLiveInterval; |
| 412 | 412 | date_default_timezone_set('UTC'); |
@@ -466,11 +466,11 @@ discard block |
||
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | /** |
| 469 | - * Gets Minimal Live Spotter data |
|
| 470 | - * |
|
| 471 | - * @return Array the spotter information |
|
| 472 | - * |
|
| 473 | - */ |
|
| 469 | + * Gets Minimal Live Spotter data |
|
| 470 | + * |
|
| 471 | + * @return Array the spotter information |
|
| 472 | + * |
|
| 473 | + */ |
|
| 474 | 474 | public function getMinLiveSpotterDataPlayback($begindate,$enddate,$filter = array()) { |
| 475 | 475 | global $globalDBdriver, $globalLiveInterval; |
| 476 | 476 | date_default_timezone_set('UTC'); |
@@ -537,11 +537,11 @@ discard block |
||
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | /** |
| 540 | - * Gets count Live Spotter data |
|
| 541 | - * |
|
| 542 | - * @return Array the spotter information |
|
| 543 | - * |
|
| 544 | - */ |
|
| 540 | + * Gets count Live Spotter data |
|
| 541 | + * |
|
| 542 | + * @return Array the spotter information |
|
| 543 | + * |
|
| 544 | + */ |
|
| 545 | 545 | public function getLiveSpotterCount($begindate,$enddate,$filter = array()) { |
| 546 | 546 | global $globalDBdriver, $globalLiveInterval; |
| 547 | 547 | date_default_timezone_set('UTC'); |
@@ -587,11 +587,11 @@ discard block |
||
| 587 | 587 | // Spotter_Archive_output |
| 588 | 588 | |
| 589 | 589 | /** |
| 590 | - * Gets all the spotter information |
|
| 591 | - * |
|
| 592 | - * @return Array the spotter information |
|
| 593 | - * |
|
| 594 | - */ |
|
| 590 | + * Gets all the spotter information |
|
| 591 | + * |
|
| 592 | + * @return Array the spotter information |
|
| 593 | + * |
|
| 594 | + */ |
|
| 595 | 595 | public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filters=array()) { |
| 596 | 596 | global $globalTimezone, $globalDBdriver; |
| 597 | 597 | require_once(dirname(__FILE__).'/class.Translation.php'); |
@@ -883,11 +883,11 @@ discard block |
||
| 883 | 883 | } |
| 884 | 884 | |
| 885 | 885 | /** |
| 886 | - * Gets all the spotter information based on the callsign |
|
| 887 | - * |
|
| 888 | - * @return Array the spotter information |
|
| 889 | - * |
|
| 890 | - */ |
|
| 886 | + * Gets all the spotter information based on the callsign |
|
| 887 | + * |
|
| 888 | + * @return Array the spotter information |
|
| 889 | + * |
|
| 890 | + */ |
|
| 891 | 891 | public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '') { |
| 892 | 892 | $global_query = "SELECT spotter_archive_output.* FROM spotter_archive_output"; |
| 893 | 893 | |
@@ -935,11 +935,11 @@ discard block |
||
| 935 | 935 | |
| 936 | 936 | |
| 937 | 937 | /** |
| 938 | - * Gets all the spotter information based on the owner |
|
| 939 | - * |
|
| 940 | - * @return Array the spotter information |
|
| 941 | - * |
|
| 942 | - */ |
|
| 938 | + * Gets all the spotter information based on the owner |
|
| 939 | + * |
|
| 940 | + * @return Array the spotter information |
|
| 941 | + * |
|
| 942 | + */ |
|
| 943 | 943 | public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '', $filter = array()) { |
| 944 | 944 | $global_query = "SELECT spotter_archive_output.* FROM spotter_archive_output"; |
| 945 | 945 | |
@@ -987,11 +987,11 @@ discard block |
||
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | /** |
| 990 | - * Gets all the spotter information based on the pilot |
|
| 991 | - * |
|
| 992 | - * @return Array the spotter information |
|
| 993 | - * |
|
| 994 | - */ |
|
| 990 | + * Gets all the spotter information based on the pilot |
|
| 991 | + * |
|
| 992 | + * @return Array the spotter information |
|
| 993 | + * |
|
| 994 | + */ |
|
| 995 | 995 | public function getSpotterDataByPilot($pilot = '', $limit = '', $sort = '', $filter = array()) { |
| 996 | 996 | $global_query = "SELECT spotter_archive_output.* FROM spotter_archive_output"; |
| 997 | 997 | |
@@ -1035,11 +1035,11 @@ discard block |
||
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | /** |
| 1038 | - * Gets all number of flight over countries |
|
| 1039 | - * |
|
| 1040 | - * @return Array the airline country list |
|
| 1041 | - * |
|
| 1042 | - */ |
|
| 1038 | + * Gets all number of flight over countries |
|
| 1039 | + * |
|
| 1040 | + * @return Array the airline country list |
|
| 1041 | + * |
|
| 1042 | + */ |
|
| 1043 | 1043 | public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') { |
| 1044 | 1044 | global $globalDBdriver; |
| 1045 | 1045 | /* |
@@ -1079,11 +1079,11 @@ discard block |
||
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | 1081 | /** |
| 1082 | - * Gets all number of flight over countries |
|
| 1083 | - * |
|
| 1084 | - * @return Array the airline country list |
|
| 1085 | - * |
|
| 1086 | - */ |
|
| 1082 | + * Gets all number of flight over countries |
|
| 1083 | + * |
|
| 1084 | + * @return Array the airline country list |
|
| 1085 | + * |
|
| 1086 | + */ |
|
| 1087 | 1087 | public function countAllFlightOverCountriesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') { |
| 1088 | 1088 | global $globalDBdriver; |
| 1089 | 1089 | /* |
@@ -1124,11 +1124,11 @@ discard block |
||
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | 1126 | /** |
| 1127 | - * Gets last spotter information based on a particular callsign |
|
| 1128 | - * |
|
| 1129 | - * @return Array the spotter information |
|
| 1130 | - * |
|
| 1131 | - */ |
|
| 1127 | + * Gets last spotter information based on a particular callsign |
|
| 1128 | + * |
|
| 1129 | + * @return Array the spotter information |
|
| 1130 | + * |
|
| 1131 | + */ |
|
| 1132 | 1132 | public function getDateArchiveSpotterDataById($id,$date) { |
| 1133 | 1133 | $Spotter = new Spotter($this->db); |
| 1134 | 1134 | date_default_timezone_set('UTC'); |
@@ -1140,11 +1140,11 @@ discard block |
||
| 1140 | 1140 | } |
| 1141 | 1141 | |
| 1142 | 1142 | /** |
| 1143 | - * Gets all the spotter information based on a particular callsign |
|
| 1144 | - * |
|
| 1145 | - * @return Array the spotter information |
|
| 1146 | - * |
|
| 1147 | - */ |
|
| 1143 | + * Gets all the spotter information based on a particular callsign |
|
| 1144 | + * |
|
| 1145 | + * @return Array the spotter information |
|
| 1146 | + * |
|
| 1147 | + */ |
|
| 1148 | 1148 | public function getDateArchiveSpotterDataByIdent($ident,$date) { |
| 1149 | 1149 | $Spotter = new Spotter($this->db); |
| 1150 | 1150 | date_default_timezone_set('UTC'); |
@@ -1156,11 +1156,11 @@ discard block |
||
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | 1158 | /** |
| 1159 | - * Gets all the spotter information based on the airport |
|
| 1160 | - * |
|
| 1161 | - * @return Array the spotter information |
|
| 1162 | - * |
|
| 1163 | - */ |
|
| 1159 | + * Gets all the spotter information based on the airport |
|
| 1160 | + * |
|
| 1161 | + * @return Array the spotter information |
|
| 1162 | + * |
|
| 1163 | + */ |
|
| 1164 | 1164 | public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) { |
| 1165 | 1165 | global $global_query; |
| 1166 | 1166 | $Spotter = new Spotter($this->db); |
@@ -14,75 +14,75 @@ discard block |
||
| 14 | 14 | * @param Array $filter the filter |
| 15 | 15 | * @return Array the SQL part |
| 16 | 16 | */ |
| 17 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
| 17 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
| 18 | 18 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
| 19 | 19 | $filters = array(); |
| 20 | 20 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
| 21 | 21 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
| 22 | 22 | $filters = $globalStatsFilters[$globalFilterName]; |
| 23 | 23 | } else { |
| 24 | - $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
|
| 24 | + $filter = array_merge($filter, $globalStatsFilters[$globalFilterName]); |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | if (isset($filter[0]['source'])) { |
| 28 | - $filters = array_merge($filters,$filter); |
|
| 28 | + $filters = array_merge($filters, $filter); |
|
| 29 | 29 | } |
| 30 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 30 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
| 31 | 31 | $filter_query_join = ''; |
| 32 | 32 | $filter_query_where = ''; |
| 33 | - foreach($filters as $flt) { |
|
| 33 | + foreach ($filters as $flt) { |
|
| 34 | 34 | if (isset($flt['airlines']) && !empty($flt['airlines'])) { |
| 35 | 35 | if ($flt['airlines'][0] != '' && $flt['airlines'][0] != 'all') { |
| 36 | 36 | if (isset($flt['source'])) { |
| 37 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$flt['airlines'])."') AND spotter_archive_output.format_source IN ('".implode("','",$flt['source'])."')) saff ON saff.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 37 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','", $flt['airlines'])."') AND spotter_archive_output.format_source IN ('".implode("','", $flt['source'])."')) saff ON saff.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 38 | 38 | } else { |
| 39 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$flt['airlines'])."')) saff ON saff.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 39 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','", $flt['airlines'])."')) saff ON saff.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | if (isset($flt['pilots_id']) && !empty($flt['pilots_id'])) { |
| 44 | 44 | if (isset($flt['source'])) { |
| 45 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.pilot_id IN ('".implode("','",$flt['pilots_id'])."') AND spotter_archive_output.format_source IN ('".implode("','",$flt['source'])."')) sp ON sp.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 45 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.pilot_id IN ('".implode("','", $flt['pilots_id'])."') AND spotter_archive_output.format_source IN ('".implode("','", $flt['source'])."')) sp ON sp.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 46 | 46 | } else { |
| 47 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.pilot_id IN ('".implode("','",$flt['pilots_id'])."')) sp ON sp.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 47 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.pilot_id IN ('".implode("','", $flt['pilots_id'])."')) sp ON sp.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | if (isset($flt['idents']) && !empty($flt['idents'])) { |
| 51 | 51 | if (isset($flt['source'])) { |
| 52 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.ident IN ('".implode("','",$flt['idents'])."') AND spotter_archive_output.format_source IN ('".implode("','",$flt['source'])."')) spi ON spi.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 52 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.ident IN ('".implode("','", $flt['idents'])."') AND spotter_archive_output.format_source IN ('".implode("','", $flt['source'])."')) spi ON spi.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 53 | 53 | } else { |
| 54 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.ident IN ('".implode("','",$flt['idents'])."')) spi ON spi.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 54 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.ident IN ('".implode("','", $flt['idents'])."')) spi ON spi.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | if (isset($flt['registrations']) && !empty($flt['registrations'])) { |
| 58 | 58 | if (isset($flt['source'])) { |
| 59 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.registration IN ('".implode("','",$flt['registrations'])."') AND spotter_archive_output.format_source IN ('".implode("','",$flt['source'])."')) sre ON sre.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 59 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.registration IN ('".implode("','", $flt['registrations'])."') AND spotter_archive_output.format_source IN ('".implode("','", $flt['source'])."')) sre ON sre.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 60 | 60 | } else { |
| 61 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.registration IN ('".implode("','",$flt['registrations'])."')) sre ON sre.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 61 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.registration IN ('".implode("','", $flt['registrations'])."')) sre ON sre.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | if ((isset($flt['airlines']) && empty($flt['airlines']) && isset($flt['pilots_id']) && empty($flt['pilots_id']) && isset($flt['idents']) && empty($flt['idents']) && isset($flt['registrations']) && empty($flt['registrations'])) || (!isset($flt['airlines']) && !isset($flt['pilots_id']) && !isset($flt['idents']) && !isset($flt['registrations']))) { |
| 65 | 65 | if (isset($flt['source'])) { |
| 66 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_output.format_source IN ('".implode("','",$flt['source'])."')) saa ON saa.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 66 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_output.format_source IN ('".implode("','", $flt['source'])."')) saa ON saa.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
| 71 | 71 | if ($filter['airlines'][0] != '' && $filter['airlines'][0] != 'all') { |
| 72 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) saf ON saf.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 72 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) saf ON saf.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
| 76 | 76 | $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive_output.flightaware_id "; |
| 77 | 77 | } |
| 78 | 78 | if (isset($filter['pilots_id']) && !empty($filter['pilots_id'])) { |
| 79 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.pilot_id IN ('".implode("','",$filter['pilots_id'])."')) spi ON spi.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 79 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.pilot_id IN ('".implode("','", $filter['pilots_id'])."')) spi ON spi.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 80 | 80 | } |
| 81 | 81 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 82 | 82 | if (count($filter['source']) == 1) { |
| 83 | 83 | $filter_query_where .= " AND format_source = '".$filter['source'][0]."'"; |
| 84 | 84 | } else { |
| 85 | - $filter_query_where .= " AND format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 85 | + $filter_query_where .= " AND format_source IN ('".implode("','", $filter['source'])."')"; |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | if (isset($filter['ident']) && !empty($filter['ident'])) { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $filter_query_where .= " AND flightaware_id = '".$filter['id']."'"; |
| 93 | 93 | } |
| 94 | 94 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 95 | - $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 95 | + $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 96 | 96 | } |
| 97 | 97 | if ((isset($filter['year']) && $filter['year'] != '') || (isset($filter['month']) && $filter['month'] != '') || (isset($filter['day']) && $filter['day'] != '')) { |
| 98 | 98 | $filter_query_date = ''; |
@@ -117,41 +117,41 @@ discard block |
||
| 117 | 117 | $filter_query_date .= " AND EXTRACT(DAY FROM spotter_archive_output.date) = '".$filter['day']."'"; |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output".preg_replace('/^ AND/',' WHERE',$filter_query_date).") sd ON sd.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 120 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output".preg_replace('/^ AND/', ' WHERE', $filter_query_date).") sd ON sd.flightaware_id = spotter_archive_output.flightaware_id"; |
|
| 121 | 121 | } |
| 122 | 122 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
| 123 | 123 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
| 124 | 124 | if ($filter_query_where != '') { |
| 125 | - $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
|
| 125 | + $filter_query_where = preg_replace('/^ AND/', ' WHERE', $filter_query_where); |
|
| 126 | 126 | } |
| 127 | 127 | $filter_query = $filter_query_join.$filter_query_where; |
| 128 | 128 | return $filter_query; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // Spotter_archive |
| 132 | - public function addSpotterArchiveData($flightaware_id = '', $ident = '', $registration = '', $airline_name = '', $airline_icao = '', $airline_country = '', $airline_type = '', $aircraft_icao = '', $aircraft_shadow = '', $aircraft_name = '', $aircraft_manufacturer = '', $departure_airport_icao = '', $departure_airport_name = '', $departure_airport_city = '', $departure_airport_country = '', $departure_airport_time = '',$arrival_airport_icao = '', $arrival_airport_name = '', $arrival_airport_city ='', $arrival_airport_country = '', $arrival_airport_time = '', $route_stop = '', $date = '',$latitude = '', $longitude = '', $waypoints = '', $altitude = '', $real_altitude = '',$heading = '', $ground_speed = '', $squawk = '', $ModeS = '', $pilot_id = '', $pilot_name = '',$verticalrate = '',$format_source = '', $source_name = '', $over_country = '') { |
|
| 132 | + public function addSpotterArchiveData($flightaware_id = '', $ident = '', $registration = '', $airline_name = '', $airline_icao = '', $airline_country = '', $airline_type = '', $aircraft_icao = '', $aircraft_shadow = '', $aircraft_name = '', $aircraft_manufacturer = '', $departure_airport_icao = '', $departure_airport_name = '', $departure_airport_city = '', $departure_airport_country = '', $departure_airport_time = '', $arrival_airport_icao = '', $arrival_airport_name = '', $arrival_airport_city = '', $arrival_airport_country = '', $arrival_airport_time = '', $route_stop = '', $date = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $real_altitude = '', $heading = '', $ground_speed = '', $squawk = '', $ModeS = '', $pilot_id = '', $pilot_name = '', $verticalrate = '', $format_source = '', $source_name = '', $over_country = '') { |
|
| 133 | 133 | require_once(dirname(__FILE__).'/class.Spotter.php'); |
| 134 | 134 | if ($over_country == '') { |
| 135 | 135 | $Spotter = new Spotter($this->db); |
| 136 | - $data_country = $Spotter->getCountryFromLatitudeLongitude($latitude,$longitude); |
|
| 136 | + $data_country = $Spotter->getCountryFromLatitudeLongitude($latitude, $longitude); |
|
| 137 | 137 | if (!empty($data_country)) $country = $data_country['iso2']; |
| 138 | 138 | else $country = ''; |
| 139 | 139 | } else $country = $over_country; |
| 140 | - if ($airline_type === NULL) $airline_type =''; |
|
| 140 | + if ($airline_type === NULL) $airline_type = ''; |
|
| 141 | 141 | |
| 142 | 142 | //if ($country == '') echo "\n".'************ UNKNOW COUNTRY ****************'."\n"; |
| 143 | 143 | //else echo "\n".'*/*/*/*/*/*/*/ Country : '.$country.' */*/*/*/*/*/*/*/*/'."\n"; |
| 144 | 144 | |
| 145 | 145 | // Route is not added in spotter_archive |
| 146 | - $query = "INSERT INTO spotter_archive (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_shadow, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, departure_airport_time,arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, arrival_airport_time, route_stop, date,latitude, longitude, waypoints, altitude, heading, ground_speed, squawk, ModeS, pilot_id, pilot_name, verticalrate,format_source,over_country,source_name,real_altitude) |
|
| 146 | + $query = "INSERT INTO spotter_archive (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_shadow, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, departure_airport_time,arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, arrival_airport_time, route_stop, date,latitude, longitude, waypoints, altitude, heading, ground_speed, squawk, ModeS, pilot_id, pilot_name, verticalrate,format_source,over_country,source_name,real_altitude) |
|
| 147 | 147 | VALUES (:flightaware_id, :ident, :registration, :airline_name, :airline_icao, :airline_country, :airline_type, :aircraft_icao, :aircraft_shadow, :aircraft_name, :aircraft_manufacturer, :departure_airport_icao, :departure_airport_name, :departure_airport_city, :departure_airport_country, :departure_airport_time,:arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :arrival_airport_time, :route_stop, :date,:latitude, :longitude, :waypoints, :altitude, :heading, :ground_speed, :squawk, :ModeS, :pilot_id, :pilot_name, :verticalrate, :format_source, :over_country, :source_name,:real_altitude)"; |
| 148 | 148 | |
| 149 | - $query_values = array(':flightaware_id' => $flightaware_id, ':ident' => $ident, ':registration' => $registration, ':airline_name' => $airline_name, ':airline_icao' => $airline_icao, ':airline_country' => $airline_country, ':airline_type' => $airline_type, ':aircraft_icao' => $aircraft_icao, ':aircraft_shadow' => $aircraft_shadow, ':aircraft_name' => $aircraft_name, ':aircraft_manufacturer' => $aircraft_manufacturer, ':departure_airport_icao' => $departure_airport_icao, ':departure_airport_name' => $departure_airport_name, ':departure_airport_city' => $departure_airport_city, ':departure_airport_country' => $departure_airport_country, ':departure_airport_time' => $departure_airport_time,':arrival_airport_icao' => $arrival_airport_icao, ':arrival_airport_name' => $arrival_airport_name, ':arrival_airport_city' => $arrival_airport_city, ':arrival_airport_country' => $arrival_airport_country, ':arrival_airport_time' => $arrival_airport_time, ':route_stop' => $route_stop, ':date' => $date,':latitude' => $latitude, ':longitude' => $longitude, ':waypoints' => $waypoints, ':altitude' => $altitude, ':heading' => $heading, ':ground_speed' => $ground_speed, ':squawk' => $squawk, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':format_source' => $format_source, ':over_country' => $country, ':source_name' => $source_name,':real_altitude' => $real_altitude); |
|
| 149 | + $query_values = array(':flightaware_id' => $flightaware_id, ':ident' => $ident, ':registration' => $registration, ':airline_name' => $airline_name, ':airline_icao' => $airline_icao, ':airline_country' => $airline_country, ':airline_type' => $airline_type, ':aircraft_icao' => $aircraft_icao, ':aircraft_shadow' => $aircraft_shadow, ':aircraft_name' => $aircraft_name, ':aircraft_manufacturer' => $aircraft_manufacturer, ':departure_airport_icao' => $departure_airport_icao, ':departure_airport_name' => $departure_airport_name, ':departure_airport_city' => $departure_airport_city, ':departure_airport_country' => $departure_airport_country, ':departure_airport_time' => $departure_airport_time, ':arrival_airport_icao' => $arrival_airport_icao, ':arrival_airport_name' => $arrival_airport_name, ':arrival_airport_city' => $arrival_airport_city, ':arrival_airport_country' => $arrival_airport_country, ':arrival_airport_time' => $arrival_airport_time, ':route_stop' => $route_stop, ':date' => $date, ':latitude' => $latitude, ':longitude' => $longitude, ':waypoints' => $waypoints, ':altitude' => $altitude, ':heading' => $heading, ':ground_speed' => $ground_speed, ':squawk' => $squawk, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':format_source' => $format_source, ':over_country' => $country, ':source_name' => $source_name, ':real_altitude' => $real_altitude); |
|
| 150 | 150 | try { |
| 151 | 151 | $sth = $this->db->prepare($query); |
| 152 | 152 | $sth->execute($query_values); |
| 153 | 153 | $sth->closeCursor(); |
| 154 | - } catch(PDOException $e) { |
|
| 154 | + } catch (PDOException $e) { |
|
| 155 | 155 | return "error : ".$e->getMessage(); |
| 156 | 156 | } |
| 157 | 157 | return "success"; |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 172 | 172 | //$query = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1"; |
| 173 | - $query = "SELECT spotter_archive.* FROM spotter_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1"; |
|
| 173 | + $query = "SELECT spotter_archive.* FROM spotter_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1"; |
|
| 174 | 174 | |
| 175 | - $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident)); |
|
| 175 | + $spotter_array = $Spotter->getDataFromDB($query, array(':ident' => $ident)); |
|
| 176 | 176 | |
| 177 | 177 | return $spotter_array; |
| 178 | 178 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 191 | 191 | //$query = SpotterArchive->$global_query." WHERE spotter_archive.flightaware_id = :id"; |
| 192 | 192 | //$query = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1"; |
| 193 | - $query = "SELECT * FROM spotter_archive WHERE flightaware_id = :id ORDER BY date DESC LIMIT 1"; |
|
| 193 | + $query = "SELECT * FROM spotter_archive WHERE flightaware_id = :id ORDER BY date DESC LIMIT 1"; |
|
| 194 | 194 | |
| 195 | 195 | // $spotter_array = Spotter->getDataFromDB($query,array(':id' => $id)); |
| 196 | 196 | /* |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | $spotter_array = $sth->fetchAll(PDO->FETCH_ASSOC); |
| 205 | 205 | */ |
| 206 | - $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id)); |
|
| 206 | + $spotter_array = $Spotter->getDataFromDB($query, array(':id' => $id)); |
|
| 207 | 207 | |
| 208 | 208 | return $spotter_array; |
| 209 | 209 | } |
@@ -217,14 +217,14 @@ discard block |
||
| 217 | 217 | public function getAllArchiveSpotterDataById($id) { |
| 218 | 218 | date_default_timezone_set('UTC'); |
| 219 | 219 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 220 | - $query = $this->global_query." WHERE spotter_archive.flightaware_id = :id ORDER BY date"; |
|
| 220 | + $query = $this->global_query." WHERE spotter_archive.flightaware_id = :id ORDER BY date"; |
|
| 221 | 221 | |
| 222 | 222 | // $spotter_array = Spotter->getDataFromDB($query,array(':id' => $id)); |
| 223 | 223 | |
| 224 | 224 | try { |
| 225 | 225 | $sth = $this->db->prepare($query); |
| 226 | 226 | $sth->execute(array(':id' => $id)); |
| 227 | - } catch(PDOException $e) { |
|
| 227 | + } catch (PDOException $e) { |
|
| 228 | 228 | echo $e->getMessage(); |
| 229 | 229 | die; |
| 230 | 230 | } |
@@ -242,11 +242,11 @@ discard block |
||
| 242 | 242 | public function getCoordArchiveSpotterDataById($id) { |
| 243 | 243 | date_default_timezone_set('UTC'); |
| 244 | 244 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 245 | - $query = "SELECT spotter_archive.latitude, spotter_archive.longitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER by spotter_archive.date ASC"; |
|
| 245 | + $query = "SELECT spotter_archive.latitude, spotter_archive.longitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER by spotter_archive.date ASC"; |
|
| 246 | 246 | try { |
| 247 | 247 | $sth = $this->db->prepare($query); |
| 248 | 248 | $sth->execute(array(':id' => $id)); |
| 249 | - } catch(PDOException $e) { |
|
| 249 | + } catch (PDOException $e) { |
|
| 250 | 250 | echo $e->getMessage(); |
| 251 | 251 | die; |
| 252 | 252 | } |
@@ -260,14 +260,14 @@ discard block |
||
| 260 | 260 | * @return Array the spotter information |
| 261 | 261 | * |
| 262 | 262 | */ |
| 263 | - public function getCoordArchiveSpotterDataByIdDate($id,$begindate,$enddate) { |
|
| 263 | + public function getCoordArchiveSpotterDataByIdDate($id, $begindate, $enddate) { |
|
| 264 | 264 | date_default_timezone_set('UTC'); |
| 265 | 265 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 266 | - $query = "SELECT spotter_archive.latitude, spotter_archive.longitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id AND spotter_archive.date BETWEEN :begindate AND :enddate ORDER by spotter_archive.date ASC"; |
|
| 266 | + $query = "SELECT spotter_archive.latitude, spotter_archive.longitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id AND spotter_archive.date BETWEEN :begindate AND :enddate ORDER by spotter_archive.date ASC"; |
|
| 267 | 267 | try { |
| 268 | 268 | $sth = $this->db->prepare($query); |
| 269 | - $sth->execute(array(':id' => $id,':begindate' => $begindate,':enddate' => $enddate)); |
|
| 270 | - } catch(PDOException $e) { |
|
| 269 | + $sth->execute(array(':id' => $id, ':begindate' => $begindate, ':enddate' => $enddate)); |
|
| 270 | + } catch (PDOException $e) { |
|
| 271 | 271 | echo $e->getMessage(); |
| 272 | 272 | die; |
| 273 | 273 | } |
@@ -287,12 +287,12 @@ discard block |
||
| 287 | 287 | date_default_timezone_set('UTC'); |
| 288 | 288 | |
| 289 | 289 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 290 | - $query = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.ident = :ident AND spotter_archive.latitude <> 0 AND spotter_archive.longitude <> 0 ORDER BY date"; |
|
| 290 | + $query = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.ident = :ident AND spotter_archive.latitude <> 0 AND spotter_archive.longitude <> 0 ORDER BY date"; |
|
| 291 | 291 | |
| 292 | 292 | try { |
| 293 | 293 | $sth = $this->db->prepare($query); |
| 294 | 294 | $sth->execute(array(':ident' => $ident)); |
| 295 | - } catch(PDOException $e) { |
|
| 295 | + } catch (PDOException $e) { |
|
| 296 | 296 | echo $e->getMessage(); |
| 297 | 297 | die; |
| 298 | 298 | } |
@@ -312,12 +312,12 @@ discard block |
||
| 312 | 312 | date_default_timezone_set('UTC'); |
| 313 | 313 | |
| 314 | 314 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 315 | - $query = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id AND spotter_archive.latitude <> 0 AND spotter_archive.longitude <> 0 ORDER BY date"; |
|
| 315 | + $query = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id AND spotter_archive.latitude <> 0 AND spotter_archive.longitude <> 0 ORDER BY date"; |
|
| 316 | 316 | |
| 317 | 317 | try { |
| 318 | 318 | $sth = $this->db->prepare($query); |
| 319 | 319 | $sth->execute(array(':id' => $id)); |
| 320 | - } catch(PDOException $e) { |
|
| 320 | + } catch (PDOException $e) { |
|
| 321 | 321 | echo $e->getMessage(); |
| 322 | 322 | die; |
| 323 | 323 | } |
@@ -335,11 +335,11 @@ discard block |
||
| 335 | 335 | public function getAltitudeSpeedArchiveSpotterDataById($id) { |
| 336 | 336 | date_default_timezone_set('UTC'); |
| 337 | 337 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 338 | - $query = "SELECT spotter_archive.altitude, spotter_archive.real_altitude,spotter_archive.ground_speed, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER BY date"; |
|
| 338 | + $query = "SELECT spotter_archive.altitude, spotter_archive.real_altitude,spotter_archive.ground_speed, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER BY date"; |
|
| 339 | 339 | try { |
| 340 | 340 | $sth = $this->db->prepare($query); |
| 341 | 341 | $sth->execute(array(':id' => $id)); |
| 342 | - } catch(PDOException $e) { |
|
| 342 | + } catch (PDOException $e) { |
|
| 343 | 343 | echo $e->getMessage(); |
| 344 | 344 | die; |
| 345 | 345 | } |
@@ -356,12 +356,12 @@ discard block |
||
| 356 | 356 | public function getLastAltitudeArchiveSpotterDataByIdent($ident) { |
| 357 | 357 | date_default_timezone_set('UTC'); |
| 358 | 358 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 359 | - $query = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1"; |
|
| 359 | + $query = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1"; |
|
| 360 | 360 | // $query = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.ident = :ident"; |
| 361 | 361 | try { |
| 362 | 362 | $sth = $this->db->prepare($query); |
| 363 | 363 | $sth->execute(array(':ident' => $ident)); |
| 364 | - } catch(PDOException $e) { |
|
| 364 | + } catch (PDOException $e) { |
|
| 365 | 365 | echo $e->getMessage(); |
| 366 | 366 | die; |
| 367 | 367 | } |
@@ -377,11 +377,11 @@ discard block |
||
| 377 | 377 | * @return Array the spotter information |
| 378 | 378 | * |
| 379 | 379 | */ |
| 380 | - public function getSpotterArchiveData($ident,$flightaware_id,$date) { |
|
| 380 | + public function getSpotterArchiveData($ident, $flightaware_id, $date) { |
|
| 381 | 381 | $Spotter = new Spotter($this->db); |
| 382 | 382 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 383 | - $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.flightaware_id = :flightaware_id AND l.date LIKE :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate"; |
|
| 384 | - $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':flightaware_id' => $flightaware_id,':date' => $date.'%')); |
|
| 383 | + $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.flightaware_id = :flightaware_id AND l.date LIKE :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate"; |
|
| 384 | + $spotter_array = $Spotter->getDataFromDB($query, array(':ident' => $ident, ':flightaware_id' => $flightaware_id, ':date' => $date.'%')); |
|
| 385 | 385 | return $spotter_array; |
| 386 | 386 | } |
| 387 | 387 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | try { |
| 396 | 396 | $sth = $this->db->prepare($query); |
| 397 | 397 | $sth->execute(); |
| 398 | - } catch(PDOException $e) { |
|
| 398 | + } catch (PDOException $e) { |
|
| 399 | 399 | echo $e->getMessage(); |
| 400 | 400 | die; |
| 401 | 401 | } |
@@ -407,39 +407,39 @@ discard block |
||
| 407 | 407 | * @return Array the spotter information |
| 408 | 408 | * |
| 409 | 409 | */ |
| 410 | - public function getMinLiveSpotterData($begindate,$enddate,$filter = array(),$part = 0) { |
|
| 410 | + public function getMinLiveSpotterData($begindate, $enddate, $filter = array(), $part = 0) { |
|
| 411 | 411 | global $globalDBdriver, $globalLiveInterval; |
| 412 | 412 | date_default_timezone_set('UTC'); |
| 413 | 413 | //$filter_query = $this->getFilter($filter,true,true); |
| 414 | 414 | |
| 415 | 415 | $filter_query = ''; |
| 416 | 416 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 417 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
| 417 | + $filter_query .= " AND format_source IN ('".implode("','", $filter['source'])."') "; |
|
| 418 | 418 | } |
| 419 | 419 | // Use spotter_output also ? |
| 420 | 420 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
| 421 | - $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id "; |
|
| 421 | + $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id "; |
|
| 422 | 422 | } |
| 423 | 423 | if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
| 424 | 424 | $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id "; |
| 425 | 425 | } |
| 426 | 426 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 427 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 427 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | $limit = ''; |
| 431 | 431 | if ($part != 0) { |
| 432 | - $limit = ' LIMIT 100 OFFSET '.($part-1)*100; |
|
| 432 | + $limit = ' LIMIT 100 OFFSET '.($part - 1)*100; |
|
| 433 | 433 | } |
| 434 | 434 | if ($globalDBdriver == 'mysql') { |
| 435 | - $query = 'SELECT spotter_archive.date,spotter_archive.flightaware_id, spotter_archive.ident, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
| 435 | + $query = 'SELECT spotter_archive.date,spotter_archive.flightaware_id, spotter_archive.ident, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
| 436 | 436 | FROM spotter_archive |
| 437 | 437 | INNER JOIN aircraft a on spotter_archive.aircraft_icao = a.icao |
| 438 | 438 | WHERE spotter_archive.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".' |
| 439 | 439 | '.$filter_query.' ORDER BY flightaware_id'.$limit; |
| 440 | 440 | } else { |
| 441 | 441 | |
| 442 | - $query = 'SELECT spotter_archive.flightaware_id, spotter_archive.date, spotter_archive.ident, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
| 442 | + $query = 'SELECT spotter_archive.flightaware_id, spotter_archive.date, spotter_archive.ident, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
| 443 | 443 | FROM spotter_archive |
| 444 | 444 | INNER JOIN aircraft a on spotter_archive.aircraft_icao = a.icao |
| 445 | 445 | WHERE spotter_archive.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".' |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | try { |
| 458 | 458 | $sth = $this->db->prepare($query); |
| 459 | 459 | $sth->execute(); |
| 460 | - } catch(PDOException $e) { |
|
| 460 | + } catch (PDOException $e) { |
|
| 461 | 461 | echo $e->getMessage(); |
| 462 | 462 | die; |
| 463 | 463 | } |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | * @return Array the spotter information |
| 472 | 472 | * |
| 473 | 473 | */ |
| 474 | - public function getMinLiveSpotterDataPlayback($begindate,$enddate,$filter = array()) { |
|
| 474 | + public function getMinLiveSpotterDataPlayback($begindate, $enddate, $filter = array()) { |
|
| 475 | 475 | global $globalDBdriver, $globalLiveInterval; |
| 476 | 476 | date_default_timezone_set('UTC'); |
| 477 | 477 | |
@@ -479,17 +479,17 @@ discard block |
||
| 479 | 479 | |
| 480 | 480 | $filter_query = ''; |
| 481 | 481 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 482 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
| 482 | + $filter_query .= " AND format_source IN ('".implode("','", $filter['source'])."') "; |
|
| 483 | 483 | } |
| 484 | 484 | // Use spotter_output also ? |
| 485 | 485 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
| 486 | - $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id "; |
|
| 486 | + $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id "; |
|
| 487 | 487 | } |
| 488 | 488 | if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
| 489 | 489 | $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id "; |
| 490 | 490 | } |
| 491 | 491 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 492 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 492 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | FROM spotter_archive |
| 501 | 501 | INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE (l.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON spotter_archive.aircraft_icao = a.icao'; |
| 502 | 502 | */ |
| 503 | - $query = 'SELECT a.aircraft_shadow, spotter_archive_output.ident, spotter_archive_output.flightaware_id, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk |
|
| 503 | + $query = 'SELECT a.aircraft_shadow, spotter_archive_output.ident, spotter_archive_output.flightaware_id, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk |
|
| 504 | 504 | FROM spotter_archive_output |
| 505 | 505 | LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON spotter_archive_output.aircraft_icao = a.icao |
| 506 | 506 | WHERE (spotter_archive_output.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | WHERE spotter_archive_output.date >= '."'".$begindate."'".' AND spotter_archive_output.date <= '."'".$enddate."'".' |
| 516 | 516 | '.$filter_query.' GROUP BY spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao, spotter_archive_output.arrival_airport_icao, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow'; |
| 517 | 517 | */ |
| 518 | - $query = 'SELECT DISTINCT spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow |
|
| 518 | + $query = 'SELECT DISTINCT spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow |
|
| 519 | 519 | FROM spotter_archive_output |
| 520 | 520 | INNER JOIN (SELECT * FROM aircraft) a on spotter_archive_output.aircraft_icao = a.icao |
| 521 | 521 | WHERE spotter_archive_output.date >= '."'".$begindate."'".' AND spotter_archive_output.date <= '."'".$enddate."'".' |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | try { |
| 528 | 528 | $sth = $this->db->prepare($query); |
| 529 | 529 | $sth->execute(); |
| 530 | - } catch(PDOException $e) { |
|
| 530 | + } catch (PDOException $e) { |
|
| 531 | 531 | echo $e->getMessage(); |
| 532 | 532 | die; |
| 533 | 533 | } |
@@ -542,22 +542,22 @@ discard block |
||
| 542 | 542 | * @return Array the spotter information |
| 543 | 543 | * |
| 544 | 544 | */ |
| 545 | - public function getLiveSpotterCount($begindate,$enddate,$filter = array()) { |
|
| 545 | + public function getLiveSpotterCount($begindate, $enddate, $filter = array()) { |
|
| 546 | 546 | global $globalDBdriver, $globalLiveInterval; |
| 547 | 547 | date_default_timezone_set('UTC'); |
| 548 | 548 | |
| 549 | 549 | $filter_query = ''; |
| 550 | 550 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 551 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
| 551 | + $filter_query .= " AND format_source IN ('".implode("','", $filter['source'])."') "; |
|
| 552 | 552 | } |
| 553 | 553 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
| 554 | - $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id "; |
|
| 554 | + $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id "; |
|
| 555 | 555 | } |
| 556 | 556 | if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
| 557 | 557 | $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id "; |
| 558 | 558 | } |
| 559 | 559 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 560 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 560 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | try { |
| 573 | 573 | $sth = $this->db->prepare($query); |
| 574 | 574 | $sth->execute(); |
| 575 | - } catch(PDOException $e) { |
|
| 575 | + } catch (PDOException $e) { |
|
| 576 | 576 | echo $e->getMessage(); |
| 577 | 577 | die; |
| 578 | 578 | } |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | * @return Array the spotter information |
| 593 | 593 | * |
| 594 | 594 | */ |
| 595 | - public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filters=array()) { |
|
| 595 | + public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '', $pilot_id = '', $pilot_name = '', $altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '', $origLat = '', $origLon = '', $dist = '', $filters = array()) { |
|
| 596 | 596 | global $globalTimezone, $globalDBdriver; |
| 597 | 597 | require_once(dirname(__FILE__).'/class.Translation.php'); |
| 598 | 598 | $Translation = new Translation($this->db); |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | if ($registration != "") { |
| 645 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 645 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 646 | 646 | if (!is_string($registration)) { |
| 647 | 647 | return array(); |
| 648 | 648 | } else { |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | if ($aircraft_icao != "") { |
| 654 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 654 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 655 | 655 | if (!is_string($aircraft_icao)) { |
| 656 | 656 | return array(); |
| 657 | 657 | } else { |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | if ($aircraft_manufacturer != "") { |
| 663 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 663 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 664 | 664 | if (!is_string($aircraft_manufacturer)) { |
| 665 | 665 | return array(); |
| 666 | 666 | } else { |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | if ($airline_icao != "") { |
| 680 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 680 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 681 | 681 | if (!is_string($airline_icao)) { |
| 682 | 682 | return array(); |
| 683 | 683 | } else { |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | if ($airline_country != "") { |
| 689 | - $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING); |
|
| 689 | + $airline_country = filter_var($airline_country, FILTER_SANITIZE_STRING); |
|
| 690 | 690 | if (!is_string($airline_country)) { |
| 691 | 691 | return array(); |
| 692 | 692 | } else { |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | if ($airline_type != "") { |
| 698 | - $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
|
| 698 | + $airline_type = filter_var($airline_type, FILTER_SANITIZE_STRING); |
|
| 699 | 699 | if (!is_string($airline_type)) { |
| 700 | 700 | return array(); |
| 701 | 701 | } else { |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | if ($airport != "") { |
| 715 | - $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
| 715 | + $airport = filter_var($airport, FILTER_SANITIZE_STRING); |
|
| 716 | 716 | if (!is_string($airport)) { |
| 717 | 717 | return array(); |
| 718 | 718 | } else { |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | if ($airport_country != "") { |
| 724 | - $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING); |
|
| 724 | + $airport_country = filter_var($airport_country, FILTER_SANITIZE_STRING); |
|
| 725 | 725 | if (!is_string($airport_country)) { |
| 726 | 726 | return array(); |
| 727 | 727 | } else { |
@@ -730,14 +730,14 @@ discard block |
||
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | if ($callsign != "") { |
| 733 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
| 733 | + $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
| 734 | 734 | if (!is_string($callsign)) { |
| 735 | 735 | return array(); |
| 736 | 736 | } else { |
| 737 | 737 | $translate = $Translation->ident2icao($callsign); |
| 738 | 738 | if ($translate != $callsign) { |
| 739 | 739 | $additional_query .= " AND (spotter_archive_output.ident = :callsign OR spotter_archive_output.ident = :translate)"; |
| 740 | - $query_values = array_merge($query_values,array(':callsign' => $callsign,':translate' => $translate)); |
|
| 740 | + $query_values = array_merge($query_values, array(':callsign' => $callsign, ':translate' => $translate)); |
|
| 741 | 741 | } else { |
| 742 | 742 | $additional_query .= " AND (spotter_archive_output.ident = '".$callsign."')"; |
| 743 | 743 | } |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | } |
| 746 | 746 | |
| 747 | 747 | if ($owner != "") { |
| 748 | - $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
|
| 748 | + $owner = filter_var($owner, FILTER_SANITIZE_STRING); |
|
| 749 | 749 | if (!is_string($owner)) { |
| 750 | 750 | return array(); |
| 751 | 751 | } else { |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | if ($pilot_name != "") { |
| 757 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
| 757 | + $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
| 758 | 758 | if (!is_string($pilot_name)) { |
| 759 | 759 | return array(); |
| 760 | 760 | } else { |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | if ($pilot_id != "") { |
| 766 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT); |
|
| 766 | + $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_NUMBER_INT); |
|
| 767 | 767 | if (!is_string($pilot_id)) { |
| 768 | 768 | return array(); |
| 769 | 769 | } else { |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | if ($departure_airport_route != "") { |
| 775 | - $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING); |
|
| 775 | + $departure_airport_route = filter_var($departure_airport_route, FILTER_SANITIZE_STRING); |
|
| 776 | 776 | if (!is_string($departure_airport_route)) { |
| 777 | 777 | return array(); |
| 778 | 778 | } else { |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | if ($arrival_airport_route != "") { |
| 784 | - $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING); |
|
| 784 | + $arrival_airport_route = filter_var($arrival_airport_route, FILTER_SANITIZE_STRING); |
|
| 785 | 785 | if (!is_string($arrival_airport_route)) { |
| 786 | 786 | return array(); |
| 787 | 787 | } else { |
@@ -792,8 +792,8 @@ discard block |
||
| 792 | 792 | if ($altitude != "") { |
| 793 | 793 | $altitude_array = explode(",", $altitude); |
| 794 | 794 | |
| 795 | - $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 796 | - $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 795 | + $altitude_array[0] = filter_var($altitude_array[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 796 | + $altitude_array[1] = filter_var($altitude_array[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 797 | 797 | |
| 798 | 798 | |
| 799 | 799 | if ($altitude_array[1] != "") { |
@@ -808,8 +808,8 @@ discard block |
||
| 808 | 808 | |
| 809 | 809 | if ($date_posted != "") { |
| 810 | 810 | $date_array = explode(",", $date_posted); |
| 811 | - $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING); |
|
| 812 | - $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING); |
|
| 811 | + $date_array[0] = filter_var($date_array[0], FILTER_SANITIZE_STRING); |
|
| 812 | + $date_array[1] = filter_var($date_array[1], FILTER_SANITIZE_STRING); |
|
| 813 | 813 | if ($globalTimezone != '') { |
| 814 | 814 | date_default_timezone_set($globalTimezone); |
| 815 | 815 | $datetime = new DateTime(); |
@@ -834,16 +834,16 @@ discard block |
||
| 834 | 834 | } |
| 835 | 835 | if ($limit != "") { |
| 836 | 836 | $limit_array = explode(",", $limit); |
| 837 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 838 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 837 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 838 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 839 | 839 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) { |
| 840 | 840 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
| 841 | 841 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
| 842 | 842 | } |
| 843 | 843 | } |
| 844 | 844 | if ($origLat != "" && $origLon != "" && $dist != "") { |
| 845 | - $dist = number_format($dist*0.621371,2,'.',''); |
|
| 846 | - $query="SELECT spotter_archive_output.*, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - ABS(CAST(spotter_archive.latitude as double precision)))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(ABS(CAST(spotter_archive.latitude as double precision))*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
| 845 | + $dist = number_format($dist*0.621371, 2, '.', ''); |
|
| 846 | + $query = "SELECT spotter_archive_output.*, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - ABS(CAST(spotter_archive.latitude as double precision)))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(ABS(CAST(spotter_archive.latitude as double precision))*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
| 847 | 847 | FROM spotter_archive_output, spotter_archive WHERE spotter_output_archive.flightaware_id = spotter_archive.flightaware_id AND spotter_output.ident <> '' ".$additional_query."AND CAST(spotter_archive.longitude as double precision) between ($origLon-$dist/ABS(cos(radians($origLat))*69)) and ($origLon+$dist/ABS(cos(radians($origLat))*69)) and CAST(spotter_archive.latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
| 848 | 848 | AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - ABS(CAST(spotter_archive.latitude as double precision)))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(ABS(CAST(spotter_archive.latitude as double precision))*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2)))) < $dist".$filter_query." ORDER BY distance"; |
| 849 | 849 | } else { |
@@ -857,12 +857,12 @@ discard block |
||
| 857 | 857 | $additional_query .= " AND (spotter_archive_output.waypoints <> '')"; |
| 858 | 858 | } |
| 859 | 859 | |
| 860 | - $query = "SELECT spotter_archive_output.* FROM spotter_archive_output |
|
| 860 | + $query = "SELECT spotter_archive_output.* FROM spotter_archive_output |
|
| 861 | 861 | WHERE spotter_archive_output.ident <> '' |
| 862 | 862 | ".$additional_query." |
| 863 | 863 | ".$filter_query.$orderby_query; |
| 864 | 864 | } |
| 865 | - $spotter_array = $Spotter->getDataFromDB($query, $query_values,$limit_query); |
|
| 865 | + $spotter_array = $Spotter->getDataFromDB($query, $query_values, $limit_query); |
|
| 866 | 866 | return $spotter_array; |
| 867 | 867 | } |
| 868 | 868 | |
@@ -877,7 +877,7 @@ discard block |
||
| 877 | 877 | try { |
| 878 | 878 | $sth = $this->db->prepare($query); |
| 879 | 879 | $sth->execute(); |
| 880 | - } catch(PDOException $e) { |
|
| 880 | + } catch (PDOException $e) { |
|
| 881 | 881 | return "error"; |
| 882 | 882 | } |
| 883 | 883 | } |
@@ -910,8 +910,8 @@ discard block |
||
| 910 | 910 | if ($limit != "") { |
| 911 | 911 | $limit_array = explode(",", $limit); |
| 912 | 912 | |
| 913 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 914 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 913 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 914 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 915 | 915 | |
| 916 | 916 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) { |
| 917 | 917 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
@@ -949,7 +949,7 @@ discard block |
||
| 949 | 949 | $query_values = array(); |
| 950 | 950 | $limit_query = ''; |
| 951 | 951 | $additional_query = ''; |
| 952 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 952 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 953 | 953 | |
| 954 | 954 | if ($owner != "") { |
| 955 | 955 | if (!is_string($owner)) { |
@@ -963,8 +963,8 @@ discard block |
||
| 963 | 963 | if ($limit != "") { |
| 964 | 964 | $limit_array = explode(",", $limit); |
| 965 | 965 | |
| 966 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 967 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 966 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 967 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 968 | 968 | |
| 969 | 969 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) { |
| 970 | 970 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | $query_values = array(); |
| 1002 | 1002 | $limit_query = ''; |
| 1003 | 1003 | $additional_query = ''; |
| 1004 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 1004 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 1005 | 1005 | |
| 1006 | 1006 | if ($pilot != "") { |
| 1007 | 1007 | $additional_query = " AND (spotter_archive_output.pilot_id = :pilot OR spotter_archive_output.pilot_name = :pilot)"; |
@@ -1011,8 +1011,8 @@ discard block |
||
| 1011 | 1011 | if ($limit != "") { |
| 1012 | 1012 | $limit_array = explode(",", $limit); |
| 1013 | 1013 | |
| 1014 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1015 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1014 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1015 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1016 | 1016 | |
| 1017 | 1017 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) { |
| 1018 | 1018 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | * @return Array the airline country list |
| 1041 | 1041 | * |
| 1042 | 1042 | */ |
| 1043 | - public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') { |
|
| 1043 | + public function countAllFlightOverCountries($limit = true, $olderthanmonths = 0, $sincedate = '') { |
|
| 1044 | 1044 | global $globalDBdriver; |
| 1045 | 1045 | /* |
| 1046 | 1046 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | $flight_array = array(); |
| 1069 | 1069 | $temp_array = array(); |
| 1070 | 1070 | |
| 1071 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
| 1071 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
| 1072 | 1072 | $temp_array['flight_count'] = $row['nb']; |
| 1073 | 1073 | $temp_array['flight_country'] = $row['name']; |
| 1074 | 1074 | $temp_array['flight_country_iso3'] = $row['iso3']; |
@@ -1084,7 +1084,7 @@ discard block |
||
| 1084 | 1084 | * @return Array the airline country list |
| 1085 | 1085 | * |
| 1086 | 1086 | */ |
| 1087 | - public function countAllFlightOverCountriesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') { |
|
| 1087 | + public function countAllFlightOverCountriesByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') { |
|
| 1088 | 1088 | global $globalDBdriver; |
| 1089 | 1089 | /* |
| 1090 | 1090 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
@@ -1112,7 +1112,7 @@ discard block |
||
| 1112 | 1112 | $flight_array = array(); |
| 1113 | 1113 | $temp_array = array(); |
| 1114 | 1114 | |
| 1115 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
| 1115 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
| 1116 | 1116 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 1117 | 1117 | $temp_array['flight_count'] = $row['nb']; |
| 1118 | 1118 | $temp_array['flight_country'] = $row['name']; |
@@ -1129,13 +1129,13 @@ discard block |
||
| 1129 | 1129 | * @return Array the spotter information |
| 1130 | 1130 | * |
| 1131 | 1131 | */ |
| 1132 | - public function getDateArchiveSpotterDataById($id,$date) { |
|
| 1132 | + public function getDateArchiveSpotterDataById($id, $date) { |
|
| 1133 | 1133 | $Spotter = new Spotter($this->db); |
| 1134 | 1134 | date_default_timezone_set('UTC'); |
| 1135 | 1135 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 1136 | - $query = 'SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate ORDER BY spotter_archive.date DESC'; |
|
| 1137 | - $date = date('c',$date); |
|
| 1138 | - $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id,':date' => $date)); |
|
| 1136 | + $query = 'SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate ORDER BY spotter_archive.date DESC'; |
|
| 1137 | + $date = date('c', $date); |
|
| 1138 | + $spotter_array = $Spotter->getDataFromDB($query, array(':id' => $id, ':date' => $date)); |
|
| 1139 | 1139 | return $spotter_array; |
| 1140 | 1140 | } |
| 1141 | 1141 | |
@@ -1145,13 +1145,13 @@ discard block |
||
| 1145 | 1145 | * @return Array the spotter information |
| 1146 | 1146 | * |
| 1147 | 1147 | */ |
| 1148 | - public function getDateArchiveSpotterDataByIdent($ident,$date) { |
|
| 1148 | + public function getDateArchiveSpotterDataByIdent($ident, $date) { |
|
| 1149 | 1149 | $Spotter = new Spotter($this->db); |
| 1150 | 1150 | date_default_timezone_set('UTC'); |
| 1151 | 1151 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 1152 | - $query = 'SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate ORDER BY spotter_archive.date DESC'; |
|
| 1153 | - $date = date('c',$date); |
|
| 1154 | - $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
|
| 1152 | + $query = 'SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate ORDER BY spotter_archive.date DESC'; |
|
| 1153 | + $date = date('c', $date); |
|
| 1154 | + $spotter_array = $Spotter->getDataFromDB($query, array(':ident' => $ident, ':date' => $date)); |
|
| 1155 | 1155 | return $spotter_array; |
| 1156 | 1156 | } |
| 1157 | 1157 | |
@@ -1161,14 +1161,14 @@ discard block |
||
| 1161 | 1161 | * @return Array the spotter information |
| 1162 | 1162 | * |
| 1163 | 1163 | */ |
| 1164 | - public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) { |
|
| 1164 | + public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '', $filters = array()) { |
|
| 1165 | 1165 | global $global_query; |
| 1166 | 1166 | $Spotter = new Spotter($this->db); |
| 1167 | 1167 | date_default_timezone_set('UTC'); |
| 1168 | 1168 | $query_values = array(); |
| 1169 | 1169 | $limit_query = ''; |
| 1170 | 1170 | $additional_query = ''; |
| 1171 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 1171 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 1172 | 1172 | |
| 1173 | 1173 | if ($airport != "") { |
| 1174 | 1174 | if (!is_string($airport)) { |
@@ -1182,8 +1182,8 @@ discard block |
||
| 1182 | 1182 | if ($limit != "") { |
| 1183 | 1183 | $limit_array = explode(",", $limit); |
| 1184 | 1184 | |
| 1185 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1186 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1185 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1186 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1187 | 1187 | |
| 1188 | 1188 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) { |
| 1189 | 1189 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
@@ -17,33 +17,33 @@ discard block |
||
| 17 | 17 | * @param Array $filter the filter |
| 18 | 18 | * @return Array the SQL part |
| 19 | 19 | */ |
| 20 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
| 20 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
| 21 | 21 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
| 22 | 22 | $filters = array(); |
| 23 | 23 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
| 24 | 24 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
| 25 | 25 | $filters = $globalStatsFilters[$globalFilterName]; |
| 26 | 26 | } else { |
| 27 | - $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
|
| 27 | + $filter = array_merge($filter, $globalStatsFilters[$globalFilterName]); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | if (isset($filter[0]['source'])) { |
| 31 | - $filters = array_merge($filters,$filter); |
|
| 31 | + $filters = array_merge($filters, $filter); |
|
| 32 | 32 | } |
| 33 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 33 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
| 34 | 34 | $filter_query_join = ''; |
| 35 | 35 | $filter_query_where = ''; |
| 36 | - foreach($filters as $flt) { |
|
| 36 | + foreach ($filters as $flt) { |
|
| 37 | 37 | if (isset($flt['idents']) && !empty($flt['idents'])) { |
| 38 | 38 | if (isset($flt['source'])) { |
| 39 | - $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output WHERE tracker_output.ident IN ('".implode("','",$flt['idents'])."') AND tracker_output.format_source IN ('".implode("','",$flt['source'])."')) spid ON spid.famtrackid = tracker_live.famtrackid"; |
|
| 39 | + $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output WHERE tracker_output.ident IN ('".implode("','", $flt['idents'])."') AND tracker_output.format_source IN ('".implode("','", $flt['source'])."')) spid ON spid.famtrackid = tracker_live.famtrackid"; |
|
| 40 | 40 | } else { |
| 41 | - $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output WHERE tracker_output.ident IN ('".implode("','",$flt['idents'])."')) spid ON spid.famtrackid = tracker_live.famtrackid"; |
|
| 41 | + $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output WHERE tracker_output.ident IN ('".implode("','", $flt['idents'])."')) spid ON spid.famtrackid = tracker_live.famtrackid"; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 46 | - $filter_query_where .= " AND format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 46 | + $filter_query_where .= " AND format_source IN ('".implode("','", $filter['source'])."')"; |
|
| 47 | 47 | } |
| 48 | 48 | if (isset($filter['ident']) && !empty($filter['ident'])) { |
| 49 | 49 | $filter_query_where .= " AND ident = '".$filter['ident']."'"; |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | $filter_query_date .= " AND EXTRACT(DAY FROM tracker_output.date) = '".$filter['day']."'"; |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | - $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output".preg_replace('/^ AND/',' WHERE',$filter_query_date).") sd ON sd.famtrackid = tracker_live.famtrackid"; |
|
| 78 | + $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_output".preg_replace('/^ AND/', ' WHERE', $filter_query_date).") sd ON sd.famtrackid = tracker_live.famtrackid"; |
|
| 79 | 79 | } |
| 80 | 80 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 81 | - $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 81 | + $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 82 | 82 | } |
| 83 | 83 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
| 84 | 84 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
| 85 | 85 | if ($filter_query_where != '') { |
| 86 | - $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
|
| 86 | + $filter_query_where = preg_replace('/^ AND/', ' WHERE', $filter_query_where); |
|
| 87 | 87 | } |
| 88 | 88 | $filter_query = $filter_query_join.$filter_query_where; |
| 89 | 89 | return $filter_query; |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | if ($limit != '') |
| 107 | 107 | { |
| 108 | 108 | $limit_array = explode(',', $limit); |
| 109 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 110 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 109 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 110 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 111 | 111 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 112 | 112 | { |
| 113 | 113 | $limit_query = ' LIMIT '.$limit_array[1].' OFFSET '.$limit_array[0]; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } else { |
| 131 | 131 | $query = "SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= l.date GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate".$filter_query.$orderby_query; |
| 132 | 132 | } |
| 133 | - $spotter_array = $Tracker->getDataFromDB($query.$limit_query,array(),'',true); |
|
| 133 | + $spotter_array = $Tracker->getDataFromDB($query.$limit_query, array(), '', true); |
|
| 134 | 134 | |
| 135 | 135 | return $spotter_array; |
| 136 | 136 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | global $globalDBdriver, $globalLiveInterval; |
| 147 | 147 | date_default_timezone_set('UTC'); |
| 148 | 148 | |
| 149 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 149 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 150 | 150 | |
| 151 | 151 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 152 | 152 | if ($globalDBdriver == 'mysql') { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | try { |
| 165 | 165 | $sth = $this->db->prepare($query); |
| 166 | 166 | $sth->execute(); |
| 167 | - } catch(PDOException $e) { |
|
| 167 | + } catch (PDOException $e) { |
|
| 168 | 168 | echo $e->getMessage(); |
| 169 | 169 | die; |
| 170 | 170 | } |
@@ -179,25 +179,25 @@ discard block |
||
| 179 | 179 | * @return Array the spotter information |
| 180 | 180 | * |
| 181 | 181 | */ |
| 182 | - public function getMinLastLiveTrackerData($coord,$filter = array(),$limit = false) |
|
| 182 | + public function getMinLastLiveTrackerData($coord, $filter = array(), $limit = false) |
|
| 183 | 183 | { |
| 184 | 184 | global $globalDBdriver, $globalLiveInterval, $globalArchive, $globalMap3DTrackersLimit; |
| 185 | 185 | date_default_timezone_set('UTC'); |
| 186 | 186 | $usecoord = false; |
| 187 | 187 | if (is_array($coord) && !empty($coord)) { |
| 188 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 189 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 190 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 191 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 188 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 189 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 190 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 191 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 192 | 192 | $usecoord = true; |
| 193 | 193 | } |
| 194 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 194 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 195 | 195 | |
| 196 | 196 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 197 | 197 | if (!isset($globalMap3DTrackersLimit) || $globalMap3DTrackersLimit == '') $globalMap3DTrackersLimit = '300'; |
| 198 | 198 | if ($globalDBdriver == 'mysql') { |
| 199 | 199 | if (isset($globalArchive) && $globalArchive) { |
| 200 | - $query = "SELECT * FROM ( |
|
| 200 | + $query = "SELECT * FROM ( |
|
| 201 | 201 | SELECT tracker_archive.ident, tracker_archive.famtrackid,tracker_archive.type,tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.date, tracker_archive.format_source |
| 202 | 202 | FROM tracker_archive INNER JOIN (SELECT famtrackid FROM tracker_live".$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= tracker_live.date) l ON l.famtrackid = tracker_archive.famtrackid "; |
| 203 | 203 | if ($usecoord) $query .= "AND tracker_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND tracker_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | } else { |
| 221 | 221 | if (isset($globalArchive) && $globalArchive) { |
| 222 | - $query = "SELECT * FROM ( |
|
| 222 | + $query = "SELECT * FROM ( |
|
| 223 | 223 | SELECT tracker_archive.ident, tracker_archive.famtrackid,tracker_archive.type,tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.date, tracker_archive.format_source |
| 224 | 224 | FROM tracker_archive INNER JOIN (SELECT famtrackid FROM tracker_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= tracker_live.date) l ON l.famtrackid = tracker_archive.famtrackid "; |
| 225 | 225 | if ($usecoord) $query .= "AND tracker_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND tracker_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." "; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | try { |
| 244 | 244 | $sth = $this->db->prepare($query); |
| 245 | 245 | $sth->execute(); |
| 246 | - } catch(PDOException $e) { |
|
| 246 | + } catch (PDOException $e) { |
|
| 247 | 247 | echo $e->getMessage(); |
| 248 | 248 | die; |
| 249 | 249 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | public function getLiveTrackerCount($filter = array()) |
| 261 | 261 | { |
| 262 | 262 | global $globalDBdriver, $globalLiveInterval; |
| 263 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 263 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 264 | 264 | |
| 265 | 265 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 266 | 266 | if ($globalDBdriver == 'mysql') { |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | try { |
| 272 | 272 | $sth = $this->db->prepare($query); |
| 273 | 273 | $sth->execute(); |
| 274 | - } catch(PDOException $e) { |
|
| 274 | + } catch (PDOException $e) { |
|
| 275 | 275 | echo $e->getMessage(); |
| 276 | 276 | die; |
| 277 | 277 | } |
@@ -294,10 +294,10 @@ discard block |
||
| 294 | 294 | $filter_query = $this->getFilter($filter); |
| 295 | 295 | |
| 296 | 296 | if (is_array($coord)) { |
| 297 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 298 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 299 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 300 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 297 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 298 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 299 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 300 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 301 | 301 | } else return array(); |
| 302 | 302 | if ($globalDBdriver == 'mysql') { |
| 303 | 303 | $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate AND tracker_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND tracker_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY tracker_live.famtrackid'.$filter_query; |
@@ -319,13 +319,13 @@ discard block |
||
| 319 | 319 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
| 320 | 320 | $Tracker = new Tracker($this->db); |
| 321 | 321 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
| 322 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 322 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 323 | 323 | |
| 324 | 324 | if (is_array($coord)) { |
| 325 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 326 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 327 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 328 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 325 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 326 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 327 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 328 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 329 | 329 | } else return array(); |
| 330 | 330 | /* |
| 331 | 331 | if ($globalDBdriver == 'mysql') { |
@@ -339,13 +339,13 @@ discard block |
||
| 339 | 339 | */ |
| 340 | 340 | if ($globalDBdriver == 'mysql') { |
| 341 | 341 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 342 | - $query = 'SELECT tracker_live.ident, tracker_live.famtrackid,tracker_live.type, tracker_live.latitude, tracker_live.longitude, tracker_live.altitude, tracker_live.heading, tracker_live.ground_speed, tracker_live.date, tracker_live.format_source |
|
| 342 | + $query = 'SELECT tracker_live.ident, tracker_live.famtrackid,tracker_live.type, tracker_live.latitude, tracker_live.longitude, tracker_live.altitude, tracker_live.heading, tracker_live.ground_speed, tracker_live.date, tracker_live.format_source |
|
| 343 | 343 | FROM tracker_live |
| 344 | 344 | '.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= tracker_live.date |
| 345 | 345 | AND tracker_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND tracker_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' |
| 346 | 346 | AND tracker_live.latitude <> 0 AND tracker_live.longitude <> 0 ORDER BY date DESC'; |
| 347 | 347 | } else { |
| 348 | - $query = 'SELECT tracker_live.ident, tracker_live.famtrackid,tracker_live.type, tracker_live.latitude, tracker_live.longitude, tracker_live.altitude, tracker_live.heading, tracker_live.ground_speed, tracker_live.date, tracker_live.format_source |
|
| 348 | + $query = 'SELECT tracker_live.ident, tracker_live.famtrackid,tracker_live.type, tracker_live.latitude, tracker_live.longitude, tracker_live.altitude, tracker_live.heading, tracker_live.ground_speed, tracker_live.date, tracker_live.format_source |
|
| 349 | 349 | FROM tracker_live |
| 350 | 350 | INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate |
| 351 | 351 | FROM tracker_live l |
@@ -357,14 +357,14 @@ discard block |
||
| 357 | 357 | } |
| 358 | 358 | } else { |
| 359 | 359 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 360 | - $query = "SELECT tracker_live.ident, tracker_live.famtrackid,tracker_live.type, tracker_live.latitude, tracker_live.longitude, tracker_live.altitude, tracker_live.heading, tracker_live.ground_speed, tracker_live.date, tracker_live.format_source |
|
| 360 | + $query = "SELECT tracker_live.ident, tracker_live.famtrackid,tracker_live.type, tracker_live.latitude, tracker_live.longitude, tracker_live.altitude, tracker_live.heading, tracker_live.ground_speed, tracker_live.date, tracker_live.format_source |
|
| 361 | 361 | FROM tracker_live |
| 362 | 362 | ".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= tracker_live.date |
| 363 | 363 | AND tracker_live.latitude BETWEEN ".$minlat." AND ".$maxlat." |
| 364 | 364 | AND tracker_live.longitude BETWEEN ".$minlong." AND ".$maxlong." |
| 365 | 365 | AND tracker_live.latitude <> '0' AND tracker_live.longitude <> '0' ORDER BY date DESC"; |
| 366 | 366 | } else { |
| 367 | - $query = "SELECT tracker_live.ident, tracker_live.famtrackid,tracker_live.type, tracker_live.latitude, tracker_live.longitude, tracker_live.altitude, tracker_live.heading, tracker_live.ground_speed, tracker_live.date, tracker_live.format_source |
|
| 367 | + $query = "SELECT tracker_live.ident, tracker_live.famtrackid,tracker_live.type, tracker_live.latitude, tracker_live.longitude, tracker_live.altitude, tracker_live.heading, tracker_live.ground_speed, tracker_live.date, tracker_live.format_source |
|
| 368 | 368 | FROM tracker_live |
| 369 | 369 | INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate |
| 370 | 370 | FROM tracker_live l |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | if ($interval == '1m') |
| 422 | 422 | { |
| 423 | 423 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= tracker_live.date '; |
| 424 | - } else if ($interval == '15m'){ |
|
| 424 | + } else if ($interval == '15m') { |
|
| 425 | 425 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= tracker_live.date '; |
| 426 | 426 | } |
| 427 | 427 | } |
@@ -429,14 +429,14 @@ discard block |
||
| 429 | 429 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= tracker_live.date '; |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | - $query = "SELECT tracker_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM tracker_live |
|
| 432 | + $query = "SELECT tracker_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM tracker_live |
|
| 433 | 433 | WHERE tracker_live.latitude <> '' |
| 434 | 434 | AND tracker_live.longitude <> '' |
| 435 | 435 | ".$additional_query." |
| 436 | 436 | HAVING distance < :radius |
| 437 | 437 | ORDER BY distance"; |
| 438 | 438 | |
| 439 | - $spotter_array = $Tracker->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius)); |
|
| 439 | + $spotter_array = $Tracker->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng, ':radius' => $radius)); |
|
| 440 | 440 | |
| 441 | 441 | return $spotter_array; |
| 442 | 442 | } |
@@ -454,9 +454,9 @@ discard block |
||
| 454 | 454 | date_default_timezone_set('UTC'); |
| 455 | 455 | |
| 456 | 456 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 457 | - $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate ORDER BY tracker_live.date DESC'; |
|
| 457 | + $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate ORDER BY tracker_live.date DESC'; |
|
| 458 | 458 | |
| 459 | - $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident),'',true); |
|
| 459 | + $spotter_array = $Tracker->getDataFromDB($query, array(':ident' => $ident), '', true); |
|
| 460 | 460 | |
| 461 | 461 | return $spotter_array; |
| 462 | 462 | } |
@@ -467,16 +467,16 @@ discard block |
||
| 467 | 467 | * @return Array the spotter information |
| 468 | 468 | * |
| 469 | 469 | */ |
| 470 | - public function getDateLiveTrackerDataByIdent($ident,$date) |
|
| 470 | + public function getDateLiveTrackerDataByIdent($ident, $date) |
|
| 471 | 471 | { |
| 472 | 472 | $Tracker = new Tracker($this->db); |
| 473 | 473 | date_default_timezone_set('UTC'); |
| 474 | 474 | |
| 475 | 475 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 476 | - $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate ORDER BY tracker_live.date DESC'; |
|
| 476 | + $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate ORDER BY tracker_live.date DESC'; |
|
| 477 | 477 | |
| 478 | - $date = date('c',$date); |
|
| 479 | - $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
|
| 478 | + $date = date('c', $date); |
|
| 479 | + $spotter_array = $Tracker->getDataFromDB($query, array(':ident' => $ident, ':date' => $date)); |
|
| 480 | 480 | |
| 481 | 481 | return $spotter_array; |
| 482 | 482 | } |
@@ -493,9 +493,9 @@ discard block |
||
| 493 | 493 | date_default_timezone_set('UTC'); |
| 494 | 494 | |
| 495 | 495 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 496 | - $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE l.famtrackid = :id GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate ORDER BY tracker_live.date DESC'; |
|
| 496 | + $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE l.famtrackid = :id GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate ORDER BY tracker_live.date DESC'; |
|
| 497 | 497 | |
| 498 | - $spotter_array = $Tracker->getDataFromDB($query,array(':id' => $id),'',true); |
|
| 498 | + $spotter_array = $Tracker->getDataFromDB($query, array(':id' => $id), '', true); |
|
| 499 | 499 | |
| 500 | 500 | return $spotter_array; |
| 501 | 501 | } |
@@ -506,15 +506,15 @@ discard block |
||
| 506 | 506 | * @return Array the spotter information |
| 507 | 507 | * |
| 508 | 508 | */ |
| 509 | - public function getDateLiveTrackerDataById($id,$date) |
|
| 509 | + public function getDateLiveTrackerDataById($id, $date) |
|
| 510 | 510 | { |
| 511 | 511 | $Tracker = new Tracker($this->db); |
| 512 | 512 | date_default_timezone_set('UTC'); |
| 513 | 513 | |
| 514 | 514 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 515 | - $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE l.famtrackid = :id AND l.date <= :date GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate ORDER BY tracker_live.date DESC'; |
|
| 516 | - $date = date('c',$date); |
|
| 517 | - $spotter_array = $Tracker->getDataFromDB($query,array(':id' => $id,':date' => $date),'',true); |
|
| 515 | + $query = 'SELECT tracker_live.* FROM tracker_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_live l WHERE l.famtrackid = :id AND l.date <= :date GROUP BY l.famtrackid) s on tracker_live.famtrackid = s.famtrackid AND tracker_live.date = s.maxdate ORDER BY tracker_live.date DESC'; |
|
| 516 | + $date = date('c', $date); |
|
| 517 | + $spotter_array = $Tracker->getDataFromDB($query, array(':id' => $id, ':date' => $date), '', true); |
|
| 518 | 518 | |
| 519 | 519 | return $spotter_array; |
| 520 | 520 | } |
@@ -531,13 +531,13 @@ discard block |
||
| 531 | 531 | date_default_timezone_set('UTC'); |
| 532 | 532 | |
| 533 | 533 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 534 | - $query = 'SELECT tracker_live.altitude, tracker_live.date FROM tracker_live WHERE tracker_live.ident = :ident'; |
|
| 534 | + $query = 'SELECT tracker_live.altitude, tracker_live.date FROM tracker_live WHERE tracker_live.ident = :ident'; |
|
| 535 | 535 | |
| 536 | 536 | try { |
| 537 | 537 | |
| 538 | 538 | $sth = $this->db->prepare($query); |
| 539 | 539 | $sth->execute(array(':ident' => $ident)); |
| 540 | - } catch(PDOException $e) { |
|
| 540 | + } catch (PDOException $e) { |
|
| 541 | 541 | echo $e->getMessage(); |
| 542 | 542 | die; |
| 543 | 543 | } |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | * @return Array the spotter information |
| 553 | 553 | * |
| 554 | 554 | */ |
| 555 | - public function getAllLiveTrackerDataById($id,$liveinterval = false) |
|
| 555 | + public function getAllLiveTrackerDataById($id, $liveinterval = false) |
|
| 556 | 556 | { |
| 557 | 557 | global $globalDBdriver, $globalLiveInterval; |
| 558 | 558 | date_default_timezone_set('UTC'); |
@@ -561,19 +561,19 @@ discard block |
||
| 561 | 561 | if ($globalDBdriver == 'mysql') { |
| 562 | 562 | $query = 'SELECT tracker_live.* FROM tracker_live WHERE tracker_live.famtrackid = :id'; |
| 563 | 563 | if ($liveinterval === true) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
| 564 | - elseif ($liveinterval !== false) $query .= " AND date <= '".date('c',$liveinterval)."'"; |
|
| 564 | + elseif ($liveinterval !== false) $query .= " AND date <= '".date('c', $liveinterval)."'"; |
|
| 565 | 565 | $query .= ' ORDER BY date'; |
| 566 | 566 | } else { |
| 567 | 567 | $query = 'SELECT tracker_live.* FROM tracker_live WHERE tracker_live.famtrackid = :id'; |
| 568 | 568 | if ($liveinterval === true) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
| 569 | - elseif ($liveinterval !== false) $query .= " AND date <= '".date('c',$liveinterval)."'"; |
|
| 569 | + elseif ($liveinterval !== false) $query .= " AND date <= '".date('c', $liveinterval)."'"; |
|
| 570 | 570 | $query .= ' ORDER BY date'; |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | try { |
| 574 | 574 | $sth = $this->db->prepare($query); |
| 575 | 575 | $sth->execute(array(':id' => $id)); |
| 576 | - } catch(PDOException $e) { |
|
| 576 | + } catch (PDOException $e) { |
|
| 577 | 577 | echo $e->getMessage(); |
| 578 | 578 | die; |
| 579 | 579 | } |
@@ -591,12 +591,12 @@ discard block |
||
| 591 | 591 | { |
| 592 | 592 | date_default_timezone_set('UTC'); |
| 593 | 593 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 594 | - $query = self::$global_query.' WHERE tracker_live.ident = :ident'; |
|
| 594 | + $query = self::$global_query.' WHERE tracker_live.ident = :ident'; |
|
| 595 | 595 | try { |
| 596 | 596 | |
| 597 | 597 | $sth = $this->db->prepare($query); |
| 598 | 598 | $sth->execute(array(':ident' => $ident)); |
| 599 | - } catch(PDOException $e) { |
|
| 599 | + } catch (PDOException $e) { |
|
| 600 | 600 | echo $e->getMessage(); |
| 601 | 601 | die; |
| 602 | 602 | } |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | |
| 627 | 627 | $sth = $this->db->prepare($query); |
| 628 | 628 | $sth->execute(); |
| 629 | - } catch(PDOException $e) { |
|
| 629 | + } catch (PDOException $e) { |
|
| 630 | 630 | return "error"; |
| 631 | 631 | } |
| 632 | 632 | |
@@ -649,14 +649,14 @@ discard block |
||
| 649 | 649 | |
| 650 | 650 | $sth = $this->db->prepare($query); |
| 651 | 651 | $sth->execute(); |
| 652 | - } catch(PDOException $e) { |
|
| 652 | + } catch (PDOException $e) { |
|
| 653 | 653 | return "error"; |
| 654 | 654 | } |
| 655 | 655 | $query_delete = 'DELETE FROM tracker_live WHERE famtrackid IN ('; |
| 656 | 656 | $i = 0; |
| 657 | - $j =0; |
|
| 657 | + $j = 0; |
|
| 658 | 658 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 659 | - foreach($all as $row) |
|
| 659 | + foreach ($all as $row) |
|
| 660 | 660 | { |
| 661 | 661 | $i++; |
| 662 | 662 | $j++; |
@@ -664,9 +664,9 @@ discard block |
||
| 664 | 664 | if ($globalDebug) echo "."; |
| 665 | 665 | try { |
| 666 | 666 | |
| 667 | - $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
|
| 667 | + $sth = $this->db->prepare(substr($query_delete, 0, -1).")"); |
|
| 668 | 668 | $sth->execute(); |
| 669 | - } catch(PDOException $e) { |
|
| 669 | + } catch (PDOException $e) { |
|
| 670 | 670 | return "error"; |
| 671 | 671 | } |
| 672 | 672 | $query_delete = 'DELETE FROM tracker_live WHERE famtrackid IN ('; |
@@ -677,9 +677,9 @@ discard block |
||
| 677 | 677 | if ($i > 0) { |
| 678 | 678 | try { |
| 679 | 679 | |
| 680 | - $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
|
| 680 | + $sth = $this->db->prepare(substr($query_delete, 0, -1).")"); |
|
| 681 | 681 | $sth->execute(); |
| 682 | - } catch(PDOException $e) { |
|
| 682 | + } catch (PDOException $e) { |
|
| 683 | 683 | return "error"; |
| 684 | 684 | } |
| 685 | 685 | } |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | |
| 693 | 693 | $sth = $this->db->prepare($query); |
| 694 | 694 | $sth->execute(); |
| 695 | - } catch(PDOException $e) { |
|
| 695 | + } catch (PDOException $e) { |
|
| 696 | 696 | return "error"; |
| 697 | 697 | } |
| 698 | 698 | /* $query_delete = "DELETE FROM tracker_live WHERE famtrackid IN ("; |
@@ -740,13 +740,13 @@ discard block |
||
| 740 | 740 | public function deleteLiveTrackerDataByIdent($ident) |
| 741 | 741 | { |
| 742 | 742 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
| 743 | - $query = 'DELETE FROM tracker_live WHERE ident = :ident'; |
|
| 743 | + $query = 'DELETE FROM tracker_live WHERE ident = :ident'; |
|
| 744 | 744 | |
| 745 | 745 | try { |
| 746 | 746 | |
| 747 | 747 | $sth = $this->db->prepare($query); |
| 748 | 748 | $sth->execute(array(':ident' => $ident)); |
| 749 | - } catch(PDOException $e) { |
|
| 749 | + } catch (PDOException $e) { |
|
| 750 | 750 | return "error"; |
| 751 | 751 | } |
| 752 | 752 | |
@@ -762,13 +762,13 @@ discard block |
||
| 762 | 762 | public function deleteLiveTrackerDataById($id) |
| 763 | 763 | { |
| 764 | 764 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
| 765 | - $query = 'DELETE FROM tracker_live WHERE famtrackid = :id'; |
|
| 765 | + $query = 'DELETE FROM tracker_live WHERE famtrackid = :id'; |
|
| 766 | 766 | |
| 767 | 767 | try { |
| 768 | 768 | |
| 769 | 769 | $sth = $this->db->prepare($query); |
| 770 | 770 | $sth->execute(array(':id' => $id)); |
| 771 | - } catch(PDOException $e) { |
|
| 771 | + } catch (PDOException $e) { |
|
| 772 | 772 | return "error"; |
| 773 | 773 | } |
| 774 | 774 | |
@@ -786,13 +786,13 @@ discard block |
||
| 786 | 786 | { |
| 787 | 787 | global $globalDBdriver, $globalTimezone; |
| 788 | 788 | if ($globalDBdriver == 'mysql') { |
| 789 | - $query = 'SELECT tracker_live.ident FROM tracker_live |
|
| 789 | + $query = 'SELECT tracker_live.ident FROM tracker_live |
|
| 790 | 790 | WHERE tracker_live.ident = :ident |
| 791 | 791 | AND tracker_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) |
| 792 | 792 | AND tracker_live.date < UTC_TIMESTAMP()'; |
| 793 | 793 | $query_data = array(':ident' => $ident); |
| 794 | 794 | } else { |
| 795 | - $query = "SELECT tracker_live.ident FROM tracker_live |
|
| 795 | + $query = "SELECT tracker_live.ident FROM tracker_live |
|
| 796 | 796 | WHERE tracker_live.ident = :ident |
| 797 | 797 | AND tracker_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 798 | 798 | AND tracker_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -801,8 +801,8 @@ discard block |
||
| 801 | 801 | |
| 802 | 802 | $sth = $this->db->prepare($query); |
| 803 | 803 | $sth->execute($query_data); |
| 804 | - $ident_result=''; |
|
| 805 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 804 | + $ident_result = ''; |
|
| 805 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 806 | 806 | { |
| 807 | 807 | $ident_result = $row['ident']; |
| 808 | 808 | } |
@@ -819,13 +819,13 @@ discard block |
||
| 819 | 819 | { |
| 820 | 820 | global $globalDBdriver, $globalTimezone; |
| 821 | 821 | if ($globalDBdriver == 'mysql') { |
| 822 | - $query = 'SELECT tracker_live.ident, tracker_live.famtrackid FROM tracker_live |
|
| 822 | + $query = 'SELECT tracker_live.ident, tracker_live.famtrackid FROM tracker_live |
|
| 823 | 823 | WHERE tracker_live.ident = :ident |
| 824 | 824 | AND tracker_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE)'; |
| 825 | 825 | // AND tracker_live.date < UTC_TIMESTAMP()"; |
| 826 | 826 | $query_data = array(':ident' => $ident); |
| 827 | 827 | } else { |
| 828 | - $query = "SELECT tracker_live.ident, tracker_live.famtrackid FROM tracker_live |
|
| 828 | + $query = "SELECT tracker_live.ident, tracker_live.famtrackid FROM tracker_live |
|
| 829 | 829 | WHERE tracker_live.ident = :ident |
| 830 | 830 | AND tracker_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '30 MINUTES'"; |
| 831 | 831 | // AND tracker_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -834,8 +834,8 @@ discard block |
||
| 834 | 834 | |
| 835 | 835 | $sth = $this->db->prepare($query); |
| 836 | 836 | $sth->execute($query_data); |
| 837 | - $ident_result=''; |
|
| 838 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 837 | + $ident_result = ''; |
|
| 838 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 839 | 839 | { |
| 840 | 840 | $ident_result = $row['famtrackid']; |
| 841 | 841 | } |
@@ -852,13 +852,13 @@ discard block |
||
| 852 | 852 | { |
| 853 | 853 | global $globalDBdriver, $globalTimezone; |
| 854 | 854 | if ($globalDBdriver == 'mysql') { |
| 855 | - $query = 'SELECT tracker_live.ident, tracker_live.famtrackid FROM tracker_live |
|
| 855 | + $query = 'SELECT tracker_live.ident, tracker_live.famtrackid FROM tracker_live |
|
| 856 | 856 | WHERE tracker_live.famtrackid = :id |
| 857 | 857 | AND tracker_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 HOUR)'; |
| 858 | 858 | // AND tracker_live.date < UTC_TIMESTAMP()"; |
| 859 | 859 | $query_data = array(':id' => $id); |
| 860 | 860 | } else { |
| 861 | - $query = "SELECT tracker_live.ident, tracker_live.famtrackid FROM tracker_live |
|
| 861 | + $query = "SELECT tracker_live.ident, tracker_live.famtrackid FROM tracker_live |
|
| 862 | 862 | WHERE tracker_live.famtrackid = :id |
| 863 | 863 | AND tracker_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '10 HOUR'"; |
| 864 | 864 | // AND tracker_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -867,8 +867,8 @@ discard block |
||
| 867 | 867 | |
| 868 | 868 | $sth = $this->db->prepare($query); |
| 869 | 869 | $sth->execute($query_data); |
| 870 | - $ident_result=''; |
|
| 871 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 870 | + $ident_result = ''; |
|
| 871 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 872 | 872 | { |
| 873 | 873 | $ident_result = $row['famtrackid']; |
| 874 | 874 | } |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | * @return String success or false |
| 887 | 887 | * |
| 888 | 888 | */ |
| 889 | - public function addLiveTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $comment = '', $type = '',$noarchive = false,$format_source = '', $source_name = '', $over_country = '') |
|
| 889 | + public function addLiveTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $comment = '', $type = '', $noarchive = false, $format_source = '', $source_name = '', $over_country = '') |
|
| 890 | 890 | { |
| 891 | 891 | global $globalURL, $globalArchive, $globalDebug; |
| 892 | 892 | $Common = new Common(); |
@@ -945,21 +945,21 @@ discard block |
||
| 945 | 945 | if ($date == '') $date = date("Y-m-d H:i:s", time()); |
| 946 | 946 | |
| 947 | 947 | |
| 948 | - $famtrackid = filter_var($famtrackid,FILTER_SANITIZE_STRING); |
|
| 949 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 950 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 951 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 952 | - $altitude = filter_var($altitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 953 | - $heading = filter_var($heading,FILTER_SANITIZE_NUMBER_INT); |
|
| 954 | - $groundspeed = filter_var($groundspeed,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 955 | - $format_source = filter_var($format_source,FILTER_SANITIZE_STRING); |
|
| 956 | - $source_name = filter_var($source_name,FILTER_SANITIZE_STRING); |
|
| 957 | - $over_country = filter_var($over_country,FILTER_SANITIZE_STRING); |
|
| 958 | - $comment = filter_var($comment,FILTER_SANITIZE_STRING); |
|
| 959 | - $type = filter_var($type,FILTER_SANITIZE_STRING); |
|
| 960 | - |
|
| 961 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
| 962 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
| 948 | + $famtrackid = filter_var($famtrackid, FILTER_SANITIZE_STRING); |
|
| 949 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 950 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 951 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 952 | + $altitude = filter_var($altitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 953 | + $heading = filter_var($heading, FILTER_SANITIZE_NUMBER_INT); |
|
| 954 | + $groundspeed = filter_var($groundspeed, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 955 | + $format_source = filter_var($format_source, FILTER_SANITIZE_STRING); |
|
| 956 | + $source_name = filter_var($source_name, FILTER_SANITIZE_STRING); |
|
| 957 | + $over_country = filter_var($over_country, FILTER_SANITIZE_STRING); |
|
| 958 | + $comment = filter_var($comment, FILTER_SANITIZE_STRING); |
|
| 959 | + $type = filter_var($type, FILTER_SANITIZE_STRING); |
|
| 960 | + |
|
| 961 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 962 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 963 | 963 | |
| 964 | 964 | $query = ''; |
| 965 | 965 | if ($globalArchive) { |
@@ -969,12 +969,12 @@ discard block |
||
| 969 | 969 | $query .= 'INSERT INTO tracker_live (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, over_country, comment, type) |
| 970 | 970 | VALUES (:famtrackid,:ident,:latitude,:longitude,:altitude,:heading,:groundspeed,:date,:format_source, :source_name, :over_country,:comment,:type)'; |
| 971 | 971 | |
| 972 | - $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident,':latitude' => $latitude,':longitude' => $longitude,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date, ':format_source' => $format_source, ':source_name' => $source_name, ':over_country' => $over_country,':comment' => $comment,':type' => $type); |
|
| 972 | + $query_values = array(':famtrackid' => $famtrackid, ':ident' => $ident, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':heading' => $heading, ':groundspeed' => $groundspeed, ':date' => $date, ':format_source' => $format_source, ':source_name' => $source_name, ':over_country' => $over_country, ':comment' => $comment, ':type' => $type); |
|
| 973 | 973 | try { |
| 974 | 974 | $sth = $this->db->prepare($query); |
| 975 | 975 | $sth->execute($query_values); |
| 976 | 976 | $sth->closeCursor(); |
| 977 | - } catch(PDOException $e) { |
|
| 977 | + } catch (PDOException $e) { |
|
| 978 | 978 | return "error : ".$e->getMessage(); |
| 979 | 979 | } |
| 980 | 980 | /* |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
| 985 | 985 | if ($globalDebug) echo '(Add to Tracker archive '.$famtrackid.' : '; |
| 986 | 986 | $TrackerArchive = new TrackerArchive($this->db); |
| 987 | - $result = $TrackerArchive->addTrackerArchiveData($famtrackid, $ident,$latitude, $longitude, $altitude, $heading, $groundspeed, $date, $putinarchive, $comment, $type,$noarchive,$format_source, $source_name, $over_country); |
|
| 987 | + $result = $TrackerArchive->addTrackerArchiveData($famtrackid, $ident, $latitude, $longitude, $altitude, $heading, $groundspeed, $date, $putinarchive, $comment, $type, $noarchive, $format_source, $source_name, $over_country); |
|
| 988 | 988 | if ($globalDebug) echo $result.')'; |
| 989 | 989 | } |
| 990 | 990 | |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | |
| 995 | 995 | public function getOrderBy() |
| 996 | 996 | { |
| 997 | - $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY tracker_live.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY tracker_live.aircraft_icao DESC"),"manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY tracker_live.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY tracker_live.aircraft_manufacturer DESC"),"airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY tracker_live.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY tracker_live.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY tracker_live.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY tracker_live.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY tracker_live.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY tracker_live.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY tracker_live.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY tracker_live.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY tracker_live.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY tracker_live.date DESC")); |
|
| 997 | + $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY tracker_live.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY tracker_live.aircraft_icao DESC"), "manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY tracker_live.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY tracker_live.aircraft_manufacturer DESC"), "airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY tracker_live.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY tracker_live.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY tracker_live.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY tracker_live.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY tracker_live.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY tracker_live.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY tracker_live.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY tracker_live.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY tracker_live.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY tracker_live.date DESC")); |
|
| 998 | 998 | return $orderby; |
| 999 | 999 | } |
| 1000 | 1000 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | <?php }; if (isset($globalSatellite) && $globalSatellite) { ?><td><div id="ibxsatellite"><h4><?php echo _("Satellites Displayed"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div></td><?php } ?> |
| 51 | 51 | </tr></table></div> |
| 52 | 52 | <?php |
| 53 | - if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
| 53 | + if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
| 54 | 54 | ?> |
| 55 | 55 | <script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script> |
| 56 | 56 | <?php |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | <script src="<?php echo $globalURL; ?>/js/map-marine.3d.js.php"></script> |
| 75 | 75 | <?php |
| 76 | 76 | } |
| 77 | - } |
|
| 77 | + } |
|
| 78 | 78 | ?> |
| 79 | 79 | |
| 80 | 80 | <div id="sidebar" class="sidebar collapsed"> |
@@ -85,34 +85,34 @@ discard block |
||
| 85 | 85 | <li><a href="" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li> |
| 86 | 86 | <li><a href="" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li> |
| 87 | 87 | <?php |
| 88 | - //if ((isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') || (isset($globalBeta) && $globalBeta === TRUE)) { |
|
| 88 | + //if ((isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') || (isset($globalBeta) && $globalBeta === TRUE)) { |
|
| 89 | 89 | if (isset($globalArchive) && $globalArchive == TRUE && (!isset($globalAircraft) || $globalAircraft === TRUE)) { |
| 90 | 90 | ?> |
| 91 | 91 | <li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li> |
| 92 | 92 | <?php |
| 93 | 93 | } |
| 94 | - //} |
|
| 94 | + //} |
|
| 95 | 95 | ?> |
| 96 | 96 | <li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li> |
| 97 | 97 | <li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li> |
| 98 | 98 | <li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li> |
| 99 | 99 | <?php |
| 100 | - if (isset($globalMap3D) && $globalMap3D) { |
|
| 100 | + if (isset($globalMap3D) && $globalMap3D) { |
|
| 101 | 101 | if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
| 102 | 102 | ?> |
| 103 | 103 | <li><a href="" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li> |
| 104 | 104 | <?php |
| 105 | 105 | } else { |
| 106 | - if (isset($globalSatellite) && $globalSatellite) { |
|
| 106 | + if (isset($globalSatellite) && $globalSatellite) { |
|
| 107 | 107 | ?> |
| 108 | 108 | <li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li> |
| 109 | 109 | <?php |
| 110 | - } |
|
| 110 | + } |
|
| 111 | 111 | ?> |
| 112 | 112 | <li><a href="" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li> |
| 113 | 113 | <?php |
| 114 | 114 | } |
| 115 | - } |
|
| 115 | + } |
|
| 116 | 116 | ?> |
| 117 | 117 | </ul> |
| 118 | 118 | |
@@ -261,72 +261,72 @@ discard block |
||
| 261 | 261 | <?php |
| 262 | 262 | if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
| 263 | 263 | else $MapType = $_COOKIE['MapType']; |
| 264 | - ?> |
|
| 264 | + ?> |
|
| 265 | 265 | <?php |
| 266 | 266 | if (isset($globalMapOffline) && $globalMapOffline === TRUE) { |
| 267 | - ?> |
|
| 267 | + ?> |
|
| 268 | 268 | <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option> |
| 269 | 269 | <?php |
| 270 | 270 | } else { |
| 271 | - if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) { |
|
| 272 | - ?> |
|
| 271 | + if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) { |
|
| 272 | + ?> |
|
| 273 | 273 | <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option> |
| 274 | 274 | <?php |
| 275 | - } |
|
| 276 | - ?> |
|
| 275 | + } |
|
| 276 | + ?> |
|
| 277 | 277 | <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option> |
| 278 | 278 | <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option> |
| 279 | 279 | <?php |
| 280 | - if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
| 281 | - ?> |
|
| 280 | + if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
| 281 | + ?> |
|
| 282 | 282 | <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
| 283 | 283 | <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
| 284 | 284 | <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
| 285 | 285 | <?php |
| 286 | - } |
|
| 287 | - ?> |
|
| 286 | + } |
|
| 287 | + ?> |
|
| 288 | 288 | <?php |
| 289 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
| 290 | - ?> |
|
| 289 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
| 290 | + ?> |
|
| 291 | 291 | <?php |
| 292 | 292 | if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
| 293 | - ?> |
|
| 293 | + ?> |
|
| 294 | 294 | <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
| 295 | 295 | <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
| 296 | 296 | <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
| 297 | 297 | <?php |
| 298 | 298 | } |
| 299 | - ?> |
|
| 299 | + ?> |
|
| 300 | 300 | <?php |
| 301 | 301 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
| 302 | - ?> |
|
| 302 | + ?> |
|
| 303 | 303 | <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
| 304 | 304 | <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
| 305 | 305 | <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
| 306 | 306 | <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
| 307 | 307 | <?php |
| 308 | 308 | } |
| 309 | - ?> |
|
| 309 | + ?> |
|
| 310 | 310 | <?php |
| 311 | 311 | if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
| 312 | - ?> |
|
| 312 | + ?> |
|
| 313 | 313 | <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
| 314 | 314 | <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
| 315 | 315 | <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
| 316 | 316 | <?php |
| 317 | 317 | } |
| 318 | - ?> |
|
| 318 | + ?> |
|
| 319 | 319 | <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
| 320 | 320 | <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option> |
| 321 | 321 | <?php |
| 322 | - } |
|
| 323 | - ?> |
|
| 322 | + } |
|
| 323 | + ?> |
|
| 324 | 324 | <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option> |
| 325 | 325 | <?php |
| 326 | - if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
| 326 | + if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
| 327 | 327 | if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
| 328 | 328 | else $MapBoxId = $_COOKIE['MapTypeId']; |
| 329 | - ?> |
|
| 329 | + ?> |
|
| 330 | 330 | <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option> |
| 331 | 331 | <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
| 332 | 332 | <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
@@ -341,16 +341,16 @@ discard block |
||
| 341 | 341 | <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
| 342 | 342 | <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
| 343 | 343 | <?php |
| 344 | - } |
|
| 345 | - ?> |
|
| 344 | + } |
|
| 345 | + ?> |
|
| 346 | 346 | <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
| 347 | 347 | <?php |
| 348 | 348 | } |
| 349 | - ?> |
|
| 349 | + ?> |
|
| 350 | 350 | </select> |
| 351 | 351 | </li> |
| 352 | 352 | <?php |
| 353 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && (!isset($globalMapOffline) || $globalMapOffline === FALSE)) { |
|
| 353 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && (!isset($globalMapOffline) || $globalMapOffline === FALSE)) { |
|
| 354 | 354 | ?> |
| 355 | 355 | <li><?php echo _("Type of Terrain:"); ?> |
| 356 | 356 | <select class="selectpicker" onchange="terrainType(this);"> |
@@ -361,10 +361,10 @@ discard block |
||
| 361 | 361 | </select> |
| 362 | 362 | </li> |
| 363 | 363 | <?php |
| 364 | - } |
|
| 364 | + } |
|
| 365 | 365 | ?> |
| 366 | 366 | <?php |
| 367 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
| 367 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
| 368 | 368 | ?> |
| 369 | 369 | <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
| 370 | 370 | |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
| 388 | 388 | <?php |
| 389 | 389 | } |
| 390 | - } |
|
| 390 | + } |
|
| 391 | 391 | ?> |
| 392 | 392 | <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
| 393 | 393 | <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
@@ -406,80 +406,80 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | ?> |
| 408 | 408 | <?php |
| 409 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 409 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
| 410 | 410 | ?> |
| 411 | 411 | <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
| 412 | 412 | <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li> |
| 413 | 413 | <?php |
| 414 | - } |
|
| 415 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
| 414 | + } |
|
| 415 | + if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
| 416 | 416 | ?> |
| 417 | 417 | <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li> |
| 418 | 418 | <?php |
| 419 | - } |
|
| 419 | + } |
|
| 420 | 420 | ?> |
| 421 | 421 | <?php |
| 422 | 422 | if (function_exists('array_column')) { |
| 423 | - if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
| 424 | - ?> |
|
| 423 | + if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
| 424 | + ?> |
|
| 425 | 425 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
| 426 | 426 | <?php |
| 427 | - } |
|
| 427 | + } |
|
| 428 | 428 | } elseif (isset($globalSources)) { |
| 429 | - $dispolar = false; |
|
| 430 | - foreach ($globalSources as $testsource) { |
|
| 431 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
| 432 | - } |
|
| 433 | - if ($dispolar) { |
|
| 434 | - ?> |
|
| 429 | + $dispolar = false; |
|
| 430 | + foreach ($globalSources as $testsource) { |
|
| 431 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
| 432 | + } |
|
| 433 | + if ($dispolar) { |
|
| 434 | + ?> |
|
| 435 | 435 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
| 436 | 436 | <?php |
| 437 | - } |
|
| 438 | - } |
|
| 439 | - ?> |
|
| 437 | + } |
|
| 438 | + } |
|
| 439 | + ?> |
|
| 440 | 440 | <?php |
| 441 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
| 441 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
| 442 | 442 | ?> |
| 443 | 443 | |
| 444 | 444 | <?php |
| 445 | 445 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
| 446 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 447 | - ?> |
|
| 446 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 447 | + ?> |
|
| 448 | 448 | <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
| 449 | 449 | <?php |
| 450 | 450 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
| 451 | - ?> |
|
| 451 | + ?> |
|
| 452 | 452 | <li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"></li> |
| 453 | 453 | <?php |
| 454 | 454 | } |
| 455 | - } |
|
| 456 | - } |
|
| 457 | - ?> |
|
| 455 | + } |
|
| 456 | + } |
|
| 457 | + ?> |
|
| 458 | 458 | <?php |
| 459 | 459 | if (isset($globalMarine) && $globalMarine === TRUE) { |
| 460 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 461 | - ?> |
|
| 460 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 461 | + ?> |
|
| 462 | 462 | <li><?php echo _("Marine icon color:"); ?> |
| 463 | 463 | <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>"> |
| 464 | 464 | </li> |
| 465 | 465 | <?php |
| 466 | - } |
|
| 467 | - } |
|
| 468 | - ?> |
|
| 466 | + } |
|
| 467 | + } |
|
| 468 | + ?> |
|
| 469 | 469 | <?php |
| 470 | 470 | if (isset($globalTracker) && $globalTracker === TRUE) { |
| 471 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 472 | - ?> |
|
| 471 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 472 | + ?> |
|
| 473 | 473 | <li><?php echo _("Tracker icon color:"); ?> |
| 474 | 474 | <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>"> |
| 475 | 475 | </li> |
| 476 | 476 | <?php |
| 477 | - } |
|
| 478 | - } |
|
| 479 | - ?> |
|
| 477 | + } |
|
| 478 | + } |
|
| 479 | + ?> |
|
| 480 | 480 | <?php |
| 481 | 481 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
| 482 | - ?> |
|
| 482 | + ?> |
|
| 483 | 483 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
| 484 | 484 | <div class="range"> |
| 485 | 485 | <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
@@ -488,9 +488,9 @@ discard block |
||
| 488 | 488 | </li> |
| 489 | 489 | <?php |
| 490 | 490 | } |
| 491 | - ?> |
|
| 491 | + ?> |
|
| 492 | 492 | <?php |
| 493 | - } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
| 493 | + } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
| 494 | 494 | ?> |
| 495 | 495 | <li><?php echo _("Set scaling factor for rendering resolution:"); ?> |
| 496 | 496 | <div class="range"> |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | </li> |
| 529 | 529 | <?php |
| 530 | 530 | } |
| 531 | - } |
|
| 531 | + } |
|
| 532 | 532 | ?> |
| 533 | 533 | <li><?php echo _("Distance unit:"); ?> |
| 534 | 534 | <select class="selectpicker" onchange="unitdistance(this);"> |
@@ -561,19 +561,19 @@ discard block |
||
| 561 | 561 | <ul> |
| 562 | 562 | <?php |
| 563 | 563 | if (!isset($globalAircraft) || $globalAircraft) { |
| 564 | - ?> |
|
| 564 | + ?> |
|
| 565 | 565 | <?php |
| 566 | 566 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
| 567 | - ?> |
|
| 567 | + ?> |
|
| 568 | 568 | <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
| 569 | 569 | <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
| 570 | 570 | <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
| 571 | 571 | <?php |
| 572 | 572 | } |
| 573 | - ?> |
|
| 573 | + ?> |
|
| 574 | 574 | <?php |
| 575 | 575 | if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
| 576 | - ?> |
|
| 576 | + ?> |
|
| 577 | 577 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
| 578 | 578 | <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
| 579 | 579 | <?php } ?> |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | <?php } ?> |
| 583 | 583 | <?php |
| 584 | 584 | } |
| 585 | - ?> |
|
| 585 | + ?> |
|
| 586 | 586 | <li><?php echo _("Display airlines:"); ?> |
| 587 | 587 | <br/> |
| 588 | 588 | <select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines"> |
@@ -602,14 +602,14 @@ discard block |
||
| 602 | 602 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | - ?> |
|
| 605 | + ?> |
|
| 606 | 606 | </select> |
| 607 | 607 | </li> |
| 608 | 608 | <?php |
| 609 | 609 | $Spotter = new Spotter(); |
| 610 | 610 | $allalliancenames = $Spotter->getAllAllianceNames(); |
| 611 | 611 | if (!empty($allalliancenames)) { |
| 612 | - ?> |
|
| 612 | + ?> |
|
| 613 | 613 | <li><?php echo _("Display alliance:"); ?> |
| 614 | 614 | <br/> |
| 615 | 615 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
@@ -623,18 +623,18 @@ discard block |
||
| 623 | 623 | echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>'; |
| 624 | 624 | } |
| 625 | 625 | } |
| 626 | - ?> |
|
| 626 | + ?> |
|
| 627 | 627 | </select> |
| 628 | 628 | </li> |
| 629 | 629 | <?php |
| 630 | 630 | } |
| 631 | - ?> |
|
| 631 | + ?> |
|
| 632 | 632 | <?php |
| 633 | 633 | } |
| 634 | - ?> |
|
| 634 | + ?> |
|
| 635 | 635 | <?php |
| 636 | 636 | if (isset($globalAPRS) && $globalAPRS) { |
| 637 | - ?> |
|
| 637 | + ?> |
|
| 638 | 638 | <li><?php echo _("Display APRS sources name:"); ?> |
| 639 | 639 | <select class="selectpicker" multiple onchange="sources(this);"> |
| 640 | 640 | <?php |
@@ -658,18 +658,18 @@ discard block |
||
| 658 | 658 | echo '<option value="'.$src['name'].'">'.$src['name'].'</option>'; |
| 659 | 659 | } |
| 660 | 660 | } |
| 661 | - ?> |
|
| 661 | + ?> |
|
| 662 | 662 | </select> |
| 663 | 663 | </li> |
| 664 | 664 | <?php |
| 665 | 665 | } |
| 666 | - ?> |
|
| 666 | + ?> |
|
| 667 | 667 | <?php |
| 668 | 668 | if (!isset($globalAircraft) || $globalAircraft) { |
| 669 | - ?> |
|
| 669 | + ?> |
|
| 670 | 670 | <?php |
| 671 | - if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
|
| 672 | - ?> |
|
| 671 | + if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
|
| 672 | + ?> |
|
| 673 | 673 | <li><?php echo _("Display airlines of type:"); ?><br/> |
| 674 | 674 | <select class="selectpicker" onchange="airlinestype(this);"> |
| 675 | 675 | <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
@@ -679,21 +679,21 @@ discard block |
||
| 679 | 679 | </select> |
| 680 | 680 | </li> |
| 681 | 681 | <?php |
| 682 | - } |
|
| 683 | - ?> |
|
| 682 | + } |
|
| 683 | + ?> |
|
| 684 | 684 | <?php |
| 685 | 685 | } |
| 686 | - ?> |
|
| 686 | + ?> |
|
| 687 | 687 | <?php |
| 688 | 688 | if (isset($globalMarine) && $globalMarine) { |
| 689 | - ?> |
|
| 689 | + ?> |
|
| 690 | 690 | <li> |
| 691 | 691 | <?php echo _("Display vessels with MMSI:"); ?> |
| 692 | 692 | <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" /> |
| 693 | 693 | </li> |
| 694 | 694 | <?php |
| 695 | 695 | } |
| 696 | - ?> |
|
| 696 | + ?> |
|
| 697 | 697 | <li> |
| 698 | 698 | <?php echo _("Display with ident:"); ?> |
| 699 | 699 | <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | </form> |
| 707 | 707 | </div> |
| 708 | 708 | <?php |
| 709 | - if (isset($globalSatellite) && $globalSatellite) { |
|
| 709 | + if (isset($globalSatellite) && $globalSatellite) { |
|
| 710 | 710 | ?> |
| 711 | 711 | <div class="sidebar-pane" id="satellites"> |
| 712 | 712 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -746,14 +746,14 @@ discard block |
||
| 746 | 746 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
| 747 | 747 | } |
| 748 | 748 | } |
| 749 | - ?> |
|
| 749 | + ?> |
|
| 750 | 750 | </select> |
| 751 | 751 | </li> |
| 752 | 752 | </ul> |
| 753 | 753 | </form> |
| 754 | 754 | </div> |
| 755 | 755 | <?php |
| 756 | - } |
|
| 756 | + } |
|
| 757 | 757 | ?> |
| 758 | 758 | </div> |
| 759 | 759 | </div> |
@@ -52,7 +52,10 @@ discard block |
||
| 52 | 52 | <?php |
| 53 | 53 | if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
| 54 | 54 | ?> |
| 55 | -<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script> |
|
| 55 | +<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) { |
|
| 56 | + print '?tsk='.$tsk; |
|
| 57 | +} |
|
| 58 | +?>"></script> |
|
| 56 | 59 | <?php |
| 57 | 60 | if (!isset($globalAircraft) || $globalAircraft) { |
| 58 | 61 | ?> |
@@ -142,8 +145,14 @@ discard block |
||
| 142 | 145 | ?> |
| 143 | 146 | <form> |
| 144 | 147 | <ul> |
| 145 | - <li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?></label></div></li> |
|
| 146 | - <li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?></label></div></li> |
|
| 148 | + <li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') { |
|
| 149 | + print 'checked'; |
|
| 150 | +} |
|
| 151 | +?> /><?php echo _("Display waypoints"); ?></label></div></li> |
|
| 152 | + <li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') { |
|
| 153 | + print 'checked'; |
|
| 154 | +} |
|
| 155 | +?> /><?php echo _("Display airspace"); ?></label></div></li> |
|
| 147 | 156 | </ul> |
| 148 | 157 | </form> |
| 149 | 158 | <?php |
@@ -151,8 +160,14 @@ discard block |
||
| 151 | 160 | ?> |
| 152 | 161 | <form> |
| 153 | 162 | <ul> |
| 154 | - <li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li> |
|
| 155 | - <li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?> Beta</label></div></li> |
|
| 163 | + <li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') { |
|
| 164 | + print 'checked'; |
|
| 165 | +} |
|
| 166 | +?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li> |
|
| 167 | + <li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') { |
|
| 168 | + print 'checked'; |
|
| 169 | +} |
|
| 170 | +?> /><?php echo _("Display airspace"); ?> Beta</label></div></li> |
|
| 156 | 171 | </ul> |
| 157 | 172 | <p>This layers are in Beta, this can and will crash.</p> |
| 158 | 173 | </form> |
@@ -163,14 +178,32 @@ discard block |
||
| 163 | 178 | <h1>NOTAM</h1> |
| 164 | 179 | <form> |
| 165 | 180 | <ul> |
| 166 | - <li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') print 'checked'; ?> /><?php echo _("Display NOTAM"); ?></label></div></li> |
|
| 181 | + <li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') { |
|
| 182 | + print 'checked'; |
|
| 183 | +} |
|
| 184 | +?> /><?php echo _("Display NOTAM"); ?></label></div></li> |
|
| 167 | 185 | <li><?php echo _("NOTAM scope:"); ?> |
| 168 | 186 | <select class="selectpicker" onchange="notamscope(this);"> |
| 169 | - <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option> |
|
| 170 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option> |
|
| 171 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option> |
|
| 172 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option> |
|
| 173 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option> |
|
| 187 | + <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') { |
|
| 188 | + print ' selected'; |
|
| 189 | +} |
|
| 190 | +?>>All</option> |
|
| 191 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') { |
|
| 192 | + print ' selected'; |
|
| 193 | +} |
|
| 194 | +?>>Airport/Enroute warning</option> |
|
| 195 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') { |
|
| 196 | + print ' selected'; |
|
| 197 | +} |
|
| 198 | +?>>Airport warning</option> |
|
| 199 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') { |
|
| 200 | + print ' selected'; |
|
| 201 | +} |
|
| 202 | +?>>Navigation warning</option> |
|
| 203 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') { |
|
| 204 | + print ' selected'; |
|
| 205 | +} |
|
| 206 | +?>>Enroute warning</option> |
|
| 174 | 207 | </select |
| 175 | 208 | </li> |
| 176 | 209 | </ul> |
@@ -198,7 +231,10 @@ discard block |
||
| 198 | 231 | <div class="form-group"> |
| 199 | 232 | <label><?php echo _("From:"); ?></label> |
| 200 | 233 | <div class='input-group date' id='datetimepicker1'> |
| 201 | - <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC'; ?>" required /> |
|
| 234 | + <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') { |
|
| 235 | + print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC'; |
|
| 236 | +} |
|
| 237 | +?>" required /> |
|
| 202 | 238 | <span class="input-group-addon"> |
| 203 | 239 | <span class="glyphicon glyphicon-calendar"></span> |
| 204 | 240 | </span> |
@@ -207,7 +243,10 @@ discard block |
||
| 207 | 243 | <div class="form-group"> |
| 208 | 244 | <label><?php echo _("To:"); ?></label> |
| 209 | 245 | <div class='input-group date' id='datetimepicker2'> |
| 210 | - <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC'; ?>" /> |
|
| 246 | + <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') { |
|
| 247 | + print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC'; |
|
| 248 | +} |
|
| 249 | +?>" /> |
|
| 211 | 250 | <span class="input-group-addon"> |
| 212 | 251 | <span class="glyphicon glyphicon-calendar"></span> |
| 213 | 252 | </span> |
@@ -239,8 +278,20 @@ discard block |
||
| 239 | 278 | </script> |
| 240 | 279 | <li><?php echo _("Playback speed:"); ?> |
| 241 | 280 | <div class="range"> |
| 242 | - <input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>"> |
|
| 243 | - <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output> |
|
| 281 | + <input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) { |
|
| 282 | + print $_POST['archivespeed']; |
|
| 283 | +} elseif (isset($_COOKIE['archive_speed'])) { |
|
| 284 | + print $_COOKIE['archive_speed']; |
|
| 285 | +} else { |
|
| 286 | + print '1'; |
|
| 287 | +} |
|
| 288 | +?>"> |
|
| 289 | + <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) { |
|
| 290 | + print $_COOKIE['archive_speed']; |
|
| 291 | +} else { |
|
| 292 | + print '1'; |
|
| 293 | +} |
|
| 294 | +?></output> |
|
| 244 | 295 | </div> |
| 245 | 296 | </li> |
| 246 | 297 | <li><button type="button" onclick="addarchive(begindate,enddate);" class="btn btn-primary"><?php echo _("Show archive"); ?></button></li> |
@@ -259,29 +310,53 @@ discard block |
||
| 259 | 310 | <li><?php echo _("Type of Map:"); ?> |
| 260 | 311 | <select class="selectpicker" onchange="mapType(this);"> |
| 261 | 312 | <?php |
| 262 | - if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
|
| 263 | - else $MapType = $_COOKIE['MapType']; |
|
| 313 | + if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') { |
|
| 314 | + $MapType = $globalMapProvider; |
|
| 315 | + } else { |
|
| 316 | + $MapType = $_COOKIE['MapType']; |
|
| 317 | + } |
|
| 264 | 318 | ?> |
| 265 | 319 | <?php |
| 266 | 320 | if (isset($globalMapOffline) && $globalMapOffline === TRUE) { |
| 267 | 321 | ?> |
| 268 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option> |
|
| 322 | + <option value="offline"<?php if ($MapType == 'offline') { |
|
| 323 | + print ' selected'; |
|
| 324 | +} |
|
| 325 | +?>>Natural Earth (local)</option> |
|
| 269 | 326 | <?php |
| 270 | 327 | } else { |
| 271 | 328 | if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) { |
| 272 | 329 | ?> |
| 273 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option> |
|
| 330 | + <option value="offline"<?php if ($MapType == 'offline') { |
|
| 331 | + print ' selected'; |
|
| 332 | +} |
|
| 333 | +?>>Natural Earth (local)</option> |
|
| 274 | 334 | <?php |
| 275 | 335 | } |
| 276 | 336 | ?> |
| 277 | - <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option> |
|
| 278 | - <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option> |
|
| 337 | + <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') { |
|
| 338 | + print ' selected'; |
|
| 339 | +} |
|
| 340 | +?>>ArcGIS Streetmap</option> |
|
| 341 | + <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') { |
|
| 342 | + print ' selected'; |
|
| 343 | +} |
|
| 344 | +?>>ArcGIS Satellite</option> |
|
| 279 | 345 | <?php |
| 280 | 346 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
| 281 | 347 | ?> |
| 282 | - <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
|
| 283 | - <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
|
| 284 | - <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
|
| 348 | + <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') { |
|
| 349 | + print ' selected'; |
|
| 350 | +} |
|
| 351 | +?>>Bing-Aerial</option> |
|
| 352 | + <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') { |
|
| 353 | + print ' selected'; |
|
| 354 | +} |
|
| 355 | +?>>Bing-Hybrid</option> |
|
| 356 | + <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') { |
|
| 357 | + print ' selected'; |
|
| 358 | +} |
|
| 359 | +?>>Bing-Road</option> |
|
| 285 | 360 | <?php |
| 286 | 361 | } |
| 287 | 362 | ?> |
@@ -291,59 +366,143 @@ discard block |
||
| 291 | 366 | <?php |
| 292 | 367 | if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
| 293 | 368 | ?> |
| 294 | - <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
|
| 295 | - <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
|
| 296 | - <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
|
| 369 | + <option value="Here-Aerial"<?php if ($MapType == 'Here') { |
|
| 370 | + print ' selected'; |
|
| 371 | +} |
|
| 372 | +?>>Here-Aerial</option> |
|
| 373 | + <option value="Here-Hybrid"<?php if ($MapType == 'Here') { |
|
| 374 | + print ' selected'; |
|
| 375 | +} |
|
| 376 | +?>>Here-Hybrid</option> |
|
| 377 | + <option value="Here-Road"<?php if ($MapType == 'Here') { |
|
| 378 | + print ' selected'; |
|
| 379 | +} |
|
| 380 | +?>>Here-Road</option> |
|
| 297 | 381 | <?php |
| 298 | 382 | } |
| 299 | 383 | ?> |
| 300 | 384 | <?php |
| 301 | 385 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
| 302 | 386 | ?> |
| 303 | - <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
|
| 304 | - <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
|
| 305 | - <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
|
| 306 | - <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
|
| 387 | + <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') { |
|
| 388 | + print ' selected'; |
|
| 389 | +} |
|
| 390 | +?>>Google Roadmap</option> |
|
| 391 | + <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') { |
|
| 392 | + print ' selected'; |
|
| 393 | +} |
|
| 394 | +?>>Google Satellite</option> |
|
| 395 | + <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') { |
|
| 396 | + print ' selected'; |
|
| 397 | +} |
|
| 398 | +?>>Google Hybrid</option> |
|
| 399 | + <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') { |
|
| 400 | + print ' selected'; |
|
| 401 | +} |
|
| 402 | +?>>Google Terrain</option> |
|
| 307 | 403 | <?php |
| 308 | 404 | } |
| 309 | 405 | ?> |
| 310 | 406 | <?php |
| 311 | 407 | if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
| 312 | 408 | ?> |
| 313 | - <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
|
| 314 | - <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
|
| 315 | - <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
|
| 409 | + <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') { |
|
| 410 | + print ' selected'; |
|
| 411 | +} |
|
| 412 | +?>>MapQuest-OSM</option> |
|
| 413 | + <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') { |
|
| 414 | + print ' selected'; |
|
| 415 | +} |
|
| 416 | +?>>MapQuest-Aerial</option> |
|
| 417 | + <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') { |
|
| 418 | + print ' selected'; |
|
| 419 | +} |
|
| 420 | +?>>MapQuest-Hybrid</option> |
|
| 316 | 421 | <?php |
| 317 | 422 | } |
| 318 | 423 | ?> |
| 319 | - <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
|
| 320 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option> |
|
| 424 | + <option value="Yandex"<?php if ($MapType == 'Yandex') { |
|
| 425 | + print ' selected'; |
|
| 426 | +} |
|
| 427 | +?>>Yandex</option> |
|
| 428 | + <option value="offline"<?php if ($MapType == 'offline') { |
|
| 429 | + print ' selected'; |
|
| 430 | +} |
|
| 431 | +?>>Natural Earth</option> |
|
| 321 | 432 | <?php |
| 322 | 433 | } |
| 323 | 434 | ?> |
| 324 | - <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option> |
|
| 435 | + <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') { |
|
| 436 | + print ' selected'; |
|
| 437 | +} |
|
| 438 | +?>>National Geographic Street</option> |
|
| 325 | 439 | <?php |
| 326 | 440 | if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
| 327 | - if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
|
| 328 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 441 | + if (!isset($_COOKIE['MapTypeId'])) { |
|
| 442 | + $MapBoxId = 'default'; |
|
| 443 | + } else { |
|
| 444 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
| 445 | + } |
|
| 329 | 446 | ?> |
| 330 | - <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option> |
|
| 331 | - <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
|
| 332 | - <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
|
| 333 | - <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option> |
|
| 334 | - <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option> |
|
| 335 | - <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option> |
|
| 336 | - <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option> |
|
| 337 | - <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option> |
|
| 338 | - <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option> |
|
| 339 | - <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option> |
|
| 340 | - <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option> |
|
| 341 | - <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
|
| 342 | - <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
|
| 447 | + <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') { |
|
| 448 | + print ' selected'; |
|
| 449 | +} |
|
| 450 | +?>>Mapbox GL</option> |
|
| 451 | + <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') { |
|
| 452 | + print ' selected'; |
|
| 453 | +} |
|
| 454 | +?>>Mapbox default</option> |
|
| 455 | + <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') { |
|
| 456 | + print ' selected'; |
|
| 457 | +} |
|
| 458 | +?>>Mapbox streets</option> |
|
| 459 | + <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') { |
|
| 460 | + print ' selected'; |
|
| 461 | +} |
|
| 462 | +?>>Mapbox light</option> |
|
| 463 | + <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') { |
|
| 464 | + print ' selected'; |
|
| 465 | +} |
|
| 466 | +?>>Mapbox dark</option> |
|
| 467 | + <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') { |
|
| 468 | + print ' selected'; |
|
| 469 | +} |
|
| 470 | +?>>Mapbox satellite</option> |
|
| 471 | + <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') { |
|
| 472 | + print ' selected'; |
|
| 473 | +} |
|
| 474 | +?>>Mapbox streets-satellite</option> |
|
| 475 | + <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') { |
|
| 476 | + print ' selected'; |
|
| 477 | +} |
|
| 478 | +?>>Mapbox streets-basic</option> |
|
| 479 | + <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') { |
|
| 480 | + print ' selected'; |
|
| 481 | +} |
|
| 482 | +?>>Mapbox comic</option> |
|
| 483 | + <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') { |
|
| 484 | + print ' selected'; |
|
| 485 | +} |
|
| 486 | +?>>Mapbox outdoors</option> |
|
| 487 | + <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') { |
|
| 488 | + print ' selected'; |
|
| 489 | +} |
|
| 490 | +?>>Mapbox pencil</option> |
|
| 491 | + <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') { |
|
| 492 | + print ' selected'; |
|
| 493 | +} |
|
| 494 | +?>>Mapbox pirates</option> |
|
| 495 | + <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') { |
|
| 496 | + print ' selected'; |
|
| 497 | +} |
|
| 498 | +?>>Mapbox emerald</option> |
|
| 343 | 499 | <?php |
| 344 | 500 | } |
| 345 | 501 | ?> |
| 346 | - <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
|
| 502 | + <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') { |
|
| 503 | + print ' selected'; |
|
| 504 | +} |
|
| 505 | +?>>OpenStreetMap</option> |
|
| 347 | 506 | <?php |
| 348 | 507 | } |
| 349 | 508 | ?> |
@@ -354,10 +513,22 @@ discard block |
||
| 354 | 513 | ?> |
| 355 | 514 | <li><?php echo _("Type of Terrain:"); ?> |
| 356 | 515 | <select class="selectpicker" onchange="terrainType(this);"> |
| 357 | - <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> |
|
| 358 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> |
|
| 359 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> |
|
| 360 | - <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option> |
|
| 516 | + <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') { |
|
| 517 | + print ' selected'; |
|
| 518 | +} |
|
| 519 | +?>>stk terrain</option> |
|
| 520 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') { |
|
| 521 | + print ' selected'; |
|
| 522 | +} |
|
| 523 | +?>>ellipsoid</option> |
|
| 524 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') { |
|
| 525 | + print ' selected'; |
|
| 526 | +} |
|
| 527 | +?>>vr terrain</option> |
|
| 528 | + <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') { |
|
| 529 | + print ' selected'; |
|
| 530 | +} |
|
| 531 | +?>>ArticDEM</option> |
|
| 361 | 532 | </select> |
| 362 | 533 | </li> |
| 363 | 534 | <?php |
@@ -366,50 +537,98 @@ discard block |
||
| 366 | 537 | <?php |
| 367 | 538 | if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
| 368 | 539 | ?> |
| 369 | - <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
|
| 540 | + <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') { |
|
| 541 | + print 'checked'; |
|
| 542 | +} |
|
| 543 | +?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
|
| 370 | 544 | |
| 371 | 545 | <?php |
| 372 | 546 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
| 373 | 547 | ?> |
| 374 | - <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>--> |
|
| 375 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
| 376 | - <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
| 377 | - <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> |
|
| 378 | - <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
| 548 | + <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') { |
|
| 549 | + print 'checked'; |
|
| 550 | +} |
|
| 551 | +?> ><?php echo _("Display flight info as popup"); ?></label></div></li>--> |
|
| 552 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) { |
|
| 553 | + print 'checked'; |
|
| 554 | +} |
|
| 555 | +?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
| 556 | + <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) { |
|
| 557 | + print 'checked'; |
|
| 558 | +} |
|
| 559 | +?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
| 560 | + <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) { |
|
| 561 | + print 'checked'; |
|
| 562 | +} |
|
| 563 | +?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> |
|
| 564 | + <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { |
|
| 565 | + print 'checked'; |
|
| 566 | +} |
|
| 567 | +?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
| 379 | 568 | <?php |
| 380 | 569 | } elseif (!isset($globalTracker) || $globalTracker === TRUE) { |
| 381 | 570 | ?> |
| 382 | - <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) print 'checked'; ?> ><?php echo _("Enable map matching"); ?></label></div></li> |
|
| 571 | + <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) { |
|
| 572 | + print 'checked'; |
|
| 573 | +} |
|
| 574 | +?> ><?php echo _("Enable map matching"); ?></label></div></li> |
|
| 383 | 575 | <?php |
| 384 | 576 | } |
| 385 | 577 | if (isset($globalSatellite) && $globalSatellite === TRUE) { |
| 386 | 578 | ?> |
| 387 | - <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
|
| 579 | + <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { |
|
| 580 | + print 'checked'; |
|
| 581 | +} |
|
| 582 | +?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
|
| 388 | 583 | <?php |
| 389 | 584 | } |
| 390 | 585 | } |
| 391 | 586 | ?> |
| 392 | - <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
| 393 | - <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
|
| 394 | - <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
|
| 395 | - <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
|
| 587 | + <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) { |
|
| 588 | + print 'checked'; |
|
| 589 | +} |
|
| 590 | +?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
| 591 | + <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) { |
|
| 592 | + print 'checked'; |
|
| 593 | +} |
|
| 594 | +?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
|
| 595 | + <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) { |
|
| 596 | + print 'checked'; |
|
| 597 | +} |
|
| 598 | +?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
|
| 599 | + <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) { |
|
| 600 | + print 'checked'; |
|
| 601 | +} |
|
| 602 | +?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
|
| 396 | 603 | <?php |
| 397 | 604 | if (isset($globalFires)) { |
| 398 | 605 | ?> |
| 399 | - <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) print 'checked'; ?> ><?php echo _("Display fires on map"); ?></label></div></li> |
|
| 606 | + <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) { |
|
| 607 | + print 'checked'; |
|
| 608 | +} |
|
| 609 | +?> ><?php echo _("Display fires on map"); ?></label></div></li> |
|
| 400 | 610 | <?php |
| 401 | 611 | } |
| 402 | 612 | if (isset($globalMap3D) && $globalMap3D) { |
| 403 | 613 | ?> |
| 404 | - <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') print 'checked'; ?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li> |
|
| 614 | + <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') { |
|
| 615 | + print 'checked'; |
|
| 616 | +} |
|
| 617 | +?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li> |
|
| 405 | 618 | <?php |
| 406 | 619 | } |
| 407 | 620 | ?> |
| 408 | 621 | <?php |
| 409 | 622 | if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
| 410 | 623 | ?> |
| 411 | - <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
|
| 412 | - <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li> |
|
| 624 | + <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) { |
|
| 625 | + print 'checked'; |
|
| 626 | +} |
|
| 627 | +?> ><?php echo _("Show mini-map"); ?></label></div></li> |
|
| 628 | + <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) { |
|
| 629 | + print 'checked'; |
|
| 630 | +} |
|
| 631 | +?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li> |
|
| 413 | 632 | <?php |
| 414 | 633 | } |
| 415 | 634 | if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
@@ -422,17 +641,25 @@ discard block |
||
| 422 | 641 | if (function_exists('array_column')) { |
| 423 | 642 | if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
| 424 | 643 | ?> |
| 425 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
| 644 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
| 645 | + print 'checked'; |
|
| 646 | +} |
|
| 647 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
| 426 | 648 | <?php |
| 427 | 649 | } |
| 428 | 650 | } elseif (isset($globalSources)) { |
| 429 | 651 | $dispolar = false; |
| 430 | 652 | foreach ($globalSources as $testsource) { |
| 431 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
| 653 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) { |
|
| 654 | + $dispolar = true; |
|
| 655 | + } |
|
| 432 | 656 | } |
| 433 | 657 | if ($dispolar) { |
| 434 | 658 | ?> |
| 435 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
| 659 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
| 660 | + print 'checked'; |
|
| 661 | +} |
|
| 662 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
| 436 | 663 | <?php |
| 437 | 664 | } |
| 438 | 665 | } |
@@ -445,11 +672,21 @@ discard block |
||
| 445 | 672 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
| 446 | 673 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 447 | 674 | ?> |
| 448 | - <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
| 675 | + <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') { |
|
| 676 | + print 'checked'; |
|
| 677 | +} |
|
| 678 | +?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
| 449 | 679 | <?php |
| 450 | 680 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
| 451 | 681 | ?> |
| 452 | - <li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"></li> |
|
| 682 | + <li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
| 683 | + print $_COOKIE['IconColor']; |
|
| 684 | +} elseif (isset($globalAircraftIconColor)) { |
|
| 685 | + print $globalAircraftIconColor; |
|
| 686 | +} else { |
|
| 687 | + print '1a3151'; |
|
| 688 | +} |
|
| 689 | +?>"></li> |
|
| 453 | 690 | <?php |
| 454 | 691 | } |
| 455 | 692 | } |
@@ -460,7 +697,14 @@ discard block |
||
| 460 | 697 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 461 | 698 | ?> |
| 462 | 699 | <li><?php echo _("Marine icon color:"); ?> |
| 463 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>"> |
|
| 700 | + <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { |
|
| 701 | + print $_COOKIE['MarineIconColor']; |
|
| 702 | +} elseif (isset($globalMarineIconColor)) { |
|
| 703 | + print $globalMarineIconColor; |
|
| 704 | +} else { |
|
| 705 | + print '1a3151'; |
|
| 706 | +} |
|
| 707 | +?>"> |
|
| 464 | 708 | </li> |
| 465 | 709 | <?php |
| 466 | 710 | } |
@@ -471,7 +715,14 @@ discard block |
||
| 471 | 715 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 472 | 716 | ?> |
| 473 | 717 | <li><?php echo _("Tracker icon color:"); ?> |
| 474 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>"> |
|
| 718 | + <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { |
|
| 719 | + print $_COOKIE['TrackerIconColor']; |
|
| 720 | +} elseif (isset($globalTrackerIconColor)) { |
|
| 721 | + print $globalTrackerIconColor; |
|
| 722 | +} else { |
|
| 723 | + print '1a3151'; |
|
| 724 | +} |
|
| 725 | +?>"> |
|
| 475 | 726 | </li> |
| 476 | 727 | <?php |
| 477 | 728 | } |
@@ -482,8 +733,22 @@ discard block |
||
| 482 | 733 | ?> |
| 483 | 734 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
| 484 | 735 | <div class="range"> |
| 485 | - <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
|
| 486 | - <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output> |
|
| 736 | + <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) { |
|
| 737 | + print $_COOKIE['AirportZoom']; |
|
| 738 | +} elseif (isset($globalAirportZoom)) { |
|
| 739 | + print $globalAirportZoom; |
|
| 740 | +} else { |
|
| 741 | + print '7'; |
|
| 742 | +} |
|
| 743 | +?>"> |
|
| 744 | + <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) { |
|
| 745 | + print $_COOKIE['AirportZoom']; |
|
| 746 | +} elseif (isset($globalAirportZoom)) { |
|
| 747 | + print $globalAirportZoom; |
|
| 748 | +} else { |
|
| 749 | + print '7'; |
|
| 750 | +} |
|
| 751 | +?></output> |
|
| 487 | 752 | </div> |
| 488 | 753 | </li> |
| 489 | 754 | <?php |
@@ -494,17 +759,40 @@ discard block |
||
| 494 | 759 | ?> |
| 495 | 760 | <li><?php echo _("Set scaling factor for rendering resolution:"); ?> |
| 496 | 761 | <div class="range"> |
| 497 | - <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?>"> |
|
| 498 | - <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?></output> |
|
| 762 | + <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) { |
|
| 763 | + print $_COOKIE['resolutionScale']; |
|
| 764 | +} else { |
|
| 765 | + print '1'; |
|
| 766 | +} |
|
| 767 | +?>"> |
|
| 768 | + <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) { |
|
| 769 | + print $_COOKIE['resolutionScale']; |
|
| 770 | +} else { |
|
| 771 | + print '1'; |
|
| 772 | +} |
|
| 773 | +?></output> |
|
| 499 | 774 | </div> |
| 500 | 775 | </li> |
| 501 | 776 | <?php |
| 502 | 777 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
| 503 | 778 | ?> |
| 504 | - <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') print 'checked'; ?> > <?php echo _("Use airlines liveries"); ?></li> |
|
| 505 | - <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> > <?php echo _("Force Aircraft color"); ?> |
|
| 779 | + <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') { |
|
| 780 | + print 'checked'; |
|
| 781 | +} |
|
| 782 | +?> > <?php echo _("Use airlines liveries"); ?></li> |
|
| 783 | + <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') { |
|
| 784 | + print 'checked'; |
|
| 785 | +} |
|
| 786 | +?> > <?php echo _("Force Aircraft color"); ?> |
|
| 506 | 787 | <!--<li><?php echo _("Aircraft icon color:"); ?>--> |
| 507 | - <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>"> |
|
| 788 | + <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
| 789 | + print $_COOKIE['IconColor']; |
|
| 790 | +} elseif (isset($globalAircraftIconColor)) { |
|
| 791 | + print $globalAircraftIconColor; |
|
| 792 | +} else { |
|
| 793 | + print 'ff0000'; |
|
| 794 | +} |
|
| 795 | +?>"> |
|
| 508 | 796 | </li> |
| 509 | 797 | <?php |
| 510 | 798 | } |
@@ -512,9 +800,19 @@ discard block |
||
| 512 | 800 | <?php |
| 513 | 801 | if (isset($globalMarine) && $globalMarine === TRUE) { |
| 514 | 802 | ?> |
| 515 | - <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?> |
|
| 803 | + <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') { |
|
| 804 | + print 'checked'; |
|
| 805 | +} |
|
| 806 | +?> ><?php echo _("Force Marine color"); ?> |
|
| 516 | 807 | <!--<li><?php echo _("Marine icon color:"); ?>--> |
| 517 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>"> |
|
| 808 | + <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { |
|
| 809 | + print $_COOKIE['MarineIconColor']; |
|
| 810 | +} elseif (isset($globalMarineIconColor)) { |
|
| 811 | + print $globalMarineIconColor; |
|
| 812 | +} else { |
|
| 813 | + print 'ff0000'; |
|
| 814 | +} |
|
| 815 | +?>"> |
|
| 518 | 816 | </li> |
| 519 | 817 | <?php |
| 520 | 818 | } |
@@ -522,9 +820,19 @@ discard block |
||
| 522 | 820 | <?php |
| 523 | 821 | if (isset($globalTracker) && $globalTracker === TRUE) { |
| 524 | 822 | ?> |
| 525 | - <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Tracker color"); ?> |
|
| 823 | + <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') { |
|
| 824 | + print 'checked'; |
|
| 825 | +} |
|
| 826 | +?> ><?php echo _("Force Tracker color"); ?> |
|
| 526 | 827 | <!--<li><?php echo _("Tracker icon color:"); ?>--> |
| 527 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print 'ff0000'; ?>"> |
|
| 828 | + <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { |
|
| 829 | + print $_COOKIE['TrackerIconColor']; |
|
| 830 | +} elseif (isset($globalTrackerIconColor)) { |
|
| 831 | + print $globalTrackerIconColor; |
|
| 832 | +} else { |
|
| 833 | + print 'ff0000'; |
|
| 834 | +} |
|
| 835 | +?>"> |
|
| 528 | 836 | </li> |
| 529 | 837 | <?php |
| 530 | 838 | } |
@@ -532,22 +840,46 @@ discard block |
||
| 532 | 840 | ?> |
| 533 | 841 | <li><?php echo _("Distance unit:"); ?> |
| 534 | 842 | <select class="selectpicker" onchange="unitdistance(this);"> |
| 535 | - <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option> |
|
| 536 | - <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option> |
|
| 537 | - <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option> |
|
| 843 | + <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
| 844 | + echo ' selected'; |
|
| 845 | +} |
|
| 846 | +?>>km</option> |
|
| 847 | + <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
| 848 | + echo ' selected'; |
|
| 849 | +} |
|
| 850 | +?>>nm</option> |
|
| 851 | + <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
| 852 | + echo ' selected'; |
|
| 853 | +} |
|
| 854 | +?>>mi</option> |
|
| 538 | 855 | </select> |
| 539 | 856 | </li> |
| 540 | 857 | <li><?php echo _("Altitude unit:"); ?> |
| 541 | 858 | <select class="selectpicker" onchange="unitaltitude(this);"> |
| 542 | - <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option> |
|
| 543 | - <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option> |
|
| 859 | + <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) { |
|
| 860 | + echo ' selected'; |
|
| 861 | +} |
|
| 862 | +?>>m</option> |
|
| 863 | + <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
| 864 | + echo ' selected'; |
|
| 865 | +} |
|
| 866 | +?>>feet</option> |
|
| 544 | 867 | </select> |
| 545 | 868 | </li> |
| 546 | 869 | <li><?php echo _("Speed unit:"); ?> |
| 547 | 870 | <select class="selectpicker" onchange="unitspeed(this);"> |
| 548 | - <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option> |
|
| 549 | - <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option> |
|
| 550 | - <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option> |
|
| 871 | + <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) { |
|
| 872 | + echo ' selected'; |
|
| 873 | +} |
|
| 874 | +?>>km/h</option> |
|
| 875 | + <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
|
| 876 | + echo ' selected'; |
|
| 877 | +} |
|
| 878 | +?>>mph</option> |
|
| 879 | + <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
|
| 880 | + echo ' selected'; |
|
| 881 | +} |
|
| 882 | +?>>knots</option> |
|
| 551 | 883 | </select> |
| 552 | 884 | </li> |
| 553 | 885 | |
@@ -565,9 +897,18 @@ discard block |
||
| 565 | 897 | <?php |
| 566 | 898 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
| 567 | 899 | ?> |
| 568 | - <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
| 569 | - <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
| 570 | - <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
| 900 | + <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) { |
|
| 901 | + print 'checked'; |
|
| 902 | +} |
|
| 903 | +?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
| 904 | + <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) { |
|
| 905 | + print 'checked'; |
|
| 906 | +} |
|
| 907 | +?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
| 908 | + <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) { |
|
| 909 | + print 'checked'; |
|
| 910 | +} |
|
| 911 | +?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
| 571 | 912 | <?php |
| 572 | 913 | } |
| 573 | 914 | ?> |
@@ -575,10 +916,16 @@ discard block |
||
| 575 | 916 | if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
| 576 | 917 | ?> |
| 577 | 918 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
| 578 | - <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
| 919 | + <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) { |
|
| 920 | + print 'checked'; |
|
| 921 | +} |
|
| 922 | +?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
| 579 | 923 | <?php } ?> |
| 580 | 924 | <?php if (isset($globalAPRS) && $globalAPRS) { ?> |
| 581 | - <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
| 925 | + <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) { |
|
| 926 | + print 'checked'; |
|
| 927 | +} |
|
| 928 | +?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
| 582 | 929 | <?php } ?> |
| 583 | 930 | <?php |
| 584 | 931 | } |
@@ -595,7 +942,9 @@ discard block |
||
| 595 | 942 | } |
| 596 | 943 | foreach($allairlinenames as $airline) { |
| 597 | 944 | $airline_name = $airline['airline_name']; |
| 598 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; |
|
| 945 | + if (strlen($airline_name) > 30) { |
|
| 946 | + $airline_name = substr($airline_name,0,30).'...'; |
|
| 947 | + } |
|
| 599 | 948 | if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { |
| 600 | 949 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; |
| 601 | 950 | } else { |
@@ -613,7 +962,10 @@ discard block |
||
| 613 | 962 | <li><?php echo _("Display alliance:"); ?> |
| 614 | 963 | <br/> |
| 615 | 964 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
| 616 | - <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
| 965 | + <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') { |
|
| 966 | + echo ' selected'; |
|
| 967 | +} |
|
| 968 | +?>><?php echo _("All"); ?></option> |
|
| 617 | 969 | <?php |
| 618 | 970 | foreach($allalliancenames as $alliance) { |
| 619 | 971 | $alliance_name = $alliance['alliance']; |
@@ -672,10 +1024,22 @@ discard block |
||
| 672 | 1024 | ?> |
| 673 | 1025 | <li><?php echo _("Display airlines of type:"); ?><br/> |
| 674 | 1026 | <select class="selectpicker" onchange="airlinestype(this);"> |
| 675 | - <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
| 676 | - <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option> |
|
| 677 | - <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option> |
|
| 678 | - <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option> |
|
| 1027 | + <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') { |
|
| 1028 | + echo ' selected'; |
|
| 1029 | +} |
|
| 1030 | +?>><?php echo _("All"); ?></option> |
|
| 1031 | + <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') { |
|
| 1032 | + echo ' selected'; |
|
| 1033 | +} |
|
| 1034 | +?>><?php echo _("Passenger"); ?></option> |
|
| 1035 | + <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') { |
|
| 1036 | + echo ' selected'; |
|
| 1037 | +} |
|
| 1038 | +?>><?php echo _("Cargo"); ?></option> |
|
| 1039 | + <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') { |
|
| 1040 | + echo ' selected'; |
|
| 1041 | +} |
|
| 1042 | +?>><?php echo _("Military"); ?></option> |
|
| 679 | 1043 | </select> |
| 680 | 1044 | </li> |
| 681 | 1045 | <?php |
@@ -689,14 +1053,20 @@ discard block |
||
| 689 | 1053 | ?> |
| 690 | 1054 | <li> |
| 691 | 1055 | <?php echo _("Display vessels with MMSI:"); ?> |
| 692 | - <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" /> |
|
| 1056 | + <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) { |
|
| 1057 | + print $_COOKIE['filter_mmsi']; |
|
| 1058 | +} |
|
| 1059 | +?>" /> |
|
| 693 | 1060 | </li> |
| 694 | 1061 | <?php |
| 695 | 1062 | } |
| 696 | 1063 | ?> |
| 697 | 1064 | <li> |
| 698 | 1065 | <?php echo _("Display with ident:"); ?> |
| 699 | - <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
|
| 1066 | + <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) { |
|
| 1067 | + print $_COOKIE['filter_ident']; |
|
| 1068 | +} |
|
| 1069 | +?>" /> |
|
| 700 | 1070 | </li> |
| 701 | 1071 | </ul> |
| 702 | 1072 | </form> |
@@ -712,7 +1082,10 @@ discard block |
||
| 712 | 1082 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
| 713 | 1083 | <form> |
| 714 | 1084 | <ul> |
| 715 | - <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
| 1085 | + <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) { |
|
| 1086 | + print 'checked'; |
|
| 1087 | +} |
|
| 1088 | +?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
| 716 | 1089 | <li><?php echo _("Type:"); ?> |
| 717 | 1090 | <select class="selectpicker" multiple onchange="sattypes(this);"> |
| 718 | 1091 | <?php |
@@ -720,25 +1093,45 @@ discard block |
||
| 720 | 1093 | $types = $Satellite->get_tle_types(); |
| 721 | 1094 | foreach ($types as $type) { |
| 722 | 1095 | $type_name = $type['tle_type']; |
| 723 | - if ($type_name == 'musson') $type_name = 'Russian LEO Navigation'; |
|
| 724 | - else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System'; |
|
| 725 | - else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System'; |
|
| 726 | - else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational'; |
|
| 727 | - else if ($type_name == 'gps-ops') $type_name = 'GPS Operational'; |
|
| 728 | - else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System'; |
|
| 729 | - else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System'; |
|
| 730 | - else if ($type_name == 'sarsat') $type_name = 'Search & Rescue'; |
|
| 731 | - else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring'; |
|
| 732 | - else if ($type_name == 'resource') $type_name = 'Earth Resources'; |
|
| 733 | - else if ($type_name == 'stations') $type_name = 'Space Stations'; |
|
| 734 | - else if ($type_name == 'geo') $type_name = 'Geostationary'; |
|
| 735 | - else if ($type_name == 'amateur') $type_name = 'Amateur Radio'; |
|
| 736 | - else if ($type_name == 'x-comm') $type_name = 'Experimental'; |
|
| 737 | - else if ($type_name == 'other-comm') $type_name = 'Other Comm'; |
|
| 738 | - else if ($type_name == 'science') $type_name = 'Space & Earth Science'; |
|
| 739 | - else if ($type_name == 'military') $type_name = 'Miscellaneous Military'; |
|
| 740 | - else if ($type_name == 'radar') $type_name = 'Radar Calibration'; |
|
| 741 | - else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; |
|
| 1096 | + if ($type_name == 'musson') { |
|
| 1097 | + $type_name = 'Russian LEO Navigation'; |
|
| 1098 | + } else if ($type_name == 'nnss') { |
|
| 1099 | + $type_name = 'Navi Navigation Satellite System'; |
|
| 1100 | + } else if ($type_name == 'sbas') { |
|
| 1101 | + $type_name = 'Satellite-Based Augmentation System'; |
|
| 1102 | + } else if ($type_name == 'glo-ops') { |
|
| 1103 | + $type_name = 'Glonass Operational'; |
|
| 1104 | + } else if ($type_name == 'gps-ops') { |
|
| 1105 | + $type_name = 'GPS Operational'; |
|
| 1106 | + } else if ($type_name == 'argos') { |
|
| 1107 | + $type_name = 'ARGOS Data Collection System'; |
|
| 1108 | + } else if ($type_name == 'tdrss') { |
|
| 1109 | + $type_name = 'Tracking and Data Relay Satellite System'; |
|
| 1110 | + } else if ($type_name == 'sarsat') { |
|
| 1111 | + $type_name = 'Search & Rescue'; |
|
| 1112 | + } else if ($type_name == 'dmc') { |
|
| 1113 | + $type_name = 'Disaster Monitoring'; |
|
| 1114 | + } else if ($type_name == 'resource') { |
|
| 1115 | + $type_name = 'Earth Resources'; |
|
| 1116 | + } else if ($type_name == 'stations') { |
|
| 1117 | + $type_name = 'Space Stations'; |
|
| 1118 | + } else if ($type_name == 'geo') { |
|
| 1119 | + $type_name = 'Geostationary'; |
|
| 1120 | + } else if ($type_name == 'amateur') { |
|
| 1121 | + $type_name = 'Amateur Radio'; |
|
| 1122 | + } else if ($type_name == 'x-comm') { |
|
| 1123 | + $type_name = 'Experimental'; |
|
| 1124 | + } else if ($type_name == 'other-comm') { |
|
| 1125 | + $type_name = 'Other Comm'; |
|
| 1126 | + } else if ($type_name == 'science') { |
|
| 1127 | + $type_name = 'Space & Earth Science'; |
|
| 1128 | + } else if ($type_name == 'military') { |
|
| 1129 | + $type_name = 'Miscellaneous Military'; |
|
| 1130 | + } else if ($type_name == 'radar') { |
|
| 1131 | + $type_name = 'Radar Calibration'; |
|
| 1132 | + } else if ($type_name == 'tle-new') { |
|
| 1133 | + $type_name = 'Last 30 days launches'; |
|
| 1134 | + } |
|
| 742 | 1135 | |
| 743 | 1136 | if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { |
| 744 | 1137 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; |