production/Societes/envoyx/Tarifs/Controleur/Courriercontrateng.php
2026-03-04 01:48:40 +00:00

134 lines
5.0 KiB
PHP
Executable File

<?php
$idPolice = $_SESSION['idPolice_C'];
require_once $_SESSION['dossierSociete'].'/Tarifs/Modele/Police_sodciete.php';
$this->police_societe = new Police_sodciete();
$idAvenant = $this->requete->getParametreFormulaire("idAvenant");
$numeroAvenant_cp=0;
$numeroAvenant = $_SESSION['numeroAvenant_cp'] ;
$p_emission = $numeroAvenant['numeroAvenant'];
$entetecp = $this->police_societe->getEnteteCP($idPolice,$p_emission);
//highlight_string("<?php\n\$datas =\n" . var_export($numeroAvenant, true) . ";\n>");
$collegecps = $this->police_societe->getCollegesCpLienParente($idPolice);
//$collegecp2s = $this->police_societe->getCollegesCpLienParente($idPolice);
$garantiescollegecps = $this->police_societe->getGarantiesCollegesCpLienParente($idPolice);
$tableaupretationcps = $this->police_societe->gettableauPrestationsCpLienParente($idPolice);
$conditionsparticuliers = $this->police_societe->getconditionsparticuliers($idPolice);
$codeGarant = $this->police_societe->getcodeGarant($idPolice);
$codeGcAssureur = $codeGarant['codeGcAssureur'];
$infosDuGarant = $this->police_societe->getInfosGarant($codeGcAssureur);
$pdf = new FPDF_Protection();
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
$userPassword = '';
$ownerPassword = null;
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
$pdf->AliasNbPages();
$pdf->AddPage();
$ht=10;
$htext=6;
// Logo
//$pdf->Image($_SESSION['lienLogo'],10,6,30);
if ($infosDuGarant['typeGarant']=="1"){
if (file_exists($_SESSION['dossierSociete'].'/Tarifs/Img/garants/logo_'.strtolower($codeGcAssureur).'.png')){
$pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/garants/logo_'.strtolower($codeGcAssureur).'.png',10,5,30);
}else{
$pdf->Image($_SESSION['lienLogo'],10,6,30);
}
}else{
$pdf->Image($_SESSION['lienLogo'],10,6,30);
}
// Police Arial gras 15
$pdf->SetFont('Arial','B',12);
// Décalage à droite
$pdf->Cell(30);
$pdf->SetFont('Arial','B',11);
$pdf->SetFillColor(153,255,153); // bleu
/* Titre
$text = convertirc("SUITE DES CONDITIONS PARTICULIERES DE L'AVENANT N° ".$numeroAvenant['numeroAvenant']);
$text .= convertirc(" A LA POLICE N° ".$entetecp['numeroPoliceGarant']." SOUCRITE PAR LA SOCIETE ".$entetecp['libellePolice']);
$text .= convertirc("AUPRES DE ".$entetecp['garant']);
$pdf->MultiCell(150,5, $text,1,'C',true);
*/
$pdf->Ln(40);
$pdf->Cell(50,6,convertirc($entetecp['garant']),0,1,'L',false);
$pdf->Cell(50,6,convertirc(strtoupper($infosDuGarant['siglerepresentant'].'. '.$infosDuGarant['representant'])),0,1,'L',false);
$pdf->Cell(50,6,convertirc(strtoupper($infosDuGarant['servicerepresentant'])),0,1,'L',false);
$pdf->SetFont('Arial','BU',11);
$pdf->Cell(50,6,convertirc($_SESSION['villeSociete']),0,1,'L',false);
$pdf->Ln(20);
$pdf->SetFont('Arial','',11);
$pdf->Cell(45,5,convertirc($_SESSION['villeSociete'].", le ".dateToFrench("now" ,'l j F Y') ),0,1,'L',false);
$pdf->Ln();
$pdf->SetFont('Arial','BU',13);
$pdf->Cell(50,8,convertirc("OBJET : TRANSISSION DE CONTRAT"),0,1,'L',false);
$pdf->SetFont('Arial','',11);
$pdf->Ln(5);
$pdf->Cell(50,8,convertirc($infosDuGarant['siglerepresentant'].', '),0,1,'L',false);
$pdf->Ln(5);
$pdf->MultiCell(170,4,convertirc("Nous avons le plaisir de vous transmettre sous ce pli les pièces contractuelles relatives au(x) contrat(x) ci-dessous cité(s) :"),0,1);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',11);
$pdf->Cell(20,5,convertirc("Ordre"),1,0,'C',false);
$pdf->Cell(110,5,convertirc("NOM POLICE"),1,0,'C',false);
$pdf->Cell(50,5,convertirc("NUMERO POLICE"),1,1,'C',false);
$pdf->SetFont('Arial','',9);
$pdf->Cell(20,5,convertirc("01"),1,0,'C',false);
$pdf->Cell(110,5,convertirc($entetecp['libellePolice']),1,0,'C',false);
$pdf->Cell(50,5,convertirc($entetecp['numeroPolice']),1,1,'C',false);
$pdf->Ln(10);
$pdf->SetFont('Arial','',11);
$pdf->Cell(0,8,convertirc("Tout en vous souhaitant bonne réception,"),0,1,'L',false);
$pdf->Cell(0,8,convertirc("Nous vous prions d'agréer, ".$infosDuGarant['siglerepresentant'].", l'expression de nos sentiments distingués."),0,1,'L',false);
$pdf->SetFont('Arial','B',11);
$pdf->Ln(10);
$pdf->Cell(50,6,convertirc(strtoupper($_SESSION['nomUtilisateur'].' '.$_SESSION['prenomsUtilisateur'])),0,1,'L',false);
$pdf->Cell(50,6,convertirc($_SESSION['profil']),0,1,'L',false);
if ($infosDuGarant['typeGarant']=="1"){
if (file_exists($_SESSION['dossierSociete'].'/Tarifs/Img/garants/pied_'.strtolower($codeGcAssureur).'.png')){
$pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/garants/pied_'.strtolower($codeGcAssureur).'.png',10,270,190);
}
}
$fichier="Temp/TMP_SUITE_DES_CONDITIONS_PARTICULIERES"."_".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;
?>