<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Gestion de stock</title>

  <!-- Google Font: Source Sans Pro -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome Icons -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  
  <!-- jQuery -->
    <script src="plugins/jquery/jquery.js"></script>

  <script src="plugins/jquery/jquery.min.js"></script>
  
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- daterange picker -->
  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  
  <!-- Select2 -->
  <link rel="stylesheet" href="plugins/select2/css/select2.min.css">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">

<!-- date-range-picker -->
<script src="plugins/daterangepicker/daterangepicker.js"></script>


<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>

<!-- Bootstrap 4 -->

<script src="plugins/sweetalert2/sweetalert2.js"></script>
<script src="plugins/sweetalert2/sweetalert2.all.js"></script>
<script src="plugins/sweetalert2/sweetalert2.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>


<!-- DataTables -->
  




<link rel="stylesheet" href="plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" href="plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
  <link rel="stylesheet" href="plugins/datatables-buttons/css/buttons.bootstrap4.min.css">
  <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />

  
  
  
   <script src="plugins/datatables/jquery.dataTables.js"></script>
  <script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
<script src="plugins/jszip/jszip.min.js"></script>
<script src="plugins/pdfmake/pdfmake.min.js"></script>
<script src="plugins/pdfmake/vfs_fonts.js"></script>
<script src="plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="plugins/datatables-buttons/js/buttons.print.min.js"></script>
    <script src="plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
    
    <script>
        $(document).ready(function() {
    $('select').select2();
});

    </script>
  
  
</head>
<body class="hold-transition sidebar-mini">
<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>
     
    </ul>

    <!-- SEARCH FORM -->
    

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <!-- Messages Dropdown Menu -->
      
      <!-- Notifications Dropdown Menu -->
      
      <li class="nav-item">
        <a class="nav-link" data-widget="fullscreen" href="#" role="button">
          <i class="fas fa-expand-arrows-alt"></i>
        </a>
      </li>
     
    </ul>
  </nav>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="#" class="brand-link">
      <img src="dist/img/downtownlogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
      <span class="brand-text font-weight-light">E-Stock</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="dist/img/icebear.png" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="#" class="d-block">Bienvenue <?php echo $_SESSION['username'];?></a>
        </div>
      </div>

      <!-- SidebarSearch Form -->
     

      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="tree" 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 menu-open">
            <a href="dashboard.php" class="nav-link active">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                Tableau de bord
                <i class="right fas fa-angle-down"></i>
              </p>
            </a>
            <?php 
            if ($_SESSION['role']=="admin") {
              echo('
                  <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="category.php" class="nav-link active">
                  <i class="fa fa-list-alt nav-icon"></i>
                  <p>Gestion catégories</p>
                </a>
              </li>
               <li class="nav-item">
                <a href="addproducts.php" class="nav-link active">
                  <i class="fa fa-list-alt nav-icon"></i>
                  <p>Nouveau produit</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="productlist.php" class="nav-link  active ">
                  <i class="fab fa-product-hunt nav-icon"></i>
                  <p>Liste des produits</p>
                </a>
              </li>
              
              <li class="nav-item">
                <a href="orderlist.php" class="nav-link  active ">
                  <i class="fa fa-list-ol nav-icon"></i>
                  <p>Historique des ventes</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="etat.php" class="nav-link  active ">
                  <i class="fa fa-chart-bar nav-icon"></i>
                  <p>Etat des ventes</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="registration.php" class="nav-link  active ">
                  <i class="fa fa-user-plus nav-icon"></i>
                  <p>Utilisateurs</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="voir_stock.php" class="nav-link  active ">
                  <i class="fa fa-list-ol nav-icon"></i>
                  <p>Historique Stock</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="config.php" class="nav-link  active ">
                  <i class="fa fa-list-alt nav-icon"></i>
                  <p>Configuration</p>
                </a>
              </li>
               </li>
              <!--<li class="nav-item">
                <a href="benefice.php" class="nav-link  active ">
                  <i class="fa fa-list-alt nav-icon"></i>
                  <p>Bénéfices des ventes</p>
                </a>
              </li>-->

            </ul>
                ');
            } else {
              echo('
                  <ul class="nav nav-treeview">
              
              <li class="nav-item">
                <a href="productlist.php" class="nav-link  active ">
                  <i class="fab fa-product-hunt nav-icon"></i>
                  <p>Liste des produits</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="order.php" class="nav-link active">
                  <i class="fa fa-cart-plus nav-icon"></i>
                  <p>Nouvelle vente</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="orderlist.php" class="nav-link  active ">
                  <i class="fa fa-list-ol nav-icon"></i>
                  <p>Historique des ventes</p>
                </a>
              </li>

            </ul>
                ');
            }
            

            ?>
          </li>
          
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>