<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-light-yellow bg-yellow elevation-4">

    <!-- Brand Logo -->
    <a href="../../index3.html" class="brand-link">
        <img src="<?php echo e(asset('assets/logo/logo.png')); ?>" class="brand-image">
        <span class="brand-text" style="color:#c93525;font-style: italic;font-size: 20px;font-weight:bold">LSM Web Portal</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
        <!-- Sidebar user (optional) -->
        <div class="user-panel mt-3 mb-3 d-flex">
            <div class="image">
                <a href="<?php echo e(route('users.show', $logged_user_id)); ?>"><i class="fas fa-user-circle fa-2x"></i></a>
            </div>
            <div class="info">
                <a href="<?php echo e(route('users.show', $logged_user_id)); ?>" class="d-block mt-n2"><?php echo nl2br(wordwrap($logged_name, 50, "\n")); ?> <br><sup> (<?php echo e($logged_role_name); ?>) </sup> </a>
            </div>
            <div class="info" style="margin-left:auto">
                <a href="<?php echo e(route('logout.perform')); ?>" role="button" data-toggle="tooltip" data-placement="top" title="Logout">
                    <i class="fas fa-sign-out-alt fa-rotate-180"></i>
                </a>
            </div>
        </div>
        <!-- SidebarSearch Form -->
        <div class="form-inline">
            <div class="input-group" data-widget="sidebar-search">
                <input class="form-control form-control-sm form-control-sidebar" type="search" placeholder="Cari" aria-label="Cari">
                <div class="input-group-append">
                    <button class="btn btn-sidebar btn-sm">
                        <i class="fas fa-search fa-fw"></i>
                    </button>
                </div>
            </div>
        </div>
        <!-- Sidebar Menu -->
        <style>
            /* untuk kebutuhan ketika colaps iconnya rata tengah (ini pengaruh class pl-1 di nav link guna lebih luas)*/
            .sidebar-mini.sidebar-collapse .nav-sidebar .navlinkp1 {
                padding-left: 0.5rem !important;
            }
        </style>
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <?php if(array_intersect(['stores','raw_materials','item_conversions','store_raw_materials','menus','range_dois','fstrs','reason_adjustments','sales_types','armada_types','shipment_deliveries','target_sisa_malam','periods','shipment_suppliers','holidays'], Cache::get('menus', []))): ?>
                <li class="nav-item">
                    <a href="#" class="nav-link pl-1 navlinkp1">
                        <i class="nav-icon fas fa-database"></i>
                        <p>
                            Data Master
                            <i class="right fas fa-angle-left"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <?php if(in_array('stores', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('stores.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-store"></i>
                                <p>Store</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('menus', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('menus.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-utensils"></i>
                                <p>Menu</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(array_intersect(['stores','raw_materials','item_conversions','store_raw_materials','fstrs'], Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="#" class="nav-link pl-3">
                                <i class="nav-icon fas fa-database"></i>
                                <p>
                                    Item
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <?php if(in_array('raw_materials', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('raw_materials.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-boxes"></i>
                                        <p>Item</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('item_conversions', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('item_conversions.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-exchange-alt"></i>
                                        <p>Konversi Item</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('store_raw_materials', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('store_raw_materials.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-project-diagram"></i>
                                        <p>Mapping Store-Item</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('fstrs', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('fstrs.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-blender"></i>
                                        <p>FSTRs</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                            </ul>
                        </li>
                        <?php endif; ?>
                        <?php if(array_intersect(['armada_types','periods','shipment_deliveries','shipment_suppliers','holidays'], Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="#" class="nav-link pl-3">
                                <i class="nav-icon fas fa-database"></i>
                                <p>
                                    Pengiriman
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <?php if(in_array('armada_types', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('armada_types.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-truck"></i>
                                        <p>Tipe Armada</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('periods', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('periods.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-bullseye"></i>
                                        <p>Periode</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('holidays', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('holidays.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-calendar-day"></i>
                                        <p>Hari Libur</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('shipment_deliveries', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('shipment_deliveries.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-calendar-alt"></i>
                                        <p>Jadwal Pengiriman</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('shipment_suppliers', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('shipment_suppliers.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-calendar-alt"></i>
                                        <p>Supplier Pengiriman</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                            </ul>
                        </li>
                        <?php endif; ?>
                        <?php if(array_intersect(['range_dois','target_sisa_malam','reason_adjustments','sales_types'], Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="#" class="nav-link pl-3">
                                <i class="nav-icon fas fa-database"></i>
                                <p>
                                    Operasional
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <?php if(in_array('range_dois', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('range_dois.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-layer-group"></i>
                                        <p>Rentang DOI</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('target_sisa_malam', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('target_sisa_malam.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-bullseye"></i>
                                        <p>Target Sisa Malam</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('reason_adjustments', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('reason_adjustments.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-edit"></i>
                                        <p>Alasan Penyesuaian</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if(in_array('sales_types', Cache::get('menus', []))): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('sales_types.index')); ?>" class="nav-link ml-4 pl-1">
                                        <i class="nav-icon fas fa-tags"></i>
                                        <p>Tipe Penjualan</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                            </ul>
                        </li>
                        <?php endif; ?>
                    </ul>
                </li>
                <?php endif; ?>
                <?php if(array_intersect(['stock_opnames','item_requests','forecasts'], Cache::get('menus', []))): ?>
                <li class="nav-item">
                    <a href="#" class="nav-link pl-1 navlinkp1">
                        <i class="nav-icon fas fa-clipboard-list"></i>
                        <p>
                            Transaksi
                            <i class="right fas fa-angle-left"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <?php if(in_array('forecasts', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('forecasts.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-chart-line"></i>
                                <p>Forecast</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('stock_opnames', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('stock_opnames.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-clipboard-check"></i>
                                <p>Stok Opname (LSM)</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('item_requests', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('item_requests.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-file-invoice"></i>
                                <p>Permintaan Item (SPB)</p>
                            </a>
                        </li>
                        <?php endif; ?>
                    </ul>
                </li>
                <?php endif; ?>
                <?php if(array_intersect(['lsm_report','spb_report','do_report','doi_report'], Cache::get('menus', []))): ?>
                <li class="nav-item">
                    <a href="#" class="nav-link pl-1 navlinkp1">
                        <i class="nav-icon fas fa-chart-bar"></i>
                        <p>
                            Laporan
                            <i class="right fas fa-angle-left"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <?php if(in_array('lsm_report', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('reports.lsm_report')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-clipboard-check"></i>
                                <p>Laporan LSM</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('spb_report', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('reports.spb_report')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-file-invoice"></i>
                                <p>Laporan SPB</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('do_report', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('reports.do_report')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-shipping-fast"></i>
                                <p>Laporan DO</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('doi_report', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('reports.doi_report')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-chart-line"></i>
                                <p>Laporan DOI</p>
                            </a>
                        </li>
                        <?php endif; ?>
                    </ul>
                </li>
                <?php endif; ?>
                <?php if(array_intersect(['permissions','role','users'], Cache::get('menus', []))): ?>
                <li class="nav-item">
                    <a href="#" class="nav-link pl-1 navlinkp1">
                        <i class="nav-icon fas fa-users"></i>
                        <p>
                            Kelola Web
                            <i class="right fas fa-angle-left"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <?php if(in_array('permissions', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('permissions.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-link"></i>
                                <p>Hak Akses</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('roles', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('roles.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-link"></i>
                                <p>Peran</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('users', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('users.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-link"></i>
                                <p>Pengguna</p>
                            </a>
                        </li>
                        <?php endif; ?>
                    </ul>
                </li>
                <?php endif; ?>
                <?php if(array_intersect(['parameter_globals','system_logs','system_errors','qad_sync'], Cache::get('menus', []))): ?>
                <li class="nav-item">
                    <a href="#" class="nav-link pl-1 navlinkp1">
                        <i class="nav-icon fas fa-gear"></i>
                        <p>
                            Konfigurasi
                            <i class="right fas fa-angle-left"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <?php if(in_array('parameter_globals', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('parameter_globals.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-link"></i>
                                <p>Parameter Global</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('qad_sync', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('qad_sync.index')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-sync-alt"></i>
                                <p>Sinkronisasi QAD</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('system_logs', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('reports.system_logs')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-link"></i>
                                <p>Log Sistem</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(in_array('system_errors', Cache::get('menus', []))): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('reports.system_errors')); ?>" class="nav-link pl-3">
                                <i class="nav-icon fas fa-link"></i>
                                <p>Error Sistem</p>
                            </a>
                        </li>
                        <?php endif; ?>
                    </ul>
                </li>
                <?php endif; ?>
            </ul>
        </nav>
        <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
</aside><?php /**PATH D:\LSM\resources\views/layouts/partials/sidebar.blade.php ENDPATH**/ ?>