114 lines
4.5 KiB
PHP
Executable File
114 lines
4.5 KiB
PHP
Executable File
<?php
|
|
// require('fpdf.php');
|
|
|
|
|
|
require_once 'Fpdf.php';
|
|
|
|
|
|
|
|
// Example data
|
|
$header = array('Assuré(e)', 'Matricule', 'Matricule souscripteur', 'Nom','Prénoms','Satut','Genre','Date de
|
|
naissance',"Date d'effet");
|
|
|
|
|
|
// Create PDF
|
|
$pdf = new PDF();
|
|
// $pdf->SetAutoPageBreak(true, 10); // Set a maximum height for automatic page breaks
|
|
$title="Avenant incorporation";
|
|
// $pdf->setHeaderData($enteteEmission['libelleAvenant']);
|
|
$pdf->setHeaderData("MCI CARE CI");
|
|
|
|
// Add page title
|
|
// $pdf->SetMargins(10, 10, 10);
|
|
$pdf->AddPage();
|
|
|
|
$pdf->SetFillColor(200, 220, 255); // Light blue fill color
|
|
$pdf->SetDrawColor(247, 247, 249); // Red border color
|
|
$pdf->SetLineWidth(0.5);
|
|
$pdf->SetDrawColor(0,0,0); // Red border color
|
|
$pdf->SetLineWidth(0);
|
|
|
|
$intermediaire = $enteteEmission['apporteur'];
|
|
if (!empty($intermediaire) && strlen($intermediaire) > 25)
|
|
$intermediaire = substr($intermediaire, 0, 25) . "...";
|
|
$souscripteur = $enteteEmission['souscripteur'];
|
|
if(strlen($souscripteur)>25)
|
|
$souscripteur = substr($souscripteur, 0, 25) . "...";
|
|
|
|
$garant = $enteteEmission['garant'];
|
|
if (!empty($garant) && strlen($garant) > 25)
|
|
$garant = substr($garant, 0, 25) . "...";
|
|
$data = array(
|
|
array('Compagnie: '.$garant, 'Nature de risque: Assurance maladie'),
|
|
array('Code Compagnie : '.$enteteEmission['codeGcAssureur'], 'Police: '.$enteteEmission['libellePolice']),
|
|
array($pdf->convert_utf8('Intermédiaire: '.$intermediaire), $pdf->convert_utf8('Numéro Interne police: '.$enteteEmission['numeroPoliceGarant'])),
|
|
array($pdf->convert_utf8('Code Intermédiaire: '.$enteteEmission['apporteur']), $pdf->convert_utf8('Durée: '.$enteteEmission['dureeAvenant'])),
|
|
array("Souscripteur: ".$souscripteur, $pdf->convert_utf8('Echéance annuelle: '.dateLang($enteteEmission['dateEcheance'], $_SESSION['lang']))),
|
|
array($pdf->convert_utf8('Numéro de compte: 4315'), 'Fractionnement de la prime: '.$enteteEmission['fractionnement']),
|
|
array('Adresse postale: '.$enteteEmission['boitepostale'], $pdf->convert_utf8("Date d'éffet: ").dateLang($enteteEmission['dateEffet'], $_SESSION['lang'])),
|
|
array($pdf->convert_utf8('Numéro police: '.$enteteEmission['numeroPolice']), $pdf->convert_utf8("Numero d'émission: ".$enteteEmission['numeroEmission']))
|
|
|
|
// Add more rows as needed
|
|
);
|
|
|
|
$borderColor = array(255, 255, 255);
|
|
$verticalColor = array(255, 0, 0); // Red
|
|
$horizontalColor = array(0, 0, 0); // Blue
|
|
$pdf->CreateTableConditionParticulieres($data, 10, $pdf->GetY(),$borderColor,$verticalColor, $horizontalColor);
|
|
|
|
|
|
$pdf->SetDrawColor(247, 247, 249);
|
|
|
|
$pdf->Cell(190, 7,$pdf->convert_utf8('PRIME AU COMPTANT (à régler à la signature des présentes) '), 1, 1, 'C', true);
|
|
|
|
$pdf->CreatePrimeTableHeader();
|
|
|
|
$pdf->CreatePrimeTable(dateLang($enteteEmission['dateEffet'], $_SESSION['lang']),dateLang($enteteEmission['dateFin'], $_SESSION['lang']),$enteteEmission);
|
|
// $pdf->Ln();
|
|
// $pdf->Ln();
|
|
$pdf->CreateTablePrimeTerme(dateLang($enteteEmission['dateEffet'], $_SESSION['lang']),dateLang($enteteEmission['dateFin'], $_SESSION['lang']));
|
|
|
|
// $pdf->Ln(1);
|
|
$pdf->Ln();
|
|
|
|
$pdf->CreateTablePrimeAnnuelle();
|
|
|
|
$pdf->Ln();
|
|
$pdf->SetFont('Arial', '', 10);
|
|
// Save current Y position
|
|
$yPos = $pdf->GetY();
|
|
$text = "OBJET: ";
|
|
$pdf->Cell(60, 7,"OBJET: ",0, 0, 'C', true);
|
|
// $pdf->SetLineWidth(0.01); // Set line width (adjust as needed)
|
|
// $pdf->Line(10, $yPos + 9, 200, $yPos + 9); // Draw a line at the bottom of the cell
|
|
|
|
$pdf->SetFont('Arial', '', 10);
|
|
$voyelles = array('a', 'e', 'i', 'o', 'u', 'y');
|
|
// $chaine = "Exemple";
|
|
// $type_aveant = 'Avenant de'.$pdf->convert_utf8($enteteEmission['libelleAvenant']);
|
|
// if ($pdf->commenceParVoyelle($chaine)) {
|
|
// $type_aveant = "Avenant d'".$pdf->convert_utf8($enteteEmission['libelleAvenant']);
|
|
// }
|
|
$type_aveant = "AVENANT DE REGULARISATION DE MOUVEMENTS D'EFFECTIFS";
|
|
$pdf->Cell(130, 7,strtoupper($type_aveant),0, 1, 'L', true);
|
|
|
|
$currentDate = new DateTime();
|
|
// $formattedDate = $currentDate->format('l, F j, Y');
|
|
$formattedDate = $currentDate->format('l j F Y');
|
|
$pdf->SetFont('Arial', 'B', 9);
|
|
|
|
$pdf->Ln(5);
|
|
|
|
$pdf->Cell(190, 7,$pdf->convert_utf8("Etabli à ABIDJAN en 2 exemplaires, le : ".$formattedDate),0, 1, 'C', true);
|
|
|
|
$pdf->Ln(5);
|
|
$pdf->SetFont('Arial', 'B', 10);
|
|
|
|
$pdf->Cell(50, 7,'AU SOUSCRIPTEUR ',0, 0, 'L');
|
|
$pdf->Cell(95, 7,' ',0, 0, '');
|
|
$pdf->Cell(50, 7,'COMPAGNIE ',0, 1, 'L');
|
|
|
|
$pdf->Ln(15);
|
|
$pdf->SetFont('Arial', '', 7);
|
|
|
|
$pdf->Cell(190, 7,'Copie gestionnaire',0, 1, 'C'); |