Completed
Push — master ( df2e86...bc2613 )
by Yannick
32:43
created
require/class.MarineLive.php 1 patch
Braces   +140 added lines, -47 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@  discard block
 block discarded – undo
8 8
 	public function __construct($dbc = null) {
9 9
 		$Connection = new Connection($dbc);
10 10
 		$this->db = $Connection->db();
11
-		if ($this->db === null) die('Error: No DB connection. (MarineLive)');
11
+		if ($this->db === null) {
12
+			die('Error: No DB connection. (MarineLive)');
13
+		}
12 14
 	}
13 15
 
14 16
 
@@ -30,7 +32,9 @@  discard block
 block discarded – undo
30 32
 		if (isset($filter[0]['source'])) {
31 33
 			$filters = array_merge($filters,$filter);
32 34
 		}
33
-		if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
35
+		if (is_array($globalFilter)) {
36
+			$filter = array_merge($filter,$globalFilter);
37
+		}
34 38
 		$filter_query_join = '';
35 39
 		$filter_query_where = '';
36 40
 		foreach($filters as $flt) {
@@ -86,8 +90,11 @@  discard block
 block discarded – undo
86 90
 		if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
87 91
 			$filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
88 92
 		}
89
-		if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
90
-		elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
93
+		if ($filter_query_where == '' && $where) {
94
+			$filter_query_where = ' WHERE';
95
+		} elseif ($filter_query_where != '' && $and) {
96
+			$filter_query_where .= ' AND';
97
+		}
91 98
 		if ($filter_query_where != '') {
92 99
 			$filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where);
93 100
 		}
@@ -128,9 +135,13 @@  discard block
 block discarded – undo
128 135
 				$orderby_query = ' '.$search_orderby_array[$sort]['sql'];
129 136
 			}
130 137
 		}
131
-		if ($orderby_query == '') $orderby_query= ' ORDER BY date DESC';
138
+		if ($orderby_query == '') {
139
+			$orderby_query= ' ORDER BY date DESC';
140
+		}
132 141
 
133
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
142
+		if (!isset($globalLiveInterval)) {
143
+			$globalLiveInterval = '200';
144
+		}
134 145
 		if ($globalDBdriver == 'mysql') {
135 146
 			//$query  = "SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate";
136 147
 			$query  = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate'.$filter_query.$orderby_query;
@@ -155,7 +166,9 @@  discard block
 block discarded – undo
155 166
 
156 167
 		$filter_query = $this->getFilter($filter,true,true);
157 168
 
158
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
169
+		if (!isset($globalLiveInterval)) {
170
+			$globalLiveInterval = '200';
171
+		}
159 172
 		if ($globalDBdriver == 'mysql') {
160 173
 			$query  = 'SELECT marine_live.mmsi, marine_live.ident, marine_live.type,marine_live.fammarine_id, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
161 174
 			FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate'.$filter_query." marine_live.latitude <> 0 AND marine_live.longitude <> 0";
@@ -197,58 +210,96 @@  discard block
 block discarded – undo
197 210
 		$id = filter_var($id,FILTER_SANITIZE_STRING);
198 211
 		$filter_query = $this->getFilter($filter,true,true);
199 212
 
200
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
201
-		if (!isset($globalMap3DMarinesLimit) || $globalMap3DMarinesLimit == '') $globalMap3DMarinesLimit = '300';
213
+		if (!isset($globalLiveInterval)) {
214
+			$globalLiveInterval = '200';
215
+		}
216
+		if (!isset($globalMap3DMarinesLimit) || $globalMap3DMarinesLimit == '') {
217
+			$globalMap3DMarinesLimit = '300';
218
+		}
202 219
 		if ($globalDBdriver == 'mysql') {
203 220
 			if (isset($globalArchive) && $globalArchive === TRUE) {
204 221
 				$query  = 'SELECT * FROM (SELECT marine_archive.ident, marine_archive.fammarine_id,marine_archive.type_id,marine_archive.type, marine_archive.latitude, marine_archive.longitude, marine_archive.heading, marine_archive.ground_speed, marine_archive.date, marine_archive.format_source, marine_archive.captain_name 
205 222
 				    FROM marine_archive INNER JOIN (SELECT fammarine_id FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date) l ON l.fammarine_id = marine_archive.fammarine_id ";
206
-				if ($usecoord) $query .= "AND marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." ";
207
-				if ($id != '') $query .= "OR marine_archive.fammarine_id = :id ";
223
+				if ($usecoord) {
224
+					$query .= "AND marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." ";
225
+				}
226
+				if ($id != '') {
227
+					$query .= "OR marine_archive.fammarine_id = :id ";
228
+				}
208 229
 				$query .= "UNION
209 230
 				    SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
210 231
 				    FROM marine_live".$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date";
211
-				if ($usecoord) $query .= " AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong;
212
-				if ($id != '') $query .= "OR marine_live.fammarine_id = :id ";
232
+				if ($usecoord) {
233
+					$query .= " AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong;
234
+				}
235
+				if ($id != '') {
236
+					$query .= "OR marine_live.fammarine_id = :id ";
237
+				}
213 238
 				$query .= ") AS marine 
214 239
 				    WHERE latitude <> '0' AND longitude <> '0' 
215 240
 				    ORDER BY fammarine_id, date";
216
-				if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit;
241
+				if ($limit) {
242
+					$query .= " LIMIT ".$globalMap3DMarinesLimit;
243
+				}
217 244
 			} else {
218 245
 				$query  = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
219 246
 				    FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date ";
220
-				if ($usecoord) $query .= "AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." ";
221
-				if ($id != '') $query .= "OR marine_live.fammarine_id = :id ";
247
+				if ($usecoord) {
248
+					$query .= "AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." ";
249
+				}
250
+				if ($id != '') {
251
+					$query .= "OR marine_live.fammarine_id = :id ";
252
+				}
222 253
 				$query .= "AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' 
223 254
 				ORDER BY marine_live.fammarine_id, marine_live.date";
224
-				if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit;
255
+				if ($limit) {
256
+					$query .= " LIMIT ".$globalMap3DMarinesLimit;
257
+				}
225 258
 			}
226 259
 		} else {
227 260
 			if (isset($globalArchive) && $globalArchive === TRUE) {
228 261
 				$query  = "SELECT * FROM (SELECT marine_archive.ident, marine_archive.fammarine_id, marine_archive.type_id, marine_archive.type,marine_archive.latitude, marine_archive.longitude, marine_archive.heading, marine_archive.ground_speed, marine_archive.date, marine_archive.format_source, marine_archive.captain_name 
229 262
 				    FROM marine_archive INNER JOIN (SELECT fammarine_id FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date) l ON l.fammarine_id = marine_archive.fammarine_id ";
230
-				if ($usecoord) $query .= "AND (marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") ";
231
-				if ($id != '') $query .= "OR marine_archive.fammarine_id = :id ";
263
+				if ($usecoord) {
264
+					$query .= "AND (marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") ";
265
+				}
266
+				if ($id != '') {
267
+					$query .= "OR marine_archive.fammarine_id = :id ";
268
+				}
232 269
 				$query .= "UNION
233 270
 				    SELECT marine_live.ident, marine_live.fammarine_id, marine_live.type_id, marine_live.type,marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
234 271
 				    FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date";
235
-				if ($usecoord) $query .= " AND (marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")";
236
-				if ($id != '') $query .= " OR marine_live.fammarine_id = :id";
272
+				if ($usecoord) {
273
+					$query .= " AND (marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")";
274
+				}
275
+				if ($id != '') {
276
+					$query .= " OR marine_live.fammarine_id = :id";
277
+				}
237 278
 				$query .= ") AS marine WHERE latitude <> '0' AND longitude <> '0' ";
238 279
 				$query .= "ORDER BY fammarine_id, date";
239
-				if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit;
280
+				if ($limit) {
281
+					$query .= " LIMIT ".$globalMap3DMarinesLimit;
282
+				}
240 283
 			} else {
241 284
 				$query  = "SELECT marine_live.ident, marine_live.fammarine_id, marine_live.type_id, marine_live.type,marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
242 285
 				    FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date ";
243
-				if ($usecoord) $query .= "AND (marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") ";
244
-				if ($id != '') $query .= "OR marine_live.fammarine_id = :id ";
286
+				if ($usecoord) {
287
+					$query .= "AND (marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") ";
288
+				}
289
+				if ($id != '') {
290
+					$query .= "OR marine_live.fammarine_id = :id ";
291
+				}
245 292
 				$query .= "AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' 
246 293
 				ORDER BY marine_live.fammarine_id, marine_live.date";
247
-				if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit;
294
+				if ($limit) {
295
+					$query .= " LIMIT ".$globalMap3DMarinesLimit;
296
+				}
248 297
 			}
249 298
 		}
250 299
 		$query_values = array();
251
-		if ($id != '') $query_values = array(':id' => $id);
300
+		if ($id != '') {
301
+			$query_values = array(':id' => $id);
302
+		}
252 303
 		try {
253 304
 			$sth = $this->db->prepare($query);
254 305
 			$sth->execute($query_values);
@@ -271,7 +322,9 @@  discard block
 block discarded – undo
271 322
 		global $globalDBdriver, $globalLiveInterval;
272 323
 		$filter_query = $this->getFilter($filter,true,true);
273 324
 
274
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
325
+		if (!isset($globalLiveInterval)) {
326
+			$globalLiveInterval = '200';
327
+		}
275 328
 		if ($globalDBdriver == 'mysql') {
276 329
 			$query = 'SELECT COUNT(DISTINCT marine_live.fammarine_id) as nb FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
277 330
 		} else {
@@ -299,7 +352,9 @@  discard block
 block discarded – undo
299 352
 	{
300 353
 		global $globalDBdriver, $globalLiveInterval;
301 354
 		$Marine = new Marine($this->db);
302
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
355
+		if (!isset($globalLiveInterval)) {
356
+			$globalLiveInterval = '200';
357
+		}
303 358
 		$filter_query = $this->getFilter($filter);
304 359
 
305 360
 		if (is_array($coord)) {
@@ -307,7 +362,9 @@  discard block
 block discarded – undo
307 362
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
308 363
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
309 364
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
310
-		} else return array();
365
+		} else {
366
+			return array();
367
+		}
311 368
 		if ($globalDBdriver == 'mysql') {
312 369
 			$query  = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate AND marine_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND marine_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY marine_live.fammarine_id ORDER BY date DESC'.$filter_query;
313 370
 		} else {
@@ -327,7 +384,9 @@  discard block
 block discarded – undo
327 384
 	{
328 385
 		global $globalDBdriver, $globalLiveInterval, $globalArchive;
329 386
 		$Marine = new Marine($this->db);
330
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
387
+		if (!isset($globalLiveInterval)) {
388
+			$globalLiveInterval = '200';
389
+		}
331 390
 		$filter_query = $this->getFilter($filter,true,true);
332 391
 
333 392
 		if (is_array($coord)) {
@@ -335,7 +394,9 @@  discard block
 block discarded – undo
335 394
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
336 395
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
337 396
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
338
-		} else return array();
397
+		} else {
398
+			return array();
399
+		}
339 400
 		/*
340 401
 		if ($globalDBdriver == 'mysql') {
341 402
 			$query  = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source 
@@ -558,11 +619,15 @@  discard block
 block discarded – undo
558 619
 		//$query  = self::$global_query.' WHERE marine_live.fammarine_id = :id ORDER BY date';
559 620
 		if ($globalDBdriver == 'mysql') {
560 621
 			$query = 'SELECT marine_live.* FROM marine_live WHERE marine_live.fammarine_id = :id';
561
-			if ($liveinterval) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
622
+			if ($liveinterval) {
623
+				$query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
624
+			}
562 625
 			$query .= ' ORDER BY date';
563 626
 		} else {
564 627
 			$query = 'SELECT marine_live.* FROM marine_live WHERE marine_live.fammarine_id = :id';
565
-			if ($liveinterval) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date";
628
+			if ($liveinterval) {
629
+				$query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date";
630
+			}
566 631
 			$query .= ' ORDER BY date';
567 632
 		}
568 633
 
@@ -657,7 +722,9 @@  discard block
 block discarded – undo
657 722
 				$i++;
658 723
 				$j++;
659 724
 				if ($j == 30) {
660
-					if ($globalDebug) echo ".";
725
+					if ($globalDebug) {
726
+						echo ".";
727
+					}
661 728
 				    	try {
662 729
 						
663 730
 						$sth = $this->db->prepare(substr($query_delete,0,-1).")");
@@ -951,7 +1018,9 @@  discard block
 block discarded – undo
951 1018
 			{
952 1019
 				return false;
953 1020
 			}
954
-		} else return '';
1021
+		} else {
1022
+			return '';
1023
+		}
955 1024
 
956 1025
 		if ($longitude != '')
957 1026
 		{
@@ -959,7 +1028,9 @@  discard block
 block discarded – undo
959 1028
 			{
960 1029
 				return false;
961 1030
 			}
962
-		} else return '';
1031
+		} else {
1032
+			return '';
1033
+		}
963 1034
 
964 1035
 
965 1036
 		if ($heading != '')
@@ -968,7 +1039,9 @@  discard block
 block discarded – undo
968 1039
 			{
969 1040
 				return false;
970 1041
 			}
971
-		} else $heading = 0;
1042
+		} else {
1043
+			$heading = 0;
1044
+		}
972 1045
 
973 1046
 		if ($groundspeed != '')
974 1047
 		{
@@ -976,9 +1049,13 @@  discard block
 block discarded – undo
976 1049
 			{
977 1050
 				return false;
978 1051
 			}
979
-		} else $groundspeed = 0;
1052
+		} else {
1053
+			$groundspeed = 0;
1054
+		}
980 1055
 		date_default_timezone_set('UTC');
981
-		if ($date == '') $date = date("Y-m-d H:i:s", time());
1056
+		if ($date == '') {
1057
+			$date = date("Y-m-d H:i:s", time());
1058
+		}
982 1059
 
983 1060
         
984 1061
 		$fammarine_id = filter_var($fammarine_id,FILTER_SANITIZE_STRING);
@@ -1003,15 +1080,27 @@  discard block
 block discarded – undo
1003 1080
 		$captain_name = filter_var($captain_name,FILTER_SANITIZE_STRING);
1004 1081
 		$race_id = filter_var($race_id,FILTER_SANITIZE_STRING);
1005 1082
 		$race_name = filter_var($race_name,FILTER_SANITIZE_STRING);
1006
-		if ($typeid == '') $typeid = NULL;
1007
-		if ($statusid == '') $statusid = NULL;
1083
+		if ($typeid == '') {
1084
+			$typeid = NULL;
1085
+		}
1086
+		if ($statusid == '') {
1087
+			$statusid = NULL;
1088
+		}
1008 1089
 
1009
-            	if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0;
1010
-            	if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0;
1011
-            	if ($arrival_date == '') $arrival_date = NULL;
1090
+            	if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) {
1091
+            		$groundspeed = 0;
1092
+            	}
1093
+            	if ($heading == '' || $Common->isInteger($heading) === false ) {
1094
+            		$heading = 0;
1095
+            	}
1096
+            	if ($arrival_date == '') {
1097
+            		$arrival_date = NULL;
1098
+            	}
1012 1099
             	$query = '';
1013 1100
 		if ($globalArchive) {
1014
-			if ($globalDebug) echo '-- Delete previous data -- ';
1101
+			if ($globalDebug) {
1102
+				echo '-- Delete previous data -- ';
1103
+			}
1015 1104
 			$query .= 'DELETE FROM marine_live WHERE fammarine_id = :fammarine_id;';
1016 1105
 		}
1017 1106
 		$query .= 'INSERT INTO marine_live (fammarine_id, ident, latitude, longitude, heading, ground_speed, date, format_source, source_name, over_country, mmsi, type,type_id,status,status_id,imo,arrival_port_name,arrival_port_date,captain_id,captain_name,race_id,race_name) 
@@ -1026,10 +1115,14 @@  discard block
 block discarded – undo
1026 1115
 		}
1027 1116
 		
1028 1117
 		if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) {
1029
-			if ($globalDebug) echo '(Add to Marine archive : ';
1118
+			if ($globalDebug) {
1119
+				echo '(Add to Marine archive : ';
1120
+			}
1030 1121
 			$MarineArchive = new MarineArchive($this->db);
1031 1122
 			$result =  $MarineArchive->addMarineArchiveData($fammarine_id, $ident, $latitude, $longitude, $heading, $groundspeed, $date, $putinarchive, $mmsi,$type,$typeid,$imo, $callsign,$arrival_code,$arrival_date,$status,$statusid,$noarchive,$format_source, $source_name, $over_country,$captain_id,$captain_name,$race_id,$race_name);
1032
-			if ($globalDebug) echo $result.')';
1123
+			if ($globalDebug) {
1124
+				echo $result.')';
1125
+			}
1033 1126
 		}
1034 1127
 		return "success";
1035 1128
 	}
Please login to merge, or discard this patch.
index.php 1 patch
Braces   +558 added lines, -141 removed lines patch added patch discarded remove patch
@@ -52,7 +52,10 @@  discard block
 block discarded – undo
52 52
 <?php
53 53
     if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
54 54
 ?>
55
-<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script>
55
+<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) {
56
+	print '?tsk='.$tsk;
57
+}
58
+?>"></script>
56 59
 <?php
57 60
 	if (!isset($globalAircraft) || $globalAircraft) {
58 61
 ?>
@@ -142,7 +145,10 @@  discard block
 block discarded – undo
142 145
 ?>
143 146
 			<h1>Weather</h1>
144 147
 			<ul>
145
-				<li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) print 'checked'; ?> ><?php echo _("Display weather on 3D map"); ?></label></div></li>
148
+				<li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) {
149
+	print 'checked';
150
+}
151
+?> ><?php echo _("Display weather on 3D map"); ?></label></div></li>
146 152
 			</ul>
147 153
 <?php
148 154
 	}
@@ -159,13 +165,22 @@  discard block
 block discarded – undo
159 165
 <?php
160 166
 		if (!isset($globalAircraft) || $globalAircraft) {
161 167
 ?>
162
-				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?></label></div></li>
163
-				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?></label></div></li>
168
+				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') {
169
+	print 'checked';
170
+}
171
+?> /><?php echo _("Display waypoints"); ?></label></div></li>
172
+				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') {
173
+	print 'checked';
174
+}
175
+?> /><?php echo _("Display airspace"); ?></label></div></li>
164 176
 <?php
165 177
 		}
166 178
 		if (isset($globalMarine) && $globalMarine) {
167 179
 ?>
168
-				<li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="loadOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') print 'checked'; ?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li>
180
+				<li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="loadOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') {
181
+	print 'checked';
182
+}
183
+?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li>
169 184
 <?php
170 185
 		}
171 186
 ?>
@@ -179,8 +194,14 @@  discard block
 block discarded – undo
179 194
 <?php
180 195
 		if (!isset($globalAircraft) || $globalAircraft) {
181 196
 ?>
182
-				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li>
183
-				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?> Beta</label></div></li>
197
+				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') {
198
+	print 'checked';
199
+}
200
+?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li>
201
+				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') {
202
+	print 'checked';
203
+}
204
+?> /><?php echo _("Display airspace"); ?> Beta</label></div></li>
184 205
 <?php
185 206
 		}
186 207
 ?>
@@ -194,14 +215,32 @@  discard block
 block discarded – undo
194 215
 		<h1>NOTAM</h1>
195 216
 		<form>
196 217
 			<ul>
197
-				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') print 'checked'; ?> /><?php echo _("Display NOTAM"); ?></label></div></li>
218
+				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') {
219
+	print 'checked';
220
+}
221
+?> /><?php echo _("Display NOTAM"); ?></label></div></li>
198 222
 				<li><?php echo _("NOTAM scope:"); ?>
199 223
 					<select class="selectpicker" onchange="notamscope(this);">
200
-						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>
201
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>
202
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>
203
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>
204
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>
224
+						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') {
225
+	print ' selected';
226
+}
227
+?>>All</option>
228
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') {
229
+	print ' selected';
230
+}
231
+?>>Airport/Enroute warning</option>
232
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') {
233
+	print ' selected';
234
+}
235
+?>>Airport warning</option>
236
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') {
237
+	print ' selected';
238
+}
239
+?>>Navigation warning</option>
240
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') {
241
+	print ' selected';
242
+}
243
+?>>Enroute warning</option>
205 244
 					</select
206 245
 				</li>
207 246
 			</ul>
@@ -229,7 +268,10 @@  discard block
 block discarded – undo
229 268
 		    <div class="form-group">
230 269
 			<label><?php echo _("From:"); ?></label>
231 270
 			<div class='input-group date' id='datetimepicker1'>
232
-			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC'; ?>" required />
271
+			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') {
272
+	print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC';
273
+}
274
+?>" required />
233 275
 			    <span class="input-group-addon">
234 276
 				<span class="glyphicon glyphicon-calendar"></span>
235 277
 			    </span>
@@ -238,7 +280,10 @@  discard block
 block discarded – undo
238 280
 		    <div class="form-group">
239 281
 			<label><?php echo _("To:"); ?></label>
240 282
 			<div class='input-group date' id='datetimepicker2'>
241
-			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC'; ?>" />
283
+			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') {
284
+	print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC';
285
+}
286
+?>" />
242 287
 			    <span class="input-group-addon">
243 288
 				<span class="glyphicon glyphicon-calendar"></span>
244 289
 			    </span>
@@ -270,8 +315,20 @@  discard block
 block discarded – undo
270 315
 		    </script>
271 316
 		<li><?php echo _("Playback speed:"); ?>
272 317
 		    <div class="range">
273
-			<input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>">
274
-			<output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>
318
+			<input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) {
319
+	print $_POST['archivespeed'];
320
+} elseif (isset($_COOKIE['archive_speed'])) {
321
+	print $_COOKIE['archive_speed'];
322
+} else {
323
+	print '1';
324
+}
325
+?>">
326
+			<output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) {
327
+	print $_COOKIE['archive_speed'];
328
+} else {
329
+	print '1';
330
+}
331
+?></output>
275 332
 		    </div>
276 333
 		</li>
277 334
 		<?php
@@ -300,14 +357,20 @@  discard block
 block discarded – undo
300 357
 		    <li><?php echo _("Type of Map:"); ?>
301 358
 			    <?php
302 359
 				if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
303
-					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
304
-					else $MapType = $_COOKIE['MapType'];
360
+					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') {
361
+						$MapType = $globalMapProvider;
362
+					} else {
363
+						$MapType = $_COOKIE['MapType'];
364
+					}
305 365
 			    ?>
306 366
 			<select  class="selectpicker" onchange="mapType(this);">
307 367
 			    <?php
308 368
 				} else {
309
-					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') $MapType = $globalMapProvider;
310
-					else $MapType = $_COOKIE['MapType3D'];
369
+					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') {
370
+						$MapType = $globalMapProvider;
371
+					} else {
372
+						$MapType = $_COOKIE['MapType3D'];
373
+					}
311 374
 			    ?>
312 375
 			<select  class="selectpicker" onchange="mapType3D(this);">
313 376
 			    <?php
@@ -316,24 +379,48 @@  discard block
 block discarded – undo
316 379
 			    <?php
317 380
 				if (isset($globalMapOffline) && $globalMapOffline === TRUE) {
318 381
 			    ?>
319
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
382
+			    <option value="offline"<?php if ($MapType == 'offline') {
383
+	print ' selected';
384
+}
385
+?>>Natural Earth (local)</option>
320 386
 			    <?php
321 387
 				} else {
322 388
 				    if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) {
323 389
 			    ?>
324
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
390
+			    <option value="offline"<?php if ($MapType == 'offline') {
391
+	print ' selected';
392
+}
393
+?>>Natural Earth (local)</option>
325 394
 			    <?php
326 395
 				    }
327 396
 			    ?>
328
-			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option>
329
-			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option>
330
-			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') print ' selected'; ?>>ArcGIS Ocean</option>
397
+			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') {
398
+	print ' selected';
399
+}
400
+?>>ArcGIS Streetmap</option>
401
+			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') {
402
+	print ' selected';
403
+}
404
+?>>ArcGIS Satellite</option>
405
+			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') {
406
+	print ' selected';
407
+}
408
+?>>ArcGIS Ocean</option>
331 409
 			    <?php
332 410
 				    if (isset($globalBingMapKey) && $globalBingMapKey != '') {
333 411
 			    ?>
334
-			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
335
-			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
336
-			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
412
+			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') {
413
+	print ' selected';
414
+}
415
+?>>Bing-Aerial</option>
416
+			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') {
417
+	print ' selected';
418
+}
419
+?>>Bing-Hybrid</option>
420
+			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') {
421
+	print ' selected';
422
+}
423
+?>>Bing-Road</option>
337 424
 			    <?php
338 425
 				    }
339 426
 			    ?>
@@ -343,60 +430,147 @@  discard block
 block discarded – undo
343 430
 			    <?php
344 431
 					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
345 432
 			    ?>
346
-			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
347
-			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
348
-			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
433
+			    <option value="Here-Aerial"<?php if ($MapType == 'Here') {
434
+	print ' selected';
435
+}
436
+?>>Here-Aerial</option>
437
+			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') {
438
+	print ' selected';
439
+}
440
+?>>Here-Hybrid</option>
441
+			    <option value="Here-Road"<?php if ($MapType == 'Here') {
442
+	print ' selected';
443
+}
444
+?>>Here-Road</option>
349 445
 			    <?php
350 446
 					}
351 447
 			    ?>
352 448
 			    <?php
353 449
 					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
354 450
 			    ?>
355
-			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
356
-			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
357
-			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
358
-			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
451
+			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') {
452
+	print ' selected';
453
+}
454
+?>>Google Roadmap</option>
455
+			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') {
456
+	print ' selected';
457
+}
458
+?>>Google Satellite</option>
459
+			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') {
460
+	print ' selected';
461
+}
462
+?>>Google Hybrid</option>
463
+			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') {
464
+	print ' selected';
465
+}
466
+?>>Google Terrain</option>
359 467
 			    <?php
360 468
 					}
361 469
 			    ?>
362 470
 			    <?php
363 471
 					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
364 472
 			    ?>
365
-			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
366
-			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
367
-			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
473
+			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') {
474
+	print ' selected';
475
+}
476
+?>>MapQuest-OSM</option>
477
+			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') {
478
+	print ' selected';
479
+}
480
+?>>MapQuest-Aerial</option>
481
+			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') {
482
+	print ' selected';
483
+}
484
+?>>MapQuest-Hybrid</option>
368 485
 			    <?php
369 486
 					}
370 487
 			    ?>
371
-			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
372
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option>
488
+			    <option value="Yandex"<?php if ($MapType == 'Yandex') {
489
+	print ' selected';
490
+}
491
+?>>Yandex</option>
492
+			    <option value="offline"<?php if ($MapType == 'offline') {
493
+	print ' selected';
494
+}
495
+?>>Natural Earth</option>
373 496
 			    <?php
374 497
 				    }
375 498
 			    ?>
376
-			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option>
499
+			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') {
500
+	print ' selected';
501
+}
502
+?>>National Geographic Street</option>
377 503
 			    <?php
378 504
 				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
379
-					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
380
-					else $MapBoxId = $_COOKIE['MapTypeId'];
505
+					if (!isset($_COOKIE['MapTypeId'])) {
506
+						$MapBoxId = 'default';
507
+					} else {
508
+						$MapBoxId = $_COOKIE['MapTypeId'];
509
+					}
381 510
 			    ?>
382
-			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option>
383
-			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
384
-			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
385
-			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
386
-			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>
387
-			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>
388
-			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>
389
-			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>
390
-			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>
391
-			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>
392
-			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>
393
-			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
394
-			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
511
+			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') {
512
+	print ' selected';
513
+}
514
+?>>Mapbox GL</option>
515
+			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') {
516
+	print ' selected';
517
+}
518
+?>>Mapbox default</option>
519
+			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') {
520
+	print ' selected';
521
+}
522
+?>>Mapbox streets</option>
523
+			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') {
524
+	print ' selected';
525
+}
526
+?>>Mapbox light</option>
527
+			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') {
528
+	print ' selected';
529
+}
530
+?>>Mapbox dark</option>
531
+			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') {
532
+	print ' selected';
533
+}
534
+?>>Mapbox satellite</option>
535
+			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') {
536
+	print ' selected';
537
+}
538
+?>>Mapbox streets-satellite</option>
539
+			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') {
540
+	print ' selected';
541
+}
542
+?>>Mapbox streets-basic</option>
543
+			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') {
544
+	print ' selected';
545
+}
546
+?>>Mapbox comic</option>
547
+			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') {
548
+	print ' selected';
549
+}
550
+?>>Mapbox outdoors</option>
551
+			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') {
552
+	print ' selected';
553
+}
554
+?>>Mapbox pencil</option>
555
+			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') {
556
+	print ' selected';
557
+}
558
+?>>Mapbox pirates</option>
559
+			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') {
560
+	print ' selected';
561
+}
562
+?>>Mapbox emerald</option>
395 563
 			    <?php
396 564
 				    }
397 565
 			    ?>
398
-			    <!--<option value="OpenSeaMap"<?php if ($MapType == 'OpenSeaMap') print ' selected'; ?>>OpenSeaMap</option>-->
399
-			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
566
+			    <!--<option value="OpenSeaMap"<?php if ($MapType == 'OpenSeaMap') {
567
+	print ' selected';
568
+}
569
+?>>OpenSeaMap</option>-->
570
+			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') {
571
+	print ' selected';
572
+}
573
+?>>OpenStreetMap</option>
400 574
 			    <?php
401 575
 				}
402 576
 			    ?>
@@ -407,10 +581,22 @@  discard block
 block discarded – undo
407 581
 ?>
408 582
 		    <li><?php echo _("Type of Terrain:"); ?>
409 583
 			<select  class="selectpicker" onchange="terrainType(this);">
410
-			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
411
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
412
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
413
-			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option>
584
+			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') {
585
+	print ' selected';
586
+}
587
+?>>stk terrain</option>
588
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') {
589
+	print ' selected';
590
+}
591
+?>>ellipsoid</option>
592
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') {
593
+	print ' selected';
594
+}
595
+?>>vr terrain</option>
596
+			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') {
597
+	print ' selected';
598
+}
599
+?>>ArticDEM</option>
414 600
 			</select>
415 601
 		    </li>
416 602
 <?php
@@ -420,59 +606,116 @@  discard block
 block discarded – undo
420 606
 <?php
421 607
     if (isset($globalMap3D) && $globalMap3D) {
422 608
 ?>
423
-		    <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') print 'checked'; ?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li>
609
+		    <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') {
610
+	print 'checked';
611
+}
612
+?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li>
424 613
 <?php
425 614
     }
426 615
 ?>
427 616
 <?php
428 617
     if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
429 618
 ?>
430
-		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
619
+		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') {
620
+	print 'checked';
621
+}
622
+?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
431 623
 
432 624
 <?php
433 625
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
434 626
 ?>
435
-		    <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>-->
436
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li>
437
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
438
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
439
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
627
+		    <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') {
628
+	print 'checked';
629
+}
630
+?> ><?php echo _("Display flight info as popup"); ?></label></div></li>-->
631
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) {
632
+	print 'checked';
633
+}
634
+?> ><?php echo _("Display flight path"); ?></label></div></li>
635
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) {
636
+	print 'checked';
637
+}
638
+?> ><?php echo _("Display flight route on click"); ?></label></div></li>
639
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) {
640
+	print 'checked';
641
+}
642
+?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
643
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) {
644
+	print 'checked';
645
+}
646
+?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
440 647
 <?php
441 648
 	} elseif (!isset($globalTracker) || $globalTracker === TRUE) {
442 649
 ?>
443
-		    <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) print 'checked'; ?> ><?php echo _("Enable map matching"); ?></label></div></li>
650
+		    <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) {
651
+	print 'checked';
652
+}
653
+?> ><?php echo _("Enable map matching"); ?></label></div></li>
444 654
 <?php
445 655
 	}
446 656
 	if (isset($globalSatellite) && $globalSatellite === TRUE) {
447 657
 ?>
448
-		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
658
+		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) {
659
+	print 'checked';
660
+}
661
+?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
449 662
 <?php
450 663
 	}
451 664
     }
452 665
 ?>
453
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
454
-		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li>
455
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li>
456
-		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li>
666
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) {
667
+	print 'checked';
668
+}
669
+?> ><?php echo _("Display airports on map"); ?></label></div></li>
670
+		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) {
671
+	print 'checked';
672
+}
673
+?> ><?php echo _("Display ground station on map"); ?></label></div></li>
674
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) {
675
+	print 'checked';
676
+}
677
+?> ><?php echo _("Display weather station on map"); ?></label></div></li>
678
+		    <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) {
679
+	print 'checked';
680
+}
681
+?> ><?php echo _("Display lightning on map"); ?></label></div></li>
457 682
 <?php
458 683
 	if (isset($globalFires)) {
459 684
 ?>
460
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) print 'checked'; ?> ><?php echo _("Display fires on map"); ?></label></div></li>
685
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) {
686
+	print 'checked';
687
+}
688
+?> ><?php echo _("Display fires on map"); ?></label></div></li>
461 689
 <?php
462 690
 	}
463 691
 	if (isset($globalMap3D) && $globalMap3D) {
464 692
 ?>
465
-		    <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') print 'checked'; ?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li>
693
+		    <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') {
694
+	print 'checked';
695
+}
696
+?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li>
466 697
 <?php
467 698
 	}
468 699
 ?>
469 700
 <?php
470 701
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
471 702
 ?>
472
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
473
-		    <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) print 'checked'; ?> ><?php echo _("Use shadows"); ?></label></div></li>
474
-		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
475
-		    <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) print 'checked'; ?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li>
703
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) {
704
+	print 'checked';
705
+}
706
+?> ><?php echo _("Show mini-map"); ?></label></div></li>
707
+		    <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) {
708
+	print 'checked';
709
+}
710
+?> ><?php echo _("Use shadows"); ?></label></div></li>
711
+		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) {
712
+	print 'checked';
713
+}
714
+?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
715
+		    <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) {
716
+	print 'checked';
717
+}
718
+?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li>
476 719
 <?php
477 720
     }
478 721
     if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
@@ -485,17 +728,25 @@  discard block
 block discarded – undo
485 728
 			if (function_exists('array_column')) {
486 729
 			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
487 730
 		    ?>
488
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
731
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
732
+	print 'checked';
733
+}
734
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
489 735
 		    <?php
490 736
 			    }
491 737
 			} elseif (isset($globalSources)) {
492 738
 			    $dispolar = false;
493 739
 			    foreach ($globalSources as $testsource) {
494
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
740
+			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) {
741
+			        	$dispolar = true;
742
+			        }
495 743
 			    }
496 744
 			    if ($dispolar) {
497 745
 		    ?>
498
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
746
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
747
+	print 'checked';
748
+}
749
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
499 750
 		    <?php
500 751
 			    }
501 752
 		        }
@@ -508,11 +759,21 @@  discard block
 block discarded – undo
508 759
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
509 760
 		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
510 761
 		    ?>
511
-		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
762
+		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') {
763
+	print 'checked';
764
+}
765
+?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
512 766
 		    <?php 
513 767
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
514 768
 		    ?>
515
-			<li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"></li>
769
+			<li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
770
+	print $_COOKIE['IconColor'];
771
+} elseif (isset($globalAircraftIconColor)) {
772
+	print $globalAircraftIconColor;
773
+} else {
774
+	print '1a3151';
775
+}
776
+?>"></li>
516 777
 		    <?php
517 778
 				}
518 779
 			    }
@@ -523,7 +784,14 @@  discard block
 block discarded – undo
523 784
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
524 785
 		    ?>
525 786
 		    <li><?php echo _("Marine icon color:"); ?>
526
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">
787
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
788
+	print $_COOKIE['MarineIconColor'];
789
+} elseif (isset($globalMarineIconColor)) {
790
+	print $globalMarineIconColor;
791
+} else {
792
+	print '1a3151';
793
+}
794
+?>">
527 795
 		    </li>
528 796
 		    <?php
529 797
 			    }
@@ -534,7 +802,14 @@  discard block
 block discarded – undo
534 802
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
535 803
 		    ?>
536 804
 		    <li><?php echo _("Tracker icon color:"); ?>
537
-			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>">
805
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
806
+	print $_COOKIE['TrackerIconColor'];
807
+} elseif (isset($globalTrackerIconColor)) {
808
+	print $globalTrackerIconColor;
809
+} else {
810
+	print '1a3151';
811
+}
812
+?>">
538 813
 		    </li>
539 814
 		    <?php
540 815
 			    }
@@ -545,8 +820,22 @@  discard block
 block discarded – undo
545 820
 		    ?>
546 821
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
547 822
 			<div class="range">
548
-			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
549
-			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>
823
+			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) {
824
+	print $_COOKIE['AirportZoom'];
825
+} elseif (isset($globalAirportZoom)) {
826
+	print $globalAirportZoom;
827
+} else {
828
+	print '7';
829
+}
830
+?>">
831
+			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) {
832
+	print $_COOKIE['AirportZoom'];
833
+} elseif (isset($globalAirportZoom)) {
834
+	print $globalAirportZoom;
835
+} else {
836
+	print '7';
837
+}
838
+?></output>
550 839
 			</div>
551 840
 		    </li>
552 841
 		    <?php
@@ -557,17 +846,40 @@  discard block
 block discarded – undo
557 846
 ?>
558 847
 		    <li><?php echo _("Set scaling factor for rendering resolution:"); ?>
559 848
 			<div class="range">
560
-			    <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?>">
561
-			    <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?></output>
849
+			    <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) {
850
+	print $_COOKIE['resolutionScale'];
851
+} else {
852
+	print '1';
853
+}
854
+?>">
855
+			    <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) {
856
+	print $_COOKIE['resolutionScale'];
857
+} else {
858
+	print '1';
859
+}
860
+?></output>
562 861
 			</div>
563 862
 		    </li>
564 863
 <?php
565 864
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
566 865
 ?>
567
-		    <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') print 'checked'; ?> > <?php echo _("Use airlines liveries"); ?></li>
568
-		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> > <?php echo _("Force Aircraft color"); ?>&nbsp;
866
+		    <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') {
867
+	print 'checked';
868
+}
869
+?> > <?php echo _("Use airlines liveries"); ?></li>
870
+		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') {
871
+	print 'checked';
872
+}
873
+?> > <?php echo _("Force Aircraft color"); ?>&nbsp;
569 874
 		    <!--<li><?php echo _("Aircraft icon color:"); ?>-->
570
-			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>">
875
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
876
+	print $_COOKIE['IconColor'];
877
+} elseif (isset($globalAircraftIconColor)) {
878
+	print $globalAircraftIconColor;
879
+} else {
880
+	print 'ff0000';
881
+}
882
+?>">
571 883
 		    </li>
572 884
 <?php
573 885
 	}
@@ -575,9 +887,19 @@  discard block
 block discarded – undo
575 887
 <?php
576 888
 	if (isset($globalMarine) && $globalMarine === TRUE) {
577 889
 ?>
578
-		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?>&nbsp;
890
+		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') {
891
+	print 'checked';
892
+}
893
+?> ><?php echo _("Force Marine color"); ?>&nbsp;
579 894
 		    <!--<li><?php echo _("Marine icon color:"); ?>-->
580
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>">
895
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
896
+	print $_COOKIE['MarineIconColor'];
897
+} elseif (isset($globalMarineIconColor)) {
898
+	print $globalMarineIconColor;
899
+} else {
900
+	print 'ff0000';
901
+}
902
+?>">
581 903
 		    </li>
582 904
 <?php
583 905
 	}
@@ -585,9 +907,19 @@  discard block
 block discarded – undo
585 907
 <?php
586 908
 	if (isset($globalTracker) && $globalTracker === TRUE) {
587 909
 ?>
588
-		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Tracker color"); ?>&nbsp;
910
+		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') {
911
+	print 'checked';
912
+}
913
+?> ><?php echo _("Force Tracker color"); ?>&nbsp;
589 914
 		    <!--<li><?php echo _("Tracker icon color:"); ?>-->
590
-			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print 'ff0000'; ?>">
915
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
916
+	print $_COOKIE['TrackerIconColor'];
917
+} elseif (isset($globalTrackerIconColor)) {
918
+	print $globalTrackerIconColor;
919
+} else {
920
+	print 'ff0000';
921
+}
922
+?>">
591 923
 		    </li>
592 924
 <?php
593 925
 	}
@@ -595,22 +927,46 @@  discard block
 block discarded – undo
595 927
 ?>
596 928
 		    <li><?php echo _("Distance unit:"); ?>
597 929
 			<select class="selectpicker" onchange="unitdistance(this);">
598
-			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
599
-			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>
600
-			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>
930
+			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
931
+	echo ' selected';
932
+}
933
+?>>km</option>
934
+			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
935
+	echo ' selected';
936
+}
937
+?>>nm</option>
938
+			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
939
+	echo ' selected';
940
+}
941
+?>>mi</option>
601 942
 		        </select>
602 943
 		    </li>
603 944
 		    <li><?php echo _("Altitude unit:"); ?>
604 945
 			<select class="selectpicker" onchange="unitaltitude(this);">
605
-			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>
606
-			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>
946
+			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) {
947
+	echo ' selected';
948
+}
949
+?>>m</option>
950
+			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
951
+	echo ' selected';
952
+}
953
+?>>feet</option>
607 954
 		        </select>
608 955
 		    </li>
609 956
 		    <li><?php echo _("Speed unit:"); ?>
610 957
 			<select class="selectpicker" onchange="unitspeed(this);">
611
-			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option>
612
-			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>
613
-			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>
958
+			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) {
959
+	echo ' selected';
960
+}
961
+?>>km/h</option>
962
+			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
963
+	echo ' selected';
964
+}
965
+?>>mph</option>
966
+			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
967
+	echo ' selected';
968
+}
969
+?>>knots</option>
614 970
 		        </select>
615 971
 		    </li>
616 972
 
@@ -628,9 +984,18 @@  discard block
 block discarded – undo
628 984
 		    <?php
629 985
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
630 986
 		    ?>
631
-			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
632
-			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
633
-			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
987
+			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) {
988
+	print 'checked';
989
+}
990
+?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
991
+			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) {
992
+	print 'checked';
993
+}
994
+?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
995
+			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) {
996
+	print 'checked';
997
+}
998
+?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
634 999
 		    <?php
635 1000
 			}
636 1001
 		    ?>
@@ -638,10 +1003,16 @@  discard block
 block discarded – undo
638 1003
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
639 1004
 		    ?>
640 1005
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
641
-			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
1006
+			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) {
1007
+	print 'checked';
1008
+}
1009
+?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
642 1010
 			<?php } ?>
643 1011
 			<?php if (isset($globalAPRS) && $globalAPRS) { ?>
644
-			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li>
1012
+			    <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) {
1013
+	print 'checked';
1014
+}
1015
+?> ><?php echo _("Display APRS data"); ?></label></div></li>
645 1016
 			<?php } ?>
646 1017
 		    <?php
647 1018
 			}
@@ -658,7 +1029,9 @@  discard block
 block discarded – undo
658 1029
 				}
659 1030
 				foreach($allairlinenames as $airline) {
660 1031
 					$airline_name = $airline['airline_name'];
661
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
1032
+					if (strlen($airline_name) > 30) {
1033
+						$airline_name = substr($airline_name,0,30).'...';
1034
+					}
662 1035
 					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) {
663 1036
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
664 1037
 					} else {
@@ -676,7 +1049,10 @@  discard block
 block discarded – undo
676 1049
 		    <li><?php echo _("Display alliance:"); ?>
677 1050
 		    <br/>
678 1051
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
679
-			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
1052
+			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') {
1053
+	echo ' selected';
1054
+}
1055
+?>><?php echo _("All"); ?></option>
680 1056
 			    <?php
681 1057
 				foreach($allalliancenames as $alliance) {
682 1058
 					$alliance_name = $alliance['alliance'];
@@ -735,10 +1111,22 @@  discard block
 block discarded – undo
735 1111
 		    ?>
736 1112
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
737 1113
 			<select class="selectpicker" onchange="airlinestype(this);">
738
-			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
739
-			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option>
740
-			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option>
741
-			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option>
1114
+			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') {
1115
+	echo ' selected';
1116
+}
1117
+?>><?php echo _("All"); ?></option>
1118
+			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') {
1119
+	echo ' selected';
1120
+}
1121
+?>><?php echo _("Passenger"); ?></option>
1122
+			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') {
1123
+	echo ' selected';
1124
+}
1125
+?>><?php echo _("Cargo"); ?></option>
1126
+			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') {
1127
+	echo ' selected';
1128
+}
1129
+?>><?php echo _("Military"); ?></option>
742 1130
 			</select>
743 1131
 		    </li>
744 1132
 		    <?php
@@ -752,7 +1140,10 @@  discard block
 block discarded – undo
752 1140
 		    ?>
753 1141
 		    <li>
754 1142
 			<?php echo _("Display vessels with MMSI:"); ?>
755
-			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" />
1143
+			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) {
1144
+	print $_COOKIE['filter_mmsi'];
1145
+}
1146
+?>" />
756 1147
 		    </li>
757 1148
 			<?php
758 1149
 				if (isset($globalVM) && $globalVM) {
@@ -779,7 +1170,10 @@  discard block
 block discarded – undo
779 1170
 		    ?>
780 1171
 		    <li>
781 1172
 			<?php echo _("Display with ident:"); ?>
782
-			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
1173
+			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) {
1174
+	print $_COOKIE['filter_ident'];
1175
+}
1176
+?>" />
783 1177
 		    </li>
784 1178
 		</ul>
785 1179
 	    </form>
@@ -795,7 +1189,10 @@  discard block
 block discarded – undo
795 1189
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
796 1190
 	    <form>
797 1191
 		<ul>
798
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
1192
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) {
1193
+	print 'checked';
1194
+}
1195
+?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
799 1196
 		    <li><?php echo _("Type:"); ?>
800 1197
 			<select class="selectpicker" multiple onchange="sattypes(this);">
801 1198
 			    <?php
@@ -803,25 +1200,45 @@  discard block
 block discarded – undo
803 1200
 				$types = $Satellite->get_tle_types();
804 1201
 				foreach ($types as $type) {
805 1202
 					$type_name = $type['tle_type'];
806
-					if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';
807
-					else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';
808
-					else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';
809
-					else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';
810
-					else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';
811
-					else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';
812
-					else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';
813
-					else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';
814
-					else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';
815
-					else if ($type_name == 'resource') $type_name = 'Earth Resources';
816
-					else if ($type_name == 'stations') $type_name = 'Space Stations';
817
-					else if ($type_name == 'geo') $type_name = 'Geostationary';
818
-					else if ($type_name == 'amateur') $type_name = 'Amateur Radio';
819
-					else if ($type_name == 'x-comm') $type_name = 'Experimental';
820
-					else if ($type_name == 'other-comm') $type_name = 'Other Comm';
821
-					else if ($type_name == 'science') $type_name = 'Space & Earth Science';
822
-					else if ($type_name == 'military') $type_name = 'Miscellaneous Military';
823
-					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
824
-					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
1203
+					if ($type_name == 'musson') {
1204
+						$type_name = 'Russian LEO Navigation';
1205
+					} else if ($type_name == 'nnss') {
1206
+						$type_name = 'Navi Navigation Satellite System';
1207
+					} else if ($type_name == 'sbas') {
1208
+						$type_name = 'Satellite-Based Augmentation System';
1209
+					} else if ($type_name == 'glo-ops') {
1210
+						$type_name = 'Glonass Operational';
1211
+					} else if ($type_name == 'gps-ops') {
1212
+						$type_name = 'GPS Operational';
1213
+					} else if ($type_name == 'argos') {
1214
+						$type_name = 'ARGOS Data Collection System';
1215
+					} else if ($type_name == 'tdrss') {
1216
+						$type_name = 'Tracking and Data Relay Satellite System';
1217
+					} else if ($type_name == 'sarsat') {
1218
+						$type_name = 'Search & Rescue';
1219
+					} else if ($type_name == 'dmc') {
1220
+						$type_name = 'Disaster Monitoring';
1221
+					} else if ($type_name == 'resource') {
1222
+						$type_name = 'Earth Resources';
1223
+					} else if ($type_name == 'stations') {
1224
+						$type_name = 'Space Stations';
1225
+					} else if ($type_name == 'geo') {
1226
+						$type_name = 'Geostationary';
1227
+					} else if ($type_name == 'amateur') {
1228
+						$type_name = 'Amateur Radio';
1229
+					} else if ($type_name == 'x-comm') {
1230
+						$type_name = 'Experimental';
1231
+					} else if ($type_name == 'other-comm') {
1232
+						$type_name = 'Other Comm';
1233
+					} else if ($type_name == 'science') {
1234
+						$type_name = 'Space & Earth Science';
1235
+					} else if ($type_name == 'military') {
1236
+						$type_name = 'Miscellaneous Military';
1237
+					} else if ($type_name == 'radar') {
1238
+						$type_name = 'Radar Calibration';
1239
+					} else if ($type_name == 'tle-new') {
1240
+						$type_name = 'Last 30 days launches';
1241
+					}
825 1242
 					
826 1243
 					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
827 1244
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
Please login to merge, or discard this patch.