168 lines
5.8 KiB
PHP
Executable File
168 lines
5.8 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleurrequete.php'; // OK
|
|
require_once 'Modele/Prestationactes.php';
|
|
|
|
class ControleurAjaximprimerbonhospitalisation extends Controleurrequete
|
|
{
|
|
private $prestationacte;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->prestationacte = new Prestationactes();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
$codePrestataire = $_SESSION['p_codePrestataire_C'];
|
|
|
|
$numeroBonHospitalisation = $this->prestationacte->getnobonhospitalisation($numeroFeuilleMaladie, $codePrestataire);
|
|
|
|
|
|
$prestations = $this->prestationacte->getactesmedicauxhospitalisation($numeroFeuilleMaladie, $codePrestataire);
|
|
$prestations_total = $this->prestationacte->getactesmedicauxhospitalisation_total($numeroFeuilleMaladie, $codePrestataire);
|
|
|
|
if ($prestations_total['depassement'] > "0")
|
|
{
|
|
$aPayer = $prestations_total['montantTm'] + $prestations_total['depassement'];
|
|
}else{
|
|
$aPayer = $prestations_total['montantTm'];
|
|
}
|
|
|
|
$pdf = new FPDF_Protection();
|
|
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
|
|
$userPassword = '';
|
|
$ownerPassword = null;
|
|
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
|
|
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$ht=8;
|
|
|
|
$hl=5;
|
|
|
|
$hy=20;
|
|
|
|
$pdf->SetMargins(10, 10, 10) ;
|
|
|
|
$pdf->Image($_SESSION['p_lienLogo'],94,3,18);
|
|
|
|
$pdf->Ln(2);
|
|
|
|
$pdf->SetFont('Arial','', 7);
|
|
$pdf->Cell(0,$ht,convertirc(' Edité le '.heureCouranteLang($_SESSION['p_lang'])),0,1,'R',false);
|
|
|
|
$pdf->Ln(10);
|
|
// Décalage à droite
|
|
$pdf->Cell(30);
|
|
|
|
$pdf->SetFont('Arial','B', 18);
|
|
$pdf->Cell(140,$ht,convertirc(" Bon No : ".$numeroBonHospitalisation),'TLBR',1,'C',false);
|
|
|
|
$pdf->Ln(10);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(30,$ht,convertirc(_('Souscripteur')),0,0,'L',false);
|
|
$pdf->Cell(45,$ht,convertirc(" : ".$_SESSION['p_nomClient_C']),0,1,'L',false);
|
|
|
|
$pdf->Cell(30,$ht,convertirc(_('Adhérent')),0,0,'L',false);
|
|
$pdf->Cell(45,$ht,convertirc(" : ".$_SESSION['p_numeroAdherent_C']." / ".$_SESSION['p_adherent_C']),0,1,'L',false);
|
|
|
|
$pdf->SetFont('Arial','BU', 12);
|
|
$pdf->Cell(30,$ht,convertirc(_('Patient')),0,0,'L',false);
|
|
$pdf->Cell(45,$ht,convertirc(" : ".$_SESSION['p_numeroBeneficiaire_C']." / ".$_SESSION['p_beneficiaire_C']),0,1,'L',false);
|
|
|
|
$pdf->SetFont('Arial','', 12);
|
|
$pdf->Cell(30,$ht,convertirc(_('Prise en charge')),0,0,'L',false);
|
|
$pdf->Cell(45,$ht,convertirc(" : ".taux_couverture($_SESSION['p_tm_C'])),0,1,'L',false);
|
|
|
|
$pdf->Ln(10);
|
|
///////////////////////////////////////////////////////
|
|
$pdf->SetFont('Arial','B', 10);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(20,$ht,convertirc(_("Date")),'TLR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(20,$ht,convertirc(_('Type acte')),'TR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(80,$ht,convertirc(_("Acte")),'TR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(10,$ht,convertirc(_("Nbre")),'TR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(25,$ht,convertirc(_("Montant")),'TR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(35,$ht,convertirc(_("A Payer")),1,1,'C',true);
|
|
|
|
$pdf->Cell(20,$hl,convertirc(""),'LBR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(20,$hl,convertirc(""),'BR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(80,$hl,convertirc(""),'BR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(10,$hl,convertirc(""),'BR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(25,$hl,convertirc(""),'BR',0,'C',true);
|
|
$pdf->SetFillColor(217,237,247);
|
|
$pdf->Cell(18,$hl,convertirc(_("TM")),1,0,'C',true);
|
|
$pdf->Cell(17,$hl,convertirc(_("Dépas")),1,1,'C',true);
|
|
|
|
/////////////////////////////////////////////////////////////////
|
|
foreach ($prestations as $v){
|
|
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
|
|
{
|
|
$libelleActe = $v['libelleActeEng'];
|
|
|
|
}else{
|
|
|
|
$libelleActe = $v['libelleActe'];
|
|
}
|
|
|
|
|
|
|
|
|
|
$pdf->SetFont('Arial','', 8);
|
|
$pdf->Cell(20,$hy,convertirc(dateLang($v['datePrestation'],$_SESSION['p_lang'])),'LBR',0,'C',false);
|
|
$pdf->Cell(20,$hy,convertirc($v['codeTypePrestation']),'BR',0,'C',false);
|
|
$pdf->Cell(80,$hy,convertirc(substr($libelleActe,0,65)),'BR',0,'L',false);
|
|
$pdf->Cell(10,$hy,convertirc($v['quantite']),'BR',0,'C',false);
|
|
$pdf->Cell(25,$hy,convertirc(format_N($v['fraisReel'])),'BR',0,'C',false);
|
|
$pdf->Cell(18,$hy,convertirc(format_N($v['montantTm'])),1,0,'C',false);
|
|
$pdf->Cell(17,$hy,convertirc(format_N($v['depassement'])),1,1,'C',false);
|
|
}
|
|
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(130,10,convertirc(_("Total")),1,0,'C',false);
|
|
$pdf->Cell(25,10,convertirc(format_N($prestations_total['fraisReel'])),1,0,'C',false);
|
|
$pdf->Cell(35,10,convertirc(format_N($aPayer)),1,1,'C',false);
|
|
|
|
|
|
$pdf->Ln(10);
|
|
|
|
$pdf->SetFont('Arial','B', 12);
|
|
$pdf->Cell(0,6,convertirc(_('Arrêté la présente facture à la somme de').' : '),0,1,'C',false);
|
|
|
|
$pdf->Ln(3);
|
|
$pdf->SetFont('Arial','I',12);
|
|
|
|
|
|
$pdf->Cell(0,15, convetirEnLettre($aPayer, $_SESSION['p_lang'])." ".$_SESSION['p_devise_C'],'TLBR',1,'C',false);
|
|
|
|
|
|
$pdf->Ln(20);
|
|
$pdf->SetFont('','BU');
|
|
$pdf->Cell(0,6,convertirc($_SESSION['p_prestataire_C']),0,0,'R',false);
|
|
|
|
|
|
$fichier="Temp/TMP_detail_hospitalisation"."_".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;
|
|
|
|
exit();
|
|
}
|
|
} |