production/Controleur/ControleurAjaxstatsmaladiefichetechniquedeuxm.php
2025-12-02 11:29:44 +00:00

133 lines
4.6 KiB
PHP
Executable File
Raw Permalink Blame History

<?php
require_once 'Framework/Controleurrequete.php'; // OK
require_once 'Modele/Statistique.php';
class ControleurAjaxstatsmaladiefichetechniquedeuxpdf extends Controleur
{
private $detailsp;
public function __construct() {
$this->detailsp = new Statistique();
}
public function index()
{
$idPolice = $this->requete->getParametreFormulaire("idPolice");
$debutStat = $this->requete->getParametreDate("debutStat");
$finStat = $this->requete->getParametreDate("finStat");
$_SESSION['debutStat'] = $debutStat;
$_SESSION['finStat'] = $finStat;
$entete = $this->detailsp->detailrapportspperiodepdfentete($idPolice);
$p_datedebut = $_SESSION['debutStat'];
$p_datefin =$_SESSION['finStat'];
$p_garant = $entete ['codeGcAssureur'];
$p_id = $entete ['idPolice'] ;
$idCollege= "";
$idClient="";
$idClient=null;
$idCollege=null;
//$detailsps = $this->detailsp->detailrapportspperiodepdf($idPolice);
//$statuts = $this->detailsp->listestatutbeneficiaire($idPolice,$debutStat,$finStat);
$p_factures = $this->detailsp->getdepenseparcontratrp($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin);
$primeSinistre = $this->detailsp->getdepenseparcontratrp($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin);
$pdf = new FPDF_Protection();
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
$userPassword = '';
$ownerPassword = null;
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetMargins(10, 10, 10) ;
$pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/logo_vitalis.png',94,3,15);
$pdf->SetFont('Arial','B',7);
$pdf->Cell(0,5,'FICHE TECHNIQUE No 2',0,1,'L',false);
$pdf->SetY(10);
$pdf->SetFont('Arial','',7);
$pdf->Cell(0,5,'Edition du : '.heureCouranteLang($_SESSION['lang']),0,1,'R',false);
$pdf->Ln(2);
$pdf->SetFont('Arial','B',13);
// $pdf->AliasNbPages();
//$pdf->SetTextColor(81,163,226);
$pdf->SetFillColor(143,206,143); // bleu
$pdf->Cell(0,8,convertirc(_("ETAT DES DEPENSES PAR CONTRAT")),1,0,'C',true);
$pdf->Ln(10);
$pdf->SetFont('Arial','B',11);
$pdf->SetTextColor(0);
$pdf->Cell(0,8,convertirc($entete['garant']),0,1,'C',false);
$pdf->Ln(5);
$pdf->Cell(0,5,$entete['souscripteur'],0,1,'C',false);
$pdf->Ln(5);
$pdf->SetFont('Arial','BI',11);
$pdf->Cell(45);
$pdf->Cell(150,8,convertirc(_('POLICE: ').$entete['libellePolice']),0,1,'L',false);
$pdf->Ln(5);
$pdf->Cell(30);
$pdf->Cell(150,5,convertirc(_('PERIODE COMPTABLE CONSIDEREE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])),0,1,'C',false);
$pdf->Ln(5);
$hl=8;
$pdf->SetFont('Arial','B',8);
$pdf->SetFillColor(143,206,143);
$pdf->Cell(55,$hl,convertirc(_('Souscripteur')),1,0,'C',true);
$pdf->SetFillColor(143,206,143);
$pdf->Cell(20,$hl,convertirc(_("No Police")),1,0,'C',true);
$pdf->SetFillColor(143,206,143);
$pdf->Cell(52,$hl,convertirc(_("Police")),1,0,'C',true);
$pdf->SetFillColor(143,206,143);
$pdf->Cell(25,$hl,convertirc(_("Mt A Rembourser")),1,0,'C',true);
$pdf->SetFillColor(143,206,143);
$pdf->Cell(22,$hl,convertirc(_("Mt Rembours<72>")),1,0,'C',true);
$pdf->SetFillColor(143,206,143);
$pdf->Cell(16,$hl,convertirc(_("Taux (%)")),1,1,'C',true);
$pdf->SetFont('Arial','',9);
$total_assure = 0;
$total_traite = 0;
$total_taux = 0;
$pdf->Cell(55,$hl,convertirc($entete['souscripteur']),1,0,'L',false);
$pdf->Cell(20,$hl,convertirc($entete['numeroPolice']),1,0,'C',false);
$pdf->Cell(52,$hl,convertirc($entete['libellePolice']),1,0,'C',false);
$pdf->Cell(25,$hl,convertirc(format_N($primeSinistre['montantFacture'])),1,0,'C',false);
$pdf->Cell(22,$hl,convertirc(format_N($primeSinistre['apresDecompte'])),1,0,'C',false);
$pdf->Cell(16,$hl,convertirc($primeSinistre['Taux']),1,1,'C',false);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(127,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',false);
$pdf->Cell(25,$hl,format_N($primeSinistre['montantFacture']),1,0,'C',false);
$pdf->Cell(22,$hl,format_N($primeSinistre['apresDecompte']),1,0,'C',false);
$pdf->Cell(16,$hl,format_N($primeSinistre['Taux']),1,0,'C',false);
$fichier="Temp/TMP_CUMUL_SP_FICHE2"."_".uniqid().".pdf";
$pdf->Output($fichier,"F");
$t_html =' <div id ="div_export_b" class="alert alert-info"> ';
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
$t_html .=' </div ';
echo $t_html;
}
}