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("
", 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("
", 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 = <<Write(0, $txt, '', 0, 'C', true, 0, false, false, 0); $pdf->Ln(); $pdf->SetFont('times', 'I', 12); $v ='
Nom et Prénom : '.$response['fullname'].'
Fonction : '.$response['fonction'].'
Date de Recrutement : '.$response['date_recrutement'].'
Structure : '.$response['structure'].'
Sous Structure : '.$response['sous_structure'].'
Est en congé pour la période :
Exercice : '.$response['exercice'].'
'; $pdf->writeHTML($v, true, false, false, false, ''); $pdf->SetFont('times', 'I', 11); $t = '
DESIGNATIONS NOMBRE
DE
JOURS
PERIODE DATE
DE
REPRISE
OBSERVATIONS
DU AU
'.$response['designations'].' '.$response['nbr_jour'].' jours '.$response['date_debut'].' '.$response['date_fin'].' '.$response['date_reprise'].' '.$response['observations'].'
'; $pdf->writeHTML($t, true, false, false, false, ''); $pdf->SetFont('times', 'I', 12); $qr = '
ADRESSE COMPLETE DURANT LE CONGE : '.$response['adresse'].'
Reliquat : '.$response['reliquat'].' jours
'; $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 = '
COPIE : Le Directeur des Ressources Humaines
L'intéressé(e)
Dossier Administratif
'; $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');