<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Pdf_Conge extends CI_Controller {

    function __construct() {
        parent::__construct();
    }
    
    public function index($id){

      include 'pdfinclude/fpdf/mc_table.php';
      include 'pdfinclude/fpdf/pdf_config.php';

      $id=$id;

      $info_conge=$this->Model->getOne('conge_demande_conge',array('ID_DEMANDE_CONGE'=>$id));
      $info_conge_historique=$this->Model->getList('doc_demande_historique',array('DEMANDE_ID'=>$id));

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

      $logo_banque='dist/logo_pdf.png';
     

      $pdf = new PDF_CONFIG('P','mm','A4');
      $pdf->addPage();
      $pdf->Ln(20);
      $pdf->SetFont('Arial','B',15);

      // $pdf->SetX(10);
      $pdf->Cell(190,5,utf8_decode(strtoupper('DEMANDE DE CONGE')),0,1,'C');
      
      $pdf->SetFont('Arial','',10);
      $pdf->Ln(4);
      $pdf->SetX(10);
      $pdf->Cell(55,6,utf8_decode('Nom'),0,0,'L');
      $pdf->Cell(100,6,utf8_decode(':'),0,1,'L');
      $pdf->Cell(55,6,utf8_decode('Prénom'),0,0,'L');
      $pdf->Cell(100,6,utf8_decode(':'),0,1,'L');
      $pdf->Cell(55,6,utf8_decode('Service'),0,0,'L');
      $pdf->Cell(100,6,utf8_decode(':'),0,1,'L');
      $pdf->Cell(55,6,utf8_decode('Fonction'),0,0,'L');
      $pdf->Cell(100,6,utf8_decode(':'),0,1,'L');
      $pdf->Cell(55,6,utf8_decode('Période de congé'),0,0,'L');
      $pdf->Cell(100,6,utf8_decode(':'),0,1,'L');

      $pdf->Ln(4);
      $pdf->Cell(55,6,utf8_decode('Type de congé'),0,0,'L');
      $pdf->Cell(8,6,utf8_decode(' '),1,0,'L');
      $pdf->Cell(100,6,utf8_decode('Congé annuel '),0,1,'L');
      $pdf->Cell(55,6,utf8_decode(''),0,0,'L');
      $pdf->Cell(8,6,utf8_decode(' '),1,0,'L');
      $pdf->Cell(100,6,utf8_decode('Congé de circonstance'),0,1,'L');
      $pdf->Cell(55,6,utf8_decode(''),0,0,'L');
      $pdf->Cell(8,6,utf8_decode(' '),1,0,'L');
      $pdf->Cell(100,6,utf8_decode('Autres : '),0,1,'L');

      $pdf->Ln(5);
      $pdf->Cell(10,6,utf8_decode('Le'),0,0,'L');
      $pdf->Cell(10,6,utf8_decode(''),0,1,'L');
      $pdf->Cell(5,4,utf8_decode(''),0,0,'L');
      $pdf->Cell(50,0,utf8_decode(''),1,1,'L');


      $pdf->Ln(10);
      $pdf->Cell(45,6,utf8_decode('Signature du demandeur '),0,0,'L');
      $pdf->Cell(45,6,utf8_decode(''),0,1,'L');
      $pdf->Cell(45,6,utf8_decode(''),0,0,'L');
      $pdf->Cell(100,0,utf8_decode(''),1,1,'L');
     

      $pdf->Ln(10);
      $pdf->Cell(190,0,utf8_decode(' '),1,1,'L');
      $pdf->Ln(5);

      $pdf->Cell(55,8,utf8_decode('Visa du Service Administration '),0,1,'L');
      $pdf->Cell(55,0,utf8_decode(''),1,1,'L');
      $pdf->Cell(15,5,utf8_decode(''),0,0,'L');
      $pdf->Cell(70,5,utf8_decode('- Nombre de jrs de congés dus : 23.5 jrs ex 2021'),0,1,'L');
      $pdf->Cell(15,5,utf8_decode(''),0,0,'L');
      $pdf->Cell(55,5,utf8_decode('- Nombre de jrs demandés : 1/2 Jrn '),0,1,'L');
      $pdf->Cell(15,5,utf8_decode(''),0,0,'L');
      $pdf->Cell(55,5,utf8_decode('- Nombre de jrs de congés restants : 23 jours ex 2021 '),0,1,'L');
      // $pdf->Cell(40,0,utf8_decode(''),1,1,'L');



      $pdf->Ln(5);
      $pdf->Cell(10,8,utf8_decode('Le '),0,0,'L');
      $pdf->Cell(10,8,utf8_decode('15/11/2022'),0,1,'L');
      $pdf->Cell(10,8,utf8_decode('Signature du Chef de Service Administration '),0,1,'L');
      
      $pdf->Ln(10);
      $pdf->Cell(50,0,utf8_decode(''),1,1,'L');
      $pdf->Ln(10);
      $pdf->Cell(190,0,utf8_decode(' '),1,1,'L');
      $pdf->Ln(5);



      $pdf->Cell(90,5,utf8_decode('Accordé le'),0,0,'L');
      $pdf->Cell(10,5,utf8_decode(''),0,0,'L');
      $pdf->Cell(90,5,utf8_decode('Refusé le'),0,1,'L');
      // $pdf->Ln(10);
      $pdf->Cell(100,5,utf8_decode(''),0,0,'L');
      $pdf->Cell(90,5,utf8_decode('Motif:'),0,1,'L');
      // $pdf->Ln(2);
      $pdf->Cell(100,0,utf8_decode(''),0,0,'L');
      $pdf->Cell(90,0,utf8_decode(''),1,1,'L');
      $pdf->Ln(15);
      $pdf->SetFont('Arial','B',10);
      $pdf->Cell(90,5,utf8_decode('SHAKA FRED. P'),0,0,'L');
      $pdf->Cell(10,5,utf8_decode(''),0,0,'L');
      $pdf->Cell(90,5,utf8_decode('Augustin SINDAYIGAYA'),0,1,'L');
      $pdf->Cell(90,5,utf8_decode('DIRECTEUR TECHNIQUE'),0,0,'L');
      $pdf->Cell(10,5,utf8_decode(''),0,0,'L');
      $pdf->Cell(90,5,utf8_decode('DIRECTEUR GENERAL'),0,1,'L');

   


     

      $pdf->Output('Assurance__mois.pdf','I');

    }


    

    
}
