Completed
Push — master ( 9adbe5...64358c )
by Yannick
33:16
created

header.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
if (isset($globalProtect) && $globalProtect) {
3
	@session_start();
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
4
	$_SESSION['protect'] = 'protect';
5
}
6
//gets the page file and stores it in a variable
7
$file_path = pathinfo($_SERVER['SCRIPT_NAME']);
8
$current_page = $file_path['filename'];
9
if ($globalTimezone == '') $globalTimezone = 'UTC';
10
date_default_timezone_set($globalTimezone);
11
if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType'];
12
else $MapType = $globalMapProvider;
13
14
15
if (isset($_GET['3d'])) {
16
	setcookie('MapFormat','3d');
17
} else if (isset($_GET['2d'])) {
18
	setcookie('MapFormat','2d');
19
}
20
21
if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) {
22
	$tsk = filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL);
23
}
24
25
if (isset($_POST['archive'])) {
26
	setcookie('archive','true');
27
	setcookie('archive_begin',strtotime($_POST['start_date']));
28
	setcookie('archive_end',strtotime($_POST['end_date']));
29
	setcookie('archive_speed',$_POST['archivespeed']);
30
}
31
if (isset($_POST['noarchive'])) {
32
	setcookie('archive','false',-1);
33
	setcookie('archive_begin','',-1);
34
	setcookie('archive_end','',-1);
35
	setcookie('archive_speed','',-1);
36
}
37
// When button "Remove all filters" is clicked
38
if (isset($_POST['removefilters'])) {
39
	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
40
	    return strpos($key,'filter_') === 0;
41
	});
42
	foreach ($allfilters as $filt) {
43
		unset($_COOKIE[$filt]);
44
		setcookie($filt,null,-1);
45
	}
46
}
47
?>
48
<!DOCTYPE html>
49
<html>
50
<head>
51
<meta charset="UTF-8">
52
<meta http-equiv="X-UA-Compatible" content="IE=10" />
53
<title><?php print $title; ?> | <?php print $globalName; ?></title>
54
<meta name="keywords" content="<?php print $title; ?> spotter live flight tracking tracker map aircraft airline airport history database ads-b acars" />
55
<meta name="description" content="<?php print $title; ?> | <?php print $globalName; ?> use FlightAirMap to track flight" />
56
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
57
<link rel="shortcut icon" type="image/x-icon" href="<?php print $globalURL; ?>/favicon.ico">
58
<link rel="apple-touch-icon" href="<?php print $globalURL; ?>/images/touch-icon.png">
59
<!--[if lt IE 9]>
60
  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
61
  <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
62
<![endif]-->
63
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/js/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
64
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/jquery-ui.min.css" />
65
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/bootstrap-datetimepicker.min.css" />  
66
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/font-awesome-4.7.0/css/font-awesome.min.css" />
67
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/bootstrap-select.min.css" />
68
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/style.css" />
69
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/print.css" />
70
71
<script type="text/javascript" src="<?php print $globalURL; ?>/js/jquery-3.2.1.min.js"></script>
72
<script type="text/javascript" src="<?php print $globalURL; ?>/js/jquery-ui.min.js"></script>
73
74
<script type="text/javascript" src="<?php print $globalURL; ?>/js/moment.min.js"></script>
75
<script type="text/javascript" src="<?php print $globalURL; ?>/js/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
76
<script type="text/javascript" src="<?php print $globalURL; ?>/js/bootstrap-datetimepicker.min.js"></script>
77
<script type="text/javascript" src="<?php print $globalURL; ?>/js/bootstrap-select.min.js"></script>
78
<script type="text/javascript" src="<?php print $globalURL; ?>/js/script.js"></script>
79
80
<?php
81
if (strtolower($current_page) == "about")
82
{
83
?>
84
<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
85
<script src="<?php print $globalURL; ?>/js/leaflet.js"></script>
86
<?php
87
}
88
?>
89
<?php
90
if (strtolower($current_page) == "search")
91
{
92
?>
93
<script src="<?php print $globalURL; ?>/js/search.js"></script>
94
<?php
95
}
96
?>
97
<?php
98
if (strtolower($current_page) == "index")
99
{
100
?>
101
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/style-map.css?<?php print date("H"); ?>" />
102
<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
103
<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet-sidebar.css" />
104
<script src="<?php print $globalURL; ?>/js/leaflet.js"></script>
105
<script src="<?php print $globalURL; ?>/js/leaflet.textpath.js"></script>
106
<script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script>
107
<script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
108
<script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
109
<script src="<?php print $globalURL; ?>/js/jquery-sidebar.js"></script>
110
<script src="<?php print $globalURL; ?>/js/map.common.js"></script>
111
<?php 
112
	if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
113
?>
114
<?php 
115
	if (isset($globalOffline) && $globalOffline) {
116
?>
117
<link rel="stylesheet" href="<?php print $globalURL; ?>/js/Cesium/Widgets/widgets.css" />
118
<script src="<?php print $globalURL; ?>/js/Cesium/Cesium.js"></script>
119
<?php
120
	} else {
121
?>
122
<link rel="stylesheet" href="https://cesiumjs.org/releases/1.36/Build/Cesium/Widgets/widgets.css" />
123
<script src="https://cesiumjs.org/releases/1.36/Build/Cesium/Cesium.js"></script>
124
<?php
125
	}
126
?>
127
<link rel="stylesheet" href="<?php print $globalURL; ?>/css/cesium-minimap.css" />
128
<script src="<?php print $globalURL; ?>/js/cesium-minimap.js"></script>
129
<?php
130
	} else {
131
?>
132
<?php
133
		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
134
?>
135
<script src="https://maps.google.com/maps/api/js?v=3&key=<?php print $globalGoogleAPIKey; ?>"></script>
136
<script src="<?php print $globalURL; ?>/js/leaflet-Google.js"></script>
137
<?php
138
		}
139
?>
140
<?php
141
		if (isset($globalBingMapKey) && $globalBingMapKey != '') {
142
?>
143
<!--<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise"></script>-->
144
<script src="<?php print $globalURL; ?>/js/leaflet-Bing.js"></script>
145
<?php
146
		}
147
?>
148
<?php
149
		if (isset($globalMapQuestKey) && $globalMapQuestKey != '' && ($MapType == 'MapQuest-OSM' || $MapType == 'MapQuest-Hybrid' || $MapType == 'MapQuest-Aerial')) {
150
?>
151
<!--<script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=<?php print $globalMapQuestKey; ?>"></script>-->
152
<script src="https://open.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=<?php print $globalMapQuestKey; ?>"></script>
153
<?php
154
		}
155
?>
156
<?php
157
		if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
158
?>
159
<script src="<?php print $globalURL; ?>/js/leaflet-Here.js"></script>
160
<?php
161
		}
162
?>
163
<?php
164
		if ($MapType == 'Yandex') {
165
?>
166
<script src="https://api-maps.yandex.ru/2.0/?load=package.map&lang=en_US" type="text/javascript"></script>
167
<script src="<?php print $globalURL; ?>/js/leaflet-Yandex.js"></script>
168
<?php
169
		}
170
	}
171
?>
172
<?php 
173
    if (isset($_POST['archive'])) {
174
?>
175
<script src="<?php print $globalURL; ?>/js/map.common.js"></script>
176
<?php 
177
	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
178
?>
179
180
<script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script>
181
<?php    
182
	    }
183
    } else {
184
?>
185
<?php
186
/*	if (isset($globalBeta) && $globalBeta) {
187
?>
188
<script src="<?php print $globalURL; ?>/js/leaflet-realtime.js"></script>
189
<script src="<?php print $globalURL; ?>/js/map.new.js.php?<?php print time(); ?>"></script>
190
<?php
191
	} else {
192
*/
193
?>
194
<?php 
195
	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
196
?>
197
<?php
198
//		if (isset($globalBeta) && $globalBeta) {
199
?>
200
<script src="<?php print $globalURL; ?>/js/leaflet-playback.js"></script>
201
<?php
202
//		}
203
?>
204
<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) print '&tsk='.$tsk; ?>"></script>
205
<?php
206
		if (!isset($globalAircraft) || $globalAircraft) {
207
?>
208
<script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?<?php print time(); ?>"></script>
209
<?php
210
		}
211
		if (isset($globalTracker) && $globalTracker) {
212
?>
213
<script src="<?php print $globalURL; ?>/js/map-tracker.2d.js.php?<?php print time(); ?>"></script>
214
<?php
215
		}
216
		if (isset($globalMarine) && $globalMarine) {
217
?>
218
<script src="<?php print $globalURL; ?>/js/map-marine.2d.js.php?<?php print time(); ?>"></script>
219
<?php
220
		}
221
		if (isset($globalSatellite) && $globalSatellite) {
222
?>
223
<script src="<?php print $globalURL; ?>/js/map-satellite.2d.js.php?<?php print time(); ?>"></script>
224
<?php
225
		}
226
	    }
227
?>
228
<?php
229
//	}
230
?>
231
<?php
232
    }
233
}
234
?>
235
<?php
236
//if ((strtolower($current_page) == "ident-detailed" && isset($ident)) || strtolower($current_page) == "flightid-overview")
237
//if ((strtolower($current_page) == "ident-detailed" && isset($ident) && isset($globalArchive) && $globalArchive))
238
if ((strtolower($current_page) == "ident-detailed" && isset($ident) && isset($globalArchive) && $globalArchive))
239
{
240
?>
241
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/style-map.css?<?php print date("H"); ?>" />
242
<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
243
<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet-sidebar.css" />
244
<script src="<?php print $globalURL; ?>/js/leaflet.js"></script>
245
<script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script>
246
<script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
247
<script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
248
<script src="<?php print $globalURL; ?>/js/map.common.js"></script>
249
<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
250
<?php
251
		if (!isset($type) || $type == 'aircraft') {
252
?>
253
<script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?<?php print time(); ?>&ident=<?php print $ident; ?>"></script>
254
<?php
255
		} elseif (isset($type) && $type == 'marine') {
256
?>
257
<script src="<?php print $globalURL; ?>/js/map-marine.2d.js.php?<?php print time(); ?>&ident=<?php print $ident; ?>"></script>
258
<?php
259
		} elseif (isset($type) && $type == 'tracker') {
260
?>
261
<script src="<?php print $globalURL; ?>/js/map-tracker.2d.js.php?<?php print time(); ?>&ident=<?php print $ident; ?>"></script>
262
<?php
263
		} elseif (isset($type) && $type == 'satellite') {
264
?>
265
<script src="<?php print $globalURL; ?>/js/map-satellite.2d.js.php?<?php print time(); ?>&ident=<?php print $ident; ?>"></script>
266
<?php
267
		}
268
?>
269
<?php
270
		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
271
?>
272
<script src="https://maps.google.com/maps/api/js?v=3&key=<?php print $globalGoogleAPIKey; ?>"></script>
273
<script src="<?php print $globalURL; ?>/js/leaflet-Google.js"></script>
274
<?php
275
		}
276
?>
277
<?php
278
		if (isset($globalBingMapKey) && $globalBingMapKey != '') {
279
?>
280
<!--<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise"></script>-->
281
<script src="<?php print $globalURL; ?>/js/leaflet-Bing.js"></script>
282
<?php
283
		}
284
?>
285
<?php
286
		if (isset($globalMapQuestKey) && $globalMapQuestKey != '' && ($MapType == 'MapQuest-OSM' || $MapType == 'MapQuest-Hybrid' || $MapType == 'MapQuest-Aerial')) {
287
?>
288
<!--<script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=<?php print $globalMapQuestKey; ?>"></script>-->
289
<script src="https://open.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=<?php print $globalMapQuestKey; ?>"></script>
290
<?php
291
		}
292
?>
293
<?php
294
		if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
295
?>
296
<script src="<?php print $globalURL; ?>/js/leaflet-Here.js"></script>
297
<?php
298
		}
299
?>
300
<?php
301
		if ($MapType == 'Yandex') {
302
?>
303
<script src="http://api-maps.yandex.ru/2.0/?load=package.map&lang=en_US" type="text/javascript"></script>
304
<script src="<?php print $globalURL; ?>/js/leaflet-Yandex.js"></script>
305
<?php
306
		}
307
?>
308
<?php
309
}
310
311
if (strtolower($current_page) == "flightid-overview" && isset($globalArchive) && $globalArchive && isset($flightaware_id))
312
{
313
?>
314
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/style-map.css?<?php print date("H"); ?>" />
315
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
316
<link type="text/css" rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet-sidebar.css" />
317
<script src="<?php print $globalURL; ?>/js/leaflet.js"></script>
318
<script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script>
319
<script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
320
<script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
321
<script src="<?php print $globalURL; ?>/js/map.common.js"></script>
322
<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
323
<script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
324
<?php
325
		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
326
?>
327
<script src="https://maps.google.com/maps/api/js?v=3&key=<?php print $globalGoogleAPIKey; ?>"></script>
328
<script src="<?php print $globalURL; ?>/js/leaflet-Google.js"></script>
329
<?php
330
		}
331
?>
332
<?php
333
		if (isset($globalBingMapKey) && $globalBingMapKey != '') {
334
?>
335
<!--<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise"></script>-->
336
<script src="<?php print $globalURL; ?>/js/leaflet-Bing.js"></script>
337
<?php
338
		}
339
?>
340
<?php
341
		if (isset($globalMapQuestKey) && $globalMapQuestKey != '' && ($MapType == 'MapQuest-OSM' || $MapType == 'MapQuest-Hybrid' || $MapType == 'MapQuest-Aerial')) {
342
?>
343
<!--<script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=<?php print $globalMapQuestKey; ?>"></script>-->
344
<script src="https://open.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=<?php print $globalMapQuestKey; ?>"></script>
345
<?php
346
		}
347
?>
348
<?php
349
		if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
350
?>
351
<script src="<?php print $globalURL; ?>/js/leaflet-Here.js"></script>
352
<?php
353
		}
354
?>
355
<?php
356
		if ($MapType == 'Yandex') {
357
?>
358
<script src="http://api-maps.yandex.ru/2.0/?load=package.map&lang=en_US" type="text/javascript"></script>
359
<script src="<?php print $globalURL; ?>/js/leaflet-Yandex.js"></script>
360
<?php
361
		}
362
?>
363
<?php
364
}
365
?>
366
<?php
367
/*
368
if ($facebook_meta_image != "")
369
{
370
?>
371
<meta property="og:image" content="<?php print $facebook_meta_image; ?>"/>
372
<?php
373
} else {
374
?>
375
<meta property="og:image" content="<?php print $globalURL; ?>/images/touch-icon.png"/>
376
<?php
377
}
378
*/
379
?>
380
<?php
381
if (isset($globalCustomCSS) && $globalCustomCSS != '') {
382
?>
383
<link type="text/css" rel="stylesheet" href="<?php print $globalCustomCSS; ?>" />
384
<?php
385
}
386
?>
387
388
<meta property="og:title" content="<?php print $title; ?> | <?php print $globalName; ?>"/>
389
<meta property="og:url" content="<?php print $globalURL.$_SERVER['REQUEST_URI']; ?>"/>
390
<meta property="og:site_name" content="<?php print $globalName; ?>"/>
391
</head>
392
<body class="page-<?php print strtolower($current_page); ?>">
393
<div class="navbar navbar-fixed-top" role="navigation">
394
  <div class="container">
395
    <div class="navbar-header">
396
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
397
        <span class="sr-only">Toggle navigation</span>
398
        <span class="icon-bar"></span>
399
        <span class="icon-bar"></span>
400
        <span class="icon-bar"></span>
401
      </button>
402
      <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a>
403
      <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
404
    </div>
405
    <div class="collapse navbar-collapse">
406
407
      <ul class="nav navbar-nav">
408
<?php
409
    if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
410
?>
411
    <li><a href="<?php print $globalURL; ?>/news"><?php echo _("News"); ?></a></li>
412
<?php
413
    }
414
?>
415
416
<?php 
417
    $sub = false;
418
    if (
419
	(
420
	    (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
421
	) || 
422
	(
423
	    isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
424
	) || 
425
	(
426
	    isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
427
	) || 
428
	(
429
	    isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
430
	)
431
    ) {
432
	$sub = true;
433
    }
434
?>
435
<?php
436
    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
437
?>
438
    <li class="dropdown">
439
<?php
440
	if ($sub) {
441
?>
442
      	<li class="dropdown">
443
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Aircrafts"); ?> <b class="caret"></b></a>
444
	<ul class="dropdown-menu multi-level">
445
      	<li class="dropdown-submenu">
446
<?php
447
        }
448
?>
449
<?php
450
	if (isset($globalNewsFeeds['aircraft']) && !empty($globalNewsFeeds['aircraft'])) {
451
?>
452
    <a href="<?php print $globalURL; ?>/news-aircraft"><?php echo _("Aircrafts News"); ?></a></li>
453
    <li>
454
<?php
455
	}
456
?>
457
458
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
459
          <ul class="dropdown-menu">
460
          	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li>
461
<?php
462
    if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
463
?>
464
			<li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li>
465
<?php
466
    }
467
?>
468
			<li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li>
469
<?php
470
    if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
471
?>
472
			<li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li>
473
<?php
474
    } 
475
    if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
476
477
?>
478
			<li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li>
479
<?php
480
    }
481
?>
482
			<li><hr /></li>
483
            <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li>
484
            <li><a href="<?php print $globalURL; ?>/latest"><?php echo _("Latest Activity"); ?></a></li>
485
            <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
486
            <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li>
487
            <?php
488
        	if ($globalACARS) {
489
        	    if (isset($globalDemo) && $globalDemo) {
490
    	    ?>
491
            <li><hr /></li>
492
            <li><i><?php echo _('ACARS data not available publicly'); ?></i></li>
493
            <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li>
494
            <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li>
495
            <?php
496
        	    } else {
497
    	    ?>
498
            <li><hr /></li>
499
            <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li>
500
            <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li>
501
            <?php
502
        	    }
503
        	}
504
    	    ?>
505
    	    <?php
506
    	        if (isset($globalAccidents) && $globalAccidents) {
507
    	    ?>
508
            <li><hr /></li>
509
            <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li>
510
            <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li>
511
            <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li>
512
            <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li>
513
            <?php
514
        	}
515
    	    ?>
516
            <li><hr /></li>
517
            <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li>
518
            <?php
519
		if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) {
520
	    ?>
521
            <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li>
522
	    <?php
523
		}
524
	    ?>
525
          </ul>
526
        </li>
527
      	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
528
      	<li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li>
529
        <li class="dropdown<?php if ($sub) echo '-submenu'; ?>">
530
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
531
          <ul class="dropdown-menu">
532
          	<li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li>
533
          	<li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li>
534
          	<li><a href="<?php print $globalURL; ?>/tools/notam"><?php echo _("NOTAM translator"); ?></a></li>
535
<?php
536
	if (isset($globalGeoid) && $globalGeoid) {
537
?>
538
          	<li><a href="<?php print $globalURL; ?>/tools/geoid"><?php echo _("Geoid Height Calculator"); ?></a></li>
539
<?php
540
	}
541
?>
542
          </ul>
543
        </li>
544
<?php 
545
	if ($sub) {
546
?>
547
    </li>
548
    </ul>
549
<?php
550
	}
551
    }
552
?>
553
<?php
554
    if (isset($globalMarine) && $globalMarine) {
555
?>
556
    <li class="dropdown">
557
<?php
558
        if ($sub) {
559
?>
560
    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Marines"); ?> <b class="caret"></b></a>
561
	<ul class="dropdown-menu multi-level">
562
	    <li class="dropdown-submenu">
563
<?php
564
	}
565
?>
566
<?php
567
	if (isset($globalNewsFeeds['marine']) && !empty($globalNewsFeeds['marine'])) {
568
?>
569
    <a href="<?php print $globalURL; ?>/marine/news"><?php echo _("Marines News"); ?></a></li>
570
    <li>
571
<?php
572
	}
573
?>
574
		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
575
		<ul class="dropdown-menu">
576
		    <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li>
577
		    <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li>
578
		    <li><a href="<?php print $globalURL; ?>/marine/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
579
		</ul>
580
		<li><a href="<?php print $globalURL; ?>/marine/search"><?php echo _("Search"); ?></a></li>
581
		<li><a href="<?php print $globalURL; ?>/marine/statistics"><?php echo _("Statistics"); ?></a></li>
582
	    </li>
583
<?php
584
	if ($sub) {
585
?>
586
	</ul>
587
    </li>
588
<?php
589
	}
590
?>
591
<?php
592
    }
593
?>
594
<?php
595
    if (isset($globalTracker) && $globalTracker) {
596
?>
597
    <li class="dropdown">
598
<?php
599
        if ($sub) {
600
?>
601
    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a>
602
	<ul class="dropdown-menu multi-level">
603
	    <li class="dropdown-submenu">
604
<?php
605
	}
606
?>
607
<?php
608
	if (isset($globalNewsFeeds['tracker']) && !empty($globalNewsFeeds['tracker'])) {
609
?>
610
    <a href="<?php print $globalURL; ?>/tracker/news"><?php echo _("Trackers News"); ?></a></li>
611
    <li>
612
<?php
613
	}
614
?>
615
		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
616
		<ul class="dropdown-menu">
617
		    <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li>
618
		    <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li>
619
		    <li><a href="<?php print $globalURL; ?>/tracker/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
620
		</ul>
621
	    </li>
622
	    <li><a href="<?php print $globalURL; ?>/tracker/search"><?php echo _("Search"); ?></a></li>
623
	    <li><a href="<?php print $globalURL; ?>/tracker/statistics"><?php echo _("Statistics"); ?></a></li>
624
<?php
625
	if ($sub) {
626
?>
627
	</ul>
628
    </li>
629
<?php
630
	}
631
?>
632
<?php
633
    }
634
?>
635
<?php
636
    if (isset($globalSatellite) && $globalSatellite) {
637
?>
638
    <li class="dropdown">
639
<?php
640
        if ($sub) {
641
?>
642
    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellites"); ?> <b class="caret"></b></a>
643
	<ul class="dropdown-menu multi-level">
644
	    <li class="dropdown-submenu">
645
<?php
646
	}
647
?>
648
<?php
649
	if (isset($globalNewsFeeds['satellite']) && !empty($globalNewsFeeds['satellite'])) {
650
?>
651
    <a href="<?php print $globalURL; ?>/marine/news"><?php echo _("Satellites News"); ?></a></li>
652
    <li>
653
<?php
654
	}
655
?>
656
657
<!--
658
		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
659
		<ul class="dropdown-menu">
660
		    <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li>
661
		    <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li>
662
		    <li><a href="<?php print $globalURL; ?>/satellite/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
663
		</ul>
664
	    </li>
665
-->
666
	    <li><a href="<?php print $globalURL; ?>/satellite/statistics"><?php echo _("Statistics"); ?></a></li>
667
<?php
668
	if ($sub) {
669
?>
670
	</ul>
671
    </li>
672
<?php
673
	}
674
?>
675
<?php
676
    }
677
?>
678
679
        <li class="dropdown">
680
          <a href="<?php print $globalURL; ?>/about" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("About"); ?> <b class="caret"></b></a>
681
          <ul class="dropdown-menu">
682
          	<li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li>
683
          	<li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li>
684
<?php
685
    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
686
?>
687
		<li><hr /></li>
688
		<li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li>
689
<?php
690
    }
691
?>
692
	    <?php if (isset($globalContribute) && $globalContribute) { ?>
693
                <li><hr /></li>
694
                <li><a href="<?php print $globalURL; ?>/contribute"><?php echo _("Contribute"); ?></a></li>
695
                <li><hr /></li>
696
	    <?php } ?>
697
            <?php if ($globalName == 'FlightAirMap') { ?>
698
                <li><hr /></li>
699
        	<li><a href="https://github.com/Ysurac/FlightAirMap/issues" target="_blank"><?php echo _("Report any Issues"); ?></a></li>
700
            <?php } ?>
701
          </ul>
702
        </li>
703
      </ul>
704
<?php
705
	if (isset($globalTranslate) && $globalTranslate) {
706
?>
707
  	<div class="language">
708
  	    <form>
709
  		<select class="selectpicker" data-width="120px" onchange="language(this);">
710
  		    <?php
711
  		        $Language = new Language();
712
  		        $alllang = $Language->getLanguages();
713
  		        foreach ($alllang as $key => $lang) {
714
  		            print '<option value="'.$key.'"';
715
  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
716
  		            print '>'.$lang[0].'</option>';
717
  		        }
718
  		    ?>
719
  		</select>
720
  	    </form>
721
  	</div>
722
<?php
723
	}
724
?>
725
      <div class="search">
726
      <form action="<?php print $globalURL; ?>/search" method="get">
727
		<!--<input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != ""){ print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>-->
728
		<input type="text" name="callsign" value="<?php if (isset($GET['callsign'])) { if ($_GET['callsign'] != ""){ print $_GET['callsign']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>
729
	</form>
730
	</div>
731
  	<div class="social">
732
  		<!-- I'm not sociable -->
733
  	</div>
734
    </div><!--/.nav-collapse -->
735
  </div>
736
</div>
737
738
<?php
739
if (isset($top_header) && $top_header != "") 
740
{
741
	print '<div class="top-header container clear" role="main">';
742
		print '<img src="'.$globalURL.'/images/'.$top_header.'" alt="'.$title.'" title="'.$title.'" />';
743
	print '</div>';
744
}
745
746
if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') {
747
?>
748
    <div class="top-header clear" role="main">
749
<?php
750
    if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
751
?>
752
    <div id="archive-map"></div>
753
<?php
754
    }
755
?>
756
    </div>
757
<?php
758
}
759
if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false))
760
{
761
    ?>
762
    <div class="top-header clear" role="main">
763
        <div id="map"></div>
764
	<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
765
	<script src="<?php print $globalURL; ?>/js/leaflet.js"></script>
766
767
        <script>
768
        var map;
769
        var zoom = 13;
770
//create the map
771
<?php
772
    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
773
?>
774
  map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
775
<?php
776
    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
777
?>
778
  map = L.map('map', { zoomControl:true });
779
<?php
780
    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
781
?>
782
  map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
783
    var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map);
784
    map.fitBounds([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]);
785
    var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
786
    var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
787
<?php
788
    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
789
?>
790
  map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
791
<?php
792
    } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
793
?>
794
  map = L.map('map', { zoomControl:true });
795
<?php
796
    }
797
?>
798
  //initialize the layer group for the aircrft markers
799
  var layer_data = L.layerGroup();
800
801
  //a few title layers
802
<?php
803
    if ($globalMapProvider == 'Mapbox') {
804
?>
805
  L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
806
    maxZoom: 18,
807
    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
808
      '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
809
      'Imagery © <a href="http://mapbox.com">Mapbox</a>',
810
    id: '<?php print $globalMapboxId; ?>',
811
    token : '<?php print $globalMapboxToken; ?>'
812
  }).addTo(map);
813
<?php
814
    } elseif ($globalMapProvider == 'MapQuest-OSM') {
815
?>
816
  L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
817
    maxZoom: 18,
818
    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
819
      '<a href="http://www.openstreetmap.org/copyright">Open Database Licence</a>, ' +
820
      'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>'
821
  }).addTo(map);
822
<?php
823
    } elseif ($globalMapProvider == 'MapQuest-Aerial') {
824
?>
825
  L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
826
    maxZoom: 18,
827
    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
828
      '<a href="http://www.openstreetmap.org/copyright">Open Database Licence</a>, ' +
829
      'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"'
830
  }).addTo(map);
831
<?php
832
    } elseif ($globalMapProvider == 'Google-Roadmap') {
833
?>
834
    var googleLayer = new L.Google('ROADMAP');
835
    map.addLayer(googleLayer);
836
<?php
837
    } elseif ($globalMapProvider == 'Google-Satellite') {
838
?>
839
    var googleLayer = new L.Google('SATELLITE');
840
    map.addLayer(googleLayer);
841
<?php
842
    } elseif ($globalMapProvider == 'Google-Hybrid') {
843
?>
844
    var googleLayer = new L.Google('HYBRID');
845
    map.addLayer(googleLayer);
846
<?php
847
    } elseif ($globalMapProvider == 'Google-Terrain') {
848
?>
849
    var googleLayer = new L.Google('Terrain');
850
    map.addLayer(googleLayer);
851
<?php
852
    } elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
853
	$customid = $globalMapProvider;
854
?>
855
    L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
856
        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>,
857
        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
858
        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
859
        attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
860
    }).addTo(map);
861
<?php
862
    //} elseif ($globalMapProvider == 'OpenStreetMap') {
863
    } else {
864
?>
865
  L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
866
    maxZoom: 18,
867
    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
868
      '<a href="http://www.openstreetmap.org/copyright">Open Database Licence</a>'
869
  }).addTo(map);
870
871
<?php
872
    }
873
?>
874
        </script>
875
    </div>
876
    <?php
877
}
878
879
?>
880
881
<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear">
882