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

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

      <!-- Default box -->
      <div class="card">
      
      <div class="card card-primary">
              <div class="card-header">
                <h3 class="card-title">Detail du courier</h3>
              </div>
              <!-- /.card-header -->
              <!-- form start -->
                <?php 
                          if(!empty($this->session->flashdata('message')))
                             echo $this->session->flashdata('message');
            ?>
            
            
                <div class="card-body row">
                  <div class="form-group col-lg-2"> <label for="exampleInputEmail1">Type de courier : </label> </div>
                  <div class="form-group col-lg-4"> <?php echo $resultat['TYPE_COURIER']?> </div>
                  <div class="form-group col-lg-2"> <label for="exampleInputEmail1">Nature du courier : </label> </div>
                  <div class="form-group col-lg-4"><?php echo $resultat['NOM_CORRESPONDANT']?></div>
                  <div class="form-group col-lg-2">
                    <label for="exampleInputEmail1">Référence du courier : </label>  </div>
                  <div class="form-group col-lg-4"><?php echo $resultat['NUM_COURIER']?> </div>
                  <div class="form-group col-lg-2"><label for="exampleInputEmail1">Personne en copie : </label></div>
                 
                  <div class="form-group col-lg-4">
                  <?php foreach ($resultatcopie as $key => $value) {
                      echo $value['DESTINATAIRE_COPIE'].'<br>';
                    } ?>
                  </div>
                    
                   
                  
                  <div class="form-group col-lg-2">
                    <label for="exampleInputEmail1">Objet du courier : </label> </div>
                  <div class="form-group col-lg-4"><?php echo $resultat['OBJET_COURIER']?> </div>
                  <div class="form-group col-lg-2">
                    <label for="exampleInputEmail1">Date reception du courier : </label> </div>
                  <div class="form-group col-lg-4"><?php echo $resultat['DATE_TIME_ENREGISTREMENT']?> </div>
                  <div class="form-group col-lg-2">
                    <label for="exampleInputEmail1">Commentaire : </label> </div>
                  <div class="form-group col-lg-4"><?php echo $resultat['COMMENTAIRE']?> </div>
                  <div class="form-group col-lg-2">
                    <label for="exampleInputEmail1">Affectation actuel : </label> </div>
                  <div class="form-group col-lg-4"><?php echo $resultat['AFFECTATION_ACTUEL']?> </div>

                  <div class="form-group col-lg-2">
                    <label for="exampleInputEmail1">Voir documents : </label> 
                    
                    
                  </div>

                  <div class="form-group col-lg-4">
                  <button type="button" style="" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#myModalalldoc">
                        Documents
                      </button>
                      <div class="modal fade" id="myModalalldoc" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog modal-lg" role="document" style="max-width: 80%;">
                          <div class="modal-content">
                         
                            <div class="modal-body">
                              <?php
                        $urlpass = base_url();
                        $elementspas = explode("/", $urlpass);
                        $nouveau_urlpass = null ;
                          $indicepass = sizeof($elementspas);
                          for ($i = 0; $i < ($indicepass - 2); $i++) {
                              $nouveau_urlpass .=$elementspas[$i] . '/';
                            }

                          ?>
                          <div class="text-center"><h6>Scan du document</h6></div>

                        <embed src="<?=$nouveau_urlpass?>/uploads/scandocument/<?=$resultat['SCAN_ORIGINAL']?>" type="application/pdf" scrolling="auto" height="500px" width="100%">

                            </div>
                            <div class="modal-footer">
                              <button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
                            </div>
                          </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';
  ?>

<script>

function get_departement(va){
 var ID_DIRECTION= $(va).val();
 $.post('<?php echo base_url('courier/Enregistrement_Courier/get_departement')?>',
     {ID_DIRECTION:ID_DIRECTION},
     function(data){
       $('#ID_SERVICE').html(data);
     });
$.post('<?php echo base_url('courier/Enregistrement_Courier/get_destinataire')?>',
     {ID_DIRECTION:ID_DIRECTION},
     function(data){
       $('#DESTINATAIRE_PRINCIPAL').html(data);
     });
}
</script>

<script>

function get_service(va){
 var ID_SERVICE= $(va).val();
 $.post('<?php echo base_url('courier/Enregistrement_Courier/get_destinataire_ser')?>',
     {ID_SERVICE:ID_SERVICE},
     function(data){
       $('#DESTINATAIRE_PRINCIPAL').html(data);
     });
}
</script>


</body>
</html>
