@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | { |
11 | 11 | $date = date('Y-m-d'); |
12 | 12 | } else { |
13 | - $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
13 | + $date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
14 | 14 | } |
15 | 15 | |
16 | -if(!isset($_GET['limit'])) |
|
16 | +if (!isset($_GET['limit'])) |
|
17 | 17 | { |
18 | 18 | $limit_start = 0; |
19 | 19 | $limit_end = 25; |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | print '<br />'; |
49 | 49 | |
50 | 50 | print '<div class="info column">'; |
51 | -print '<h1>'.sprintf(_("Incidents from %s"),date("l F j, Y",strtotime($date))).'</h1>'; |
|
51 | +print '<h1>'.sprintf(_("Incidents from %s"), date("l F j, Y", strtotime($date))).'</h1>'; |
|
52 | 52 | print '</div>'; |
53 | 53 | |
54 | 54 | print '<div class="table column">'; |
55 | -print '<p>'.sprintf(_("The table below shows the Incidents on <strong>%s</strong>."),date("l M j, Y",strtotime($date))).'</p>'; |
|
56 | -$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference,'incident',$date); |
|
55 | +print '<p>'.sprintf(_("The table below shows the Incidents on <strong>%s</strong>."), date("l M j, Y", strtotime($date))).'</p>'; |
|
56 | +$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference, 'incident', $date); |
|
57 | 57 | //print_r($spotter_array); |
58 | 58 | if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) { |
59 | 59 | include('table-output.php'); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -$date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
|
2 | +$date = filter_input(INPUT_POST, 'date', FILTER_SANITIZE_STRING); |
|
3 | 3 | if ($date == '') $date = date('Y-m-d'); |
4 | 4 | header('Location: '.$globalURL.'/incident/'.$date); |
5 | 5 | ?> |
6 | 6 | \ No newline at end of file |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | { |
11 | 11 | $date = date('Y-m-d'); |
12 | 12 | } else { |
13 | - $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
13 | + $date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
14 | 14 | } |
15 | 15 | |
16 | -if(!isset($_GET['limit'])) |
|
16 | +if (!isset($_GET['limit'])) |
|
17 | 17 | { |
18 | 18 | $limit_start = 0; |
19 | 19 | $limit_end = 25; |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | print '<br />'; |
49 | 49 | |
50 | 50 | print '<div class="info column">'; |
51 | -print '<h1>'.sprintf(_("Accidents from %s"),date("l F j, Y",strtotime($date))).'</h1>'; |
|
51 | +print '<h1>'.sprintf(_("Accidents from %s"), date("l F j, Y", strtotime($date))).'</h1>'; |
|
52 | 52 | print '</div>'; |
53 | 53 | |
54 | 54 | print '<div class="table column">'; |
55 | -print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),date("l M j, Y",strtotime($date))).'</p>'; |
|
56 | -$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference,'accident',$date); |
|
55 | +print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), date("l M j, Y", strtotime($date))).'</p>'; |
|
56 | +$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference, 'accident', $date); |
|
57 | 57 | //print_r($spotter_array); |
58 | 58 | if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) { |
59 | 59 | include('table-output.php'); |
@@ -5,11 +5,11 @@ |
||
5 | 5 | |
6 | 6 | if ($_POST['aircraft_manufacturer'] != "") |
7 | 7 | { |
8 | - $aircraft_manufacturer = filter_input(INPUT_POST,'aircraft_manufacturer',FILTER_SANITIZE_STRING); |
|
8 | + $aircraft_manufacturer = filter_input(INPUT_POST, 'aircraft_manufacturer', FILTER_SANITIZE_STRING); |
|
9 | 9 | header('Location: '.$globalURL.'/manufacturer/'.$aircraft_manufacturer); |
10 | 10 | } elseif ($_GET['aircraft_manufacturer'] != "") |
11 | 11 | { |
12 | - $aircraft_manufacturer = filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING); |
|
12 | + $aircraft_manufacturer = filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING); |
|
13 | 13 | header('Location: '.$globalURL.'/manufacturer/'.$aircraft_manufacturer); |
14 | 14 | } else { |
15 | 15 | header('Location: '.$globalURL); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | if ($_POST['registration'] != "") |
7 | 7 | { |
8 | - $registration = filter_input(INPUT_POST,'registration',FILTER_SANITIZE_STRING); |
|
8 | + $registration = filter_input(INPUT_POST, 'registration', FILTER_SANITIZE_STRING); |
|
9 | 9 | header('Location: '.$globalURL.'/registration/'.$registration); |
10 | 10 | } else { |
11 | 11 | header('Location: '.$globalURL); |
@@ -5,17 +5,17 @@ discard block |
||
5 | 5 | require_once('require/class.Stats.php'); |
6 | 6 | require_once('require/class.METAR.php'); |
7 | 7 | |
8 | -if (!isset($_GET['airport'])){ |
|
8 | +if (!isset($_GET['airport'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/airport'); |
10 | 10 | } else { |
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | //calculation for the pagination |
13 | - if(!isset($_GET['limit'])) |
|
13 | + if (!isset($_GET['limit'])) |
|
14 | 14 | { |
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | $limit_next = $limit_end + $absolute_difference; |
29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
31 | - $airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
31 | + $airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/airport/'.$airport_icao; |
33 | 33 | |
34 | 34 | if (isset($_GET['sort'])) { |
35 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
36 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $sort); |
|
35 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
36 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $sort); |
|
37 | 37 | } else { |
38 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, ''); |
|
38 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, ''); |
|
39 | 39 | } |
40 | 40 | $airport_array = $Spotter->getAllAirportInfo($airport_icao); |
41 | 41 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | //print_r($metar_parse); |
51 | 51 | } |
52 | 52 | |
53 | - $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
53 | + $title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
54 | 54 | |
55 | 55 | require_once('header.php'); |
56 | 56 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | $airport_names = $Stats->getAllAirportNames(); |
63 | 63 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
64 | 64 | ksort($airport_names); |
65 | - foreach($airport_names as $airport_name) |
|
65 | + foreach ($airport_names as $airport_name) |
|
66 | 66 | { |
67 | - if($airport_icao == $airport_name['airport_icao']) |
|
67 | + if ($airport_icao == $airport_name['airport_icao']) |
|
68 | 68 | { |
69 | 69 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
70 | 70 | } else { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | var data = google.visualization.arrayToDataTable([ |
113 | 113 | ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], '; |
114 | 114 | $airport_data = ''; |
115 | - foreach($all_data as $data) |
|
115 | + foreach ($all_data as $data) |
|
116 | 116 | { |
117 | 117 | $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],'; |
118 | 118 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | print _("Dew point:").' '.$metar_parse['dew'].' °C'." - "; |
166 | 166 | } |
167 | 167 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
168 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
168 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
169 | 169 | print _("Humidity:").' '.$humidity.'%'." - "; |
170 | 170 | } |
171 | 171 | if (isset($metar_parse['QNH'])) { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | print '<div class="table column">'; |
182 | 182 | if ($airport_array[0]['iata'] != "NA") |
183 | 183 | { |
184 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
184 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
185 | 185 | } |
186 | 186 | include('table-output.php'); |
187 | 187 | print '<div class="pagination">'; |
@@ -25,23 +25,23 @@ discard block |
||
25 | 25 | $min = true; |
26 | 26 | $allhistory = false; |
27 | 27 | $filter['source'] = array(); |
28 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
29 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
30 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
31 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
32 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
33 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
34 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
35 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
36 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
37 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
28 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
29 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
30 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
31 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs')); |
|
32 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
33 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
34 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
35 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
36 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
37 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
38 | 38 | |
39 | 39 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
40 | 40 | $min = true; |
41 | 41 | } else $min = false; |
42 | 42 | |
43 | 43 | if (isset($_GET['ident'])) { |
44 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
44 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
45 | 45 | $spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident); |
46 | 46 | if (empty($spotter_array)) { |
47 | 47 | $from_archive = true; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | $allhistory = true; |
51 | 51 | } elseif (isset($_GET['flightaware_id'])) { |
52 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
52 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
53 | 53 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
54 | 54 | if (empty($spotter_array)) { |
55 | 55 | $from_archive = true; |
@@ -58,25 +58,25 @@ discard block |
||
58 | 58 | $allhistory = true; |
59 | 59 | } elseif (isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) { |
60 | 60 | //if (isset($_GET['coord'])) { |
61 | - $coord = explode(',',$_GET['coord']); |
|
62 | - $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter); |
|
61 | + $coord = explode(',', $_GET['coord']); |
|
62 | + $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter); |
|
63 | 63 | |
64 | 64 | #} elseif (isset($globalMapPopup) && !$globalMapPopup) { |
65 | 65 | } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) { |
66 | 66 | $from_archive = true; |
67 | 67 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
68 | 68 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
69 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
70 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
71 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
72 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
73 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
74 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
69 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
70 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
71 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
72 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
73 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
74 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
75 | 75 | } elseif ($min) { |
76 | 76 | $spotter_array = $SpotterLive->getMinLiveSpotterData($filter); |
77 | 77 | # $min = true; |
78 | 78 | } else { |
79 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
79 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | if (!empty($spotter_array)) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | if ($flightcnt == '') $flightcnt = 0; |
92 | 92 | } else $flightcnt = 0; |
93 | 93 | |
94 | -$sqltime = round(microtime(true)-$begintime,2); |
|
94 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
95 | 95 | |
96 | 96 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
97 | 97 | else $usenextlatlon = true; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if (!empty($spotter_array) && is_array($spotter_array)) |
109 | 109 | { |
110 | 110 | $output .= '"features": ['; |
111 | - foreach($spotter_array as $spotter_item) |
|
111 | + foreach ($spotter_array as $spotter_item) |
|
112 | 112 | { |
113 | 113 | $j++; |
114 | 114 | date_default_timezone_set('UTC'); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
160 | 160 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
161 | 161 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
162 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
162 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
163 | 163 | } elseif (isset($spotter_item['aircraft_type'])) { |
164 | 164 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
165 | 165 | } elseif (!$min) { |
@@ -233,16 +233,16 @@ discard block |
||
233 | 233 | else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
234 | 234 | |
235 | 235 | if (isset($archivespeed)) { |
236 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
236 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
237 | 237 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
238 | 238 | } elseif ($usenextlatlon) { |
239 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
239 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
240 | 240 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
241 | 241 | } |
242 | 242 | |
243 | 243 | if (!$min) $output .= '"image": "'.$image.'",'; |
244 | 244 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
245 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
245 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
246 | 246 | } |
247 | 247 | if (isset($spotter_item['image_source_website'])) { |
248 | 248 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
265 | 265 | } |
266 | 266 | if (isset($spotter_item['acars'])) { |
267 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
267 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
268 | 268 | } |
269 | 269 | // type when not aircraft ? |
270 | 270 | if ($compress) $output .= '"t": "aircraft"'; |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | |
335 | 335 | } |
336 | 336 | */ |
337 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
337 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
338 | 338 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
339 | 339 | |
340 | 340 | if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
@@ -361,9 +361,9 @@ discard block |
||
361 | 361 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
362 | 362 | } |
363 | 363 | $output_history .= '['; |
364 | - $output_history .= $spotter_history['longitude'].', '; |
|
365 | - $output_history .= $spotter_history['latitude'].', '; |
|
366 | - $output_history .= $spotter_history['altitude']*30.48; |
|
364 | + $output_history .= $spotter_history['longitude'].', '; |
|
365 | + $output_history .= $spotter_history['latitude'].', '; |
|
366 | + $output_history .= $spotter_history['altitude']*30.48; |
|
367 | 367 | $output_history .= '],'; |
368 | 368 | $prev_alt = $alt; |
369 | 369 | //} |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $output = substr($output, 0, -1); |
404 | 404 | $output .= ']'; |
405 | 405 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
406 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
406 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
407 | 407 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
408 | 408 | $output .= '"fc": "'.$j.'"'; |
409 | 409 | } else { |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | require_once('../require/settings.php'); |
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | -setcookie("MapFormat",'2d'); |
|
5 | +setcookie("MapFormat", '2d'); |
|
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | 8 | if (!isset($globalJsonCompress)) $compress = true; |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
19 | 19 | if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
20 | 20 | else $enddate = time(); |
21 | - setcookie("archive_begin",$begindate); |
|
22 | - setcookie("archive_end",$enddate); |
|
23 | - setcookie("archive_update",$lastupd); |
|
24 | - setcookie("archive_speed",$archivespeed); |
|
21 | + setcookie("archive_begin", $begindate); |
|
22 | + setcookie("archive_end", $enddate); |
|
23 | + setcookie("archive_update", $lastupd); |
|
24 | + setcookie("archive_speed", $archivespeed); |
|
25 | 25 | ?> |
26 | 26 | document.cookie = 'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
27 | 27 | document.cookie = 'archive_end=<?php print $enddate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
@@ -92,16 +92,16 @@ discard block |
||
92 | 92 | <?php |
93 | 93 | } |
94 | 94 | if (isset($_GET['ident'])) { |
95 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
95 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
96 | 96 | } |
97 | 97 | if (isset($_GET['flightaware_id'])) { |
98 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
98 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
99 | 99 | } |
100 | 100 | if (isset($_GET['latitude'])) { |
101 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
101 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
102 | 102 | } |
103 | 103 | if (isset($_GET['longitude'])) { |
104 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
104 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
105 | 105 | } |
106 | 106 | ?> |
107 | 107 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | || navigator.userAgent.match(/BlackBerry/i) |
137 | 137 | || navigator.userAgent.match(/Windows Phone/i)) |
138 | 138 | { |
139 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
139 | + var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom - 1; else print '8'; ?>; |
|
140 | 140 | } else { |
141 | 141 | var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
142 | 142 | } |
@@ -230,19 +230,19 @@ discard block |
||
230 | 230 | map.addLayer(yandexLayer); |
231 | 231 | <?php |
232 | 232 | } elseif ($MapType == 'Bing-Aerial') { |
233 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
233 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
234 | 234 | ?> |
235 | 235 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
236 | 236 | map.addLayer(bingLayer); |
237 | 237 | <?php |
238 | 238 | } elseif ($MapType == 'Bing-Hybrid') { |
239 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
239 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
240 | 240 | ?> |
241 | 241 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
242 | 242 | map.addLayer(bingLayer); |
243 | 243 | <?php |
244 | 244 | } elseif ($MapType == 'Bing-Road') { |
245 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
245 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
246 | 246 | ?> |
247 | 247 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
248 | 248 | map.addLayer(bingLayer); |
@@ -534,10 +534,10 @@ discard block |
||
534 | 534 | }; |
535 | 535 | archive.update = function (props) { |
536 | 536 | if (typeof props != 'undefined') { |
537 | - //this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><i class="fa fa-fast-backward" aria-hidden="true"></i> <i class="fa fa-backward" aria-hidden="true"></i> <a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a> <i class="fa fa-forward" aria-hidden="true"></i> <i class="fa fa-fast-forward" aria-hidden="true"></i>'; |
|
538 | - this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>'; |
|
537 | + //this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><i class="fa fa-fast-backward" aria-hidden="true"></i> <i class="fa fa-backward" aria-hidden="true"></i> <a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a> <i class="fa fa-forward" aria-hidden="true"></i> <i class="fa fa-fast-forward" aria-hidden="true"></i>'; |
|
538 | + this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b>' + props.archive_date + ' UTC </b>' + '<br/><a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>'; |
|
539 | 539 | } else { |
540 | - this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>'; |
|
540 | + this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>'; |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | }; |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | <?php |
738 | 738 | } else { |
739 | 739 | ?> |
740 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
740 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
741 | 741 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
742 | 742 | <?php |
743 | 743 | } |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | /* |
754 | 754 | shadowUrl: iconURLShadowpath, |
755 | 755 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
756 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
756 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
757 | 757 | */ |
758 | 758 | }) |
759 | 759 | }) |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | <?php |
787 | 787 | } else { |
788 | 788 | ?> |
789 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
789 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
790 | 790 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
791 | 791 | <?php |
792 | 792 | } |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | <?php |
835 | 835 | } else { |
836 | 836 | ?> |
837 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
837 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
838 | 838 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
839 | 839 | <?php |
840 | 840 | } |
@@ -1460,23 +1460,23 @@ discard block |
||
1460 | 1460 | airs.push(air.value); |
1461 | 1461 | } |
1462 | 1462 | } |
1463 | - document.cookie = 'filter_Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
1463 | + document.cookie = 'filter_Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
1464 | 1464 | } |
1465 | 1465 | function airlinestype(selectObj) { |
1466 | 1466 | var idx = selectObj.selectedIndex; |
1467 | 1467 | var airtype = selectObj.options[idx].value; |
1468 | - document.cookie = 'filter_airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
1468 | + document.cookie = 'filter_airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
1469 | 1469 | } |
1470 | 1470 | function alliance(selectObj) { |
1471 | 1471 | var idx = selectObj.selectedIndex; |
1472 | 1472 | var alliance = selectObj.options[idx].value; |
1473 | - document.cookie = 'filter_alliance='+alliance+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
1473 | + document.cookie = 'filter_alliance='+alliance+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
1474 | 1474 | } |
1475 | 1475 | |
1476 | 1476 | function identfilter() { |
1477 | 1477 | var ident = $('#identfilter').val(); |
1478 | 1478 | console.log('Filter with '+ident); |
1479 | - document.cookie = 'filter_ident='+ident+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1479 | + document.cookie = 'filter_ident='+ident+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1480 | 1480 | } |
1481 | 1481 | function removefilters() { |
1482 | 1482 | // Get an array of all cookie names (the regex matches what we don't want) |
@@ -1498,7 +1498,7 @@ discard block |
||
1498 | 1498 | } |
1499 | 1499 | } |
1500 | 1500 | //document.cookie = 'Sources='+sources.join()+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1501 | - document.cookie = 'filter_Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+1, date("Y"))); ?>; path=/' |
|
1501 | + document.cookie = 'filter_Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/' |
|
1502 | 1502 | } |
1503 | 1503 | |
1504 | 1504 | function show3D() { |
@@ -1521,23 +1521,23 @@ discard block |
||
1521 | 1521 | |
1522 | 1522 | function clickVATSIM(cb) { |
1523 | 1523 | //document.cookie = 'ShowVATSIM='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1524 | - document.cookie = 'filter_ShowVATSIM='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1524 | + document.cookie = 'filter_ShowVATSIM='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1525 | 1525 | } |
1526 | 1526 | function clickIVAO(cb) { |
1527 | 1527 | //document.cookie = 'ShowIVAO='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1528 | - document.cookie = 'filter_ShowIVAO='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1528 | + document.cookie = 'filter_ShowIVAO='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1529 | 1529 | } |
1530 | 1530 | function clickphpVMS(cb) { |
1531 | 1531 | //document.cookie = 'ShowVMS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1532 | - document.cookie = 'filter_ShowVMS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1532 | + document.cookie = 'filter_ShowVMS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1533 | 1533 | } |
1534 | 1534 | function clickSBS1(cb) { |
1535 | 1535 | //document.cookie = 'ShowSBS1='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1536 | - document.cookie = 'filter_ShowSBS1='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1536 | + document.cookie = 'filter_ShowSBS1='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1537 | 1537 | } |
1538 | 1538 | function clickAPRS(cb) { |
1539 | 1539 | //document.cookie = 'ShowAPRS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
1540 | - document.cookie = 'filter_ShowAPRS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m") , date("d")+2, date("Y"))); ?>; path=/' |
|
1540 | + document.cookie = 'filter_ShowAPRS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/' |
|
1541 | 1541 | } |
1542 | 1542 | function clickFlightPopup(cb) { |
1543 | 1543 | document.cookie = 'flightpopup='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | $s3 = sin($bank/2); |
23 | 23 | $c1c2 = $c1*$c2; |
24 | 24 | $s1s2 = $s1*$s2; |
25 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
26 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
27 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
28 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
29 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
25 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
26 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
27 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
28 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
29 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
30 | 30 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
31 | 31 | |
32 | 32 | } |
@@ -47,16 +47,16 @@ discard block |
||
47 | 47 | $min = false; |
48 | 48 | $allhistory = false; |
49 | 49 | $filter['source'] = array(); |
50 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
51 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
52 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
53 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
54 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
55 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
56 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
57 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
58 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
59 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
50 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
51 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
52 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
53 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs')); |
|
54 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
55 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
56 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
57 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
58 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
59 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
60 | 60 | /* |
61 | 61 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
62 | 62 | $min = true; |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | $from_archive = true; |
104 | 104 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
105 | 105 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
106 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
107 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
108 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
109 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
110 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
111 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
106 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
107 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
108 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
109 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
110 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
111 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
112 | 112 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
113 | 113 | $from_archive = true; |
114 | 114 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
@@ -118,34 +118,34 @@ discard block |
||
118 | 118 | $begindate = $_COOKIE['archive_begin']; |
119 | 119 | $enddate = $_COOKIE['archive_end']; |
120 | 120 | |
121 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
122 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
123 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
121 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
122 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
123 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
124 | 124 | // echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
125 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
125 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
126 | 126 | } else { |
127 | 127 | $spotter_array = $SpotterLive->getMinLastLiveSpotterData($filter); |
128 | 128 | } |
129 | 129 | |
130 | 130 | if (!empty($spotter_array)) { |
131 | 131 | if (isset($_GET['archive'])) { |
132 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
132 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
133 | 133 | } else { |
134 | 134 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
135 | 135 | } |
136 | 136 | if ($flightcnt == '') $flightcnt = 0; |
137 | 137 | } else $flightcnt = 0; |
138 | 138 | |
139 | -$sqltime = round(microtime(true)-$begintime,2); |
|
139 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
140 | 140 | $minitime = time(); |
141 | 141 | $maxitime = 0; |
142 | 142 | |
143 | 143 | |
144 | 144 | $modelsdb = array(); |
145 | 145 | if (file_exists('models/modelsdb')) { |
146 | - if (($handle = fopen('models/modelsdb','r')) !== FALSE) { |
|
147 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
148 | - if (isset($row[1]) ){ |
|
146 | + if (($handle = fopen('models/modelsdb', 'r')) !== FALSE) { |
|
147 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
148 | + if (isset($row[1])) { |
|
149 | 149 | $model = $row[0]; |
150 | 150 | $modelsdb[$model] = $row[1]; |
151 | 151 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $output .= '},'; |
175 | 175 | if (!empty($spotter_array) && is_array($spotter_array)) |
176 | 176 | { |
177 | - foreach($spotter_array as $spotter_item) |
|
177 | + foreach ($spotter_array as $spotter_item) |
|
178 | 178 | { |
179 | 179 | $j++; |
180 | 180 | date_default_timezone_set('UTC'); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | $output .= '"cartographicDegrees": ['; |
360 | 360 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
361 | 361 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
362 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
362 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
363 | 363 | $output .= $spotter_item['longitude'].', '; |
364 | 364 | $output .= $spotter_item['latitude'].', '; |
365 | 365 | $prevlong = $spotter_item['longitude']; |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
372 | 372 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
373 | 373 | } else { |
374 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
374 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
375 | 375 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
376 | 376 | if ($spotter_item['ground_speed'] == 0) { |
377 | 377 | $output .= $prevlong.', '; |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $output = substr($output, 0, -1); |
401 | 401 | } |
402 | 402 | $output .= ']'; |
403 | -$output = str_replace('%minitime%',date("c",$minitime),$output); |
|
404 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
403 | +$output = str_replace('%minitime%', date("c", $minitime), $output); |
|
404 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
405 | 405 | print $output; |
406 | 406 | ?> |