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