<?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_reception_courier.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 couriers enregistr&eacute;</h3>
              </div>
              <!-- /.card-header -->
              <div class="card-body">
                <table id="example1" class="table table-bordered table-striped table-hover">
                  <thead>
                  <tr>
                    <th>Référence</th>
                    <th>Objet</th>
                    <th>Type</th>
                    <th>Nature</th>
                    <th>Destinataire</th>
                    <th>Date</th>
                    <th>Expediteur</th>
                    <th></th>
                  </tr>
                  </thead>
                  <tbody>

                  <?php
                    foreach ($resultat as $key) 
                    {
                       
                      
                    $date_enregistrement = $key['DATE_TIME_ENREGISTREMENT'];
                    $date_formattee = date('h:i d/m/Y', strtotime($date_enregistrement));
                     echo "<tr>
                     <td>".$key['NUM_COURIER']."</td>
                     <td>".$key['OBJET_COURIER']."</td>
                     <td>".$key['TYPE_COURIER']."</td>
                     <td>".$key['NATURE_COURIER']."</td>
                     <td>".$key['DESTINATAIRE_PRINCIPAL']."</td>
                     <td>".$date_formattee."</td>
                     <td>".$key['NOM_CORRESPONDANT']."</td>
                     <td>
                     <a href='".base_url("courier/Enregistrement_Courier/details/".$key['ID_COURIER'])."' class='btn btn-primary btn-xs'>Détails</a>
                     </td>
                   </tr>";
           
                }
                  ?>
                  
                  </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>
