<?php
/*
 * ************************************************
 * Copyright (C) 2020 Earworks.                    *
 * Codeigniter Project Template Modification       *
 * Please contact our email for more information : *
 * contact@earworks.co.id                          *
 * *************************************************
 */
defined('BASEPATH') OR exit('No direct script access allowed');
$title_img = '';
if (isset($title) && !empty($title)) {
    if ($title == 'Pendaftaran') {
        $title_img = '<img src="' . base_url('img/registrasi.png') . '" />';
    } elseif ($title == 'VERIFIKASI') {
        $title_img = '<img src="' . base_url('img/verifikasi.png') . '" />';
    } else {
        $title_img = $title;
    }
}
$should_be_base_url = (isset($sess['user']) && !empty($sess['user'])) ? 'dashboard' : '';
if (isset($location) && $location && $location != 'general') {
    $should_be_base_url .= '/' . $location;
}
?>
<header>
    <nav class="navbar navbar-default custom-navbar navbar-fixed-top">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <a class="img-logo" href="#">
                    <img src="<?= base_url('img/logo.png') ?>" class="img img-responsive visible-xs" /> <!-- white -->
                    <img src="<?= base_url('img/logo.png') ?>" class="img img-responsive img-default hidden-xs" /> <!-- primary -->
                    <img src="<?= base_url('img/logo.png') ?>" class="img img-responsive img-hover  hidden-xs" /> <!-- hover effect -->
                </a>
                <?php if (isset($sess['user']) && !empty($sess['user'])): ?>
                    <button type="button"  class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar first"></span>
                        <span class="icon-bar second"></span>
                        <span class="icon-bar third"></span>
                    </button>
                <?php endif; ?>
            </div>
            <ul class="nav navbar-nav navbar-right hidden-xs">
                <!--                <li>
                                    <a class="with-icon" href="<?= base_url('login/view-login') ?>" style="background-image:url(<?= base_url('img/user.png') ?>)">
                <?= lang('login/register') ?>
                                        <span class="bottom-line"></span>
                                    </a>
                                </li>-->
                <li>
                    <a href="javascript:void(0)">
                        <!--<img src="<?= base_url('img/sinergitanpabatas.png?ver=' . VERSION) ?>"  class="img img-responsive" style="max-height: 32px;"/>-->
                    </a>
                </li>
            </ul>
        </div><!-- /.container-fluid -->
        <?php if (isset($sess['user']) && !empty($sess['user'])): ?>
            <div class="sidebar collapse" id="bs-example-navbar-collapse-1" style="height:1px;">
                <ul class="nav navbar-nav visible-xs">
                    <li role="presentation">
                        <a href="<?= base_url('dashboard/profile') ?>">
                            <i class="fa fa-user"></i>&nbsp;
                            <?= lang('profile') ?>
                        </a>
                    </li>
                    <li role="presentation">
                        <a href="<?= base_url('dashboard/absen') ?>">
                            <i class="fa fa-list"></i>&nbsp;
                            <?= lang('absen') ?>
                        </a>
                    </li>
                    <li role="presentation">
                        <a href="<?= base_url('login/logout') ?>">
                            <i class="fa fa-power-off"></i>&nbsp;
                            <?= lang('logout') ?>
                        </a>
                    </li>
                </ul>
            </div>
        <?php endif; ?>
    </nav>
</header>
<style type="text/css">
    .banner {
        width:100%;
        display:block;
        margin-bottom:15px;
        position: relative;
        /*max-width:420px;*/
        /*border-bottom: 30px solid #006600;*/
    }
    .banner1 {
        display:none;
    }
    .banner2 {
        display:block;
    }
    .banner .img {
        width:100%;
        margin:0px auto;
    }
    .title-banner {
        position: absolute;
        top: 10%;
        right: 20px;
        left:auto;
        text-transform: uppercase;
        font-size:24px;
    }
    .title-banner > img {
        height: auto;
        width: 60%;
        margin: auto 0 auto auto;
        display:block;
    }
    @media (min-width: 768px){
        .banner {
            /*height: 60vh;*/
            overflow:hidden;
        }
        .banner .img {
            -o-object-fit:cover;
            object-fit:cover;
        }
        .banner1 {
            display:block;
        }
        .banner2 {
            display:none;
        }
        .title-banner {
            top: 5%;
            right: 11%;
            left: auto;
            font-size:36px;
        }
        .title-banner > img {
            height: 90px;
            width: auto;
        }
    }
</style>
<?php if(!isset($hide_banner) || (isset($hide_banner) && $hide_banner === false)): ?>
<div class="banner">
    <img src="<?= base_url('img/img_webbanner.jpg?v=' . VERSION) ?>" class="img img-responsive banner1" />
    <img src="<?= base_url('img/banner.jpg?v=' . VERSION) ?>" class="img img-responsive banner2" />
    <!--<span class="title-banner"><?= $title_img ?></span>-->
</div>
<?php endif; ?>
