<?php
/*
 * Copyright (c) 2018 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');
$is_configuration_page = strpos(current_url(), 'roles') !== false ||
    strpos(current_url(), 'permissions') !== false ||
    strpos(current_url(), 'users') !== false;
?>
<!-- BEGIN SIDEBAR -->
<div class="page-sidebar-wrapper">
    <!-- BEGIN SIDEBAR -->
    <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
    <!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
    <div class="page-sidebar navbar-collapse collapse">
        <!-- BEGIN SIDEBAR MENU -->
        <!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->
        <!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->
        <!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->
        <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
        <!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->
        <!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->
        <ul class="page-sidebar-menu  page-header-fixed " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" style="padding-top: 20px">
            <!-- DOC: To remove the sidebar toggler from the sidebar you just need to completely remove the below "sidebar-toggler-wrapper" LI element -->
            <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
            <li class="sidebar-toggler-wrapper hide">
                <div class="sidebar-toggler">
                    <span></span>
                </div>
            </li>
            <li class="nav-item<?= base_url() == current_url() ? ' active open' : null ?>">
                <a href="<?= base_url() ?>" class="nav-link nav-toggle">
                    <i class="fa fa-dashboard"></i>
                    <span class="title"><?= lang('dashboard') ?></span>
                    <span class="selected"></span>
                </a>
            </li>
            <li class="nav-item<?= strpos(current_url(), '/user-data') !== false ? ' active open' : null ?>">
                <a href="<?= base_url('user-data') ?>" class="nav-link nav-toggle">
                    <i class="fa fa-list"></i>
                    <span class="title"><?= lang('user_data') ?></span>
                    <span class="selected"></span>
                </a>
            </li>
            <?php if (array_search(User_model::ACCESS_ABSEN_LIST, $sess['permissions']) !== false) : ?>
            <li class="nav-item<?= strpos(current_url(), '/absen') !== false ? ' active open' : null ?>">
                <a href="<?= base_url('absen') ?>" class="nav-link nav-toggle">
                    <i class="fa fa-qrcode"></i>
                    <span class="title"><?= lang('absen') ?></span>
                    <span class="selected"></span>
                </a>
            </li>
            <?php endif; ?>
            <?php if (array_search(User_model::ACCESS_PUBLIC_USER_LIST, $sess['permissions']) !== false) : ?>
                <li class="nav-item<?= strpos(current_url(), '/public-user') !== false ? ' active open' : null ?>">
                    <a href="<?= base_url('public-user') ?>" class="nav-link nav-toggle">
                        <i class="fa fa-user"></i>
                        <span class="title"><?= lang('public_user') ?></span>
                        <span class="selected"></span>
                    </a>
                </li>
            <?php endif; ?>
            <?php if (array_search(User_model::ACCESS_VISITOR_USER_LIST, $sess['permissions']) !== false) : ?>
                <li class="nav-item<?= strpos(current_url(), '/visitor-user') !== false ? ' active open' : null ?>">
                    <a href="<?= base_url('visitor-user') ?>" class="nav-link nav-toggle">
                        <i class="fa fa-users"></i>
                        <span class="title"><?= lang('visitor_user') ?></span>
                        <span class="selected"></span>
                    </a>
                </li>
            <?php endif; ?>
            <li class="nav-item<?= strpos(current_url(), '/doorprize') !== false ? ' active open' : null ?>">
                <a href="<?= base_url('doorprize') ?>" class="nav-link nav-toggle">
                    <i class="fa fa-gift"></i>
                    <span class="title"><?= lang('doorprize') ?></span>
                    <span class="selected"></span>
                </a>
            </li>
            <li class="nav-item<?= strpos(current_url(), '/user-doorprize') !== false ? ' active open' : null ?>">
                <a href="<?= base_url('user-doorprize') ?>" class="nav-link nav-toggle">
                    <i class="fa fa-gift"></i>
                    <span class="title"><?= lang('user_doorprize') ?></span>
                    <span class="selected"></span>
                </a>
            </li>
            <li class="nav-item<?= $is_configuration_page !== false ? ' active open' : null ?>">
                <a href="javascript:void()" class="nav-link nav-toggle">
                    <i class="fa fa-database"></i>
                    <span class="title"><?= lang('configuration') ?></span>
                    <span class="selected"></span>
                    <span class="arrow open"></span>
                </a>
                <ul class="sub-menu">
                    <li class="nav-item<?= strpos(current_url(), 'roles') !== false ? ' active open' : null ?>">
                        <a href="<?= base_url('roles') ?>" class="nav-link nav-toggle">
                            <span class="title"><?= lang('roles') ?></span>
                            <span class="selected"></span>
                        </a>
                    </li>

                    <li class="nav-item<?= strpos(current_url(), 'permissions') !== false ? ' active open' : null ?>">
                        <a href="<?= base_url('permissions') ?>" class="nav-link nav-toggle">
                            <span class="title"><?= lang('permissions') ?></span>
                            <span class="selected"></span>
                        </a>
                    </li>

                    <li class="nav-item<?= strpos(current_url(), 'users') !== false ? ' active open' : null ?>">
                        <a href="<?= base_url('users') ?>" class="nav-link nav-toggle">
                            <span class="title"><?= lang('users') ?></span>
                            <span class="selected"></span>
                        </a>
                    </li>
                </ul>
            </li>
        </ul>
        <!-- END SIDEBAR MENU -->
        <!-- END SIDEBAR MENU -->
    </div>
    <!-- END SIDEBAR -->
</div>
<!-- END SIDEBAR -->
