<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<!DOCTYPE html>
<!--[if IE 9]>
<html class="no-js lt-ie10" lang="en">
   <![endif]-->
   <!--[if gt IE 9]><!-->
   <html class="no-js" lang="en">
      <!--<![endif]-->
      <head>
         <meta charset="utf-8">
         <meta http-equiv="content-type" content="text/html; charset=utf-8" />
         <title>iCrew&trade; | <?php echo SITE_NAME ?></title>
         <meta name="description" content="iCrew v4 is a Responsive Pilot Center created by icrewsystems">
         <meta name="author" content="<?php echo SITE_NAME ?>">
         <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
         <!-- Icons -->
         <!-- The following icons can be replaced with your own, they are used by desktop and mobile browsers -->
         <!--<link rel="shortcut icon" href="https://www.jal.com/favicon.ico">-->
          <link rel="shortcut icon" href="<?php echo SITE_URL; ?>/iCrew/favicon.png">
         <link rel="apple-touch-icon" href="<?php echo SITE_URL?>/lib/skins/iCrew/img/icon57.png" sizes="57x57">
         <link rel="apple-touch-icon" href="<?php echo SITE_URL?>/lib/skins/iCrew/img/icon72.png" sizes="72x72">
         <link rel="apple-touch-icon" href="<?php echo SITE_URL?>/lib/skins/iCrew/img/icon76.png" sizes="76x76">
         <link rel="apple-touch-icon" href="<?php echo SITE_URL?>/lib/skins/iCrew/img/icon114.png" sizes="114x114">
         <link rel="apple-touch-icon" href="<?php echo SITE_URL?>/lib/skins/iCrew/img/icon120.png" sizes="120x120">
         <link rel="apple-touch-icon" href="<?php echo SITE_URL?>/lib/skins/iCrew/img/icon144.png" sizes="144x144">
         <link rel="apple-touch-icon" href="<?php echo SITE_URL?>/lib/skins/iCrew/img/icon152.png" sizes="152x152">
         <link rel="apple-touch-icon" href="<?php echo SITE_URL?>/lib/skins/iCrew/img/icon180.png" sizes="180x180">
         <!-- END Icons -->
         <!-- Stylesheets -->
         <!-- Bootstrap is included in its original form, unaltered -->
         <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/iCrew/css/bootstrap.min.css">
         <!-- Related styles of various icon packs and plugins -->
         <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/iCrew/css/plugins.css">
         <!-- Ranger slider CSS -->
         <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/iCrew/css/rangeslider.css">
         <!-- The main stylesheet of this template. All Bootstrap overwrites are defined in here -->
         <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/iCrew/css/main.css">
         <!-- Include a specific file here from css/themes/ folder to alter the default theme of the template -->
         <!-- The themes stylesheet of this template (for using specific theme color in individual elements - must included last) -->
         <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/iCrew/css/themes/modern.css">
         <style>
            	.navbar.navbar-inverse {
          			/* Changed the theme to give a gradient */
          			background-color: #152040;
          			background: -moz-linear-gradient(135deg, #137ba8 0%, #152040 100%);
          			background: -webkit-linear-gradient(135deg, #137ba8 0%, #152040 100%);
          			background: linear-gradient(135deg, #137ba8 0%, #152040 100%);
          			-webkit-box-shadow: 0px 5px 23px 0px rgba(0, 0, 0, 0.1);
          			-moz-box-shadow: 0px 5px 23px 0px rgba(0, 0, 0, 0.1);
          			box-shadow: 0px 5px 23px 0px rgba(0, 0, 0, 0.1);
          		}
         </style>
         <!-- END Stylesheets -->
         <!--The App_top's CSS code-->
         <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/iCrew/css/app_top.css">
         <!--App_top END-->
         <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/iCrew/css/snackbar.css">
         <link href="<?php echo SITE_URL; ?>/lib/skins/iCrew/css/hotsnackbar.css" rel="stylesheet">
         
         <?php
            Template::Show('core_htmlhead.php')
         ?>
         
         <!-- Morris Charts -->
         <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
         <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
         <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
         <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.bundle.js"></script>
         <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.js"></script>
         <script src="<?php echo SITE_URL?>/lib/skins/iCrew/js/jquery.growl.js" type="text/javascript"></script>
         <!-- Modernizr (browser feature detection library) -->
         <script type="text/javascript" src="<?php echo SITE_URL?>/lib/skins//iCrew/js/vendor/modernizr.min.js"></script>
         <script type="text/javascript" src="<?php echo SITE_URL; ?>/lib/skins/iCrew/js/hotsnackbar.js"></script>
         <script type="text/javascript" src="<?php echo fileurl('lib/js/simbrief.apiv1.js');?>"></script>
         
         <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/js/leaflet/leaflet.css" />
         <script type="text/javascript" src="<?php echo SITE_URL?>/lib/js/leaflet/leaflet.js"></script>
         <script type="text/javascript" src="<?php echo SITE_URL?>/lib/js/leaflet/leaflet-providers.js"></script>
         <script type="text/javascript" src="<?php echo SITE_URL?>/lib/js/leaflet/Leaflet.Geodesic.js"></script>
         
         <!-- AXIOS LIBRARY FOR API CALLS -->
         <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.0.0-alpha.1/axios.min.js" integrity="sha512-xIPqqrfvUAc/Cspuj7Bq0UtHNo/5qkdyngx6Vwt+tmbvTLDszzXM0G6c91LXmGrRx8KEPulT+AfOOez+TeVylg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
         <script src="//unpkg.com/alpinejs" defer></script>
      </head>
      
     
      <body>
         <!--Remove this to enable Inspect Element-->
         <?php echo $page_htmlreq; ?>
         <?php
            if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/login' || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/registration') {
            	if(Auth::LoggedIn()) {
            		Template::Show('app_top.php');
            	}
            }
            ?>
         <div id="content" class="">
            <?php echo $page_content; ?>
         </div>
         <?php
            if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/login' || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/registration') {
            	if(Auth::LoggedIn()) {
            		Template::Show('app_bottom.php');
            	}
            }
            ?>
         <div id="cookie_directive_container" class="container" style="display: none">
            <nav class="navbar navbar-default navbar-fixed-bottom">
               <div class="container">
                  <div class="navbar-inner navbar-content-center" id="cookie_accept">
                     <p class="text-muted">
                        <br>
                     <h4 class="text-muted">Ahoy, we need your attention here</h4>
                     To make sure we provide you the best pilot experience, we use cookies. By using our website <?php echo SITE_URL; ?> you are consenting to our use of cookies in accordance with our <a href="<?php echo SITE_URL; ?>/index.php/privacy">Privacy Policy</a>.
                     <a href="#" class="btn btn-default pull-right">Okay, Got it!</a>
                     </p>
                     <br>
                  </div>
               </div>
            </nav>
         </div>
         <!-- jQuery, Bootstrap.js, jQuery plugins and Custom JS code -->
         <script src="<?php echo SITE_URL?>/lib/skins/iCrew/js/vendor/bootstrap.min.js"></script>
         <script src="<?php echo SITE_URL?>/lib/skins/iCrew/js/plugins.js"></script>
         <script src="<?php echo SITE_URL?>/lib/skins/iCrew/js/app.js"></script>
         <script src="https://demo.pixelcave.com/proui/js/helpers/ckeditor/ckeditor.js"></script>
         <!--<script src="<?php echo SITE_URL?>/lib/skins/iCrew/js/mf/core/Core.js"></script>-->
         <script src="<?php echo SITE_URL?>/lib/skins/iCrew/js/jquery.countTo.js"></script>
         <!--App Top Click JS-->
         <script>
            function openNav() {
             		document.getElementById("myNav").style.height = "100%";
            }

            function closeNav() {
             		document.getElementById("myNav").style.height = "0%";
            }
         </script>
         <!--APP TOP END -->
         <!--UT CLOCK -->
         <script type="text/javascript">
            function GetClock(){
            var tzOffset = 0; //UTC +0

            var d=new Date();
            var dx=d.toGMTString();
            dx=dx.substr(0,dx.length -3);
            d.setTime(Date.parse(dx))
            d.setHours(d.getHours()+tzOffset);
            var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds();
            if(nmin<=9) nmin="0"+nmin
            if(nsec<=9) nsec="0"+nsec;

            document.getElementById('clockbox').innerHTML=""+nhour+":"+nmin+":"+nsec+" z";
            }

            GetClock();
            setInterval(GetClock,1000);
         </script>
         <!--UT CLOCK END -->
         <script>
            function snackbar() {
            	var x = document.getElementById("snackbar")
            	x.className = "show";
            	setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
            }
         </script>
         <script>
            jQuery(function($) {

            checkCookie_eu();

            function checkCookie_eu()
            {

                var consent = getCookie_eu("cookies_consent");

                if (consent == null || consent == "" || consent == undefined)
                {
                    // show notification bar
                    $('#cookie_directive_container').show();
                }

            }

            function setCookie_eu(c_name,value,exdays)
            {

                var exdate = new Date();
                exdate.setDate(exdate.getDate() + exdays);
                var c_value = escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
                document.cookie = c_name + "=" + c_value+"; path=/";

                $('#cookie_directive_container').hide('slow');
            }


            function getCookie_eu(c_name)
            {
                var i,x,y,ARRcookies=document.cookie.split(";");
                for (i=0;i<ARRcookies.length;i++)
                {
                    x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
                    y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
                    x=x.replace(/^\s+|\s+$/g,"");
                    if (x==c_name)
                    {
                        return unescape(y);
                    }
                }
            }

            $("#cookie_accept a").click(function(){
                setCookie_eu("cookies_consent", 1, 30);
            });

            });


         </script>
         <script>
            var rangeSlider = function(){
            var slider = $('.range-slider'),
              range = $('.range-slider__range'),
              value = $('.range-slider__value');

            slider.each(function(){

            value.each(function(){
              var value = $(this).prev().attr('value');
              $(this).html(value);
            });

            range.on('input', function(){
              $(this).next(value).html(this.value);
            });
            });
            };

            rangeSlider();
         </script>
         <script src="<?php echo SITE_URL?>/lib/skins/iCrew/js/pages/uiProgress.js" type="text/javascript"></script>
         <script>$(function(){ UiProgress.init(); });</script>
         <?php
            if(ENABLE_SNOWFALL_ON_DECEMBER == 1) {
              if(date("m") == '12') {
                ?>
                <script src="<?php echo SITE_URL; ?>/lib/skins/iCrew/js/snowfall.js"></script>
                <?php
              }
            }
          ?>

      </body>
    </html>
