<?php if($mloc == 'action') { $urlref = "actionurl"; ?>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL ?>/lib/skins/crystal/styles.css" />
<style>
.cc_hubadm_sidebar { position: fixed; min-height: 100% !important; } 
.cc_hubadm_content { margin-left: 230px; min-height: 100% !important; } 
</style>
<?php } else { $urlref = "url"; } ?>

<link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL?>/core/modules/HubOps/hubops.css" />
<script>var ccSITE_URL = "<?php echo SITE_URL ?>"; var ccmloc = "<?php echo $mloc ?>";
var baseurl="<?php echo SITE_URL;?>";
var geourl="<?php echo Config::Get('GEONAME_API_SERVER'); ?>";
var airport_lookup = "<?php echo Config::Get('AIRPORT_LOOKUP_SERVER'); ?>";
var phpvms_api_server = "<?php echo Config::Get('PHPVMS_API_SERVER'); ?>";
</script>
<!--<script type="text/javascript" src="<?php echo fileurl('lib/js/ckeditor/ckeditor.js'); ?>"></script>-->
<script src="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.js"></script>
<!--
Added by Leonard to overcome JS errors on textarea. 
Oct 21, 2021
-->
<script type="text/javascript" src="<?php echo SITE_URL?>/core/modules/HubOps/hubops.js"></script>

<div class="cc_hubadm_sidebar">
    <div class="cc_hubadm_sidetitle">Hub Administration</div>
    <div class="cc_hubadm_hubselform">
        <div class="cc_hubadm_t11">Selected Hub</div>
        <form method="post" action="<?php echo SITE_URL ?>/<?php echo $mloc ?>.php/HubOps/selecthub">
        <select name="hub"><?php echo $sidehublist ?></select>
        <input type="submit" value="Change Hub" />
    </form>
    </div>
    <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions)
            { ?>
    <a href="<?php echo $urlref('/HubOps/admin'); ?>" class="cc_hubadm_menulink">Hub Overview</a>
    <?php } ?>
    <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions->editstaff == '1')
            { ?>
    <a href="<?php echo $urlref('/HubOps/hubdetails'); ?>" class="cc_hubadm_menulink">Hub Details</a>
    <?php } ?>
    <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions->editstaff == '1')
            { ?>
    <a href="<?php echo $urlref('/HubOps/staffadmin'); ?>" class="cc_hubadm_menulink">Staff Admin</a>
    <?php if($actpage == 'staff') { ?>
    <a href="<?php echo $urlref('/HubOps/staffadmin'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">View Hub Managers</a>
    <a href="<?php echo $urlref('/HubOps/addstaff'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">Add new Staff Member</a>
    <?php } ?>
    <?php } ?>
    <a href="<?php echo $urlref('/HubOps/documents'); ?>" class="cc_hubadm_menulink">Staff Documents</a>
    <?php if($actpage == 'docs') { ?>
    <a href="<?php echo $urlref('/HubOps/documents'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">View Staff Documents</a>
     <?php } ?>
    <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions->editdocs)
            { ?>
    <?php if($actpage == 'docs') { ?>
    <a href="<?php echo $urlref('/HubOps/uploaddocs'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">Upload Document</a>
    <a href="<?php echo $urlref('/HubOps/writedoc'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">Write Document</a>
    <?php } ?>
    <?php } ?>
    <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions->editpages == '1')
            { ?>
    <a href="<?php echo $urlref('/HubOps/hubpage'); ?>" class="cc_hubadm_menulink">Info Page Customization</a>
        <?php } ?>
    <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions->editpilots == '1')
            { ?>
    <a href="<?php echo $urlref('/HubOps/pilots'); ?>" class="cc_hubadm_menulink">Pilot Administration <span class="pendpil"></span></a>
    <?php if($actpage == 'pilots') { ?>
        <a href="<?php echo $urlref('/HubOps/pilots'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">View Hub Pilots</a>
        <a href="<?php echo $urlref('/HubOps/pirepwarnings'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">PIREP Warnings <span class="pirwarn"></span></a>
        <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions->emailpilots == '1')
            { ?>
    <a href="<?php echo $urlref('/HubOps/emailpilots'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">Email Pilots</a>
        <?php } ?>
    <a href="<?php echo $urlref('/HubOps/issueawards'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">Issue Awards</a>
    <?php } ?>
    <?php } ?>
    <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions->editpireps == '1')
            { ?>
    <a href="<?php echo $urlref('/HubOps/pendingpireps'); ?>" class="cc_hubadm_menulink">PIREP Administration <span class="pendpir"></span></a>
        <?php if($actpage == 'pireps') { ?>
        <a href="<?php echo $urlref('/HubOps/pendingpireps'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">PIREPs Pending</a>
        <a href="<?php echo $urlref('/HubOps/viewpireps'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">View all PIREPs</a>
        <?php } ?>
    <?php } ?>
    <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $pilotpermissions->editschedules == '1')
            { ?>
    <a href="<?php echo $urlref('/HubOps/viewschedules'); ?>" class="cc_hubadm_menulink">Hub Schedules</a>
        <?php if($actpage == 'schedules') { ?>
        <a href="<?php echo $urlref('/HubOps/viewschedules'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">View Schedules</a>
        <a href="<?php echo $urlref('/HubOps/airports'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">View Airports</a>
        <a href="<?php echo $urlref('/HubOps/airportform'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">Add Airport</a>
        <a href="<?php echo $urlref('/HubOps/addflight'); ?>" class="cc_hubadm_menulink cc_hubadm_menulink_sub">Add new Schedules</a>
        <?php } ?>
        <?php } ?>

</div>
