<?php
  include VIEWPATH.'includes/new_header.php';
  ?>
  
<body class="hold-transition sidebar-mini">
<!-- Site wrapper -->
<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_employe.php';
    ?>

    <!-- Main content -->
    <section class="content">

      <!-- Default box -->
      <div class="card">
      
      <div class="card card-primary">
              <div class="card-header">
                <h3 class="card-title">Details d'un Employé</h3>
              </div>
              <!-- /.card-header -->
              <!-- form start -->
                <div class="card-body row">
                
                  <!-- <div class="row"> -->
              <div class="col-5 col-sm-2">
                <div class="nav flex-column nav-tabs h-100" id="vert-tabs-tab" role="tablist" aria-orientation="vertical">
                  <a class="nav-link active" id="vert-tabs-home-tab" data-toggle="pill" href="#vert-tabs-home" role="tab" aria-controls="vert-tabs-home" aria-selected="true">Details Personnel</a>
                  <a class="nav-link" id="vert-tabs-profile-tab" data-toggle="pill" href="#vert-tabs-profile" role="tab" aria-controls="vert-tabs-profile" aria-selected="false">Affectation</a>
                  <a class="nav-link" id="vert-tabs-messages-tab" data-toggle="pill" href="#vert-tabs-messages" role="tab" aria-controls="vert-tabs-messages" aria-selected="false">Cong&eacute;e</a>
                  <!-- <a class="nav-link" id="vert-tabs-settings-tab" data-toggle="pill" href="#vert-tabs-settings" role="tab" aria-controls="vert-tabs-settings" aria-selected="false">Settings</a> -->
                </div>
              </div>
              <div class="col-7 col-sm-10">
                <div class="tab-content" id="vert-tabs-tabContent">
                  <div class="tab-pane text-left fade show active" id="vert-tabs-home" role="tabpanel" aria-labelledby="vert-tabs-home-tab">
                    
                     <table class="table">
                      <tr>
                        <td colspan="2" class="text-center"> Details de l'employ&eacute;</td>
                      </tr>
                      <tr>
                        <td>Nom & Pr&eacute;nom</td>
                        <td><?php echo $data['NOM']?> <?php echo $data['PRENOM']?></td>
                      </tr>
                      <tr>
                        <td>Mail</td>
                        <td><?php echo $data['EMAIL']?></td>
                      </tr>
                      <tr>
                        <td>Sexe</td>
                        <td><?php echo $data['ID_SEXE']?></td>
                      </tr>
                      <tr>
                        <td>Telephone</td>
                        <td><?php echo $data['TEL']?></td>
                      </tr>
                      <tr>
                        <td>Debut service</td>
                        <td><?php echo $data['DATE_ENTRE_SERVICE']?></td>
                      </tr>
                      <tr>
                        <td>Status</td>
                        <td><?php echo $data['STATUS']?></td>
                      </tr>


                      <?php 
                           $urlpass = base_url();
      $elementspas = explode("/", $urlpass);
      $nouveau_urlpass = null ;
        $indicepass = sizeof($elementspas);
        for ($i = 0; $i < ($indicepass - 2); $i++) {
            $nouveau_urlpass .=$elementspas[$i] . '/';
        }

                      ?>

                        <tr>
                        <td>Signature</td>
                        <td><img class="fit-picture" src="<?=$nouveau_urlpass?>uploads/signatures/<?=$data['SIGNATURE']?>" alt="Signature" style="height: 100px"></td>
                      </tr>



                      
                     </table>
                  </div>
                  <div class="tab-pane fade" id="vert-tabs-profile" role="tabpanel" aria-labelledby="vert-tabs-profile-tab">
                     

                     <table class="table">
                       <tr>
                         <td>P&eacute;riode</td>
                         <td>Direction</td>
                         <td>Service</td>
                         <td>Section</td>
                         <td>Status</td>
                         <td>Responsabilite</td>
                       </tr>
                       <?php foreach ($affectation as $affe) {
                         // code...
                       ?>
                       <tr>
                         <td><?php echo $affe['DATE_DEBUT']?> - <?php echo $affe['DATE_FIN']?> </td>
                         <td><?php echo $affe['ID_DIRECTION']?></td>
                         <td><?php echo $affe['ID_SERVICE']?></td>
                         <td><?php echo $affe['SECTION']?></td>
                         <td><?php echo $affe['STATUS_AFFECTATION']?></td>
                         <td><?php echo $affe['ID_RESPONSABILITE']?></td>
                       </tr>
                       <?php }?>

                     </table>

                  </div>

                  <div class="tab-pane fade" id="vert-tabs-messages" role="tabpanel" aria-labelledby="vert-tabs-messages-tab">
                     
                     <table class="table">
                       <tr>
                         <td>Type</td>
                         <td>Traitement</td>
                         <td>Status</td>
                         <td>P Demande</td>
                         <td>P Accorde</td>
                       </tr>
                       <?php foreach ($conge as $conges) {
                         // code...
                       ?>
                       <tr>
                        <td><?php echo $conges['ID_TYPE_CONGE']?></td>
                        <td><?php echo $conges['DATE_SYSTEME_DEMANDE']?> <?php echo $conges['DATE_DERNIER_REPOSE']?></td>
                        <td><?php echo $conges['STATUS_CONGE']?></td>
                         <td><?php echo $conges['DATE_DEBUT_CONGE_DEMANDE']?> / <?php echo $conges['DATE_FIN_CONGE_DEMANDE']?> (<?php echo $conges['NB_JOURS_DEMANDE']?>)</td>
                         <td><?php echo $conges['DATE_DEBUT_CONGE_ACCORDE']?> / <?php echo $conges['DATE_FIN_CONGE_ACCORDE']?> (<?php echo $conges['NB_JOURS_ACCORDE']?>)</td>
                       </tr>
                       <?php }?>

                     </table>
                  </div>
                </div>
              </div>
            <!-- </div> -->
                  


                 
                  
                </div>
                <!-- /.card-body -->

            </div>
        
        
        <!-- /.card-body -->
        <!-- <div class="card-footer">
          Footer
        </div> -->
        <!-- /.card-footer-->
      </div>
      <!-- /.card -->

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <?php
 include VIEWPATH.'includes/new_copy_footer.php';  
  ?>
  <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<?php
  include VIEWPATH.'includes/new_script.php';
  ?>
</body>
</html>
