prestation/Controleur/ControleurAjaximprimerdlisteprestataireparametrage.php
2025-12-01 18:54:33 +00:00

82 lines
2.9 KiB
PHP

<?php
require_once 'Framework/Controleurrequete.php'; // OK
require_once 'Modele/Prestataire.php';
class ControleurAjaximprimerdlisteprestataireparametrage extends Controleurrequete
{
private $prestataire;
public function __construct()
{
$this->prestataire = new Prestataire();
}
public function index()
{
$codeTypePrestataire = $this->requete->getParametreFormulaire("codeTypePrestataire");
$codeReseau = $this->requete->getParametreFormulaire("codeReseau");
$libelle = $this->requete->getParametreFormulaire("libelle");
$prestataires = $this->prestataire->getprestataireparametrageexport($codeTypePrestataire, $codeReseau, $libelle) ;
$pdf = new FPDF('L');
$pdf->AliasNbPages();
$pdf->AddPage();
$ht=4;
$pdf->SetMargins(10, 10, 10) ;
$pdf->SetFont('Arial','BI', 7);
$pdf->Cell(0,$ht,convertirc($_SESSION['nomSociete']),0,0,'L',false);
$pdf->Cell(0,$ht,convertirc(_("LISTE DES PRESTATAIRES")),0,1,'R',false);
$pdf->SetFont('Arial','', 7);
$pdf->Cell(0,$ht,convertirc('Edition : '.heureCouranteLang($_SESSION['lang'])),0,1,'L',false);
$pdf->SetFont('Arial','', 5);
$ht=4;
$pdf->Cell(10,$ht,convertirc("No"),1,0,'C',false);
$pdf->Cell(50,$ht,convertirc(_("Nom")),1,0,'L',false);
$pdf->Cell(45,$ht,convertirc(_("Adresse Géo")),1,0,'L',false);
$pdf->Cell(20,$ht,convertirc(_("Signature")),1,0,'L',false);
$pdf->Cell(20,$ht,convertirc(_("District")),1,0,'L',false);
$pdf->Cell(20,$ht,convertirc(_("Province")),1,0,'L',false);
$pdf->Cell(30,$ht,convertirc("E-mail"),1,0,'L',false);
$pdf->Cell(20,$ht,convertirc("Tel"),1,0,'L',false);
$pdf->Cell(30,$ht,convertirc("Type"),1,0,'L',false);
$pdf->Cell(30,$ht,convertirc(_("Réseau")),1,1,'R',false);
$ordre = "0";
foreach ($prestataires as $prestataire)
{
$ordre++;
$pdf->Cell(10,$ht,$ordre,1,0,'C',false);
$pdf->Cell(50,$ht,substr($prestataire['libelle'], 0, 45),1,0,'L',false);
$pdf->Cell(45,$ht,substr($prestataire['adresseGeo'], 0, 40),1,0,'L',false);
$pdf->Cell(20,$ht,substr($prestataire['villeSignature'], 0, 25),1,0,'L',false);
$pdf->Cell(20,$ht,substr($prestataire['district'], 0, 35),1,0,'L',false);
$pdf->Cell(20,$ht,substr($prestataire['province'], 0, 25),1,0,'L',false);
$pdf->Cell(30,$ht,$prestataire['emailGestionPrestataire'],1,0,'L',false);
$pdf->Cell(20,$ht,$prestataire['smsGestionPrestataire'],1,0,'L',false);
$pdf->Cell(30,$ht,$prestataire['typeprestataire'],1,0,'L',false);
$pdf->Cell(30,$ht,convertirc($prestataire['reseausoins']),1,1,'L',false);
}
$fichier="Temp/TEMP_LISTE_PRESTATAIRES"."_".uniqid().".pdf";
$pdf->Output($fichier,"F");
$t_html =' <div id ="div_liste_prestataire" class="alert alert-info"> ';
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
$t_html .=' </div ';
echo $t_html;
}
}