<?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_messages.php';
    ?>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        
        <?php 
    include 'includes/menu_messages_small.php';
    ?>
        <!-- /.col -->
        <div class="col-md-9">
          <div class="card card-success card-outline">
            <div class="card-header">
              <h3 class="card-title"><?php echo $title?></h3>

              
              <!-- /.card-tools -->
            </div>
            <!-- /.card-header -->
            <div class="card-body p-0">
              
              <div class="table-responsive mailbox-messages">
                <table class="table table-hover table-striped" id="example1">
                  <thead>
                  <tr>
                    <th></th>
                    <th></th>
                    <th></th>
                    <th></th>
                  </tr>
                  </thead>
                  <tbody>

                    <?php
                    foreach ($listemessage as $key) {
                      
                      if ($key['ID_STATUS_MESSAGE'] == 1) {
                        $start = '<i class="fas fa-star text-warning"></i>';
                      }
                      else{
                        $start = ' ';
                      }
                      echo '<tr>
                    
                    <td class="mailbox-star"><a href="#"> '.$start.' </a></td>
                    <td class="mailbox-name"><a href="'.base_url('conge/Messages/read/'.$key['ID_MESSAGE_CONGE'].'').'">'.$key['SNOM'].' '.$key['SPRENOM'].'</a></td>
                    <td class="mailbox-subject"><b>'.$key['TYPE_MESSAGE'].' au conge # '.$key['ID_DEMANDE_CONGE'].' </b>
                    </td>
                    <td class="mailbox-date">'.$key['DATE_SYSTEME_DEMANDE'].'</td>
                  </tr>';
                    }
                    ?>
                 
                  
                  
                  
                  
                  
                  </tbody>
                </table>
                <!-- /.table -->
              </div>
              <!-- /.mail-box-messages -->
            </div>
            <!-- /.card-body -->
            
          </div>
          <!-- /.card -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </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,"ordering": false,
    });
   
  });
</script>

</body>
</html>
