<!DOCTYPE html>
<html>
<?php foreach($kontak as $kontak) :   endforeach; ?> 
<?php foreach($admin_login as $user) :   endforeach; ?> 
<?php 
            $username = $this->session->userdata("username");  
            $this->db->where('username',$username);
            $query = $this->db->get('tb_admin');
            $row = $query->row();
           
            $level = $row->level;

             ?>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Halaman Admin</title>
  <link rel="icon" href="<?php echo base_url();?>images/kontak/<?php echo $kontak->logo ;?>" type="image/png" />
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">


 
 
  <!-- SweetAlert2 -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css">
  <!-- Toastr -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/toastr/toastr.min.css">
  
  
  <!-- DataTables -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
  
  <!-- Font Awesome -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/fontawesome-free/css/all.min.css">
  <!-- Ionicons -->
 <!--  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/css/ionicons.min.css">
   <!-- overlayScrollbars -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
  <!-- daterange picker -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/daterangepicker/daterangepicker.css">
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  <!-- Bootstrap Color Picker -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css">
  <!-- Tempusdominus Bbootstrap 4 -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/select2/css/select2.min.css">
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
  <!-- Bootstrap4 Duallistbox -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/bootstrap4-duallistbox/bootstrap-duallistbox.min.css">
  <!-- Theme style -->
  <!-- daterangepicker -->
 
 <link href="<?php echo base_url();?>assets/js/jquery-ui.css" rel="stylesheet" />

  <link rel="stylesheet" href="<?php echo base_url();?>assets/dist/css/adminlte.min.css">
  <!-- 
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
 Google Font: Source Sans Pro -->
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

  <!-- Navbar -->
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">
    <!-- Left navbar links -->
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
      </li>
      <li class="nav-item d-none d-sm-inline-block">
        <a href="<?php echo base_url('kasir');?>" target="_blank" class="nav-link">Kasir</a>
      </li>
      <li class="nav-item d-none d-sm-inline-block">
        <a href="<?php echo base_url('transaksi');?>" class="nav-link">Data Transaksi</a>
      </li>
      <?php  
              if($level =='manager' or $level =='admin'){
            ?> 
      <li class="nav-item d-none d-sm-inline-block">
        <a href="<?php echo base_url('barang/tambah_data');?>" class="nav-link"><i class="fa fa-plus"></i> Barang</a>
      </li>
      <li class="nav-item d-none d-sm-inline-block">
        <form method="post"  action="<?php echo base_url('barang/tambah_data'); ?>" method="POST"  >
          <div class="input-group input-group-sm">
            <input type="text" class="form-control" name="cari"  placeholder="Nama / Id Barang" required=""  >
            <span class="input-group-append">
              <button type="submit" class="btn btn-warning btn-flat">Cari </button>
            </span>
          </div>
        </form>
      </li>
    <?php } ?>

    </ul>

    

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <!-- Messages Dropdown Menu -->
       
      <!-- Notifications Dropdown Menu -->
      <li class="nav-item dropdown">
        <a class="nav-link" data-toggle="dropdown" href="#">
          <i class="far fa-user"></i>
          
        </a>
        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
          <span class="dropdown-item dropdown-header">Profil Admin</span>
          <div class="dropdown-divider"></div>
          <a href="<?php echo base_url('admin/profile');?>" class="dropdown-item">
            Profil
          </a>
          <div class="dropdown-divider"></div>
          <a href="<?php echo base_url('admin/v_ubah_pass');?>" class="dropdown-item">
            Ubah Password
          </a>
          <div class="dropdown-divider"></div>
          <a href="<?php echo base_url('login/logout');?>" class="dropdown-item">
            Logout
          </a>
          
        </div>
      </li>
      <li class="nav-item">
        <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button">
          <i class="fas fa-th-large"></i>
        </a>
      </li>
    </ul>
  </nav>
  <!-- /.navbar -->



  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="<?php echo base_url('admin/profile');?>" class="brand-link">
      <img src="<?php echo base_url();?>images/kontak/<?php  echo $kontak->logo;   ?>" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
      style="opacity: .8">
      <span class="brand-text font-weight-light"><?php  echo $kontak->nama_toko;   ?></span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user panel (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
          <img src="<?php echo base_url();?>images/admin/<?php echo $user->foto; ?>" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="<?php echo base_url('admin/profile');?>" class="d-block"><?php  echo $user->nama_admin;   ?>   
           </a>
        </div>
      </div>

       <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library -->
           <li class="nav-item">
            <a href="<?php echo base_url('home');?>" class="nav-link <?php if($this->uri->segment(1) == 'home') { echo 'active'; } ?>">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                Dashboard 

              </p>
            </a>
            
          </li>
          <?php  
              if($level =='manager' or $level =='admin'){
            ?>  
            <li class="nav-item">
              <a href="<?php echo base_url('kontak');?>" class="nav-link <?php if($this->uri->segment(1) == 'kontak') { echo 'active'; } ?>">
                <i class="nav-icon fas fa-th"></i>
                <p>
                   Kontak Perusahaan  
                   
                </p>
              </a>
            </li>
            
            <li class="nav-item has-treeview <?php if($this->uri->segment(1) == 'katagori' or $this->uri->segment(1) == 'rak' or $this->uri->segment(1) == 'metode' or $this->uri->segment(1) == 'satuan' or $this->uri->segment(1) == 'selfing'  or $this->uri->segment(1) == 'kat_member' or $this->uri->segment(1) == 'admin' or $this->uri->segment(1) == 'metode' ) { echo 'menu-open'; } ?>">
              <a href="#" class="nav-link <?php if($this->uri->segment(1) == 'katagori' or $this->uri->segment(1) == 'rak' or $this->uri->segment(1) == 'metode' or $this->uri->segment(1) == 'satuan' or $this->uri->segment(1) == 'selfing'  or $this->uri->segment(1) == 'kat_member' or $this->uri->segment(1) == 'admin' or $this->uri->segment(1) == 'metode'  ) { echo 'active'; } ?>">
                <i class="nav-icon fas fa-table"></i>
                <p>
                  Data Master
                  <i class="fas fa-angle-left right"></i>
                </p>
              </a>
              <ul class="nav nav-treeview">
                <li class="nav-item">
                  <a href="<?php echo base_url('katagori');?>" class="nav-link <?php if($this->uri->segment(1) == 'katagori') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Katagori</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('rak');?>" class="nav-link <?php if($this->uri->segment(1) == 'rak') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Rak</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('satuan');?>" class="nav-link <?php if($this->uri->segment(1) == 'satuan') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Satuan</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('selfing');?>" class="nav-link <?php if($this->uri->segment(1) == 'selfing') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Selfing</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('kat_member');?>" class="nav-link <?php if($this->uri->segment(1) == 'kat_member') { echo 'active'; } ?>">
                    <i class="nav-icon fas fa-user"></i>
                    <p>
                       Katagori Member
                       
                    </p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('metode');?>" class="nav-link <?php if($this->uri->segment(1) == 'metode') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Metode Bayar</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('admin');?>" class="nav-link <?php if($this->uri->segment(1) == 'admin') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Admin</p>
                  </a>
                </li>
              </ul>
            </li>
            <li class="nav-item">
              <a href="<?php echo base_url('barang');?>" class="nav-link <?php if($this->uri->segment(1) == 'barang') { echo 'active'; } ?>">
                <i class="nav-icon fas fa-th"></i>
                <p>
                   Data Barang
                   
                </p>
              </a>
            </li>
			 <li class="nav-item">
              <a href="<?php echo base_url('Datatables');?>" class="nav-link <?php if($this->uri->segment(1) == 'barang') { echo 'active'; } ?>">
                <i class="nav-icon fas fa-th"></i>
                <p>
                   Data Barang new
                   
                </p>
              </a>
            </li>
            
             <?php  
              }
            ?> 
            <li class="nav-item">
              <a href="<?php echo base_url('member');?>" class="nav-link <?php if($this->uri->segment(1) == 'member') { echo 'active'; } ?>">
                <i class="nav-icon fas fa-user"></i>
                <p>
                   Data Member
                   
                </p>
              </a>
            </li>
            <li class="nav-item">
                  <a href="<?php echo base_url('kasir');?>" class="nav-link <?php if($this->uri->segment(1) == 'kasir') { echo 'active'; } ?>">
                    <i class="nav-icon fas fa-shopping-cart"></i>
                    
                    <p>
                     Kasir

                   </p>
                 </a>
               </li>

              <li class="nav-item">
                  <a href="<?php echo base_url('kasir/kasir_new');?>" class="nav-link <?php if($this->uri->segment(1) == 'kasir') { echo 'active'; } ?>">
                    <i class="nav-icon fas fa-shopping-cart"></i>
                    <p>
                     Kasir Baru

                   </p>
                 </a>
               </li>
               <li class="nav-item">
                <a href="<?php echo base_url('kasir/tampil_depan');?>" class="nav-link <?php if($this->uri->segment(2) == 'tampil_depan') { echo 'active'; } ?>" target="blank">
                  <i class="nav-icon fas fa-table"></i>
                  <p>
                   Tampil Depan Kasir

                 </p>
               </a>
             </li>
             <li class="nav-item">
              <a href="<?php echo base_url('transaksi');?>" class="nav-link <?php if($this->uri->segment(1) == 'transaksi') { echo 'active'; } ?>">
                <i class="nav-icon fas fa-chart-pie"></i>
                <p>
                 Data Transaksi

               </p>
             </a>
           </li>  
              <?php  
              if($level =='manager' or $level =='admin'){
            ?> 

            <li class="nav-item">
              <a href="<?php echo base_url('barang/fastmoving');?>" class="nav-link <?php if($this->uri->segment(2) == 'fastmoving') { echo 'active'; } ?>">
                <i class="nav-icon fas fa-table"></i>
                <p>
                 Fast Moving

               </p>
             </a>
           </li>
           <li class="nav-header">Informasi dan Laporan</li>
            <li class="nav-item">
            <a href="#" class="nav-link">
              <i class="nav-icon fas fa-search"></i>
              <p>
                Informasi dan Laporan
                <i class="fas fa-angle-left right"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <!-- <li class="nav-item">
                <a href="pages/search/simple.html" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Simple Search</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="pages/search/enhanced.html" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Enhanced</p>
                </a>
              </li> -->
               <li class="nav-item">
                  <a  href="<?php echo base_url('barang/terjual');?>" class="nav-link <?php if($this->uri->segment(2) == 'expired') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Barang Terjual Harian</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('barang/expired');?>" class="nav-link <?php if($this->uri->segment(2) == 'expired') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Barang Expired</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('barang/history');?>" class="nav-link <?php if($this->uri->segment(2) == 'history') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>History Data</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('kasir/history_kasir');?>" class="nav-link <?php if($this->uri->segment(2) == 'history_kasir') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>History Kasir</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('member/history_point');?>" class="nav-link <?php if($this->uri->segment(2) == 'history_point') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>History Point Member </p>
                  </a>
                </li>
                 <li class="nav-item">
                  <a href="<?php echo base_url('kantor/tampil_stok_satuan');?>" class="nav-link <?php if($this->uri->segment(2) == 'tampil_stok_satuan') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <?php 
                    $username = $this->session->userdata("username");
                    $this->db->where('username',$username);
                    $queryy = $this->db->get('tb_admin');
                    $rowss = $queryy->row();
                    $id_kantor = $rowss->id_kantor;



                    $this->db->where('id_kantor',$id_kantor);
                    $query = $this->db->get('tb_kantor');
                    $row = $query->row();
                    $kantor= $row->nama_kantor;

                    ?>
                    <p>Reset Stok <?php echo $kantor; ?>  </p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('supliyer');?>" class="nav-link <?php if($this->uri->segment(1) == 'supliyer') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Supliyer</p>
                  </a>
                </li>
                 
            </ul>
          </li> 
          
            <li class="nav-item has-treeview ">
              <a href="#" class="nav-link ">
                <i class="nav-icon fas fa-print"></i>
                <p>
                  Cetak Laporan
                  <i class="fas fa-angle-left right"></i>
                </p>
              </a>
              <ul class="nav nav-treeview">
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_transaksi');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_transaksi') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Transaksi</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_kulakan_manual');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_transaksi') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Kulakan Manual</p>
                  </a>
                </li>
                 <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_transaksi_laris');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_transaksi_laris') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Barang Terlaris</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_barcode');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_barcode') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Cetak Barcode</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_label');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_label') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Cetak Label Barang</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_stok_opname');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_stok_opname') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Cetak Lembar SO</p>
                  </a>
                </li>


                <li class="nav-item">
                  <a target="blank" href="<?php echo base_url('laporan/cetak_barang');?>" class="nav-link <?php if($this->uri->segment(2) == 'cetak_barang') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Data Barang </p>
                  </a>
                </li>
               <!--    <li class="nav-item">
                  <a target="blank" href="<?php echo base_url('laporan/cetak_barang_baru');?>" class="nav-link <?php if($this->uri->segment(2) == 'cetak_barang') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Data Barang Baru </p>
                  </a>
                </li> -->
                <li class="nav-item">
                  <a   href="<?php echo base_url('laporan/form_laporan_rak');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_laporan_rak') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Data Rak Barang </p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_stok');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_stok') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Data Stok Barang </p>
                  </a>
                </li>
                 <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_stok_baru');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_stok') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Data Stok Barang Baru </p>
                  </a>
                </li>
               
                 
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_history_barang');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_history_barang') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Cari History Barang </p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_barang_terjual');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_barang_terjual') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Terjual</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_faktur');?>" class="nav-link <?php if($this->uri->segment(2) == 'faktur') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Faktur</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_stokopname');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_stokopname') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Stok Opname</p>
                  </a>
                </li>
                
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_retur');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_retur') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Retur</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_dropout');?>" class="nav-link <?php if($this->uri->segment(2) == 'dropout') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Drop Out</p>
                  </a>
                </li>
                 <li class="nav-item">
                  <a href="<?php echo base_url('laporan/history_kasir');?>" class="nav-link <?php if($this->uri->segment(2) == 'history_kasir') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan History Kasir</p>
                  </a>
                </li>
                 <li class="nav-item">
                  <a href="<?php echo base_url('laporan/history_kasir_delete');?>" class="nav-link <?php if($this->uri->segment(2) == 'history_kasir_delete') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan History  Hapus</p>
                  </a>
                </li>
                 <li class="nav-item">
                  <a href="<?php echo base_url('laporan/cetak_member');?>" class="nav-link <?php if($this->uri->segment(2) == 'cetak_member') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Member</p>
                  </a>
                </li>

                <li class="nav-item">
                  <a href="<?php echo base_url('laporan/form_laporan_buku_kas');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_laporan_buku_kas') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Laporan Buku Kas</p>
                  </a>
                </li>
                
               
              </ul>
            </li>
           <li class="nav-header">Pengaturan Gudang</li>
            
            <li class="nav-item has-treeview ">
              <a href="#" class="nav-link ">
                <i class="nav-icon fas fa-table"></i>
                <p>
                  Data Gudang
                  <i class="fas fa-angle-left right"></i>
                </p>
              </a>
              <ul class="nav nav-treeview">
                
                <li class="nav-item">
                  <a href="<?php echo base_url('/kantor/singkron_cabang');?>" class="nav-link <?php if($this->uri->segment(2) == 'singkron_cabang') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Singkron Data Barang</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('kantor/data_faktur');?>" class="nav-link <?php if($this->uri->segment(2) == 'data_faktur') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Faktur</p>
                  </a>
                </li>
                 
                <li class="nav-item">
                  <a href="<?php echo base_url('kantor/data_dropout');?>" class="nav-link <?php if($this->uri->segment(2) == 'data_dropout') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Barang Drop Out</p>
                  </a>
                </li>
               
                <li class="nav-item">
                  <a target="blank" href="<?php echo base_url('stok_opname');?>" class="nav-link <?php if($this->uri->segment(2) == 'stok_opname') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Stok Opname</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a  href="<?php echo base_url('kantor/stok_opname_rak');?>" class="nav-link <?php if($this->uri->segment(2) == 'stok_opname_rak') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Stok Opname Per RAK</p>
                  </a>
                </li>
                <!-- 
                <li class="nav-item">
                  <a   href="<?php echo base_url('laporan/form_laporan_stok_opname_rak');?>" class="nav-link <?php if($this->uri->segment(2) == 'form_laporan_stok_opname_rak') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Stok Opname Rak</p>
                  </a>
                </li>

                -->
                
                
                <?php  
                  if($level =='manager' ){
                ?> 
                <li class="nav-item">
                  <a href="<?php echo base_url('kantor/all_stok');?>" class="nav-link <?php if($this->uri->segment(2) == 'stok') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Data Barang All Gudang</p>
                  </a>
                </li>

                <?php } ?>

                 <li class="nav-item">
                  <a href="<?php echo base_url('supliyer');?>" class="nav-link <?php if($this->uri->segment(1) == 'supliyer') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Supliyer</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('kantor/tampil_stok');?>" class="nav-link <?php if($this->uri->segment(2) == 'tampil_stok') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <?php 
                    $username = $this->session->userdata("username");
                    $this->db->where('username',$username);
                    $queryy = $this->db->get('tb_admin');
                    $rowss = $queryy->row();
                    $id_kantor = $rowss->id_kantor;



                    $this->db->where('id_kantor',$id_kantor);
                    $query = $this->db->get('tb_kantor');
                    $row = $query->row();
                    $kantor= $row->nama_kantor;

                    ?>
                    <p>Stok Barang <?php echo $kantor; ?> </p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?php echo base_url('kantor');?>" class="nav-link <?php if($this->uri->segment(1) == 'kantor') { echo 'active'; } ?>" class="nav-link">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Kantor</p>
                  </a>
                </li>
              </ul>
            </li>
              <?php  
                  if($level =='manager' ){
                ?> 
            <li class="nav-item">
              <a href="<?php echo base_url('grafik');?>" class="nav-link <?php if($this->uri->segment(1) == 'grafik'  ) { echo 'menu-open'; } ?>">
                <i class="nav-icon fa fa-money-check"></i>
                <p>
                  Grafik
                </p>
              </a>
            </li>  
              <?php  
            }
            ?>  

            <li class="nav-header">Laporan Keuangan</li>
            <li class="nav-item">
              <a href="<?php echo base_url('bukukas');?>" class="nav-link <?php if($this->uri->segment(1) == 'bukukas'  ) { echo 'menu-open'; } ?>">
                <i class="nav-icon fa fa-money-check"></i>
                <p>
                  Buku Kas
                </p>
              </a>
            </li>  

            <li class="nav-header">Pengaturan lainnya</li>
           
           
            <li class="nav-item">
              <a href="<?php echo base_url('backup/db');?>" class="nav-link">
                <i class="nav-icon fas fa-download"></i>
                <p>
                  Backup Data
                </p>
              </a>
            </li>

           
               <?php  
            }
            ?>  

             <li class="nav-item">
              <a href="<?php echo base_url('log_user');?>" class="nav-link <?php if($this->uri->segment(1) == 'log') { echo 'active'; } ?>">
                <i class="nav-icon fas fa-user"></i>
                <p>
                  Log User
                </p>
              </a>
            </li> 
            <?php  
                  if($level =='manager' ){
                ?> 
                
                <li class="nav-item">
                  <a href="<?php echo base_url('transaksi/code_reset_transaksi');?>"  onclick="return confirm('Apakah Transaksi Yain melakukan ini, ? Klik Oke jika Lanjut')" class="nav-link <?php if($this->uri->segment(2) == 'history_point') { echo 'active'; } ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Reset Transaksi ke Retur </p>
                  </a>
                </li> 
                
           <!--  <li class="nav-item">
              <a href="<?php echo base_url('backup/reset');?>"  onclick="return confirm('Apakah Yakin Data di reset, ? Klik Oke jika Lanjut')" class="nav-link">
                <i class="nav-icon fas fa-trash"></i>
                <p>
                  Reset Data
                </p>
              </a>
            </li>  -->
                <?php } ?>  
        
          
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </aside>