
<style>
       .sn_active{color:#fff !important;font-weight:bold;border-bottom:1px solid #F63;border-top:1px solid #F63;}
       </style>
       <script>
	   
	   $().ready(function(e) {
		   navid = $('#navid').val();

		   if(navid=="order"){id = "#nav_order";}
		   if(navid=="purchase"){id = "#nav_purchase";}
		   if(navid=="inventory"){id = "#nav_inventory";}
		   if(navid=="masterdata"){id = "#nav_master";}
		   if(navid=="report"){id = "#nav_report";}
		   if(navid=="setting"){id = "#nav_setting";}
		   if(navid=="accounting"){id = "#nav_acct";}
		   if(navid=="home"){id = "#nav_home";}
			$(id).show();
	    });
       </script>
        <!-- Sidebar  -->
        <nav id="sidebar" style="display:none">
            <div class="sidebar-header pt-4 pb-3">
            	<a href="../../home/db/index">
                <h3>KELAPAK CENTRAL</h3>
                </a>
            </div>
            <ul class="list-unstyled components">
            <input type="hidden" id="navid" value="<?php echo $navid?>">
               
               


               <?php if($prc_flag==1){?>
                <li <?php if($navid=="purchase"){echo 'class="active"';}?>>
                    <a href="#nav_purchase" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Pembelian</a>
                    <ul class="collapse list-unstyled" id="nav_purchase">
                        <li <?php if($pageid=="po"){echo 'class=" sn_active"';}?>>
                            <a href="../../purchase/po/index">Pembelian</a>
                        </li>
                        <li <?php if($pageid=="pos_report"){echo 'class=" sn_active"';}?>>
                            <a href="../../purchase/po_report/index">Laporan Pembelian</a>
                        </li>
                    </ul>
                </li>
				<?php } ?>

               <?php if($userid=="admin"||$userid=="wiwi"){?>
                <li <?php if($navid=="sales"){echo 'class="active"';}?>>
                    <a href="#nav_order" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Penjualan</a>
                    <ul class="collapse list-unstyled" id="nav_order">
                        <li <?php if($pageid=="pos_central"){echo 'class=" sn_active"';}?>>
                            <a href="../../sales/pos_central/index">Penjualan</a>
                        </li>
                        <li <?php if($pageid=="pos_report"){echo 'class=" sn_active"';}?>>
                            <a href="../../sales/pos_report/index">Laporan Penjualan</a>
                        </li>
                    </ul>
                </li>
				<?php } ?>

               <?php if($inv_flag==1){?>
                <li <?php if($navid=="inventory"){echo 'class="active"';}?>>
                    <a href="#nav_inventory" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Inventory</a>
                    <ul class="collapse list-unstyled" id="nav_inventory">

                        <li <?php if($pageid=="invtrans"){echo 'class=" sn_active"';}?>>
                            <a href="../../inventory/invtrans/index">Stock Transaction</a>
                        </li>
                        <li <?php if($pageid=="invstock"){echo 'class=" sn_active"';}?>>
                            <a href="../../inventory/invstock/index">Stock Product</a>
                        </li>
                    </ul>
                </li>
				<?php } ?>

               <?php if($inv_flag==1){?>
                <li <?php if($navid=="acct"){echo 'class="active"';}?>>
                    <a href="#nav_acct" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Accounting</a>
                    <ul class="collapse list-unstyled" id="nav_acct">
                        
                        <li <?php if($pageid=="jurnal"){echo 'class=" sn_active"';}?>>
                            <a href="../../acct/jurnal/index">Jurnal</a>
                        </li>
                        <li <?php if($pageid=="gl"){echo 'class=" sn_active"';}?>>
                            <a href="../../acct/gl/index">Buku Besar</a>
                        </li>
                    </ul>
                </li>
				<?php } ?>

                
               <?php if($md_flag==1){?>
                <li <?php if($navid=="masterdata"){echo 'class="active"';}?>>
                    <a href="#nav_master" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Masterdata</a>
                    <ul class="collapse list-unstyled" id="nav_master">
                        <li <?php if($pageid=="kategori"){echo 'class=" sn_active"';}?>>
                            <a href="../../masterdata/outlet/index">Outlet</a>
                        </li>
                        <li <?php if($pageid=="kategori"){echo 'class=" sn_active"';}?>>
                            <a href="../../masterdata/kategori/index">Category</a>
                        </li>
                        <li <?php if($pageid=="sub_kategori"){echo 'class=" sn_active"';}?>>
                            <a href="../../masterdata/sub_kategori/index">Sub Category</a>
                        </li>
                        <li <?php if($pageid=="product"){echo 'class=" sn_active"';}?>>
                            <a href="../../masterdata/product/index">Product</a>
                        </li>
                        <li <?php if($pageid=="vendor"){echo 'class=" sn_active"';}?>>
                            <a href="../../masterdata/customer/index">Customer</a>
                        </li>
                        <li <?php if($pageid=="vendor"){echo 'class=" sn_active"';}?>>
                            <a href="../../masterdata/vendor/index">Supplier</a>
                        </li>
                        <li <?php if($pageid=="warehouse"){echo 'class=" sn_active"';}?>>
                            <a href="../../masterdata/warehouse/index">Warehouse</a>
                        </li>
                    </ul>
                </li>
                <?php } ?>
                
              <?php if($rpt_flag==1){?>

             	<li <?php if($navid=="rpt"){echo 'class="active"';}?>>
                    <a href="#nav_report" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Reports</a>
                    <ul class="collapse list-unstyled" id="nav_report">
                        <li <?php if($pageid=="account"){echo 'class=" sn_active"';}?>>
		                    <a href="../../reports/purchase/index">Lap. Pembelian - Central</a>
                        </li>
                        <li <?php if($pageid=="account"){echo 'class=" sn_active"';}?>>
		                    <a href="../../reports/purchase_outlet/index">Lap. Pembelian - Outlet</a>
                        </li>
                        <li <?php if($pageid=="account"){echo 'class=" sn_active"';}?>>
		                    <a href="../../reports/inventory/index">Lap. Stok</a>
                        </li>
                    </ul>
                </li>
              <?php } ?>  
               

                
              <?php if($setting_flag==1){?>

             	<li <?php if($navid=="setting"){echo 'class="active"';}?>>
                    <a href="#nav_setting" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Setting</a>
                    <ul class="collapse list-unstyled" id="nav_setting">
                        <li <?php if($pageid=="account"){echo 'class=" sn_active"';}?>>
		                    <a href="../../setting/account/index">User Account</a>
                        </li>
                    </ul>
                </li>
              <?php } ?>  
            </ul>
        </nav>

    <script type="text/javascript">
        $(document).ready(function () {
            $('#sidebarCollapse').on('click', function () {
                $('#sidebar').toggleClass('active sn_active');
            });
        });
    </script>