234 lines
10 KiB
PHP
Executable File
234 lines
10 KiB
PHP
Executable File
<?php
|
|
|
|
$pdf->setHeaderData($garant);
|
|
|
|
|
|
$ht0 = 8;
|
|
$ht = 6;
|
|
$tp = 8;
|
|
$idCollege = "0";
|
|
$numeroAdherent = "";
|
|
$count = 0;
|
|
$rows = 0;
|
|
// $detailEmissionRetraits=[];
|
|
$recap_police = [];
|
|
$recapCollege = [];
|
|
$groupedData=array();
|
|
foreach ($detailEmissionRetraits as $item) {
|
|
$collegeKey = $item['idCollege'];
|
|
$adherentKey = $item['numeroAdherent'];
|
|
|
|
if (!isset($groupedData[$collegeKey])) {
|
|
$groupedData[$collegeKey] = [];
|
|
}
|
|
|
|
if (!isset($groupedData[$collegeKey][$adherentKey])) {
|
|
$groupedData[$collegeKey][$adherentKey] = [];
|
|
}
|
|
|
|
$groupedData[$collegeKey][$adherentKey][] = $item;
|
|
}
|
|
|
|
|
|
foreach ($groupedData as $collegeKey => $groupCollege) {
|
|
$pdf->AddPage();
|
|
$pdf->SetFillColor(226, 238, 253); // Blue color for the header background
|
|
$pdf->SetDrawColor(0, 0, 253); // Blue color for the header background
|
|
|
|
// $pdf->Cell(190, 7,$pdf->convert_utf8('PRIME AU COMPTANT (à régler à la signature des présentes) '), 1, 1, 'C', true);
|
|
$pdf->SetFont('Arial', 'B', 14);
|
|
$pdf->SetTextColor(0, 0, 255);
|
|
$pdf->MultiCell(195, 5,$pdf->convert_utf8("
|
|
ETAT DES ASSURES ET DEPENDANTS RETIRES PAR POLICE ET PAR COLLEGE
|
|
|
|
"), 0, 'C',true);
|
|
$pdf->SetTextColor(0, 0, 0);
|
|
|
|
$pdf->Ln(5);
|
|
$pdf->SetFillColor(255,255,255); // Blue color for the header background
|
|
$pdf->SetFont('Arial', 'B', 10);
|
|
|
|
$pdf->SetTextColor(128, 0, 255);
|
|
$codegarant = $enteteEmission['codeGcAssureur'];
|
|
$pdf->Cell(30, 7,$pdf->convert_utf8("Garant "), 0, 0, 'L', true);
|
|
$pdf->Cell(20, 7,$pdf->convert_utf8($codegarant), 0, 0, 'L', true);
|
|
$pdf->Cell(60, 7,$pdf->convert_utf8($garant), 0, 1, 'L', true);
|
|
// $pdf->Cell(40, 7,$pdf->convert_utf8("OBJET DE L'AVENANT "), 0, 0, 'L', true);
|
|
$pdf->SetTextColor(0, 0, 0);
|
|
|
|
$pdf->Cell(20, 7,$pdf->convert_utf8("Période du: "), 0, 0, 'L', true);
|
|
$pdf->Cell(60, 7,$pdf->convert_utf8(dateLang($enteteEmission['dateEffet'], $_SESSION['lang'])." Au ".dateLang($enteteEmission['dateFin'], $_SESSION['lang'])), 0, 0, 'L', true);
|
|
|
|
$pdf->Cell(10, 7,$pdf->convert_utf8("Statut(s) concerné(s): ('A','C','D','E','G','K','X')"), 0, 1, 'L', true);
|
|
// $pdf->Ln(20);
|
|
|
|
$pdf->SetTextColor(192, 0, 192);
|
|
$pdf->Cell(30, 7,$pdf->convert_utf8("Souscripteur "), 0, 0, 'L', true);
|
|
$pdf->Cell(20, 7,$pdf->convert_utf8($enteteEmission['souscripteur']), 0, 0, 'L', true);
|
|
$pdf->Cell(60, 7,$pdf->convert_utf8($enteteEmission['souscripteur']), 0, 1, 'L', true);
|
|
$pdf->SetTextColor(0, 0, 0);
|
|
|
|
$pdf->SetTextColor(0, 0, 128);
|
|
$pdf->Cell(30, 7,$pdf->convert_utf8("Police: "), 0, 0, 'L', true);
|
|
$pdf->Cell(20, 7,$pdf->convert_utf8($enteteEmission['numeroPolice']), 0, 0, 'L', true);
|
|
$pdf->Cell(60, 7,$pdf->convert_utf8($enteteEmission['libellePolice']), 0, 1, 'L', true);
|
|
$pdf->SetTextColor(0, 0, 0);
|
|
|
|
$pdf->SetTextColor(128, 0, 0);
|
|
$pdf->Cell(30, 7,$pdf->convert_utf8("Collège: "), 0, 0, 'L', true);
|
|
$libelleCollege = $pdf->findColleLibelleById($detailEmissionRetraits,$collegeKey,'libelleCollege');
|
|
$pdf->Cell(10, 7,$pdf->convert_utf8($pdf->convert_utf8($collegeKey)), 0, 0, 'L', true);
|
|
$pdf->Cell(80, 7,$pdf->convert_utf8($pdf->convert_utf8($libelleCollege)), 0, 1, 'L', true);
|
|
$pdf->SetTextColor(0, 0, 0);
|
|
|
|
foreach ($groupCollege as $adherentKey => $groupAdherent) {
|
|
// echo " Subgroup for key2: $adherentKey\n";
|
|
// $pdf->Cell(190,$ht,convertirc($adherentKey),0,1,'C',false);
|
|
$count=0;
|
|
foreach ($groupAdherent as $beneficiaire) {
|
|
// echo " - {$item['adherent']}\n";
|
|
// $pdf->Cell(190,$ht,convertirc($item['adherent']),0,1,'C',false);
|
|
// $pdf->Cell(20,$ht,convertirc($beneficiaire['numeroAdherent']),1,0,'C',false);
|
|
if($count==0){
|
|
// $pdf->SetFont('Arial','BI', $tp);
|
|
$pdf->SetFont('Arial', 'B', 8);
|
|
|
|
$pdf->SetFillColor(226, 238, 253); // Blue color for the header background
|
|
// $pdf->SetFont('Arial', 'B', 9);
|
|
$pdf->SetDrawColor(0, 0, 0);
|
|
// $pdf->Cell(190,$ht,convertirc(_("Famille")." : ".$beneficiaire['adherent']),0,1,'C',false);
|
|
$pdf->Cell(20,$ht,convertirc(_("Assuré")),1,0,'C',true);
|
|
$pdf->Cell(20,$ht,convertirc(_("Matricule")),1,0,'C',true);
|
|
$pdf->Cell(60,$ht,convertirc(_("Bénéficiaire")),1,0,'C',true);
|
|
$pdf->Cell(10,$ht,convertirc(_("Satut")),1,0,'C',true);
|
|
$pdf->Cell(10,$ht,convertirc(_("Genre")),1,0,'C',true);
|
|
$pdf->Cell(30,$ht,convertirc(_("Date de naissance")),1,0,'C',true);
|
|
$pdf->Cell(20,$ht,convertirc(_("Date effet")),1,0,'C',true);
|
|
$pdf->Cell(20,$ht,convertirc(_("Date sortie")),1,1,'C',true);
|
|
|
|
$pdf->SetFillColor(255);
|
|
|
|
}
|
|
$pdf->SetFont('Arial', '', 8);
|
|
|
|
|
|
$pdf->Cell(20,$ht,convertirc($beneficiaire['numeroAdherent']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,convertirc($beneficiaire['numeroBeneficiaire']),1,0,'L',false);
|
|
$pdf->Cell(60,$ht,convertirc($beneficiaire['beneficiaire']),1,0,'L',false);
|
|
$pdf->Cell(10,$ht,convertirc($beneficiaire['codeLienParente']),1,0,'C',false);
|
|
$pdf->Cell(10,$ht,convertirc($beneficiaire['sexe']),1,0,'C',false);
|
|
$pdf->Cell(30,$ht, dateLang($beneficiaire['dateNaissance'], $_SESSION['lang']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht, dateLang($beneficiaire['dateEffet'], $_SESSION['lang']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht, dateLang($beneficiaire['dateSortie'], $_SESSION['lang']),1,1,'C',false);
|
|
|
|
|
|
$count++;
|
|
if($count == sizeof($groupAdherent)){
|
|
$pdf->Cell(100,$ht,'',0,0,'C',false);
|
|
$pdf->SetFont('Arial','B', $tp);
|
|
$pdf->Cell(90,$ht,convertirc(_("Effectif famille")." : ".$count),0,1,'R',false);
|
|
$pdf->SetFont('Arial','', $tp);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
$recapCollege = $this->editionpieceavenant_societe->get_edition_emission_recap_college_retrait($collegeKey);
|
|
// var_dump($recapCollege);
|
|
$nbr_assures = 0;
|
|
$nbr_conjoints = 0;
|
|
$nbr_enfants = 0;
|
|
$nbr_geniteurs = 0;
|
|
$nbr_autres_conjoints = 0;
|
|
$nbr_enfant_sup = 0;
|
|
$nbr_autres_parents = 0;
|
|
$nbr_ascendants = 0;
|
|
$totalCollege = 0;
|
|
|
|
// die();
|
|
foreach ($recapCollege as $recap) {
|
|
// echo $recap['codeLienParente'] . "\n";
|
|
if($recap['codeLienParente'] =='A')
|
|
$nbr_assures = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='C')
|
|
$nbr_conjoints = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='D')
|
|
$nbr_autres_conjoints = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='E')
|
|
$nbr_enfants = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='O')
|
|
$nbr_autres_parents = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='F')
|
|
$nbr_ascendants = $recap['effectif'];
|
|
$totalCollege = $nbr_assures + $nbr_conjoints + $nbr_autres_conjoints + $nbr_enfants + $nbr_autres_parents + $nbr_ascendants;
|
|
// if($recap['codeLienParente'] =='F')
|
|
// $nbr_autres_parents = $recap['effectif'];
|
|
}
|
|
|
|
$data = array(
|
|
array($pdf->convert_utf8('Assuré(e)s : '.format_N($nbr_assures)), $pdf->convert_utf8('Géniteur (Ascendant) : '.format_N($nbr_ascendants)), $pdf->convert_utf8('Autre(s) parent(s) : '.format_N($nbr_autres_parents))),
|
|
array('Conjoint(e)s : '.format_N($nbr_conjoints), 'Autres conjoint(es) : '.format_N($nbr_autres_conjoints)),
|
|
array('Enfants : '.format_N($nbr_enfants), $pdf->convert_utf8("Enfant(s) supplémentaire(s) : 0 ")),
|
|
);
|
|
|
|
$titre = "Effectif collège ".$libelleCollege.' :'.format_N($totalCollege);
|
|
$pdf->RecapEffectif($data,$pdf->GetX(),$pdf->GetY(),$titre);
|
|
|
|
// echo "\n";
|
|
}
|
|
|
|
$recap_police = $this->editionpieceavenant_societe->get_edition_emission_recap_police_retraits();
|
|
// var_dump($recap_police);
|
|
$nbr_assures = 0;
|
|
$nbr_conjoints = 0;
|
|
$nbr_enfants = 0;
|
|
$nbr_geniteurs = 0;
|
|
$nbr_autres_conjoints = 0;
|
|
$nbr_enfant_sup = 0;
|
|
$nbr_autres_parents = 0;
|
|
$nbr_ascendants = 0;
|
|
$totalPolice = 0;
|
|
|
|
// die();
|
|
foreach ($recap_police as $recap) {
|
|
// echo $recap['codeLienParente'] . "\n";
|
|
if($recap['codeLienParente'] =='A')
|
|
$nbr_assures = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='C')
|
|
$nbr_conjoints = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='D')
|
|
$nbr_autres_conjoints = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='E')
|
|
$nbr_enfants = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='O')
|
|
$nbr_autres_parents = $recap['effectif'];
|
|
if($recap['codeLienParente'] =='F')
|
|
$nbr_ascendants = $recap['effectif'];
|
|
$totalPolice = $nbr_assures + $nbr_conjoints + $nbr_autres_conjoints + $nbr_enfants + $nbr_autres_parents + $nbr_ascendants;
|
|
// if($recap['codeLienParente'] =='F')
|
|
// $nbr_autres_parents = $recap['effectif'];
|
|
}
|
|
|
|
|
|
|
|
// $pdf->RecapEffectif($data,$pdf->GetX(),$pdf->GetY(),$titre);
|
|
|
|
|
|
if(sizeof($detailEmissionRetraits)>0){
|
|
$pdf->Ln(5);
|
|
$data = array(
|
|
array($pdf->convert_utf8('Assuré(e)s : '.format_N($nbr_assures)), $pdf->convert_utf8('Géniteur (Ascendant) : '.format_N($nbr_ascendants)), $pdf->convert_utf8('Autre(s) parent(s) : '.format_N($nbr_autres_parents))),
|
|
array('Conjoint(e)s : '.format_N($nbr_conjoints), 'Autres conjoint(es) : '.format_N($nbr_autres_conjoints)),
|
|
array('Enfants : '.format_N($nbr_enfants), $pdf->convert_utf8("Enfant(s) supplémentaire(s) : 0 ")),
|
|
);
|
|
|
|
$titre = "Effectif police ".$enteteEmission['numeroPolice'].' :'.format_N($totalPolice);
|
|
$pdf->RecapEffectif($data,$pdf->GetX(),$pdf->GetY(),$titre);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|