prestation/Controleur/ControleurAjaximprimerlistemedecins.php
2025-12-05 10:42:46 +00:00

94 lines
2.9 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleurrequete.php'; // OK
require_once 'Modele/Medecin.php';
class ControleurAjaximprimerlistemedecins extends Controleurrequete
{
private $medecin;
public function __construct()
{
$this->medecin = new Medecin();
}
public function index()
{
$codeSpecialite = $this->requete->getParametreFormulaire("codeSpecialite");
$nom = $this->requete->getParametreFormulaire("nom");
$prenoms = $this->requete->getParametreFormulaire("prenoms");
$noOrdreMedecin = $this->requete->getParametreFormulaire("noOrdreMedecin");
$medecins = $this->medecin->getmedecinparametrage($codeSpecialite, $nom, $prenoms, $noOrdreMedecin) ;
$pdf = new FPDF_Protection("L");
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
$userPassword = '';
$ownerPassword = null;
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
$pdf->AliasNbPages();
$pdf->AddPage();
$ht=4;
$pdf->SetMargins(10, 10, 10) ;
$pdf->SetFont('Arial','BI', 8);
$pdf->Cell(0,$ht,convertirc($_SESSION['nomSociete']),0,0,'L',false);
$pdf->ln(5);
$pdf->Cell(0,$ht,convertirc(_("LISTE DES MEDECINS")),0,1,'R',false);
$pdf->SetFont('Arial','', 8);
$pdf->Cell(0,$ht,convertirc('Edition : '.heureCouranteLang($_SESSION['lang'])),0,1,'L',false);
$pdf->SetFont('Arial','B', 8);
$ht=5;
$pdf->Cell(50,$ht,convertirc(_("Nom")),1,0,'C',false);
$pdf->Cell(50,$ht,convertirc(_("Prénoms")),1,0,'L',false);
$pdf->Cell(20,$ht,convertirc("Code"),1,0,'C',false);
$pdf->Cell(50,$ht,convertirc(_("Spécialité")),1,0,'L',false);
$pdf->Cell(20,$ht,convertirc(_("No Ordre")),1,0,'C',false);
$pdf->Cell(15,$ht,convertirc("Genre"),1,0,'C',false);
$pdf->Cell(30,$ht,convertirc("Tel"),1,0,'L',false);
$pdf->Cell(40,$ht,convertirc("E-mail"),1,1,'L',false);
$ordre = "0";
$pdf->SetFont('Arial','', 8);
foreach ($medecins as $medecin)
{
$specialite =$medecin['specialite'];
if (est_anglophone())
{
$specialite = $medecin['specialiteEng'];
}
$ordre++;
$pdf->Cell(50,$ht,convertirc($medecin['nom']),1,0,'L',false);
$pdf->Cell(50,$ht,convertirc($medecin['prenoms']),1,0,'L',false);
$pdf->Cell(20,$ht,$medecin['codeMedecin'],1,0,'C',false);
$pdf->Cell(50,$ht,convertirc($specialite),1,0,'L',false);
$pdf->Cell(20,$ht,$medecin['noOrdreMedecin'],1,0,'C',false);
$pdf->Cell(15,$ht,$medecin['sexe'],1,0,'C',false);
$pdf->Cell(30,$ht,$medecin['telephone'],1,0,'L',false);
$pdf->Cell(40,$ht,$medecin['email'],1,1,'L',false);
}
$fichier="Temp/TEMP_LISTE_MEDECINS"."_".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;
}
}