<?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_demande_doc.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 demandes</h3>
              </div> -->
              <!-- /.card-header -->
              <div class="card-body">

        <ul class="nav nav-pills">  
          <li class="nav-item">  
            <a class="nav-link active" href="<?=base_url('gestion_document/Demande_Document/listejson')?>"> Toutes </a>  
          </li>  
          <li class="nav-item">  
            <a class="nav-link" href="<?=base_url('gestion_document/Demande_Document/listejson_atraiter')?>"> A traiter </a>  
          </li>  
          <li class="nav-item">  
            <a class="nav-link" href="<?=base_url('gestion_document/Demande_Document/listejson_traitees')?>"> Traitées </a>  
          </li>  
          <li class="nav-item">  
            <a class="nav-link" href="<?=base_url('gestion_document/Demande_Document/listejson_atente')?>"> En attentes </a>  
          </li>   
        </ul>  
        <?php if($this->session->userdata('SOCAR_PROFIL_ID')==12 || $this->session->userdata('SOCAR_PROFIL_ID')==5) {?>
  <a style="margin-top: -40px" class="btn btn-outline-primary btn-xs float-right <?php if($this->router->method == 'index') echo 'active';?>" href="<?=base_url('gestion_document/Demande_Document')?>"><i class="fa fa-plus" aria-hidden="true"></i> Nouvelle</a> <?php } ?>

    <div class="table-responsive">

    <?=$this->session->flashdata('message');
              //include 'includes/menu_demande_doc.php';
      ?>
     <table id='mytable' class="table table-bordered table-striped table-hover table-condensed" style="width: 100%;">
       <thead>
         <tr>  
           <th>Demandé</th>
           <th>Requérant</th> 
         <!--   <th>Matricule</th>
           <th>Contacts</th> -->
           <th>Type</th>
           <th>Niveau</th>
           <th>Etape</th>
           <th>Options</th>       
         </tr>
       </thead>

     </table>

</div>


               
              </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';
?>

<!-- LISTE DE TOUTES LES DEMANDES -->
<script>
$(document).ready(function(){
$('#message_m').delay('slow').fadeOut(3000);
$('#msgs').delay('slow').fadeOut(3000);
    var row_count ="1000000";
$("#mytable").DataTable({
        "processing":true,
        "serverSide":true,
        "order": [[0, "desc" ]],
        "ajax":{
            url:"<?=base_url()?>gestion_document/Demande_Document/listing",
            type:"POST"
        },
    lengthMenu: [[10,50, 100, row_count], [10,50, 100, "All"]],
    pageLength: 10,
        "columnDefs":[{
            "targets":[],
            "orderable":true
        }],

                  dom: 'Bfrtlip',
    buttons: [
    ],
       language: {
                "sProcessing":     "<div class='progress active'><div class='progress-bar progress-bar-striped progress-bar-animated' role='progressbar' aria-valuenow='75' aria-valuemin='0' aria-valuemax='100' style='width: 75%'></div></div>",
                "sSearch":         "Rechercher&nbsp;:",
                "sLengthMenu":     "Afficher _MENU_ &eacute;l&eacute;ments",
                "sInfo":           "Affichage de l'&eacute;l&eacute;ment _START_ &agrave; _END_ sur _TOTAL_ &eacute;l&eacute;ments",
                "sInfoEmpty":      "Affichage de l'&eacute;l&eacute;ment 0 &agrave; 0 sur 0 &eacute;l&eacute;ment",
                "sInfoFiltered":   "(filtr&eacute; de _MAX_ &eacute;l&eacute;ments au total)",
                "sInfoPostFix":    "",
                "sLoadingRecords": "Chargement en cours...",
                "sZeroRecords":    "Aucun &eacute;l&eacute;ment &agrave; afficher",
                "sEmptyTable":     "Aucune donn&eacute;e disponible dans le tableau",
                "oPaginate": {
                  "sFirst":      "Premier",
                  "sPrevious":   "Pr&eacute;c&eacute;dent",
                  "sNext":       "Suivant",
                  "sLast":       "Dernier"
                },
                "oAria": {
                  "sSortAscending":  ": activer pour trier la colonne par ordre croissant",
                  "sSortDescending": ": activer pour trier la colonne par ordre d&eacute;croissant"
                }
            }
              
    });
}); 
</script>
