@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | |
12 | 15 | |
@@ -157,9 +160,13 @@ discard block |
||
157 | 160 | if (callsign != ""){ markerTrackerLabel += callsign; } |
158 | 161 | if (type != ""){ markerTrackerLabel += ' - '+type; } |
159 | 162 | <?php |
160 | - if (isset($_COOKIE['TrackerIconColor'])) $IconColor = $_COOKIE['TrackerIconColor']; |
|
161 | - elseif (isset($globalTrackerIconColor)) $IconColor = $globalTrackerIconColor; |
|
162 | - else $IconColor = '1a3151'; |
|
163 | + if (isset($_COOKIE['TrackerIconColor'])) { |
|
164 | + $IconColor = $_COOKIE['TrackerIconColor']; |
|
165 | + } elseif (isset($globalTrackerIconColor)) { |
|
166 | + $IconColor = $globalTrackerIconColor; |
|
167 | + } else { |
|
168 | + $IconColor = '1a3151'; |
|
169 | + } |
|
163 | 170 | if (!isset($ident) && !isset($famtrackid)) { |
164 | 171 | ?> |
165 | 172 | //info_tracker_update(feature.properties.fc); |
@@ -193,7 +200,12 @@ discard block |
||
193 | 200 | <?php |
194 | 201 | } else { |
195 | 202 | ?> |
196 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
203 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
204 | + print $archiveupdatetime*1000; |
|
205 | +} else { |
|
206 | + print $globalMapRefresh*1000+20000; |
|
207 | +} |
|
208 | +?>+feature.properties.sqt*1000); |
|
197 | 209 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
198 | 210 | <?php |
199 | 211 | } |
@@ -249,7 +261,12 @@ discard block |
||
249 | 261 | <?php |
250 | 262 | } else { |
251 | 263 | ?> |
252 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
264 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
265 | + print $archiveupdatetime*1000; |
|
266 | +} else { |
|
267 | + print $globalMapRefresh*1000+20000; |
|
268 | +} |
|
269 | +?>+feature.properties.sqt*1000); |
|
253 | 270 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
254 | 271 | <?php |
255 | 272 | } |
@@ -304,7 +321,12 @@ discard block |
||
304 | 321 | <?php |
305 | 322 | } else { |
306 | 323 | ?> |
307 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
324 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
325 | + print $archiveupdatetime*1000; |
|
326 | +} else { |
|
327 | + print $globalMapRefresh*1000+20000; |
|
328 | +} |
|
329 | +?>+feature.properties.sqt*1000); |
|
308 | 330 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
309 | 331 | <?php |
310 | 332 | } |
@@ -595,14 +617,24 @@ discard block |
||
595 | 617 | if (isset($archive) && $archive) { |
596 | 618 | ?> |
597 | 619 | //then load it again every 30 seconds |
598 | -// var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
620 | +// var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
621 | + print ($globalMapRefresh*1000)/2; |
|
622 | +} else { |
|
623 | + print '15000'; |
|
624 | +} |
|
625 | +?>); |
|
599 | 626 | reloadTrackerPage = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php print $archiveupdatetime*1000; ?>); |
600 | 627 | <?php |
601 | 628 | } else { |
602 | 629 | ?> |
603 | 630 | //then load it again every 30 seconds |
604 | 631 | reloadTrackerPage = setInterval( |
605 | - function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
632 | + function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
633 | + print $globalMapRefresh*1000; |
|
634 | +} else { |
|
635 | + print '30000'; |
|
636 | +} |
|
637 | +?>); |
|
606 | 638 | <?php |
607 | 639 | } |
608 | 640 | ?> |
@@ -10,7 +10,9 @@ discard block |
||
10 | 10 | public static function import_file($filename) { |
11 | 11 | $filename = filter_var($filename,FILTER_SANITIZE_STRING); |
12 | 12 | $Connection = new Connection(); |
13 | - if (!$Connection->connectionExists()) return 'error: DB connection failed'; |
|
13 | + if (!$Connection->connectionExists()) { |
|
14 | + return 'error: DB connection failed'; |
|
15 | + } |
|
14 | 16 | //Connection::$db->beginTransaction(); |
15 | 17 | $templine = ''; |
16 | 18 | $handle = @fopen($filename,"r"); |
@@ -19,7 +21,9 @@ discard block |
||
19 | 21 | //foreach ($lines as $line) |
20 | 22 | while (($line = fgets($handle,4096)) !== false) |
21 | 23 | { |
22 | - if (substr($line,0,2) == '--' || $line == '') continue; |
|
24 | + if (substr($line,0,2) == '--' || $line == '') { |
|
25 | + continue; |
|
26 | + } |
|
23 | 27 | $templine .= $line; |
24 | 28 | if (substr(trim($line), -1,1) == ';') |
25 | 29 | { |
@@ -45,7 +49,9 @@ discard block |
||
45 | 49 | //foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename) |
46 | 50 | while(false !== ($filename = readdir($dh))) |
47 | 51 | { |
48 | - if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename); |
|
52 | + if (preg_match('/\.sql$/',$filename)) { |
|
53 | + $error .= create_db::import_file($directory.$filename); |
|
54 | + } |
|
49 | 55 | } |
50 | 56 | return $error; |
51 | 57 | } |
@@ -58,19 +64,29 @@ discard block |
||
58 | 64 | $db = filter_var($db,FILTER_SANITIZE_STRING); |
59 | 65 | $db_type = filter_var($db_type,FILTER_SANITIZE_STRING); |
60 | 66 | $host = filter_var($host,FILTER_SANITIZE_STRING); |
61 | - if ($db_type == 'mysql' && $port == '') $port = 3306; |
|
62 | - elseif ($port == '') $port = 5432; |
|
67 | + if ($db_type == 'mysql' && $port == '') { |
|
68 | + $port = 3306; |
|
69 | + } elseif ($port == '') { |
|
70 | + $port = 5432; |
|
71 | + } |
|
63 | 72 | // Dirty hack |
64 | 73 | if ($host != 'localhost' && $host != '127.0.0.1') { |
65 | 74 | $grantright = $_SERVER['SERVER_ADDR']; |
66 | - } else $grantright = 'localhost'; |
|
75 | + } else { |
|
76 | + $grantright = 'localhost'; |
|
77 | + } |
|
67 | 78 | try { |
68 | - if ($host == 'localhost') $dbh = new PDO($db_type.':host=127.0.0.1',$root,$root_pass); |
|
69 | - else $dbh = new PDO($db_type.':host='.$host.';port='.$port,$root,$root_pass); |
|
79 | + if ($host == 'localhost') { |
|
80 | + $dbh = new PDO($db_type.':host=127.0.0.1',$root,$root_pass); |
|
81 | + } else { |
|
82 | + $dbh = new PDO($db_type.':host='.$host.';port='.$port,$root,$root_pass); |
|
83 | + } |
|
70 | 84 | $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
71 | 85 | if ($db_type == 'mysql') { |
72 | 86 | $dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
73 | - if ($grantright == 'localhost') $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
87 | + if ($grantright == 'localhost') { |
|
88 | + $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
89 | + } |
|
74 | 90 | } else if ($db_type == 'pgsql') { |
75 | 91 | $dbh->exec("CREATE DATABASE ".$db.";"); |
76 | 92 | $dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."'; |
@@ -12,7 +12,9 @@ discard block |
||
12 | 12 | public function __construct($dbc = null) { |
13 | 13 | $Connection = new Connection($dbc); |
14 | 14 | $this->db = $Connection->db(); |
15 | - if ($this->db === null) die('Error: No DB connection.'); |
|
15 | + if ($this->db === null) { |
|
16 | + die('Error: No DB connection.'); |
|
17 | + } |
|
16 | 18 | } |
17 | 19 | |
18 | 20 | public function get_tle($name) { |
@@ -24,8 +26,11 @@ discard block |
||
24 | 26 | echo $e->getMessage(); |
25 | 27 | } |
26 | 28 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
27 | - if (isset($result[0])) return $result[0]; |
|
28 | - else return array(); |
|
29 | + if (isset($result[0])) { |
|
30 | + return $result[0]; |
|
31 | + } else { |
|
32 | + return array(); |
|
33 | + } |
|
29 | 34 | } |
30 | 35 | public function get_tle_types() { |
31 | 36 | $query = 'SELECT DISTINCT tle_type FROM tle ORDER BY tle_type'; |
@@ -36,8 +41,11 @@ discard block |
||
36 | 41 | echo $e->getMessage(); |
37 | 42 | } |
38 | 43 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
39 | - if (isset($result[0])) return $result; |
|
40 | - else return array(); |
|
44 | + if (isset($result[0])) { |
|
45 | + return $result; |
|
46 | + } else { |
|
47 | + return array(); |
|
48 | + } |
|
41 | 49 | } |
42 | 50 | public function get_tle_names() { |
43 | 51 | $query = 'SELECT DISTINCT tle_name, tle_type FROM tle'; |
@@ -48,8 +56,11 @@ discard block |
||
48 | 56 | echo $e->getMessage(); |
49 | 57 | } |
50 | 58 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
51 | - if (isset($result[0])) return $result; |
|
52 | - else return array(); |
|
59 | + if (isset($result[0])) { |
|
60 | + return $result; |
|
61 | + } else { |
|
62 | + return array(); |
|
63 | + } |
|
53 | 64 | } |
54 | 65 | public function get_tle_names_type($type) { |
55 | 66 | $query = 'SELECT tle_name, tle_type FROM tle WHERE tle_type = :type ORDER BY tle_name'; |
@@ -60,8 +71,11 @@ discard block |
||
60 | 71 | echo $e->getMessage(); |
61 | 72 | } |
62 | 73 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
63 | - if (isset($result[0])) return $result; |
|
64 | - else return array(); |
|
74 | + if (isset($result[0])) { |
|
75 | + return $result; |
|
76 | + } else { |
|
77 | + return array(); |
|
78 | + } |
|
65 | 79 | } |
66 | 80 | |
67 | 81 | public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
@@ -79,8 +93,11 @@ discard block |
||
79 | 93 | $result = array(); |
80 | 94 | foreach ($all_sat as $sat) { |
81 | 95 | $position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second); |
82 | - if (isset($position[0])) $result = array_merge($position,$result); |
|
83 | - else $result[] = $position; |
|
96 | + if (isset($position[0])) { |
|
97 | + $result = array_merge($position,$result); |
|
98 | + } else { |
|
99 | + $result[] = $position; |
|
100 | + } |
|
84 | 101 | } |
85 | 102 | return $result; |
86 | 103 | } |
@@ -96,7 +113,9 @@ discard block |
||
96 | 113 | $sat = new Predict_Sat($tle); |
97 | 114 | $predict = new Predict(); |
98 | 115 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
99 | - if ($timestamp_begin == '') $timestamp_begin = time(); |
|
116 | + if ($timestamp_begin == '') { |
|
117 | + $timestamp_begin = time(); |
|
118 | + } |
|
100 | 119 | if ($timestamp_end == '') { |
101 | 120 | $now = Predict_Time::unix2daynum($timestamp_begin); |
102 | 121 | $predict->predict_calc($sat,$qth,$now); |
@@ -121,8 +140,11 @@ discard block |
||
121 | 140 | echo $e->getMessage(); |
122 | 141 | } |
123 | 142 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
124 | - if (isset($result[0])) return $result[0]; |
|
125 | - else return array(); |
|
143 | + if (isset($result[0])) { |
|
144 | + return $result[0]; |
|
145 | + } else { |
|
146 | + return array(); |
|
147 | + } |
|
126 | 148 | } |
127 | 149 | |
128 | 150 | /** |
@@ -140,7 +162,9 @@ discard block |
||
140 | 162 | FROM satellite".$filter_query." satellite.launch_site <> '' AND satellite.launch_site IS NOT NULL"; |
141 | 163 | $query_values = array(); |
142 | 164 | $query .= " GROUP BY satellite.launch_site ORDER BY launch_site_count DESC"; |
143 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
165 | + if ($limit) { |
|
166 | + $query .= " LIMIT 10 OFFSET 0"; |
|
167 | + } |
|
144 | 168 | $sth = $this->db->prepare($query); |
145 | 169 | $sth->execute($query_values); |
146 | 170 | $launch_site_array = array(); |
@@ -169,7 +193,9 @@ discard block |
||
169 | 193 | FROM satellite".$filter_query." satellite.owner <> '' AND satellite.owner IS NOT NULL"; |
170 | 194 | $query_values = array(); |
171 | 195 | $query .= " GROUP BY satellite.owner ORDER BY owner_count DESC"; |
172 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
196 | + if ($limit) { |
|
197 | + $query .= " LIMIT 10 OFFSET 0"; |
|
198 | + } |
|
173 | 199 | $sth = $this->db->prepare($query); |
174 | 200 | $sth->execute($query_values); |
175 | 201 | $owner_array = array(); |
@@ -198,7 +224,9 @@ discard block |
||
198 | 224 | FROM satellite".$filter_query." satellite.country_owner <> '' AND satellite.country_owner IS NOT NULL"; |
199 | 225 | $query_values = array(); |
200 | 226 | $query .= " GROUP BY satellite.country_owner ORDER BY country_count DESC"; |
201 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
227 | + if ($limit) { |
|
228 | + $query .= " LIMIT 10 OFFSET 0"; |
|
229 | + } |
|
202 | 230 | $sth = $this->db->prepare($query); |
203 | 231 | $sth->execute($query_values); |
204 | 232 | $owner_array = array(); |
@@ -225,20 +253,26 @@ discard block |
||
225 | 253 | date_default_timezone_set($globalTimezone); |
226 | 254 | $datetime = new DateTime(); |
227 | 255 | $offset = $datetime->format('P'); |
228 | - } else $offset = '+00:00'; |
|
256 | + } else { |
|
257 | + $offset = '+00:00'; |
|
258 | + } |
|
229 | 259 | //$filter_query = $this->getFilter($filters,true,true); |
230 | 260 | $filter_query = ' WHERE'; |
231 | 261 | if ($globalDBdriver == 'mysql') { |
232 | 262 | $query = "SELECT MONTH(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
233 | 263 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR)"; |
234 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
264 | + if ($sincedate != '') { |
|
265 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
266 | + } |
|
235 | 267 | $query .= " GROUP BY year_name, month_name |
236 | 268 | ORDER BY year_name, month_name ASC"; |
237 | 269 | $query_data = array(':offset' => $offset); |
238 | 270 | } else { |
239 | 271 | $query = "SELECT EXTRACT(MONTH FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS month_name, EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
240 | 272 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 YEARS'"; |
241 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
273 | + if ($sincedate != '') { |
|
274 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
275 | + } |
|
242 | 276 | $query .= " GROUP BY year_name, month_name |
243 | 277 | ORDER BY year_name, month_name ASC"; |
244 | 278 | $query_data = array(':offset' => $offset); |
@@ -270,20 +304,26 @@ discard block |
||
270 | 304 | date_default_timezone_set($globalTimezone); |
271 | 305 | $datetime = new DateTime(); |
272 | 306 | $offset = $datetime->format('P'); |
273 | - } else $offset = '+00:00'; |
|
307 | + } else { |
|
308 | + $offset = '+00:00'; |
|
309 | + } |
|
274 | 310 | //$filter_query = $this->getFilter($filters,true,true); |
275 | 311 | $filter_query = ' WHERE'; |
276 | 312 | if ($globalDBdriver == 'mysql') { |
277 | 313 | $query = "SELECT YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
278 | 314 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 YEAR)"; |
279 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
315 | + if ($sincedate != '') { |
|
316 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
317 | + } |
|
280 | 318 | $query .= " GROUP BY year_name |
281 | 319 | ORDER BY year_name ASC"; |
282 | 320 | $query_data = array(':offset' => $offset); |
283 | 321 | } else { |
284 | 322 | $query = "SELECT EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
285 | 323 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '10 YEARS'"; |
286 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
324 | + if ($sincedate != '') { |
|
325 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
326 | + } |
|
287 | 327 | $query .= " GROUP BY year_name |
288 | 328 | ORDER BY year_name ASC"; |
289 | 329 | $query_data = array(':offset' => $offset); |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | $compress = false; |
11 | 14 | ?> |
12 | 15 | |
@@ -159,9 +162,13 @@ discard block |
||
159 | 162 | if (callsign != ""){ markerSatelliteLabel += callsign; } |
160 | 163 | if (type != ""){ markerSatelliteLabel += ' - '+type; } |
161 | 164 | <?php |
162 | - if (isset($_COOKIE['SatelliteIconColor'])) $IconColor = $_COOKIE['SatelliteIconColor']; |
|
163 | - elseif (isset($globalSatelliteIconColor)) $IconColor = $globalSatelliteIconColor; |
|
164 | - else $IconColor = '1a3151'; |
|
165 | + if (isset($_COOKIE['SatelliteIconColor'])) { |
|
166 | + $IconColor = $_COOKIE['SatelliteIconColor']; |
|
167 | + } elseif (isset($globalSatelliteIconColor)) { |
|
168 | + $IconColor = $globalSatelliteIconColor; |
|
169 | + } else { |
|
170 | + $IconColor = '1a3151'; |
|
171 | + } |
|
165 | 172 | if (!isset($ident) && !isset($famsatid)) { |
166 | 173 | ?> |
167 | 174 | info_satellite_update(feature.properties.fc); |
@@ -195,7 +202,12 @@ discard block |
||
195 | 202 | <?php |
196 | 203 | } else { |
197 | 204 | ?> |
198 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
205 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
206 | + print $archiveupdatetime*1000; |
|
207 | +} else { |
|
208 | + print $globalMapRefresh*1000+20000; |
|
209 | +} |
|
210 | +?>+feature.properties.sqt*1000); |
|
199 | 211 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
200 | 212 | <?php |
201 | 213 | } |
@@ -251,7 +263,12 @@ discard block |
||
251 | 263 | <?php |
252 | 264 | } else { |
253 | 265 | ?> |
254 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
266 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
267 | + print $archiveupdatetime*1000; |
|
268 | +} else { |
|
269 | + print $globalMapRefresh*1000+20000; |
|
270 | +} |
|
271 | +?>+feature.properties.sqt*1000); |
|
255 | 272 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
256 | 273 | <?php |
257 | 274 | } |
@@ -306,7 +323,12 @@ discard block |
||
306 | 323 | <?php |
307 | 324 | } else { |
308 | 325 | ?> |
309 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
326 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
327 | + print $archiveupdatetime*1000; |
|
328 | +} else { |
|
329 | + print $globalMapRefresh*1000+20000; |
|
330 | +} |
|
331 | +?>+feature.properties.sqt*1000); |
|
310 | 332 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
311 | 333 | <?php |
312 | 334 | } |
@@ -601,14 +623,24 @@ discard block |
||
601 | 623 | if (isset($archive) && $archive) { |
602 | 624 | ?> |
603 | 625 | //then load it again every 30 seconds |
604 | -// var reload = setInterval(function(){if (noTimeout) updateSat(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
626 | +// var reload = setInterval(function(){if (noTimeout) updateSat(0)},<?php if (isset($globalMapRefresh)) { |
|
627 | + print ($globalMapRefresh*1000)/2; |
|
628 | +} else { |
|
629 | + print '15000'; |
|
630 | +} |
|
631 | +?>); |
|
605 | 632 | reloadSatellitePage = setInterval(function(){if (noTimeout) updateSat(0)},<?php print $archiveupdatetime*1000; ?>); |
606 | 633 | <?php |
607 | 634 | } else { |
608 | 635 | ?> |
609 | 636 | //then load it again every 30 seconds |
610 | 637 | reloadSatellitePage = setInterval( |
611 | - function(){if (noTimeout) updateSat(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
638 | + function(){if (noTimeout) updateSat(0)},<?php if (isset($globalMapRefresh)) { |
|
639 | + print $globalMapRefresh*1000; |
|
640 | +} else { |
|
641 | + print '30000'; |
|
642 | +} |
|
643 | +?>); |
|
612 | 644 | <?php |
613 | 645 | } |
614 | 646 | ?> |
@@ -64,13 +64,19 @@ discard block |
||
64 | 64 | $nextlatlon = $Satellite->position($spotter_item['name'],time()+$globalMapRefresh+20); |
65 | 65 | $nextlat = $nextlatlon['latitude']; |
66 | 66 | if (abs($nextlat-$spotter_item['latitude']) > 90) { |
67 | - if ($spotter_item['latitude'] < 0) $nexlat = -90; |
|
68 | - else $nexlat = 90; |
|
67 | + if ($spotter_item['latitude'] < 0) { |
|
68 | + $nexlat = -90; |
|
69 | + } else { |
|
70 | + $nexlat = 90; |
|
71 | + } |
|
69 | 72 | } |
70 | 73 | $nextlon = $nextlatlon['longitude']; |
71 | 74 | if (abs($nextlon-$spotter_item['longitude']) > 180) { |
72 | - if ($spotter_item['longitude'] < 0) $nextlon = -180; |
|
73 | - else $nextlon = 180; |
|
75 | + if ($spotter_item['longitude'] < 0) { |
|
76 | + $nextlon = -180; |
|
77 | + } else { |
|
78 | + $nextlon = 180; |
|
79 | + } |
|
74 | 80 | } |
75 | 81 | $output_data .= '"nextlatlon":['.$nextlat.','.$nextlon.']},'; |
76 | 82 | //$output_data .= '"heading":"'.$Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$nextlatlon['latitude'],$nextlatlon['longitude']).'",'; |
@@ -99,7 +105,9 @@ discard block |
||
99 | 105 | } |
100 | 106 | } |
101 | 107 | } |
102 | -if (isset($output_data)) $output = substr($output,0,-1); |
|
108 | +if (isset($output_data)) { |
|
109 | + $output = substr($output,0,-1); |
|
110 | +} |
|
103 | 111 | $output .= ']}'; |
104 | 112 | print $output; |
105 | 113 | ?> |
@@ -218,7 +218,12 @@ discard block |
||
218 | 218 | <?php |
219 | 219 | } else { |
220 | 220 | ?> |
221 | - if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
221 | + if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
222 | + print $globalMapRefresh*2000; |
|
223 | +} else { |
|
224 | + print '60000'; |
|
225 | +} |
|
226 | +?>)) { |
|
222 | 227 | viewer.dataSources.get(dsn).entities.remove(entity); |
223 | 228 | czmlds.entities.removeById(entityid); |
224 | 229 | } |
@@ -502,7 +507,12 @@ discard block |
||
502 | 507 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
503 | 508 | ?> |
504 | 509 | update_polarLayer(); |
505 | -setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
510 | +setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
511 | + print $globalMapRefresh*1000*2; |
|
512 | +} else { |
|
513 | + print '60000'; |
|
514 | +} |
|
515 | +?>); |
|
506 | 516 | <?php |
507 | 517 | } |
508 | 518 | ?> |
@@ -613,7 +623,12 @@ discard block |
||
613 | 623 | } |
614 | 624 | } |
615 | 625 | } |
616 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
626 | + ,<?php if (isset($globalMapRefresh)) { |
|
627 | + print $globalMapRefresh*1000; |
|
628 | +} else { |
|
629 | + print '30000'; |
|
630 | +} |
|
631 | +?>); |
|
617 | 632 | } else { |
618 | 633 | //var widget = new Cesium.CesiumWidget('archivebox'); |
619 | 634 | // var timeline = new Cesium.Timeline(viewer); |
@@ -632,7 +647,12 @@ discard block |
||
632 | 647 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
633 | 648 | ?> |
634 | 649 | update_atcLayer(); |
635 | -setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
650 | +setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
651 | + print $globalMapRefresh*1000*2; |
|
652 | +} else { |
|
653 | + print '60000'; |
|
654 | +} |
|
655 | +?>); |
|
636 | 656 | <?php |
637 | 657 | } |
638 | 658 | ?> |
@@ -47,7 +47,12 @@ discard block |
||
47 | 47 | <?php |
48 | 48 | } else { |
49 | 49 | ?> |
50 | - if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
50 | + if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
51 | + print $globalMapRefresh*2000; |
|
52 | +} else { |
|
53 | + print '60000'; |
|
54 | +} |
|
55 | +?>)) { |
|
51 | 56 | viewer.dataSources.get(dsn).entities.remove(entity); |
52 | 57 | } |
53 | 58 | <?php |
@@ -129,7 +134,12 @@ discard block |
||
129 | 134 | function(){ |
130 | 135 | updateMarineData(); |
131 | 136 | } |
132 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
137 | + ,<?php if (isset($globalMapRefresh)) { |
|
138 | + print $globalMapRefresh*1000; |
|
139 | +} else { |
|
140 | + print '30000'; |
|
141 | +} |
|
142 | +?>); |
|
133 | 143 | } else { |
134 | 144 | var clockViewModel = new Cesium.ClockViewModel(viewer.clock); |
135 | 145 | var animationViewModel = new Cesium.AnimationViewModel(clockViewModel); |
@@ -90,7 +90,12 @@ discard block |
||
90 | 90 | <?php |
91 | 91 | } else { |
92 | 92 | ?> |
93 | - if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
93 | + if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
94 | + print $globalMapRefresh*2000; |
|
95 | +} else { |
|
96 | + print '60000'; |
|
97 | +} |
|
98 | +?>)) { |
|
94 | 99 | viewer.dataSources.get(dsn).entities.remove(entity); |
95 | 100 | czmldstracker.entities.removeById(entityid); |
96 | 101 | } |
@@ -173,7 +178,12 @@ discard block |
||
173 | 178 | function(){ |
174 | 179 | updateTrackerData(); |
175 | 180 | } |
176 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
181 | + ,<?php if (isset($globalMapRefresh)) { |
|
182 | + print $globalMapRefresh*1000; |
|
183 | +} else { |
|
184 | + print '30000'; |
|
185 | +} |
|
186 | +?>); |
|
177 | 187 | } else { |
178 | 188 | var clockViewModel = new Cesium.ClockViewModel(viewer.clock); |
179 | 189 | var animationViewModel = new Cesium.AnimationViewModel(clockViewModel); |
@@ -79,7 +79,9 @@ |
||
79 | 79 | $output .= '"type": "'.$spotter_item['type'].'",'; |
80 | 80 | if ($spotter_item['type'] == 'wx') { |
81 | 81 | $weather = json_decode($spotter_item['description'],true); |
82 | - if (isset($weather['temp'])) $output.= '"temp": "'.$weather['temp'].'",'; |
|
82 | + if (isset($weather['temp'])) { |
|
83 | + $output.= '"temp": "'.$weather['temp'].'",'; |
|
84 | + } |
|
83 | 85 | } |
84 | 86 | $output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"'; |
85 | 87 | $output .= '},'; |