122 lines
4.0 KiB
PHP
122 lines
4.0 KiB
PHP
<?php
|
|
|
|
require_once 'vendor/autoload.php';
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
|
require_once 'Framework/Controleurrequete.php'; // OK
|
|
require_once 'Modele/Avenant.php';
|
|
|
|
class ControleurAjaxavenantretrait extends Controleurrequete
|
|
{
|
|
private $avenant;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->avenant = new Avenant();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$idAvenant = $this->requete->getParametreFormulaire("idAvenant");
|
|
|
|
$entetecp = $this->avenant->getUnAvenant($idAvenant);
|
|
$listeassures = $this->avenant->getListeassuresAvenant($idAvenant);
|
|
|
|
$pdf = new FPDF();
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$ht=10;
|
|
|
|
$pdf->SetMargins(10, 10, 10) ;
|
|
|
|
$pdf->Image($_SESSION['dossierImage'].'/logo_etat.png',10,10,180);
|
|
|
|
$pdf->SetFont('Arial','B', 15);
|
|
|
|
$pdf->SetY(37);
|
|
|
|
$pdf->SetFillColor(135,206,250); // bleu
|
|
|
|
$pdf->Cell(0,$ht,convertirc("MEMBER REMOVAL ENDORSEMENT"),1,1,'C',true);
|
|
|
|
$pdf->SetFont('Arial','B', 10);
|
|
|
|
$pdf->Ln(5);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("Subscriber : ".$entetecp['nomClient']),0,0,'L',false);
|
|
$pdf->Cell(0,$ht,convertirc("Policy Number : ".$entetecp['numeroPolice']),0,1,'R',false);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("Effective Date : ".$entetecp['dateEffetAvenant']),0,0,'L',false);
|
|
$pdf->Cell(0,$ht,convertirc("End Date : ".$entetecp['dateEcheance']),0,1,'R',false);
|
|
|
|
$pdf->Ln(5);
|
|
|
|
$pdf->SetFont('Arial','', 9);
|
|
|
|
$text = convertirc("We refer to your request regarding the removal of a member/ beneficiary under your existing Medical Insurance Policy.
|
|
We are pleased to confirm that they have been removed from the current policy in accordance with the agreed contractual terms and conditions. Below is the related premium to be refunded calculated on prorated basis in consideration of the unearned period and agreed percentage: ");
|
|
// $pdf->MultiCell(0, $ht, $text);
|
|
$pdf->MultiCell(0, 6, $text);
|
|
|
|
$pdf->Ln(5);
|
|
|
|
$pdf->SetFont('Arial','B', 10);
|
|
|
|
$pdf->SetFont('Arial','BU', 10);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("Effective Date :".$entetecp['dateEffetAvenant']),0,0,'L',false);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("End Date:".$entetecp['dateEcheance']),0,1,'R',false);
|
|
|
|
$pdf->SetFont('Arial','BU', 15);
|
|
$pdf->Cell(50,$ht,convertirc("1. Insured Members and Premium to be refunded"),0,1,'L',false);
|
|
|
|
$pdf->SetFont('Arial','B', 10);
|
|
|
|
$pdf->Cell(25,$ht,convertirc('S / N'),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,convertirc('Surname'),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,convertirc('Other name'),1,0,'C',false);
|
|
$pdf->Cell(15,$ht,convertirc('Relat'),1,0,'C',false);
|
|
$pdf->Cell(25,$ht,convertirc('Net Premium'),1,0,'C',false);
|
|
$pdf->Cell(25,$ht,convertirc('Total Premium'),1,1,'C',false);
|
|
|
|
$pdf->SetFont('Arial','', 10);
|
|
foreach ($listeassures as $assure)
|
|
{
|
|
$pdf->Cell(25,$ht,convertirc($assure['numeroBeneficiaire']),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,convertirc($assure['nomBeneficiaire']),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,convertirc($assure['prenomsBeneficiaire']),1,0,'C',false);
|
|
$pdf->Cell(15,$ht,convertirc($assure['codeLienParente']),1,0,'C',false);
|
|
$pdf->Cell(25,$ht,format_N($assure['primeNette']),1,0,'C',false);
|
|
$pdf->Cell(25,$ht,format_N($assure['primeTtc']),1,1,'C',false);
|
|
}
|
|
|
|
$pdf->Ln(5);
|
|
|
|
$pdf->SetFont('Arial','BI', 10);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("Done at ".$_SESSION['villeSociete'].", on ".$entetecp['dateJour']),0,1,'C',false);
|
|
|
|
$pdf->Ln(5);
|
|
|
|
$pdf->SetFont('Arial','B', 10);
|
|
|
|
$pdf->SetFont('Arial','BU', 10);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("The Insurer"),0,0,'L',false);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("The Subscriber"),0,1,'R',false);
|
|
|
|
$uniqid = uniqid();
|
|
$fichier="Temp/$uniqid.pdf";
|
|
$pdf->Output($fichier,"F");
|
|
|
|
$t_html =' <div id ="div_export_a" class="alert alert-info"> ';
|
|
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
|
|
$t_html .=' </div ';
|
|
echo $t_html;
|
|
|
|
exit();
|
|
}
|
|
} |