Files
MYSOPHAL/lib/tcpdf/templates/requete.administrative.php
2025-08-07 13:15:31 +01:00

163 lines
4.7 KiB
PHP

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