first commit

This commit is contained in:
2025-08-07 13:15:31 +01:00
commit d903893b4c
21854 changed files with 4461308 additions and 0 deletions

View File

@ -0,0 +1,227 @@
<?php
//============================================================+
// File name : tcpdf_config.php
// Begin : 2004-06-11
// Last Update : 2014-12-11
//
// Description : Configuration file for TCPDF.
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2004-2014 Nicola Asuni - Tecnick.com LTD
//
// This file is part of TCPDF software library.
//
// TCPDF is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// TCPDF is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
//
// See LICENSE.TXT file for more information.
//============================================================+
/**
* Configuration file for TCPDF.
* @author Nicola Asuni
* @package com.tecnick.tcpdf
* @version 4.9.005
* @since 2004-10-27
*/
// IMPORTANT:
// If you define the constant K_TCPDF_EXTERNAL_CONFIG, all the following settings will be ignored.
// If you use the tcpdf_autoconfig.php, then you can overwrite some values here.
/**
* Installation path (/var/www/tcpdf/).
* By default it is automatically calculated but you can also set it as a fixed string to improve performances.
*/
//define ('K_PATH_MAIN', '');
/**
* URL path to tcpdf installation folder (http://localhost/tcpdf/).
* By default it is automatically set but you can also set it as a fixed string to improve performances.
*/
//define ('K_PATH_URL', '');
/**
* Path for PDF fonts.
* By default it is automatically set but you can also set it as a fixed string to improve performances.
*/
//define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
/**
* Default images directory.
* By default it is automatically set but you can also set it as a fixed string to improve performances.
*/
//define ('K_PATH_IMAGES', '');
/**
* Deafult image logo used be the default Header() method.
* Please set here your own logo or an empty string to disable it.
*/
//define ('PDF_HEADER_LOGO', '');
/**
* Header logo image width in user units.
*/
//define ('PDF_HEADER_LOGO_WIDTH', 0);
/**
* Cache directory for temporary files (full path).
*/
//define ('K_PATH_CACHE', '/tmp/');
/**
* Generic name for a blank image.
*/
define ('K_BLANK_IMAGE', '_blank.png');
/**
* Page format.
*/
define ('PDF_PAGE_FORMAT', 'A4');
/**
* Page orientation (P=portrait, L=landscape).
*/
define ('PDF_PAGE_ORIENTATION', 'P');
/**
* Document creator.
*/
define ('PDF_CREATOR', 'TCPDF');
/**
* Document author.
*/
define ('PDF_AUTHOR', 'TCPDF');
/**
* Header title.
*/
define ('PDF_HEADER_TITLE', 'TCPDF Example');
/**
* Header description string.
*/
define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
/**
* Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
*/
define ('PDF_UNIT', 'mm');
/**
* Header margin.
*/
define ('PDF_MARGIN_HEADER', 5);
/**
* Footer margin.
*/
define ('PDF_MARGIN_FOOTER', 10);
/**
* Top margin.
*/
define ('PDF_MARGIN_TOP', 27);
/**
* Bottom margin.
*/
define ('PDF_MARGIN_BOTTOM', 25);
/**
* Left margin.
*/
define ('PDF_MARGIN_LEFT', 15);
/**
* Right margin.
*/
define ('PDF_MARGIN_RIGHT', 15);
/**
* Default main font name.
*/
define ('PDF_FONT_NAME_MAIN', 'helvetica');
/**
* Default main font size.
*/
define ('PDF_FONT_SIZE_MAIN', 10);
/**
* Default data font name.
*/
define ('PDF_FONT_NAME_DATA', 'helvetica');
/**
* Default data font size.
*/
define ('PDF_FONT_SIZE_DATA', 8);
/**
* Default monospaced font name.
*/
define ('PDF_FONT_MONOSPACED', 'courier');
/**
* Ratio used to adjust the conversion of pixels to user units.
*/
define ('PDF_IMAGE_SCALE_RATIO', 1.25);
/**
* Magnification factor for titles.
*/
define('HEAD_MAGNIFICATION', 1.1);
/**
* Height of cell respect font height.
*/
define('K_CELL_HEIGHT_RATIO', 1.25);
/**
* Title magnification respect main font size.
*/
define('K_TITLE_MAGNIFICATION', 1.3);
/**
* Reduction factor for small font.
*/
define('K_SMALL_RATIO', 2/3);
/**
* Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
*/
define('K_THAI_TOPCHARS', true);
/**
* If true allows to call TCPDF methods using HTML syntax
* IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
*/
define('K_TCPDF_CALLS_IN_HTML', false);
/**
* If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
*/
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
/**
* Default timezone for datetime functions
*/
define('K_TIMEZONE', 'UTC');
//============================================================+
// END OF FILE
//============================================================+

View File

@ -0,0 +1,49 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetMargins(5, 5, 5, true);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 8.5);
$var1 = '<table style="border-collapse-bottom:separate; border-spacing:5px;">';
$detail = array();
$line_br_counter = 0;
for($i=0;$i < count($arry); $i++){
$ligne = '<tr>
<th align="center" width="58" height="58" style="border-right:1px solid black; border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black;"><img src="'.implode($arry[$i]).'" width="58" height="58"></th>
<th align="center" width="188" height="58" style="border-right:1px solid black; border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black;"><h3>'.key($arry[$i]).'</h3></th>
</tr>';
array_push($detail,$ligne);
$line_br_counter ++;
if($line_br_counter == 5){
$line_br_counter = 0;
$var2 = implode("",$detail);
$content = $var1.$var2.'</table>';
$pdf->writeHTML($content, true, false, false, false, '');
$pdf->AddPage();
unset($var2);
unset($content);
unset($detail);
$detail = array();
}else if($i == count($arry) - 1){
$var2 = implode("",$detail);
$content = $var1.$var2.'</table>';
$pdf->writeHTML($content, true, false, false, false, '');
unset($var2);
unset($content);
unset($detail);
$detail = array();
}
}
//$pdf->Image($filename, 10, 10, 15, 15, 'PNG', '', '', true, 150, '', false, false, 1, false, false, false);
//$pdf->SetXY(25, 10);
//$pdf->Cell(50, 15, $libartc, 1, 0, 'L', 0, '', 0, true,'C', 'C');
$pdf->Output($codeartc.'.pdf', 'I');

View File

@ -0,0 +1,68 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF('L', 'mm', 'C7', true, 'UTF-8', false);
$pdf->SetMargins(1, 1, 1, true);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 4);
// $var1 = '<table style="border-collapse-bottom:separate; border-spacing:2px;">';
// $var1 = '<table>';
// for($i=0;$i < count($arry); $i+=2){
// $ligne = '<tr>
// <th align="center" width="60" height="52"><img src="'.implode($arry[$i]).'" width="60" height="52"></th>
// <th align="center" width="60" height="52" ><h3>'.key($arry[$i]).'</h3></th>
// <th width="18"></th>';
// if($i<count($arry)-1){$ligne = $ligne.'<th align="center" width="60" height="52" ><img src="'.implode($arry[$i+1]).'" width="60" height="52"></th><th align="center" width="60" height="52"><h3>'.key($arry[$i+1]).'</h3></th>
// ';}
// $ligne = $ligne.'</tr>';
// $content = $var1.$ligne.'</table>';
// $pdf->writeHTML($content, true, false, false, false, '');
// $pdf->AddPage();
// unset($ligne);
// }
//one line print
// $var1 = '<table>';
// for($i=0;$i < count($arry); $i++){
// $ligne = '<tr>
// <th align="center" width="52" height="52"><h3>'.key($arry[$i]).'</h3></th>
// <th align="center" width="52" height="52"><img src="'.implode($arry[$i]).'" width="52" height="52"></th>';
// $ligne = $ligne.'</tr>';
// $content = $var1.$ligne.'</table>';
// $pdf->writeHTML($content, true, false, false, false, '');
// $pdf->AddPage();
// unset($ligne);
// }
$var1 = '<table>';
for($i=0;$i < count($arry); $i++){
$ligne = '<tr><th width="3"></th>
<th align="center" width="52" height="52"><img src="'.implode($arry[$i]).'" width="52" height="52"></th>
<th align="center" width="52" height="52"><h4>'.key($arry[$i]).'</h4></th></th><th width="20"></th>
<th align="center" width="60" height="52"></th><th align="center" width="52" height="52">';
$ligne = $ligne.'</tr>';
$content = $var1.$ligne.'</table>';
$pdf->writeHTML($content, true, false, false, false, '');
$pdf->AddPage();
unset($ligne);
}
if($zone != "all"){
$ligne = '<tr>
<th align="center" width="92" height="40" style="border-right:1px solid black; border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black;"><h2>'.$zone.'</h2></th></tr>';
$content = $var1.$ligne.'</table>';
$pdf->writeHTML($content, true, false, false, false, '');
}
//$pdf->Image($filename, 10, 10, 15, 15, 'PNG', '', '', true, 150, '', false, false, 1, false, false, false);
//$pdf->SetXY(25, 10);
//$pdf->Cell(50, 15, $libartc, 1, 0, 'L', 0, '', 0, true,'C', 'C');
$pdf->Output('qr_codes.pdf', 'I');

View File

@ -0,0 +1,68 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF('L', 'mm', 'C7', true, 'UTF-8', false);
$pdf->SetMargins(1, 1, 1, true);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 4);
// $var1 = '<table style="border-collapse-bottom:separate; border-spacing:2px;">';
// $var1 = '<table>';
// for($i=0;$i < count($arry); $i+=2){
// $ligne = '<tr>
// <th align="center" width="60" height="52"><img src="'.implode($arry[$i]).'" width="60" height="52"></th>
// <th align="center" width="60" height="52" ><h3>'.key($arry[$i]).'</h3></th>
// <th width="18"></th>';
// if($i<count($arry)-1){$ligne = $ligne.'<th align="center" width="60" height="52" ><img src="'.implode($arry[$i+1]).'" width="60" height="52"></th><th align="center" width="60" height="52"><h3>'.key($arry[$i+1]).'</h3></th>
// ';}
// $ligne = $ligne.'</tr>';
// $content = $var1.$ligne.'</table>';
// $pdf->writeHTML($content, true, false, false, false, '');
// $pdf->AddPage();
// unset($ligne);
// }
//one line print
// $var1 = '<table>';
// for($i=0;$i < count($arry); $i++){
// $ligne = '<tr>
// <th align="center" width="52" height="52"><h3>'.key($arry[$i]).'</h3></th>
// <th align="center" width="52" height="52"><img src="'.implode($arry[$i]).'" width="52" height="52"></th>';
// $ligne = $ligne.'</tr>';
// $content = $var1.$ligne.'</table>';
// $pdf->writeHTML($content, true, false, false, false, '');
// $pdf->AddPage();
// unset($ligne);
// }
$var1 = '<table>';
for($i=0;$i < count($arry); $i++){
$ligne = '<tr>
<th align="center" width="60" height="52"></th><th align="center" width="52" height="52"></th><th width="20"></th>
<th align="center" width="52" height="52"><img src="'.implode($arry[$i]).'" width="52" height="52"></th>
<th align="center" width="52" height="52"><h3>'.key($arry[$i]).'</h3></th>';
$ligne = $ligne.'</tr>';
$content = $var1.$ligne.'</table>';
$pdf->writeHTML($content, true, false, false, false, '');
$pdf->AddPage();
unset($ligne);
}
if($zone != "all"){
$ligne = '<tr>
<th align="center" width="92" height="40" style="border-right:1px solid black; border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black;"><h2>'.$zone.'</h2></th></tr>';
$content = $var1.$ligne.'</table>';
$pdf->writeHTML($content, true, false, false, false, '');
}
//$pdf->Image($filename, 10, 10, 15, 15, 'PNG', '', '', true, 150, '', false, false, 1, false, false, false);
//$pdf->SetXY(25, 10);
//$pdf->Cell(50, 15, $libartc, 1, 0, 'L', 0, '', 0, true,'C', 'C');
$pdf->Output('qr_codes.pdf', 'I');

View File

@ -0,0 +1,33 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF('L', "mm", 'C7', true, 'UTF-8', false);
$pdf->SetMargins(2.5, 2, 2, true);
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 4);
// $content = '<table style="border-collapse-bottom:separate; border-spacing:2px;">
// <tr>
// <th align="center" width="48" height="40" style="border-right:1px solid black; border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black;"><img src="'.$filename.'" width="48" height="40"></th>
// <th align="center" width="48" height="40" style="border-right:1px solid black; border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black;"><h3>'.$libartc.'</h3></th>
// </tr>
// </table>';
$content = '<table style="border-collapse-bottom:separate; border-spacing:2px;">
<tr>
<th align="center" width="52" height="52"><img src="'.$filename.'" width="52" height="52"></th>
<th align="left" width="52" height="52"><h3>'.$libartc.'</h3></th>
</tr>
</table>';
//$pdf->Image($filename, 10, 10, 15, 15, 'PNG', '', '', true, 150, '', false, false, 1, false, false, false);
//$pdf->SetXY(25, 10);
//$pdf->Cell(50, 15, $libartc, 1, 0, 'L', 0, '', 0, true,'C', 'C');
$pdf->writeHTML($content, true, false, false, false, '');
$pdf->Output($codeartc.'.pdf', 'I');

View File

@ -0,0 +1,222 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// create new PDF document
//error_reporting(E_ALL);
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sophal');
$pdf->SetTitle('BULLETIN DE PAIE');
$pdf->SetSubject('BULLETIN DE PAIE');
// add a page
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 8.5);
// -----------------------------------------------------------------------------
$months = array(1=>"Janvier", 2=>"Février", 3=>"Mars", 4=>"Avril", 5=>"Mai", 6=>"Juin",
7=>"Juillet", 8=>"Août", 9=>"Septembre", 10=>"Octobre", 11=>"Novembre", 12=>"Décembre");
$moisNbr = substr($_GET['periode'], -2);
$annee = substr($_GET['periode'], 0,-2);
$DateRecrutement = explode(" ", $res['employe']['DateRecrutement']);
$DateRecrutement = date_create($DateRecrutement[0]);
$var1 = '
<table cellpadding ="3">
<tr>
<th width="75" height="16" style="border-right:hidden; border-left:0.1px solid black; border-top:hidden; border-bottom:0.1px solid black;"><h4>Nom : </h4></th>
<th width="144" align="center" height="16" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;;" id="Nom">'.$res['employe']['Nom'].'</th>
<th width="140" rowspan="2" align="center" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;"><h3>BULLETIN DE PAIE</h3></th>
<th rowspan="4" width="180" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:hidden;"><img src="../lib/tcpdf/templates/images/logo.png" width="188" height="73"></th>
</tr>
<tr>
<td height="16" style="border-right:hidden; border-left:0.1px solid black; border-top:hidden; border-bottom:0.1px solid black;"><h4>Prénom :</h4></td>
<td align="center" height="16" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;;">'.$res['employe']['Prenom'].'</td>
</tr>
<tr>
<td align="center" height="16" style="border-right:0.1px solid black; border-left:0.1px solid black; border-top:hidden; border-bottom:0.1px solid black;"><H4>Matricule</H4></td>
<td align="center" height="16" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;"><H4>Fonction</H4></td>
<td align="center" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;">Paie du mois</td>
</tr>
<tr>
<td height="16" align="center" style="border-right:0.1px solid black; border-left:0.1px solid black; border-top:hidden; border-bottom:0.1px solid black;">'.$res['employe']['MATRICULE'].'</td>
<td height="16" align="center" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;">'.$res['employe']['Libelle'].'</td>
<td rowspan="2" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;">Mois :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$months[(int)$moisNbr].'<BR><BR>Année :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$annee.'</td>
</tr>
<tr>
<td align="center" height="16" style="border-right:0.1px solid black; border-left:0.1px solid black; border-top:hidden; border-bottom:0.1px solid black;"><H4>Date Recrut.</H4></td>
<td align="center" height="16" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;">'.date_format($DateRecrutement,"d/m/Y").'</td>
<td align="center" style="border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:0.1px solid black;">N S.S Employeur : '.$res['employe']['NumEmplyeur'].'</td>
</tr>
</table>
<table>
<tr style="line-height: 50%;">
<td></td>
</tr>
</table>
<table cellpadding ="4">
<tr>
<th ></th>
<th width="244"></th>
<th width="80" height="20" align="center" style=" border-left:0.1px solid black; border-top:0.1px solid black; border-bottom:0.1px solid black;">S. Base </th>
<th width="80" height="20" align="center" style="border-right:0.1px solid black; border-top:0.1px solid black; border-bottom:0.1px solid black; text-align: right;">'.$res['entete']['SalBaseTheorique'].'</th>
</tr>
</table>
<table>
<tr style="line-height: 50%;">
<td></td>
</tr>
</table>
<table border="0.1" cellpadding ="3" style="border-radius: 10%;">
<tr>
<th align="center" style="width:3.9 cm" ><H4>Désignation Unité</H4></th>
<th align="center" style="width:1.6 cm"><H4>Centre de<br>cout</H4></th>
<th align="center" style="width:1.3 cm"><H4>Sit.Fam</H4></th>
<th align="center" style="width:1.3 cm"><H4>Nbre<br>Jrs/Hrs</H4></th>
<th align="center" style="width:2 cm"><H4>Cat/Sec/Ech</H4></th>
<th align="center" style="width:3.9 cm"><H4>N° Compte bancaire</H4></th>
<th align="center" style="width:2.5 cm"><H4>N° Mutuel</H4></th>
<th align="center" style="width:2.5 cm"><H4>N° Sec Soc</H4></th>
</tr>
<tr>
<td>'.$res['employe']['SERVICE'].'</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td></td>
<td align="center">'.$res['employe']['NumCompte'].'</td>
<td></td>
<td align="center">'.$res['employe']['NumSSNational'].'</td>
</tr>
</table>
<table>
<tr style="line-height: 50%;">
<td></td>
</tr>
</table>
<table border="0.8" cellpadding ="5">
<tr >
<th height="25" align="center" style="width:1.5 cm ;"><H4>Code</H4></th>
<th align="center" style=" width:7.5 cm ; "><H4>Libelle de la Rubrique</H4></th>
<th align="center" style="width:1.6 cm ;"><H4>Nombre</H4></th>
<th align="center" style="width:1.8 cm ; "><H4>Base</H4></th>
<th align="center" style="width:1.6 cm ; "><H4>Taux</H4></th>
<th align="center" style="width:2.5cm ; "><H4>Gains</H4></th>
<th align="center" style="width:2.5cm ;"><H4>Retenues</H4></th>
</tr>
</table>
<table cellpadding ="2">';
$values = array();
for($i = 0 ; $i < count($res['lignes']) ; $i++){
$Nombre = floatval($res['lignes'][$i]['Nombre']) == 0 ? '' : number_format(floatval($res['lignes'][$i]['Nombre']), 2, ',', ' ');
$Base = floatval($res['lignes'][$i]['Base']) == 0 ? '' : number_format(floatval($res['lignes'][$i]['Base']), 2, ',', ' ');
$Taux = floatval($res['lignes'][$i]['Taux']) == 0 ? '' : number_format(floatval($res['lignes'][$i]['Taux']), 2, ',', ' ');
$ResEmploye = floatval($res['lignes'][$i]['ResEmploye']) == 0 ? '' : number_format(floatval($res['lignes'][$i]['ResEmploye']), 2, ',', ' ');
if((int)$res['lignes'][$i]['LeSens'] == +1 ){
$Gains = $ResEmploye;
$Retenues = '';
}elseif((int)$res['lignes'][$i]['LeSens'] == -1){
$Gains = '';
$Retenues = $ResEmploye;
}
$ligne = '<tr >
<td align="center" style=" width:1.5 cm ; border-right:0.1px solid black; border-left:0.1px solid black; border-top:hidden; border-bottom:hidden;">'.$res['lignes'][$i]['CodeRubrique'].'</td>
<td style=" width:7.5 cm ;border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:hidden;">'.$res['lignes'][$i]['Libelle'].'</td>
<td style="width:1.6 cm ; border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:hidden; text-align: right;">'.$Nombre.'</td>
<td style="width:1.8 cm ; border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:hidden; text-align: right;">'.$Base.'</td>
<td style=" width:1.6 cm ; border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:hidden; text-align: right;" >'.$Taux.'</td>
<td style="width:2.5cm ; border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:hidden; text-align: right;">'.$Gains.'</td>
<td style=" width:2.5cm ; border-right:0.1px solid black; border-left:hidden; border-top:hidden; border-bottom:hidden; text-align: right;">'.$Retenues.'</td>
</tr>';
array_push($values,$ligne);
}
$var2 = implode("", $values);
$TotalBrut = $res['entete']['TotalBrut'] > 0 ? number_format($res['entete']['TotalBrut'], 2, '.', ' ') : "";
$BaseIRGTheorique = $res['entete']['BaseIRGTheorique'] > 0 ? number_format($res['entete']['BaseIRGTheorique'], 2, '.', ' ') : "";
$BaseSSTheorique = $res['entete']['BaseSSTheorique'] > 0 ? number_format($res['entete']['BaseSSTheorique'], 2, '.', ' ') : "";
$NetAPayer = $res['entete']['NetAPayer'] > 0 ? number_format($res['entete']['NetAPayer'], 2, '.', ' ') : "";
$var3 = '<tr>
<td style="border-right:0.8px solid black; border-left:0.8px solid black; border-top:0.8px solid black; border-bottom:0.8px solid black; text-align: right;" colspan="5"><H4>TOTAUX</H4></td>
<td align="center" style="border-right:0.8px solid black; border-left:0.8px solid black; border-top:0.8px solid black; border-bottom:0.8px solid black"><H4>'.number_format($res['entete']['TotalGain'], 2, '.', ' ').'</H4></td>
<td align="center" style="border-right:0.8px solid black; border-left:0.8px solid black; border-top:0.8px solid black; border-bottom:0.8px solid black"><H4>'.number_format($res['entete']['TotalRetenue'], 2, '.', ' ').'</H4></td>
</tr>
</table>
<table>
<tr style="line-height: 50%;">
<td></td>
</tr>
</table>
<table cellpadding ="2">
<tr >
<th height="28" align="center" style=" width:2.8cm; border-right:0.8px solid black; border-left:0.8px solid black; border-top:0.8px solid black; border-bottom:0.8px solid black;"><h4>Salaire Brut</h4></th>
<th width="3"></th>
<th align="center" style="width:3.8cm; border-right:0.8px solid black; border-left:0.8px solid black; border-top:0.8px solid black; border-bottom:0.8px solid black;"><h4>Base I.R.G</h4></th>
<th width="3"></th>
<th align="center" style="width:3.3cm; border-right:0.8px solid black; border-left:0.8px solid black; border-top:0.8px solid black; border-bottom:0.8px solid black;"><h4>Alloc. Familliales</h4></th>
<th width="3"></th>
<th align="center" style="width:3.7cm;border-right:0.8px solid black; border-left:0.8px solid black; border-top:0.8px solid black; border-bottom:0.8px solid black;"><h4>Salaire de Poste</h4></th>
<th width="3"></th>
<th align="center" style="width:5cm; border-right:0.8px solid black; border-left:0.8px solid black; border-top:0.8px solid black; border-bottom:0.8px solid black;"><h4>Net A Payer</h4></th>
</tr>
<tr>
<td align="center" style="width:2.8cm; border-right:0.8px solid black; border-left:0.8px solid black; border-top:hidden; border-bottom:0.8px solid black;"><h4>'.$TotalBrut.'</h4></td>
<td width="3"></td>
<td align="center" style="width:3.8cm; border-right:0.8px solid black; border-left:0.8px solid black; border-top:hidden; border-bottom:0.8px solid black;"><h4>'.$BaseIRGTheorique.'</h4></td>
<td width="3"></td>
<td align="center" style="width:3.3cm; border-right:0.8px solid black; border-left:0.8px solid black; border-top:hidden; border-bottom:0.8px solid black;"><h4></h4></td>
<td width="3"></td>
<td align="center" style="width:3.7cm; border-right:0.8px solid black; border-left:0.8px solid black; border-top:hidden; border-bottom:0.8px solid black;"><h4>'.$BaseSSTheorique.'</h4></td>
<td width="3"></td>
<td align="center" style="width:5cm;border-right:0.8px solid black; border-left:0.8px solid black; border-top:hidden; border-bottom:0.8px solid black;"><h4>'.$NetAPayer.'</h4></td>
</tr>
</table>';
$vartotal = $var1.$var2.$var3;
$pdf->writeHTML($vartotal, true, false, false, false, '');
//Close and output PDF document
$pdf->Output('BULLETIN_DE_PAIE.pdf', 'I');

View File

@ -0,0 +1,222 @@
<?php
//============================================================+
// File name : tcpdf_config.php
// Begin : 2004-06-11
// Last Update : 2013-05-16
//
// Description : Example of alternative configuration file for TCPDF.
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD
//
// This file is part of TCPDF software library.
//
// TCPDF is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// TCPDF is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
//
// See LICENSE.TXT file for more information.
//============================================================+
/**
* Example of alternative configuration file for TCPDF.
* @author Nicola Asuni
* @package com.tecnick.tcpdf
* @version 4.9.005
* @since 2004-10-27
*/
/**
* Define the following constant to ignore the default configuration file.
*/
define ('K_TCPDF_EXTERNAL_CONFIG', true);
/**
* Installation path (/var/www/tcpdf/).
* By default it is automatically calculated but you can also set it as a fixed string to improve performances.
*/
//define ('K_PATH_MAIN', '');
/**
* URL path to tcpdf installation folder (http://localhost/tcpdf/).
* By default it is automatically set but you can also set it as a fixed string to improve performances.
*/
//define ('K_PATH_URL', '');
/**
* Path for PDF fonts.
* By default it is automatically set but you can also set it as a fixed string to improve performances.
*/
//define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
/**
* Default images directory.
* By default it is automatically set but you can also set it as a fixed string to improve performances.
*/
define ('K_PATH_IMAGES', dirname(__FILE__).'/../images/');
/**
* Deafult image logo used be the default Header() method.
* Please set here your own logo or an empty string to disable it.
*/
define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
/**
* Header logo image width in user units.
*/
define ('PDF_HEADER_LOGO_WIDTH', 30);
/**
* Cache directory for temporary files (full path).
*/
define ('K_PATH_CACHE', sys_get_temp_dir().'/');
/**
* Generic name for a blank image.
*/
define ('K_BLANK_IMAGE', '_blank.png');
/**
* Page format.
*/
define ('PDF_PAGE_FORMAT', 'A4');
/**
* Page orientation (P=portrait, L=landscape).
*/
define ('PDF_PAGE_ORIENTATION', 'P');
/**
* Document creator.
*/
define ('PDF_CREATOR', 'TCPDF');
/**
* Document author.
*/
define ('PDF_AUTHOR', 'TCPDF');
/**
* Header title.
*/
define ('PDF_HEADER_TITLE', 'TCPDF Example');
/**
* Header description string.
*/
define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
/**
* Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
*/
define ('PDF_UNIT', 'mm');
/**
* Header margin.
*/
define ('PDF_MARGIN_HEADER', 5);
/**
* Footer margin.
*/
define ('PDF_MARGIN_FOOTER', 10);
/**
* Top margin.
*/
define ('PDF_MARGIN_TOP', 27);
/**
* Bottom margin.
*/
define ('PDF_MARGIN_BOTTOM', 25);
/**
* Left margin.
*/
define ('PDF_MARGIN_LEFT', 15);
/**
* Right margin.
*/
define ('PDF_MARGIN_RIGHT', 15);
/**
* Default main font name.
*/
define ('PDF_FONT_NAME_MAIN', 'helvetica');
/**
* Default main font size.
*/
define ('PDF_FONT_SIZE_MAIN', 10);
/**
* Default data font name.
*/
define ('PDF_FONT_NAME_DATA', 'helvetica');
/**
* Default data font size.
*/
define ('PDF_FONT_SIZE_DATA', 8);
/**
* Default monospaced font name.
*/
define ('PDF_FONT_MONOSPACED', 'courier');
/**
* Ratio used to adjust the conversion of pixels to user units.
*/
define ('PDF_IMAGE_SCALE_RATIO', 1.25);
/**
* Magnification factor for titles.
*/
define('HEAD_MAGNIFICATION', 1.1);
/**
* Height of cell respect font height.
*/
define('K_CELL_HEIGHT_RATIO', 1.25);
/**
* Title magnification respect main font size.
*/
define('K_TITLE_MAGNIFICATION', 1.3);
/**
* Reduction factor for small font.
*/
define('K_SMALL_RATIO', 2/3);
/**
* Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
*/
define('K_THAI_TOPCHARS', true);
/**
* If true allows to call TCPDF methods using HTML syntax
* IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
*/
define('K_TCPDF_CALLS_IN_HTML', true);
/**
* If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
*/
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
//============================================================+
// END OF FILE
//============================================================+

View File

@ -0,0 +1,212 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {
//Page header
/*
public function Header() {
$this->SetTextColor(34, 112, 147);
$image_file = '../lib/tcpdf/templates/images/logo.png';
$this->Image($image_file, 15, 5, 19, '', 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
$this->SetFont('times', 'B', 14 );
$this->Cell( 3 );
$this->Cell( 0, 0, 'SOCIETE PHARMACETIQUE ALGERIENNE', 0, 1 );
$this->SetFont('times', 'i', 9 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Siège social : BP 10, Bir El Djir - 31295 - Oran - Algérie,', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Usine : BP 147 , Hassi Ben Okba -31295 - Oran -Algérie', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Tél : +213 (0) 41 42 87 71/72 -Fax : +213 (0) 41 42 87 76', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Email : info@sophal.DZ/sophal@gmail.com', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, '', 0, 1 );
}
*/
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
//$this->SetTextColor(34, 112, 147);
//$this->Cell( 0, 0, 'SOCIETE PAR ACTIONS AU CAPITAL DE 5.000.000.000 DA', 0, 1 ,'C');
//$this->Cell( 0, 0, 'R.C.N °99B 00103116 N°M.F:099931010311611 N° A.I:31030136520', 0, 1,'C' );
$this->SetTextColor(0, 0, 0);
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
if($res[0]['type'] == 'contre decharge'){
$titre = 'Contre Décharge' ;
$type = 'Contre Décharge N° : ' ;
$text = 'avoir reçu de';
}else if($res[0]['type'] == 'decharge'){
$titre = 'Décharge' ;
$type = 'Décharge N° : ' ;
$text = 'avoir remis à';
}
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sophal');
$pdf->SetTitle($titre);
$pdf->SetSubject('Sophal');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set margins
//$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP+8, PDF_MARGIN_RIGHT);
//$pdf->SetHeaderMargin(2);
//$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
//$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', 'I', 12);
// add a page
$pdf->AddPage();
$codes = array("decharge"=>"FRM.D.00562.01 (SOP.D.00155.01)", "contre decharge"=>"FRM.D.00563.01 (SOP.D.00155.01)");
$headerTitels = array("decharge"=>"FORMULAIRE GÉNÉRAL DE DÉCHARGE DE RESPONSABILITÉ", "contre decharge"=>"FORMULAIRE GÉNÉRAL DE CONTRE DÉCHARGE DE RESPONSABILITÉ");
$Header = '<table border="0.5">
<thead>
<tr>
<td rowspan="2" width="95" align="center" ><br><img src="../lib/tcpdf/templates/images/logo.png" width="65" ></td>
<td width="265" align="center" height="70" ><br><h4>'.$headerTitels[$res[0]['type']].'</h4></td>
<td align="center"><br><h4>DATE D&#x27;APPLICATION</h4> <br> Avril 2022</td>
</tr>
<tr >
<td align="center" >'.$codes[$res[0]['type']].'</td>
<td></td>
</tr>
</thead>
</table>';
$pdf->writeHTML($Header, true, false, false, false, '');
$pdf->SetFont('times', 'BI', 12);
$pdf->Cell( 0, 0, $type.$res[0]['num'], 0, 1 ,'R');
$pdf->SetFont('times', 'I', 12);
$v = '<table>
<tr style="line-height: 150%;">
<td></td>
</tr>
</table>
<table cellpadding ="2">
<tr>
<th style=" width:1.3 cm ; text-align: right">-</th>
<th style=" width:16 cm ;">On soussigné Direction des Systèmes dInformations de la spa SOPHAL '.$text.' </th>
</tr>
<tr>
<td></td>
<td><strong>'.$res[0]['titre'].'.'.mb_strtoupper($user['fullname'],"UTF-8").'</strong> en qualité <strong>'.mb_strtoupper($res[0]['fonction'],"UTF-8").'</strong> les biens suivants:</td>
</tr>
</table>';
$pdf->writeHTML($v, true, false, false, false, '');
$var = '<table border="0.5" cellpadding ="5">
<tr >
<th height="25" style="width:5 cm ;"><H4>Désignation</H4></th>
<th style=" width:2 cm ; "><H4>Quantité</H4></th>
<th style="width:9 cm ;"><H4>Fiche Technique</H4></th>
<th style="width:2.5 cm ; "><H4>Etat</H4></th>
</tr>';
$values = array();
for($i = 0 ; $i < count($res) ; $i++){
$ligne = '<tr >
<td>'.$res[$i]['designation'].'</td>
<td>'.$res[$i]['quantite'].'</td>
<td>'.$res[$i]['fiche'].'</td>
<td>'.$res[$i]['etat'].'</td>
</tr>';
array_push($values,$ligne);
}
$var2 = implode("", $values);
$var3 = '</table>';
$pdf->writeHTML($var.$var2.$var3, true, false, false, false, '');
if($res[0]['type'] == 'decharge'){
$var4 = '<table cellpadding="2">
<tr>
<th style=" width:1.3 cm ; text-align: right">-</th>
<th style=" width:16 cm ; ">Je soussigné(e) <strong>'.$res[0]['titre'].'.'.mb_strtoupper($user['fullname'],"UTF-8").'</strong> avoir reçu les biens mentionnés ci-dessus.</th>
</tr>
<tr>
<td style=" text-align: right">-</td>
<td>Jatteste quil est de ma seule responsabilité de veiller aux biens de la société qui mont été confié,
et je ne pourrai en aucun cas tenir la société pour responsable en cas de perte, de vol ou détérioration. </td>
</tr>
<tr>
<td style=" text-align: right">-</td>
<td>Lutiliser uniquement dans le cadre professionnel. </td>
</tr>
<tr>
<td style=" text-align: right ">-</td>
<td>Le remboursement se fait sous réserve de lavis de la direction en cas de perte, vol ou casse. </td>
</tr>
<tr>
<td style="text-align: right">-</td>
<td>Je reconnais avoir pris connaissance des sanctions prévues dans le règlement intérieur. </td>
</tr>
</table>';
$pdf->writeHTML($var4, true, false, false, false, '');
}
$pdf->SetFont('times', 'BI', 12);
$x = '<table><tr style="line-height: 150%;"><td></td></tr></table>
<table cellpadding ="3">
<tr>
<th>Fait à Hassi Ben Okba, le : '.$res[0]['date'].'</th>
</tr>
</table>';
$pdf->writeHTML($x, true, false, false, false, '');
$pdf->SetFont('times', 'BIU', 12);
$visa = '<table><tr style="line-height: 150%;"><td></td></tr></table>
<table cellpadding ="3">
<tr align="center">
<th>'.$res[0]['titre'].'.'.mb_strtoupper($user['fullname'],"UTF-8").'</th>
<th>Direction des Systèmes dInformations</th>
</tr>
</table>
<table><tr style="line-height: 2cm;"><td></td></tr></table>';
$pdf->writeHTML($visa, true, false, false, false, '');
$pdf->Output($res[0]['type'].'_'.$user['fullname'].'.pdf', 'I');

View File

@ -0,0 +1,487 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// create new PDF document
require_once '../functionsophalglpi.php';
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sophal SPA');
$pdf->SetTitle('EVALUATION ANNUELLE');
$pdf->SetSubject('EVALUATION ANNUELLE');
// add a page
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 11);
$res = get_entete($idrfe);
$user = getUserId($res[0]['id_candidat']);
$annee = is_numeric(get_annee($idrfe)) ? get_annee($idrfe) : '' ;
$List = callWebService($user['matricule'] , 'get_MonDossierRH');
$profile_riasec = getRiasecTestResults($res[0]['id_candidat'],$annee);
// $profile_riasec = getRiasecTestResults(458,$annee);
//supprimer UTF-8-BOM
for ($i = 0; $i <= 31; ++$i) {
$List = str_replace(chr($i), "", $List);
}
$List = str_replace(chr(127), "", $List);
if (0 === strpos(bin2hex($List), 'efbbbf')) {
$List = substr($List, 3);
}
//supprimer UTF-8-BOM
$List = json_decode($List,true);
//print_r($List);
//print_r($allNotes);
//$imageContent = file_get_contents($List['photo']);
//$path = tempnam(sys_get_temp_dir(), 'prefix');
//file_put_contents ($path, $imageContent);
$titre_document = '
<table cellpadding="2">
<tr>
<td colspan="2" align="center"></td>
</tr>
<tr>
<td colspan="2" align="center"><h1>EVALUATION ANNUELLE '.$annee.'</h1></td>
</tr>
<tr>
<td colspan="2" align="center"></td>
</tr>
</table><hr> ';
$pdf->writeHTML($titre_document, true, false, false, false, '');
$employer_details = '
<table cellpadding="2" >
<tr>
<td style="width:3.2 cm"><strong>Nom & Prenom</strong></td>
<td style="width:9.7 cm"> : '.$List['employe']['employe_name'].'</td>
<td rowspan="7" align="center"><img src="@' . preg_replace('#^data:image/[^;]+;base64,#', '', $List['photo']) . '" width="120" ></td>
</tr>
<tr>
<td><strong>Département</strong></td>
<td> : '.$List['employe']['DEPARTEMENT'].'</td>
</tr>
<tr>
<td><strong>Fonction</strong></td>
<td> : '.$List['employe']['Libelle'].'</td>
</tr>
<tr>
<td><strong>Service</strong></td>
<td> : '.$List['employe']['SERVICE'].'</td>
</tr>
<tr>
<td><strong>Matricule</strong></td>
<td> : '.$List['employe']['MATRICULE'].'</td>
</tr>
<tr>
<td><strong>Téléphone</strong></td>
<td> : '.$List['employe']['NUMTELEPHONE'].'</td>
</tr>
<tr>
<td><strong>Date de recrutement</strong></td>
<td> : '.date("d-m-Y", strtotime($List['employe']['DateRecrutement'])).'</td>;
</tr>
</table>
<table>
<tr style="line-height: 50%;">
<td></td>
</tr>
</table>';
// print_r($List['postes']);
// print_r(count($List['postes']));
$blank_lines_count = 8; //6 - count($List['postes']);
$pdf->writeHTML($employer_details, true, false, false, false, '');
$postes = '
<table cellpadding="2">
<tr>
<td colspan="2" align="left"><strong>Différents postes de travail</strong> : </td>
<td align="center"><strong>Notes</strong> </td>
</tr><tr><td colspan="2"><ul>';
foreach($List['postes'] as $val){
$postes = $postes.'<li>'.$val['poste'].'</li>';
}
$postes = $postes.'</ul></td><td align="left"><ul><li><strong>Note Competence</strong> : '.$compNote.'/7</li><li><strong>Note Finale</strong> : '.$finalNote.'/10</li></ul></td></tr></table>';
$pdf->writeHTML($postes, true, false, false, false, '');
$profile = "Contribution operationnel";
if($compNote > 2 & $compNote < 4)
$profile = "Apport tactique";
if($compNote >= 4 & $compNote < 6)
$profile = "Apport stratégique";
if($compNote >= 6)
$profile = "Contribution visionnaire";
$profile_eval = '
<table cellpadding="2" >
<tr>
<td colspan="3" align="left"><strong>Profile</strong> : </td>
</tr><tr><td colspan="3"><ul>';
$profile_eval = $profile_eval.'<li>'.$profile.'</li></ul></td></tr></table>';
$pdf->writeHTML($profile_eval, true, false, false, false, '');
$profile_psycho = '
<table cellpadding="2" >
<tr>
<td align="left"><strong>Profile Psychotechnique</strong> : </td>
<td colspan="2" align="left"></td>
</tr><tr><td><ul>';
$riasec_score = "N/A";
$riasec_date = "";
if($profile_riasec){
$riasec_score = $profile_riasec['score'];
$riasec_date = ' (Date d\'evaluation '.date('d-m-Y',strtotime($profile_riasec['test_date'])).')';
}
$explaine ='<td colspan="3" align="left"><img height ="200" src="'.$CFG_GLPI["root_doc"].'/pics/raisec.PNG"></td>';
$profile_psycho = $profile_psycho.'<li>'.$riasec_score.$riasec_date.'</li></ul></td>'.$explaine.'</tr></table>';
$pdf->writeHTML($profile_psycho, true, false, false, false, '');
$spacing = '<table cellpadding="2" >';
for($i = 0; $i < $blank_lines_count ; $i++){
$spacing = $spacing.'<tr ><td style="width:3.2 cm">&nbsp;</td><td style="width:9.7 cm">&nbsp;</td><td>&nbsp;</td></tr>';
}
$spacing = $spacing.'</table>';
if($blank_lines_count > 0)
$pdf->writeHTML($spacing, true, false, false, false, 'C');
$charts = '<div style="float: right;"><table style="float: right;" cellpadding="2" border="1">
<tr>
<td style="width:12 cm">Resultats de l\'evaluation</td>
</tr>
</table></div>
';
$pdf->writeHTML($charts, true, false, false, false, 'C');
if($image_all_note != 'data:,')
//$pdf->writeHTML('<img src="@' . preg_replace('#^data:image/[^;]+;base64,#', '', $image_all_note) . '" >', true, false, false, false, 'C');
if($graph != 'data:,')
$pdf->writeHTML('<img src="@' . preg_replace('#^data:image/[^;]+;base64,#', '', $graph) . '" >', true, false, false, false, 'C');
$titre_tableau = '';
for($p = 0; $p < count($res) ; $p++){
$debut ='<table border="0.5" cellpadding="2">';
if($res[$p]['question'] == '1. Performances' ||
$res[$p]['question'] == '2. Compétences' ||
$res[$p]['question'] == 'Examen du plan de Formation' ||
$res[$p]['question'] == '3. Evaluation RH' ||
$res[$p]['question'] == 'Objectifs'
){
$debut = '<br pagebreak="true"/>'.$debut;
}
if($res[$p]['question'] == '1. Performances' || $res[$p]['question'] == 'Plan de Developpement de Carrière'){
$titre_tableau='<tr>
<th colspan="4" align="center"><strong>'.$res[$p]['question'].'</strong> </th>
</tr>';
}elseif($res[$p]['question'] == 'Objectifs'){
$titre_tableau='<tr>
<th colspan="2" align="center"><strong>'.$res[$p]['question'].' '.(intval($annee)+1).'</strong> </th>
</tr>';
}else{
$titre_tableau ='<tr>
<th colspan="2" align="center"><strong>'.$res[$p]['question'].'</strong> </th>
</tr>';
}
$s = '';
$ligne = get_lignes($res[$p]['id'],$idrfe) ;
$objectifs_count = 0;
if(count($ligne) > 0){
for($ps = 0; $ps < count($ligne) ; $ps++){
if(is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] != "[2]" && $res[$p]['question'] == '1. Performances'){
if($ligne[$ps]['reponse'] != '' ){
$s = $s.'<tbody>
<tr>
<td>'.$ligne[$ps]['reponse'].'</td>
<td>'.$ligne[$ps]['observation'].'</td>
<td>'.$ligne[$ps]['date'].'</td>
<td>'.$ligne[$ps]['eval'].'</td>
</tr>
</tbody>';
}
}elseif(!is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] != "[2]"){
$s = $s.'<tbody>
<tr>
<td>'.$ligne[$ps]['question'].'</td>
<td>'.$ligne[$ps]['reponse'].'</td>
</tr>
</tbody>';
}elseif(is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] == "[2]"){
$new = explode(",", $ligne[$ps]['reponse']);
if($new[0] != '[' && $new[1] != ']'){
$s = $s.'<tbody>
<tr>
<td>'.ltrim($new[0], '[').'</td>
<td>'.rtrim($new[1], "]").'</td>
</tr>
</tbody>';
}
}elseif(is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] != "[2]" && $res[$p]['question'] == 'Objectifs'){
if($ligne[$ps]['reponse'] != '' ){
$objectifs_count += 1;
$s = $s.'<tbody>
<tr>
<td>'.$ligne[$ps]['reponse'].'</td>
<td>'.$ligne[$ps]['date'].'</td>
</tr>
</tbody>';
}
}elseif(is_numeric($ligne[$ps]['question']) && $ligne[$ps]['reponses'] == "[4]"){
$new = explode(",", $ligne[$ps]['reponse']);
if($new[0] != '[' && $new[1] != ']'){
$s = $s.'<tbody>
<tr>
<td>'.ltrim($new[0], '[').'</td>
<td>'.$new[1].'</td>
<td>'.$new[2].'</td>
<td>'.rtrim($new[3], "]").'</td>
</tr>
</tbody>';
}
}
}
}
$fin = '</table>
<table>
<tr style="line-height: 100%;">
<td></td>
</tr>
</table>';
$pdf->writeHTML($debut.$titre_tableau.$s.$fin, true, false, false, false, '');
}
$spacing = '<table cellpadding="2">';
$blank_object_count = 26 - $objectifs_count;
for($i = 0; $i < $blank_object_count ; $i++){
$spacing = $spacing.'<tr ><td style="width:3.2 cm">&nbsp;</td><td style="width:9.7 cm">&nbsp;</td><td>&nbsp;</td></tr>';
}
$spacing = $spacing.'</table>';
if($blank_object_count>0)
$pdf->writeHTML($spacing, true, false, false, false, 'C');
$user_superviser = getUserID($user['users_id_supervisor']);
$signature = '<table cellpadding="2">
<tr >
<td align="center" style="width:50%">Signature du Salarié<br>('.$user['fullname'].')</td>
<td align="center" style="width:50%">Signature du Responsable<br>('.$user_superviser['fullname'].')</td>
</tr>
</table>';
$pdf->writeHTML($signature, true, false, false, false, 'C');
//Close and output PDF document
$pdf->Output('EVALUATION ANNUELLE '.$annee.'.pdf', 'I');

View File

@ -0,0 +1,133 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {
//Page header
/*
public function Header() {
$this->SetTextColor(34, 112, 147);
$image_file = '../lib/tcpdf/templates/images/logo.png';
$this->Image($image_file, 15, 5, 19, '', 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
$this->SetFont('times', 'B', 14 );
$this->Cell( 3 );
$this->Cell( 0, 0, 'SOCIETE PHARMACETIQUE ALGERIENNE', 0, 1 );
$this->SetFont('times', 'i', 9 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Siège social : BP 10, Bir El Djir - 31295 - Oran - Algérie,', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Usine : BP 147 , Hassi Ben Okba -31295 - Oran -Algérie', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Tél : +213 (0) 41 42 87 71/72 -Fax : +213 (0) 41 42 87 76', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Email : info@sophal.DZ/sophal@gmail.com', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, '', 0, 1 );
}
*/
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
//$this->SetTextColor(34, 112, 147);
//$this->Cell( 0, 0, 'SOCIETE PAR ACTIONS AU CAPITAL DE 5.000.000.000 DA', 0, 1 ,'C');
//$this->Cell( 0, 0, 'R.C.N °99B 00103116 N°M.F:099931010311611 N° A.I:31030136520', 0, 1,'C' );
$this->SetTextColor(0, 0, 0);
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sophal');
$pdf->SetTitle($category);
$pdf->SetSubject('Sophal');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
$pdf->setPrintFooter(false);
// set margins
//$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP+8, PDF_MARGIN_RIGHT);
//$pdf->SetHeaderMargin(2);
//$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
//$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', 'I', 12);
// add a page
$pdf->AddPage();
$Header = '<table border="0.5">
<thead>
<tr>
<td rowspan="2" width="95" align="center" ><br><img src="../lib/tcpdf/templates/images/logo.png" width="65" ></td>
<td width="265" align="center" height="70" ><br><h4>DEMANDE ET APPROBATION D&#x27;ACCES</h4></td>
<td align="center"><br><h4>DATE D&#x27;APPLICATION</h4> <br> Mois 2022</td>
</tr>
<tr >
<td align="center">FRM-SOP-DSI-AUD-001/Fr01</td>
<td align="center">Page N° '.$pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages().'</td>
</tr>
</thead>
</table>';
$pdf->writeHTML($Header, true, false, false, false, '');
$pdf->Ln();
$pdf->Ln();
$pdf->SetMargins(30, 20, -1, true);
$pdf->SetFont('times', 'I', 12);
$pdf->writeHTML($content, true, false, false, false, '');
// $var = '<table border="0.5" cellpadding ="5">
// <tr >
// <th height="25" style="width:5 cm ;"><H4>Désignation</H4></th>
// <th style=" width:2 cm ; "><H4>Quantité</H4></th>
// <th style="width:9 cm ;"><H4>Fiche Technique</H4></th>
// <th style="width:2.5 cm ; "><H4>Etat</H4></th>
// </tr>';
// $values = array();
// for($i = 0 ; $i < count($res) ; $i++){
// $ligne = '<tr >
// <td>'.$res[$i]['designation'].'</td>
// <td>'.$res[$i]['quantite'].'</td>
// <td>'.$res[$i]['fiche'].'</td>
// <td>'.$res[$i]['etat'].'</td>
// </tr>';
// array_push($values,$ligne);
// }
// $var2 = implode("", $values);
// $var3 = '</table>';
// $pdf->writeHTML($var.$var2.$var3, true, false, false, false, '');
$pdf->Output('demande_acces'.'_'.date('Y-m-d_H:i:s').'.pdf', 'I');

View File

@ -0,0 +1,145 @@
<?php
ob_Start();
require_once('tcpdf_include.php');
// create new PDF document
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {
//Page header
public function Header() {
$this->SetTextColor(34, 112, 147);
$image_file = '../lib/tcpdf/templates/images/logo.png';
$this->Image($image_file, 15, 5, 19, '', 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
$this->SetFont('times', 'B', 14 );
$this->Cell( 3 );
$this->Cell( 0, 0, 'SOCIETE PHARMACETIQUE ALGERIENNE', 0, 1 );
$this->SetFont('times', 'i', 9 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Siège social : BP 10, Bir El Djir - 31295 - Oran - Algérie,', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Usine : BP 147 , Hassi Ben Okba -31295 - Oran -Algérie', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Tél : +213 (0) 41 42 87 71/72 -Fax : +213 (0) 41 42 87 76', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Email : info@sophal.DZ/sophal@gmail.com', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, '', 0, 1 );
$this->Cell( 3 );
}
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
$this->SetTextColor(34, 112, 147);
$this->Cell( 0, 0, 'SOCIETE PAR ACTIONS AU CAPITAL DE 5.000.000.000 DA', 0, 1 ,'C');
$this->Cell( 0, 0, 'R.C.N °99B 00103116 N°M.F:099931010311611 N° A.I:31030136520', 0, 1,'C' );
$this->SetTextColor(0, 0, 0);
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sophal');
$pdf->SetTitle('FICHE TECHNIQUE');
$pdf->SetSubject('FICHE TECHNIQUE');
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP+8, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(2);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// add a page
$pdf->AddPage();

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,162 @@
<?php
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('ATTESTATION DE TRAVAIL');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// add a page
$pdf->AddPage();
$pdf->SetFont('times', 'I', 12);
$pdf->Cell( 0, 0, 'Oran, le '.date('d/m/Y', strtotime($response['date_creation'])), 0, 1 ,'R');
//$pdf->writeHTML("<hr>", true, false, false, false, '');
$pdf->Ln();
$pdf->Cell( 0, 0, 'Réf N° : '.$response['num_reference'].'/DRH/SS/LR/'.date('Y', strtotime($response['date_creation'])), 0, 1 ,'L');
$pdf->Ln();
$pdf->Ln();
$pdf->SetFont('times', 'BI', 20);
$txt = <<<EOD
- ATTESTATION DE TRAVAIL -
oooOooo
EOD;
// print a block of text using Write()
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
$pdf->Ln();
$pdf->SetFont('times', 'I', 12);
$v = '<table cellpadding="3">
<tr>
<td rowspan="5" style=" width:1.5 cm ;"></td>
<td colspan="2" style=" width:15 cm ;">Nous, soussignés SPA Société Pharmaceutique Algérienne, par abréviation
SOPHAL dont le Siège est situé à Bir-El-Djir (Oran) Boîte Postale 10.</td>
</tr>
<tr>
<td><Strong>Attestons que</Strong></td>
<td></td>
</tr>
<tr>
<td><Strong>Matricule</Strong></td>
<td>: '.$response['matricule'].'</td>
</tr>
<tr>
<td><Strong>Mr</Strong></td>
<td>: '.$response['fullname'].'</td>
</tr>
<tr>
<td><Strong>Né (e) le</Strong></td>
<td>: '.date('d/m/Y', strtotime($response['date_naissance'])).' à : '.$response['lieu_naissance'].'</td>
</tr>
</table>';
$pdf->writeHTML($v, true, false, false, false, '');
$pdf->SetFont('times', 'BI', 12);
$pdf->Cell( 0, 0, 'Est employé (e) au sein de la Société en qualité de :', 0, 1 ,'L');
$pdf->SetFont('times', 'I', 12);
$v = '<table cellpadding="3" >
<tr>
<td rowspan="5" style=" width:1.5 cm ;"></td>
<td colspan="2" style=" width:15 cm ; text-align: center;"><Strong>'.$response['fonction'].'</Strong></td>
</tr>
<tr>
<td>Structure :</td>
<td><Strong>'.$response['structure'].'</Strong></td>
</tr>
<tr>
<td>Depuis le :</td>
<td><Strong>'.date('d/m/Y', strtotime($response['date_recrutement'])).'</Strong> à ce jour</td>
</tr>
<tr>
<td colspan="2">la présente attestation lui est délivré pour servir et valoir ce que de droit.</td>
</tr>
</table>';
$pdf->writeHTML($v, true, false, false, false, '');
$pdf->SetFont('times', 'BIU', 12);
$visa = '<table><tr style="line-height: 150%;"><td></td></tr></table>
<table cellpadding ="3">
<tr align="center">
<th>NB : A USAGE ADMINISTRATIF</th>
<th>Le Directeur des Ressources Humaines</th>
</tr>
</table>';
$pdf->writeHTML($visa, true, false, false, false, '');
$pdf->Ln();
$pdf->SetFont('times', 'BIU', 12);
$qr = '<table>
<tr>
<td style="text-align: centre;"></td>
<td style="text-align: centre;"><img src="../lib/tcpdf/templates/images/cachet.png" width="188" height="73"></td>
</tr>
</table>';
$pdf->writeHTML($qr, true, false, false, false, '');
//qr code
$style = array(
'border' => 0,
'vpadding' => 'auto',
'hpadding' => 'auto',
'fgcolor' => array(0,0,0),
'bgcolor' => false, //array(255,255,255)
'module_width' => 1, // width of a single module in points
'module_height' => 1 // height of a single module in points
);
$setText = 'Matricule:'.$response['matricule'].',
Mr:'.$response['fullname'].',
Date Naissance:'.date('d/m/Y', strtotime($response['date_naissance'])).' à '.$response['lieu_naissance'].',
fonction:'.$response['fonction'].'
structure:'.$response['structure'].',
depuis le:'.date('d/m/Y', strtotime($response['date_recrutement'])).'
le:'.date('d/m/Y', strtotime($response['date_creation']));
//delete all spaces
$filtreText = preg_replace('/\s+/', ' ', $setText);
$pdf->write2DBarcode($filtreText, 'QRCODE,M', 33, 190, 50, 30, $style, 'N');
$pdf->Output('attestation_de_travail.pdf', 'I');

View File

@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : tcpdf_include.php
// Begin : 2008-05-14
// Last Update : 2014-12-10
//
// Description : Search and include the TCPDF library.
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com LTD
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* Search and include the TCPDF library.
* @package com.tecnick.tcpdf
* @abstract TCPDF - Include the main class.
* @author Nicola Asuni
* @since 2013-05-14
*/
// always load alternative config file for examples
require_once('config/tcpdf_config_alt.php');
// Include the main TCPDF library (search the library on the following directories).
$tcpdf_include_dirs = array(
realpath('../tcpdf.php'),
realpath($_SERVER["DOCUMENT_ROOT"]).'/vendor/tecnickcom/tcpdf/tcpdf.php',
'C:\wamp64\www\public_html\vendor\tecnickcom\tcpdf\tcpdf.php',
'/usr/share/php/tcpdf/tcpdf.php',
'/usr/share/tcpdf/tcpdf.php',
'/usr/share/php-tcpdf/tcpdf.php',
'/var/www/tcpdf/tcpdf.php',
'/var/www/html/tcpdf/tcpdf.php',
'/usr/local/apache2/htdocs/tcpdf/tcpdf.php',
);
foreach ($tcpdf_include_dirs as $tcpdf_include_path) {
if (@file_exists($tcpdf_include_path)) {
require_once($tcpdf_include_path);
break;
}
}
ob_Start();
//============================================================+
// END OF FILE
//============================================================+

View File

@ -0,0 +1,217 @@
<?php
require_once('tcpdf_include.php');
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {
//Page header
public function Header() {
$this->SetTextColor(34, 112, 147);
$image_file = '../lib/tcpdf/templates/images/logo.png';
$this->Image($image_file, 15, 5, 19, '', 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
$this->SetFont('times', 'B', 14 );
$this->Cell( 3 );
$this->Cell( 0, 0, 'SOCIETE PHARMACETIQUE ALGERIENNE', 0, 1 );
$this->SetFont('times', 'i', 9 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Siège social : BP 10, Bir El Djir - 31295 - Oran - Algérie,', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Usine : BP 147 , Hassi Ben Okba -31295 - Oran -Algérie', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Tél : +213 (0) 41 42 87 71/72 -Fax : +213 (0) 41 42 87 76', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, 'Email : info@sophal.DZ/sophal@gmail.com', 0, 1 );
$this->Cell( 22 );
$this->Cell( 0, 0, '', 0, 1 );
//$this->writeHTML("<hr>", true, false, false, false, '');
}
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
$this->SetTextColor(34, 112, 147);
$this->Cell( 0, 0, 'SOCIETE PAR ACTION AU CAPITAL DE 5.000.000.000 DA', 0, 1 ,'C');
$this->Cell( 0, 0, 'R.C.N °99B 00103116 N°M.F:099931010311611 N° A.I:31030136520', 0, 1,'C' );
$this->SetTextColor(0, 0, 0);
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sophal');
$pdf->SetTitle('');
$pdf->SetSubject('Sophal');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP+4, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(2);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
//$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// add a page
$pdf->AddPage();
$pdf->SetFont('times', 'I', 12);
$pdf->Cell( 0, 0, 'Oran le :'.date('d/m/Y', strtotime($response['date_creation'])), 0, 1 ,'R');
//$pdf->writeHTML("<hr>", true, false, false, false, '');
$pdf->Ln();
$pdf->Cell( 0, 0, 'Matricule : '.$response['matricule'], 0, 1 ,'L');
$pdf->Cell( 0, 0, 'Réf : '.$response['num_reference'].'/ DRH/SS/LR /'.date('Y', strtotime($response['date_creation'])), 0, 1 ,'L');
$pdf->Ln();
$pdf->Ln();
$pdf->SetFont('times', 'BIU', 18);
$txt = <<<EOD
- TITRE DE CONGE -
EOD;
// print a block of text using Write()
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
$pdf->Ln();
$pdf->SetFont('times', 'I', 12);
$v ='<table cellpadding ="3" >
<tr>
<th style=" width: 4cm ;">Nom et Prénom</th>
<th style=" width: 14cm ;">: '.$response['fullname'].'</th>
</tr>
<tr>
<td>Fonction</td>
<td>: '.$response['fonction'].'</td>
</tr>
<tr>
<td>Date de Recrutement</td>
<td>: '.$response['date_recrutement'].'</td>
</tr>
<tr>
<td>Structure</td>
<td>: '.$response['structure'].'</td>
</tr>
<tr>
<td>Sous Structure</td>
<td>: '.$response['sous_structure'].'</td>
</tr>
</table>
<table cellpadding ="3">
<tr>
<td style=" width: 5.5cm ;">Est en congé pour la période : </td>
<td style=" width: 12.5cm ;"></td>
</tr>
</table>
<table cellpadding ="3">
<tr>
<td style=" width: 2cm ;"><strong>Exercice :</strong></td>
<td><strong>'.$response['exercice'].'</strong></td>
</tr>
</table>
';
$pdf->writeHTML($v, true, false, false, false, '');
$pdf->SetFont('times', 'I', 11);
$t = '<table cellpadding ="3" border="1">
<tr style="text-align: centre;">
<th rowspan="2">DESIGNATIONS</th>
<th rowspan="2" >NOMBRE<br>DE<br>JOURS</th>
<th colspan="2">PERIODE</th>
<th rowspan="2">DATE<br>DE<br>REPRISE</th>
<th rowspan="2">OBSERVATIONS</th>
</tr>
<tr style="text-align: centre;">
<th>DU</th>
<th>AU</th>
</tr>
<tr style="text-align: centre;">
<td>'.$response['designations'].'</td>
<td><strong>'.$response['nbr_jour'].' jours</strong></td>
<td><strong>'.$response['date_debut'].'</strong></td>
<td><strong>'.$response['date_fin'].'</strong></td>
<td><strong>'.$response['date_reprise'].'</strong></td>
<td>'.$response['observations'].'</td>
</tr>
</table>';
$pdf->writeHTML($t, true, false, false, false, '');
$pdf->SetFont('times', 'I', 12);
$qr = '<table>
<tr>
<td><strong><u>ADRESSE COMPLETE DURANT LE CONGE </u>: </strong>'.$response['adresse'].'</td>
</tr>
<tr>
<td><strong><u>Reliquat</u> : </strong>'.$response['reliquat'].' jours</td>
</tr>
</table>';
$pdf->writeHTML($qr, true, false, false, false, '');
$pdf->Ln();
$pdf->Cell( 0, 0, 'En foi de quoi ,le présent titre lui est délivrée our servier et valoir ce que droit.', 0, 1 ,'L');
$pdf->Ln();
$visa = '<table >
<tr align="left">
<th><strong><u>COPIE :</u></strong></th>
<th><strong><u>Le Directeur des Ressources Humaines</u></strong></th>
</tr>
<tr align="left">
<th>L&#39;intéressé(e)<br>Dossier Administratif</th>
<th><img src="../lib/tcpdf/templates/images/cachet.png" width="188" height="73"></th>
</tr>
</table>';
$pdf->writeHTML($visa, true, false, false, false, '');
//qr code
$style = array(
'border' => 0,
'vpadding' => 'auto',
'hpadding' => 'auto',
'fgcolor' => array(0,0,0),
'bgcolor' => false, //array(255,255,255)
'module_width' => 1, // width of a single module in points
'module_height' => 1 // height of a single module in points
);
$setText = 'Mat:'.$response['matricule'].',
Mr:'.$response['fullname'].',
fonction:'.$response['fonction'].'
structure:'.$response['structure'].',
Sous structure:'.$response['sous_structure'].',
date de recrutement:'.date('d/m/Y', strtotime($response['date_recrutement'])).'
exercice:'.$response['exercice'].',
designations:'.$response['designations'].',
nbr_jour:'.$response['nbr_jour'].',
date_debut:'.$response['date_debut'].',
date_fin:'.$response['date_fin'].',
date_reprise:'.$response['date_reprise'];
//delete all spaces
$filtreText = preg_replace('/\s+/', ' ', $setText);
$pdf->write2DBarcode($filtreText, 'QRCODE,M', 4, 246, 50, 30, $style, 'N');
$pdf->Output('attestation_de_travail.pdf', 'I');