<?php
  include VIEWPATH.'includes/new_header.php';
  ?>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
  
  <?php
  include VIEWPATH.'includes/new_top_menu.php';
  include VIEWPATH.'includes/new_menu_principal.php';
  ?>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    
    <?php 
    include 'includes/menu_vehicule.php';
    ?>

    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-12">
            
            <!-- /.card -->

            <div class="card card-primary">
              <div class="card-header">
                <h3 class="card-title">Liste des marque de voitures d&eacute;j&agrave; enregistr&eacute;</h3>
              </div>
              <!-- /.card-header -->
              <div class="card-body">
                <table id="example1" class="table table-bordered table-striped table-hover">
                  <thead>
                  <tr>
                    <th>Marque</th>
                    <th>Status</th>
                    <th>Options</th>
                  </tr>
                  </thead>
                  <tbody>
                  <?php

                  foreach ($resultat as $key) 
         {


          if ($key['STATUS'] == 1) {
            $STATUS = 'Actif';
            $tex='Declasser';
            $fx = 'markdeclasser';
            $texs='declassement';
            $col='danger';
          }
          else{
            $STATUS = 'Desactive';
            $tex='Reclasser';
            $fx = 'markreclasser';
            $texs='reclassement';
            $col='success';
          }
          
          
      // echo '';
          
      
          
          echo "<tr>
                     <td>".$key['DESCRIPTION']."</td>
                     <td>".$STATUS."</td>";

          // if($this->mylibrary->get_permission('Vehicule') ==1) { 
          $modadcontent ='
          

          <ul class="navbar-nav ml-auto text-center">
      <li class="nav-item dropdown">
        <a class="nav-link" data-toggle="dropdown" href="#">
          <i class="fas fa-cog"></i>
        </a>
        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
        ';
          
          // if ($v == 'inf') {
            $modadcontent.='<div class="dropdown-divider"></div>
          <a  href="#" class="dropdown-item" data-toggle="modal" data-target="#modal-delet'.$key['MARQUE_ID'].'">
            <!-- Message Start -->
            <div class="media">
              <div class="media-body ">
                <h3 class="dropdown-item-title">
                  Declasser
                </h3>
                <p class="text-sm">Declasser le '.$key['DESCRIPTION'].'</p>
              </div>
            </div>
            <!-- Message End -->
          </a>';
          // }
          
          $modadcontent.='<div class="dropdown-divider"></div>
          
          
        </div>
      </li>
      
    </ul>
  </nav>';
         // }
 
         echo "<td>".$modadcontent."</td></tr>";

                          
     
     }



                  ?>
                  </tbody>
                  </tfoot>
                </table>
              </div>
              <!-- /.card-body -->
            </div>
            <!-- /.card -->
          </div>
          <!-- /.col -->
        </div>
        <!-- /.row -->
      </div>
      <!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <?php
 include VIEWPATH.'includes/new_copy_footer.php';  
  ?>
  

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
</div>

<!-- ./wrapper -->
<?php
  include VIEWPATH.'includes/new_script.php';
  ?>

<!-- Page specific script -->
<script>
  $(function () {
    $("#example1").DataTable({
      "responsive": true, "lengthChange": false, "autoWidth": false,
      "buttons": ["excel", "pdf", "print", "colvis"]
    }).buttons().container().appendTo('#example1_wrapper  .col-md-6:eq(0)');
   
  });
</script>
</body>
</html>
