@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | $_COOKIE['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 | <?php |
12 | 15 | if (isset($_GET['archive'])) { |
@@ -18,8 +21,11 @@ discard block |
||
18 | 21 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
19 | 22 | //$lastupd = 20; |
20 | 23 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
21 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
22 | - else $enddate = time(); |
|
24 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
25 | + $enddate = $_GET['enddate']; |
|
26 | + } else { |
|
27 | + $enddate = time(); |
|
28 | + } |
|
23 | 29 | setcookie("archive_begin",$begindate); |
24 | 30 | setcookie("archive_end",$enddate); |
25 | 31 | setcookie("archive_update",$lastupd); |
@@ -109,7 +115,17 @@ discard block |
||
109 | 115 | } |
110 | 116 | |
111 | 117 | //create the map |
112 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
118 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
119 | + print $latitude; |
|
120 | +} else { |
|
121 | + print $globalCenterLatitude; |
|
122 | +} |
|
123 | +?>,<?php if (isset($longitude)) { |
|
124 | + print $longitude; |
|
125 | +} else { |
|
126 | + print $globalCenterLongitude; |
|
127 | +} |
|
128 | +?>], zoom); |
|
113 | 129 | <?php |
114 | 130 | } else { |
115 | 131 | ?> |
@@ -122,9 +138,19 @@ discard block |
||
122 | 138 | || navigator.userAgent.match(/BlackBerry/i) |
123 | 139 | || navigator.userAgent.match(/Windows Phone/i)) |
124 | 140 | { |
125 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
141 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
142 | + print $globalLiveZoom-1; |
|
143 | +} else { |
|
144 | + print '8'; |
|
145 | +} |
|
146 | +?>; |
|
126 | 147 | } else { |
127 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
148 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
149 | + print $globalLiveZoom; |
|
150 | +} else { |
|
151 | + print '9'; |
|
152 | +} |
|
153 | +?>; |
|
128 | 154 | } |
129 | 155 | |
130 | 156 | //create the map |
@@ -149,16 +175,27 @@ discard block |
||
149 | 175 | bounds = L.latLngBounds(southWest,northEast); |
150 | 176 | //a few title layers |
151 | 177 | <?php |
152 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
153 | - else $MapType = $globalMapProvider; |
|
178 | + if (isset($_COOKIE['MapType'])) { |
|
179 | + $MapType = $_COOKIE['MapType']; |
|
180 | + } else { |
|
181 | + $MapType = $globalMapProvider; |
|
182 | + } |
|
154 | 183 | |
155 | 184 | if ($MapType == 'Mapbox') { |
156 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
157 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
158 | -?> |
|
185 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
186 | + $MapBoxId = $globalMapboxId; |
|
187 | + } else { |
|
188 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
189 | + } |
|
190 | + ?> |
|
159 | 191 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
160 | 192 | maxZoom: 18, |
161 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
193 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
194 | + print 'false'; |
|
195 | +} else { |
|
196 | + print 'true'; |
|
197 | +} |
|
198 | +?>, |
|
162 | 199 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
163 | 200 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
164 | 201 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -170,7 +207,12 @@ discard block |
||
170 | 207 | ?> |
171 | 208 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
172 | 209 | maxZoom: 18, |
173 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
210 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
211 | + print 'false'; |
|
212 | +} else { |
|
213 | + print 'true'; |
|
214 | +} |
|
215 | +?>, |
|
174 | 216 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
175 | 217 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
176 | 218 | }).addTo(map); |
@@ -216,20 +258,26 @@ discard block |
||
216 | 258 | map.addLayer(yandexLayer); |
217 | 259 | <?php |
218 | 260 | } elseif ($MapType == 'Bing-Aerial') { |
219 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
220 | -?> |
|
261 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
262 | + setcookie('MapType','OpenStreetMap'); |
|
263 | + } |
|
264 | + ?> |
|
221 | 265 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
222 | 266 | map.addLayer(bingLayer); |
223 | 267 | <?php |
224 | 268 | } elseif ($MapType == 'Bing-Hybrid') { |
225 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
226 | -?> |
|
269 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
270 | + setcookie('MapType','OpenStreetMap'); |
|
271 | + } |
|
272 | + ?> |
|
227 | 273 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
228 | 274 | map.addLayer(bingLayer); |
229 | 275 | <?php |
230 | 276 | } elseif ($MapType == 'Bing-Road') { |
231 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
232 | -?> |
|
277 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
278 | + setcookie('MapType','OpenStreetMap'); |
|
279 | + } |
|
280 | + ?> |
|
233 | 281 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
234 | 282 | map.addLayer(bingLayer); |
235 | 283 | <?php |
@@ -277,7 +325,12 @@ discard block |
||
277 | 325 | } |
278 | 326 | } elseif ($globalBounding == 'circle') { |
279 | 327 | ?> |
280 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
328 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
329 | + print $globalBoundingCircleSize; |
|
330 | +} else { |
|
331 | + print '70000'; |
|
332 | +} |
|
333 | +?>,{ |
|
281 | 334 | color: '#92C7D1', |
282 | 335 | fillColor: '#92C7D1', |
283 | 336 | fillOpacity: 0.3, |
@@ -336,8 +389,11 @@ discard block |
||
336 | 389 | |
337 | 390 | function update_airportsLayer() { |
338 | 391 | <?php |
339 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
340 | - else $getZoom = '7'; |
|
392 | + if (isset($_COOKIE['AirportZoom'])) { |
|
393 | + $getZoom = $_COOKIE['AirportZoom']; |
|
394 | + } else { |
|
395 | + $getZoom = '7'; |
|
396 | + } |
|
341 | 397 | ?> |
342 | 398 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
343 | 399 | if (typeof airportsLayer != 'undefined') { |
@@ -660,9 +716,13 @@ discard block |
||
660 | 716 | if (callsign != ""){ markerLabel += callsign; } |
661 | 717 | if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; } |
662 | 718 | <?php |
663 | - if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
664 | - elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
665 | - else $IconColor = '1a3151'; |
|
719 | + if (isset($_COOKIE['IconColor'])) { |
|
720 | + $IconColor = $_COOKIE['IconColor']; |
|
721 | + } elseif (isset($globalAircraftIconColor)) { |
|
722 | + $IconColor = $globalAircraftIconColor; |
|
723 | + } else { |
|
724 | + $IconColor = '1a3151'; |
|
725 | + } |
|
666 | 726 | if (!isset($ident) && !isset($flightaware_id)) { |
667 | 727 | ?> |
668 | 728 | info_update(feature.properties.fc); |
@@ -710,7 +770,12 @@ discard block |
||
710 | 770 | <?php |
711 | 771 | } else { |
712 | 772 | ?> |
713 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
773 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
774 | + print $archiveupdatetime*1000; |
|
775 | +} else { |
|
776 | + print $globalMapRefresh*1000+20000; |
|
777 | +} |
|
778 | +?>+feature.properties.sqt*1000); |
|
714 | 779 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
715 | 780 | <?php |
716 | 781 | } |
@@ -755,7 +820,12 @@ discard block |
||
755 | 820 | <?php |
756 | 821 | } else { |
757 | 822 | ?> |
758 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
823 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
824 | + print $archiveupdatetime*1000; |
|
825 | +} else { |
|
826 | + print $globalMapRefresh*1000+20000; |
|
827 | +} |
|
828 | +?>+feature.properties.sqt*1000); |
|
759 | 829 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
760 | 830 | <?php |
761 | 831 | } |
@@ -799,7 +869,12 @@ discard block |
||
799 | 869 | <?php |
800 | 870 | } else { |
801 | 871 | ?> |
802 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
872 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
873 | + print $archiveupdatetime*1000; |
|
874 | +} else { |
|
875 | + print $globalMapRefresh*1000+20000; |
|
876 | +} |
|
877 | +?>+feature.properties.sqt*1000); |
|
803 | 878 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
804 | 879 | <?php |
805 | 880 | } |
@@ -1141,19 +1216,34 @@ discard block |
||
1141 | 1216 | if (isset($_GET['archive'])) { |
1142 | 1217 | ?> |
1143 | 1218 | //then load it again every 30 seconds |
1144 | -// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
1219 | +// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1220 | + print ($globalMapRefresh*1000)/2; |
|
1221 | +} else { |
|
1222 | + print '15000'; |
|
1223 | +} |
|
1224 | +?>); |
|
1145 | 1225 | reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>); |
1146 | 1226 | <?php |
1147 | 1227 | } else { |
1148 | 1228 | ?> |
1149 | 1229 | //then load it again every 30 seconds |
1150 | -reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
1230 | +reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1231 | + print $globalMapRefresh*1000; |
|
1232 | +} else { |
|
1233 | + print '30000'; |
|
1234 | +} |
|
1235 | +?>); |
|
1151 | 1236 | |
1152 | 1237 | <?php |
1153 | 1238 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
1154 | 1239 | ?> |
1155 | 1240 | update_polarLayer(); |
1156 | -setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1241 | +setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
1242 | + print $globalMapRefresh*1000*2; |
|
1243 | +} else { |
|
1244 | + print '60000'; |
|
1245 | +} |
|
1246 | +?>); |
|
1157 | 1247 | <?php |
1158 | 1248 | } |
1159 | 1249 | ?> |
@@ -1168,7 +1258,12 @@ discard block |
||
1168 | 1258 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) ) { |
1169 | 1259 | ?> |
1170 | 1260 | update_atcLayer(); |
1171 | -setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1261 | +setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
1262 | + print $globalMapRefresh*1000*2; |
|
1263 | +} else { |
|
1264 | + print '60000'; |
|
1265 | +} |
|
1266 | +?>); |
|
1172 | 1267 | <?php |
1173 | 1268 | } |
1174 | 1269 | ?> |
@@ -636,8 +636,9 @@ |
||
636 | 636 | $t += $sat->el * sqrt($sat->alt) / 502500.0; |
637 | 637 | $this->predict_calc($sat, $qth, $t); |
638 | 638 | |
639 | - if (abs($sat->el) < 0.005) |
|
640 | - $lostime = $t; |
|
639 | + if (abs($sat->el) < 0.005) { |
|
640 | + $lostime = $t; |
|
641 | + } |
|
641 | 642 | } |
642 | 643 | } |
643 | 644 |
@@ -752,8 +752,7 @@ discard block |
||
752 | 752 | $sat->deep_arg->eosq + 5337.524 * $eoc; |
753 | 753 | $g532 = -853.666 + 4690.25 * $eq - 8624.77 * |
754 | 754 | $sat->deep_arg->eosq + 5341.4 * $eoc; |
755 | - } |
|
756 | - else { |
|
755 | + } else { |
|
757 | 756 | $g533 = -37995.78 + 161616.52 * $eq - 229838.2* |
758 | 757 | $sat->deep_arg->eosq + 109377.94 * $eoc; |
759 | 758 | $g521 = -51752.104 + 218913.95 * $eq - 309468.16* |
@@ -887,8 +886,7 @@ discard block |
||
887 | 886 | if (abs($sat->deep_arg->t - $sat->dps->atime) >= $sat->dps->stepp) { |
888 | 887 | $sat->flags |= self::DO_LOOP_FLAG; |
889 | 888 | $sat->flags &= ~self::EPOCH_RESTART_FLAG; |
890 | - } |
|
891 | - else { |
|
889 | + } else { |
|
892 | 890 | $ft = $sat->deep_arg->t - $sat->dps->atime; |
893 | 891 | $sat->flags &= ~self::DO_LOOP_FLAG; |
894 | 892 | } |
@@ -146,8 +146,7 @@ |
||
146 | 146 | $obs_geodetic->lat = $qth->lat * Predict::de2ra; |
147 | 147 | $obs_geodetic->alt = $qth->alt / 1000.0; |
148 | 148 | $obs_geodetic->theta = 0; |
149 | - } |
|
150 | - else { |
|
149 | + } else { |
|
151 | 150 | $obs_geodetic->lon = 0.0; |
152 | 151 | $obs_geodetic->lat = 0.0; |
153 | 152 | $obs_geodetic->alt = 0.0; |
@@ -23,8 +23,11 @@ discard block |
||
23 | 23 | echo $e->getMessage(); |
24 | 24 | } |
25 | 25 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
26 | - if (isset($result[0])) return $result[0]; |
|
27 | - else return array(); |
|
26 | + if (isset($result[0])) { |
|
27 | + return $result[0]; |
|
28 | + } else { |
|
29 | + return array(); |
|
30 | + } |
|
28 | 31 | } |
29 | 32 | public function get_tle_types() { |
30 | 33 | $query = 'SELECT DISTINCT tle_type FROM tle ORDER BY tle_type'; |
@@ -35,8 +38,11 @@ discard block |
||
35 | 38 | echo $e->getMessage(); |
36 | 39 | } |
37 | 40 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
38 | - if (isset($result[0])) return $result; |
|
39 | - else return array(); |
|
41 | + if (isset($result[0])) { |
|
42 | + return $result; |
|
43 | + } else { |
|
44 | + return array(); |
|
45 | + } |
|
40 | 46 | } |
41 | 47 | public function get_tle_names() { |
42 | 48 | $query = 'SELECT DISTINCT tle_name, tle_type FROM tle'; |
@@ -47,8 +53,11 @@ discard block |
||
47 | 53 | echo $e->getMessage(); |
48 | 54 | } |
49 | 55 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
50 | - if (isset($result[0])) return $result; |
|
51 | - else return array(); |
|
56 | + if (isset($result[0])) { |
|
57 | + return $result; |
|
58 | + } else { |
|
59 | + return array(); |
|
60 | + } |
|
52 | 61 | } |
53 | 62 | public function get_tle_names_type($type) { |
54 | 63 | $query = 'SELECT tle_name, tle_type FROM tle WHERE tle_type = :type ORDER BY tle_name'; |
@@ -59,8 +68,11 @@ discard block |
||
59 | 68 | echo $e->getMessage(); |
60 | 69 | } |
61 | 70 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
62 | - if (isset($result[0])) return $result; |
|
63 | - else return array(); |
|
71 | + if (isset($result[0])) { |
|
72 | + return $result; |
|
73 | + } else { |
|
74 | + return array(); |
|
75 | + } |
|
64 | 76 | } |
65 | 77 | |
66 | 78 | public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
@@ -95,7 +107,9 @@ discard block |
||
95 | 107 | $sat = new Predict_Sat($tle); |
96 | 108 | $predict = new Predict(); |
97 | 109 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
98 | - if ($timestamp_begin == '') $timestamp_begin = time(); |
|
110 | + if ($timestamp_begin == '') { |
|
111 | + $timestamp_begin = time(); |
|
112 | + } |
|
99 | 113 | if ($timestamp_end == '') { |
100 | 114 | $now = Predict_Time::unix2daynum($timestamp_begin); |
101 | 115 | //echo $now; |
@@ -54,7 +54,9 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | if (!isset($array_value)) { |
57 | - if (!isset($arrayd_value)) $arrayd_value = ''; |
|
57 | + if (!isset($arrayd_value)) { |
|
58 | + $arrayd_value = ''; |
|
59 | + } |
|
58 | 60 | //$array_value = "'".$key."' => array(".$arrayd_value.")"; |
59 | 61 | $array_value = "array(".$arrayd_value.")"; |
60 | 62 | } elseif (isset($arrayd_value)) { |
@@ -71,7 +73,9 @@ discard block |
||
71 | 73 | } |
72 | 74 | } |
73 | 75 | } |
74 | - if (!isset($array_value)) $array_value = ''; |
|
76 | + if (!isset($array_value)) { |
|
77 | + $array_value = ''; |
|
78 | + } |
|
75 | 79 | $replace = "\n".'\$'.$settingname." = array(".$array_value.")"; |
76 | 80 | unset($array_value); |
77 | 81 | } else { |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
6 | 6 | $current_page = $file_path['filename']; |
7 | 7 | date_default_timezone_set($globalTimezone); |
8 | -if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
|
9 | -else $MapType = $globalMapProvider; |
|
8 | +if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') { |
|
9 | + $MapType = $_COOKIE['MapType']; |
|
10 | +} else { |
|
11 | + $MapType = $globalMapProvider; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | <!DOCTYPE html> |
12 | 15 | <html> |
@@ -181,7 +184,13 @@ discard block |
||
181 | 184 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
182 | 185 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
183 | 186 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
184 | -<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
187 | +<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
188 | + print '&latitude='.$latitude; |
|
189 | +} |
|
190 | +?><?php if(isset($longitude)) { |
|
191 | + print '&longitude='.$longitude; |
|
192 | +} |
|
193 | +?>&<?php print time(); ?>"></script> |
|
185 | 194 | <?php |
186 | 195 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
187 | 196 | ?> |
@@ -235,7 +244,13 @@ discard block |
||
235 | 244 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
236 | 245 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
237 | 246 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
238 | -<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
247 | +<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
248 | + print '&latitude='.$latitude; |
|
249 | +} |
|
250 | +?><?php if(isset($longitude)) { |
|
251 | + print '&longitude='.$longitude; |
|
252 | +} |
|
253 | +?>&<?php print time(); ?>"></script> |
|
239 | 254 | <?php |
240 | 255 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
241 | 256 | ?> |
@@ -308,7 +323,12 @@ discard block |
||
308 | 323 | <span class="icon-bar"></span> |
309 | 324 | </button> |
310 | 325 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a> |
311 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
326 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
327 | + print '/'; |
|
328 | +} else { |
|
329 | + print $globalURL; |
|
330 | +} |
|
331 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
312 | 332 | </div> |
313 | 333 | <div class="collapse navbar-collapse"> |
314 | 334 | <ul class="nav navbar-nav"> |
@@ -386,7 +406,9 @@ discard block |
||
386 | 406 | $alllang = $Language->getLanguages(); |
387 | 407 | foreach ($alllang as $key => $lang) { |
388 | 408 | print '<option value="'.$key.'"'; |
389 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
409 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
410 | + print ' selected '; |
|
411 | + } |
|
390 | 412 | print '>'.$lang[0].'</option>'; |
391 | 413 | } |
392 | 414 | ?> |
@@ -533,4 +555,7 @@ discard block |
||
533 | 555 | |
534 | 556 | ?> |
535 | 557 | |
536 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
558 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
559 | + print 'index '; |
|
560 | +} |
|
561 | +?>clear"> |
@@ -16,7 +16,9 @@ discard block |
||
16 | 16 | print '<h1>'._("Aircrafts Types").'</h1>'; |
17 | 17 | |
18 | 18 | $aircraft_types = $Stats->getAllAircraftTypes(); |
19 | - if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
19 | + if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') { |
|
20 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
21 | + } |
|
20 | 22 | $previous = null; |
21 | 23 | print '<div class="alphabet-legend">'; |
22 | 24 | foreach($aircraft_types as $value) { |
@@ -24,7 +26,9 @@ discard block |
||
24 | 26 | $firstLetter = substr($value['aircraft_manufacturer'], 0, 1); |
25 | 27 | if($previous !== $firstLetter) |
26 | 28 | { |
27 | - if ($previous !== null) print ' | '; |
|
29 | + if ($previous !== null) { |
|
30 | + print ' | '; |
|
31 | + } |
|
28 | 32 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
29 | 33 | } |
30 | 34 | $previous = $firstLetter; |
@@ -38,7 +42,9 @@ discard block |
||
38 | 42 | { |
39 | 43 | if($previous !== $firstLetter) |
40 | 44 | { |
41 | - if ($previous !== null) print '</div>'; |
|
45 | + if ($previous !== null) { |
|
46 | + print '</div>'; |
|
47 | + } |
|
42 | 48 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
43 | 49 | } |
44 | 50 | $previous = $firstLetter; |
@@ -339,7 +339,9 @@ discard block |
||
339 | 339 | if (isset($globalTimezone)) |
340 | 340 | { |
341 | 341 | date_default_timezone_set($globalTimezone); |
342 | - } else date_default_timezone_set('UTC'); |
|
342 | + } else { |
|
343 | + date_default_timezone_set('UTC'); |
|
344 | + } |
|
343 | 345 | if ($showSpecial === true) |
344 | 346 | { |
345 | 347 | print '<tr class="special">'."\n"; |
@@ -358,8 +360,9 @@ discard block |
||
358 | 360 | print '<td class="aircraft_thumbnail">'."\n"; |
359 | 361 | |
360 | 362 | if ($spotter_item['image_source'] == 'planespotters') { |
361 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
362 | - else { |
|
363 | + if ($spotter_item['image_source_website'] != '') { |
|
364 | + $image_src = $spotter_item['image_source_website']; |
|
365 | + } else { |
|
363 | 366 | $planespotter_url_array = explode("_", $spotter_item['image']); |
364 | 367 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
365 | 368 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -372,7 +375,9 @@ discard block |
||
372 | 375 | } else { |
373 | 376 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
374 | 377 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
375 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
378 | + } else { |
|
379 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
380 | + } |
|
376 | 381 | if (isset($spotter_item['airline_name'])) { |
377 | 382 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
378 | 383 | } else { |
@@ -395,8 +400,9 @@ discard block |
||
395 | 400 | print '<td class="aircraft_thumbnail">'."\n"; |
396 | 401 | //print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
397 | 402 | if ($spotter_item['image_source'] == 'planespotters') { |
398 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
399 | - else { |
|
403 | + if ($spotter_item['image_source_website'] != '') { |
|
404 | + $image_src = $spotter_item['image_source_website']; |
|
405 | + } else { |
|
400 | 406 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
401 | 407 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
402 | 408 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -413,7 +419,9 @@ discard block |
||
413 | 419 | } else { |
414 | 420 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
415 | 421 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
416 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
422 | + } else { |
|
423 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
424 | + } |
|
417 | 425 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
418 | 426 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
419 | 427 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -494,15 +502,21 @@ discard block |
||
494 | 502 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
495 | 503 | if ($spotter_item['departure_airport_time'] > 2460) { |
496 | 504 | $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
497 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
505 | + } else { |
|
506 | + $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
507 | + } |
|
498 | 508 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
499 | 509 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
500 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
510 | + } else { |
|
511 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
512 | + } |
|
501 | 513 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
502 | 514 | } elseif (isset($spotter_item['real_departure_airport_time'])) { |
503 | 515 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
504 | 516 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
505 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
517 | + } else { |
|
518 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
519 | + } |
|
506 | 520 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
507 | 521 | } elseif (isset($spotter_item['departure_airport_time'])) { |
508 | 522 | if ($spotter_item['departure_airport_time'] > 2460) { |
@@ -524,7 +538,9 @@ discard block |
||
524 | 538 | $longitude = $spotter_item['longitude']; |
525 | 539 | } |
526 | 540 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
527 | - } else $distance = ''; |
|
541 | + } else { |
|
542 | + $distance = ''; |
|
543 | + } |
|
528 | 544 | if ($distance != '') { |
529 | 545 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
530 | 546 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -549,7 +565,9 @@ discard block |
||
549 | 565 | } else { |
550 | 566 | if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) { |
551 | 567 | print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n"; |
552 | - if (!isset($Spotter)) $Spotter = new Spotter(); |
|
568 | + if (!isset($Spotter)) { |
|
569 | + $Spotter = new Spotter(); |
|
570 | + } |
|
553 | 571 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
554 | 572 | print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n"; |
555 | 573 | print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n"; |
@@ -565,20 +583,28 @@ discard block |
||
565 | 583 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
566 | 584 | if ($spotter_item['arrival_airport_time'] > 2460) { |
567 | 585 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
568 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
586 | + } else { |
|
587 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
588 | + } |
|
569 | 589 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
570 | 590 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
571 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
591 | + } else { |
|
592 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
593 | + } |
|
572 | 594 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
573 | 595 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
574 | 596 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
575 | 597 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
576 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
598 | + } else { |
|
599 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
600 | + } |
|
577 | 601 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
578 | 602 | } elseif (isset($spotter_item['arrival_airport_time'])) { |
579 | 603 | if ($spotter_item['arrival_airport_time'] > 2460) { |
580 | 604 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
581 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
605 | + } else { |
|
606 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
607 | + } |
|
582 | 608 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
583 | 609 | } |
584 | 610 | if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
@@ -591,7 +617,9 @@ discard block |
||
591 | 617 | $longitude = $spotter_item['longitude']; |
592 | 618 | } |
593 | 619 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
594 | - } else $distance = ''; |
|
620 | + } else { |
|
621 | + $distance = ''; |
|
622 | + } |
|
595 | 623 | if ($distance != '') { |
596 | 624 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
597 | 625 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |