200 lines
8.0 KiB
PHP
Executable File
200 lines
8.0 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleurrequete.php'; // OK
|
|
require_once 'Modele/Statistique.php';
|
|
//require 'Fpdf/diag.php';
|
|
|
|
class ControleurAjaxstatsmaladiefichetechniquesixprovisoirepdf 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");
|
|
$codeGcAssureur = $this->requete->getParametreFormulaire("codeGcAssureur");
|
|
|
|
if($idPolice== ''){
|
|
$idPolice = null;
|
|
}
|
|
$depenses = $this->requete->getParametreFormulaire("depenses","numerique");
|
|
|
|
$_SESSION['debutStat'] = $debutStat;
|
|
$_SESSION['finStat'] = $finStat;
|
|
$_SESSION['depenses'] = $depenses;
|
|
$entete = $this->detailsp->detailrapportspperiodepdfentete($idPolice);
|
|
//highlight_string("<?php\n\$datas =\n" . var_export($_SESSION['depenses'], true) . ";\n>");
|
|
$p_datedebut = $_SESSION['debutStat'];
|
|
$p_datefin =$_SESSION['finStat'];
|
|
$p_garant = $codeGcAssureur;
|
|
$p_id = $idPolice;
|
|
$p_limite = $depenses;
|
|
$p_id_college = null;
|
|
$p_id_clients = null;
|
|
//$detailsps = $this->detailsp->detailrapportspperiodepdf($idPolice);
|
|
|
|
//$statuts = $this->detailsp->listestatutbeneficiaire($idPolice,$debutStat,$finStat);
|
|
|
|
$primeSinistre = $this->detailsp->getprimesinistre($idPolice,$debutStat,$finStat);
|
|
|
|
$depensesFamille = $this->detailsp->detaildepensefamilleassprovisoire($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin, $p_limite);
|
|
|
|
$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['lienLogo'],94,3,15);
|
|
$pdf->SetFont('Arial','B',7);
|
|
|
|
$pdf->Cell(0,5,convertirc(_('FICHE TECHNIQUE No 6')),0,1,'L',false);
|
|
$pdf->SetY(10);
|
|
$pdf->SetFont('Arial','',7);
|
|
$pdf->Cell(0,5,convertirc(_('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(182,216,242); // bleu
|
|
$pdf->Cell(0,8,convertirc(_("ETAT DES DEPENSES PAR FAMILLE D'ASSURES")),1,0,'C',true);
|
|
|
|
$pdf->Ln(10);
|
|
$pdf->SetFont('Arial', 'B', 11);
|
|
$pdf->SetTextColor(0);
|
|
$pdf->Ln(8);
|
|
$pdf->Cell(0, 6, convertirc(_('PERIODE COMPTABLE CONSIDEREE').': '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'C', false);
|
|
|
|
if ($p_id!=null){
|
|
|
|
|
|
$pdf->Ln(10);
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('GARANT').': '), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc($entete['garant']), 0, 1, 'L', false);
|
|
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc($entete['souscripteur']), 0, 1, 'L', false);
|
|
|
|
//$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false);
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('POLICE No').': '), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 1, 'L', false);
|
|
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('COURTIER').': '), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc($entete['courtier']), 0, 1, 'L', false);
|
|
// $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false);
|
|
}else{
|
|
$pdf->Ln(10);
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('GARANT').': '), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc($p_garant), 0, 1, 'L', false);
|
|
}
|
|
|
|
$pdf->SetX(20);
|
|
$pdf->Cell(170,6,convertirc(_('DEPENSES SUPERIEURES A').': '.format_N($depenses).' '.$_SESSION['devise_C']),1,1,'C',false);
|
|
|
|
$pdf->Ln(2);
|
|
$hl=7;
|
|
$pdf->SetFont('Arial','B',7);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(15,$hl,convertirc(_('Matricule')),1,0,'C',true);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(63,$hl,convertirc(_("Famille")),1,0,'C',true);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(15,$hl,convertirc(_("Pop. active")),1,0,'C',true);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(15,$hl,convertirc(_("Pop. traitée")),1,0,'C',true);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(22,$hl,convertirc(_("Réclamé")),1,0,'C',true);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(22,$hl,convertirc(_("# Non Remb.")),1,0,'C',true);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(22,$hl,convertirc(_("Remboursé")),1,0,'C',true);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(16,$hl,convertirc(_("Coût moyen")),1,1,'C',true);
|
|
|
|
$pdf->SetFont('Arial','',7);
|
|
|
|
$total_popActive = 0;
|
|
$total_popTraite = 0;
|
|
$total_montantReclame = 0;
|
|
$total_montantNonRembourse = 0;
|
|
$total_montantRembourse = 0;
|
|
$total_coutMoyen = 0;
|
|
|
|
foreach ($depensesFamille as $dep)
|
|
{
|
|
$pdf->Cell(15,$hl,convertirc($dep['numeroAdherent']),1,0,'C',false);
|
|
$pdf->Cell(63,$hl,convertirc($dep['adherent']),1,0,'L',false);
|
|
$pdf->Cell(15,$hl,convertirc($dep['popActive']),1,0,'C',false);
|
|
$pdf->Cell(15,$hl,convertirc($dep['popTraite']),1,0,'C',false);
|
|
$pdf->Cell(22,$hl,convertirc(format_N($dep['montantReclame'])),1,0,'C',false);
|
|
$pdf->Cell(22,$hl,convertirc(format_N($dep['montantNonRembourse'])),1,0,'C',false);
|
|
$pdf->Cell(22,$hl,convertirc(format_N($dep['montantRembourse'])),1,0,'C',false);
|
|
$pdf->Cell(16,$hl,convertirc(format_N($dep['Coutmoyen'])),1,1,'C',false);
|
|
|
|
$total_popActive = $total_popActive + $dep['popActive'];
|
|
$total_popTraite = $total_popTraite + $dep['popTraite'];
|
|
$total_montantReclame = $total_montantReclame + $dep['montantReclame'];
|
|
$total_montantNonRembourse = $total_montantNonRembourse + $dep['montantNonRembourse'];
|
|
$total_montantRembourse = $total_montantRembourse + $dep['montantRembourse'];
|
|
$total_coutMoyen = $total_montantRembourse / $total_popTraite;
|
|
}
|
|
$pdf->SetFont('Arial','B',8);
|
|
$pdf->SetFillColor(182,216,242);
|
|
$pdf->Cell(78,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true);
|
|
$pdf->Cell(15,$hl,format_N($total_popActive),1,0,'C',true);
|
|
$pdf->Cell(15,$hl,format_N($total_popTraite),1,0,'C',true);
|
|
$pdf->Cell(22,$hl,format_N($total_montantReclame),1,0,'C',true);
|
|
$pdf->Cell(22,$hl,format_N($total_montantNonRembourse),1,0,'C',true);
|
|
$pdf->Cell(22,$hl,format_N($total_montantRembourse),1,0,'C',true);
|
|
$pdf->Cell(16,$hl,format_N($total_coutMoyen),1,1,'C',true);
|
|
|
|
|
|
$pdf->Ln(5);
|
|
|
|
$pdf->Cell(45,$hl,convertirc(_("Nombre de lignes: ").count($depensesFamille)),0,0,'L',false);
|
|
|
|
$pdf->Ln(8);
|
|
|
|
$pdf->Cell(45,$hl,convertirc(_("# Non remb.= Ticket modérateur + exclusion + dépassement de plafond")),0,0,'L',false);
|
|
$pdf->Ln(5);
|
|
$pdf->Cell(45,$hl,convertirc(_("# Pop.active= Population active sur la période")),0,0,'L',false);
|
|
$pdf->Ln(5);
|
|
$pdf->Cell(45,$hl,convertirc(_("# Pop.traitée= Population traitée sur la période")),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','I',7);
|
|
|
|
//Numéro de page
|
|
/* $pdf->SetY(265);
|
|
$pdf->Cell(0,$hl,'Page '.$pdf->PageNo().'/{nb}',0,0,'C'); */
|
|
|
|
$fichier="Temp/TMP_CUMUL_SP_FICHE6"."_".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;
|
|
}
|
|
} |