196 lines
7.8 KiB
PHP
196 lines
7.8 KiB
PHP
<?php
|
|
// require_once 'Framework/Controleur.php';
|
|
require_once 'Framework/Controleurrequete.php';
|
|
require_once 'Modele/Feuillemaladie.php';
|
|
require_once 'Modele/Prestationactes.php';
|
|
require_once 'Modele/Typeaffection.php';
|
|
require_once 'Modele/Affection.php';
|
|
require_once 'Modele/Beneficiaire.php';
|
|
require_once 'Modele/Facture.php';
|
|
|
|
class ControleurAjaxfeuillemaladie extends Controleurrequete {
|
|
private $feuillemaladie;
|
|
private $prestation;
|
|
private $typeaffection;
|
|
private $affection;
|
|
private $beneficiaire;
|
|
private $facture;
|
|
|
|
public function __construct() {
|
|
$this->feuillemaladie = new Feuillemaladie();
|
|
$this->prestation = new Prestationactes();
|
|
$this->typeaffection = new Typeaffection();
|
|
$this->affection = new Affection();
|
|
$this->beneficiaire = new Beneficiaire();
|
|
$this->facture = new Facture();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
$codePrestataire = $_SESSION['p_codePrestataire_C'];
|
|
|
|
$garantieadherent_temp = null;
|
|
|
|
$infosfeuillemaladie = $this->feuillemaladie->getinfosfeuillemaladie($numeroFeuilleMaladie);
|
|
$facture = $infosfeuillemaladie['facture'];
|
|
|
|
$this->prestation->vider_garantieadherent_temp($numeroFeuilleMaladie, $codePrestataire);
|
|
|
|
if($facture==0)
|
|
{
|
|
$garantieadherent_temp = $this->prestation->init_garantieadherent_temp($numeroFeuilleMaladie, $codePrestataire);
|
|
}
|
|
|
|
$feuillemaladie = $this->feuillemaladie->getfeuillemaladie($numeroFeuilleMaladie);
|
|
|
|
$prestations = $this->prestation->getprestationsfeuille($numeroFeuilleMaladie, $codePrestataire);
|
|
|
|
$typeaffections = $this->typeaffection->getListe() ;
|
|
|
|
$codeTypeAffection = $feuillemaladie['codeTypeAffection'];
|
|
|
|
$affections = $this->affection->getListe($codeTypeAffection) ;
|
|
|
|
$diagnostics = $this->feuillemaladie->getDiagnostics($numeroFeuilleMaladie);
|
|
|
|
$idBeneficiaire = $_SESSION['p_idBeneficiaire_C'];
|
|
|
|
$this->beneficiaire->controlerplafondbeneficiaireannuel($idBeneficiaire);
|
|
|
|
$limite_beneficiaire = $this->prestation->getLimitesBeneficiaireTemp();
|
|
|
|
$this->genererVueAjax(array('feuillemaladie' => $feuillemaladie, 'prestations' => $prestations,
|
|
'garantieadherent_temp' => $garantieadherent_temp, 'typeaffections' => $typeaffections, 'affections' => $affections,
|
|
'diagnostics' => $diagnostics, 'limite_beneficiaire' => $limite_beneficiaire));
|
|
}
|
|
|
|
public function imprimerfacture()
|
|
{
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
|
|
$feuillemaladie = $this->feuillemaladie->getfeuillemaladieimpression($numeroFeuilleMaladie);
|
|
|
|
$idFacture = $this->requete->getParametreFormulaire("idFacture");
|
|
|
|
$facture = $this->facture->consulterfacturefacture($idFacture) ;
|
|
|
|
$prestations = $this->facture->consulterfactureprestationactes($idFacture) ;
|
|
|
|
$pdf = new FPDF('L');
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$ht=8;
|
|
|
|
$pdf->SetMargins(15, 15, 15) ;
|
|
|
|
$pdf->SetFont('Arial','BI', 10);
|
|
|
|
$pdf->Cell(130,$ht,convertirc($_SESSION['p_nomSociete']),0,0,'L',false);
|
|
$pdf->Cell(130,$ht,convertirc(_("FACTURE"). " No ".$facture['idFacture']." => " . $facture['prestataire']),0,1,'R',false);
|
|
|
|
$pdf->ln(5);
|
|
|
|
$pdf->SetFont('Arial','', 10);
|
|
|
|
$pdf->Cell(40,$ht,convertirc(_("Souscripteur")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['souscripteur']),0,0,'L',false);
|
|
|
|
$pdf->Cell(25,$ht,convertirc(_("Patient")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['beneficiaire'] . " ( " . $feuillemaladie['numeroBeneficiaire'] . " )"),0,1,'L',false);
|
|
|
|
$pdf->Cell(40,$ht,convertirc(_("Adhérent")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['adherent']),0,0,'L',false);
|
|
|
|
/*
|
|
$pdf->Cell(40,$ht,convertirc("E-mail"),0,0,'L',false);
|
|
$pdf->Cell(160,$ht,convertirc(" : ".$feuillemaladie['emailAdherent']),0,1,'L',false);
|
|
|
|
$pdf->Cell(40,$ht,convertirc("No Tel"),0,0,'L',false);
|
|
$pdf->Cell(160,$ht,convertirc(" : ".$feuillemaladie['telAdherent']),0,1,'L',false);
|
|
*/
|
|
|
|
$pdf->Cell(25,$ht,convertirc(_("Systeme")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".dateheureFr($feuillemaladie['dateSysteme'])),0,1,'L',false);
|
|
|
|
$pdf->Cell(40,$ht,convertirc(_("Médecin")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['medecinConsultation']),0,0,'L',false);
|
|
|
|
$pdf->Cell(25,$ht,convertirc(_("No OM")),0,0,'L',false);
|
|
$pdf->Cell(45,$ht,convertirc(" : ".$feuillemaladie['noOrdreMedecin']),0,1,'L',false);
|
|
|
|
/*
|
|
$pdf->Cell(40,$ht,convertirc("Consultation"),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".dateFr($feuillemaladie['dateConsultation'])),0,0,'L',false);
|
|
*/
|
|
|
|
$pdf->Cell(40,$ht,convertirc(_("Raison Cons")),0,0,'L',false);
|
|
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
|
|
{
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['raisonconsultationEng']),0,0,'L',false);
|
|
}
|
|
else
|
|
{
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['raisonconsultation']),0,0,'L',false);
|
|
}
|
|
|
|
$pdf->Cell(25,$ht,convertirc(_("No Bon")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['numeroBonConsultation']),0,1,'L',false);
|
|
|
|
$pdf->Cell(40,$ht,convertirc(_("Ord Pharm")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['numeroBonOrdonnance']),0,0,'L',false);
|
|
|
|
$pdf->Cell(25,$ht,convertirc(_("Ord Verres")),0,0,'L',false);
|
|
$pdf->Cell(45,$ht,convertirc(" : ".$feuillemaladie['numeroBonOptique']),0,1,'L',false);
|
|
|
|
$pdf->Cell(40,$ht,convertirc(_("Bon Exam")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['numeroBonExamen']),0,0,'L',false);
|
|
|
|
$pdf->Cell(25,$ht,convertirc(_("Bon KINE")),0,0,'L',false);
|
|
$pdf->Cell(45,$ht,convertirc(" : ".$feuillemaladie['numeroBonKine']),0,1,'L',false);
|
|
|
|
$pdf->Cell(40,$ht,convertirc(_("Bon Hospit")),0,0,'L',false);
|
|
$pdf->Cell(95,$ht,convertirc(" : ".$feuillemaladie['numeroBonHospitalisation']),0,0,'L',false);
|
|
|
|
$pdf->Cell(25,$ht,convertirc(_("Facturé par")),0,0,'L',false);
|
|
$pdf->Cell(45,$ht,convertirc(" : ".$facture['codeUtilisateur']),0,1,'L',false);
|
|
|
|
$pdf->Cell(40,$ht,convertirc("Date"),1,0,'C',false);
|
|
$pdf->Cell(117,$ht,convertirc(_("Acte")),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,convertirc(_("Valeur")),1,0,'C',false);
|
|
$pdf->Cell(10,$ht,convertirc(_("Qté")),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,convertirc(_("Frais")),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,convertirc(_("T M")),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,convertirc(_("A Remb")),1,1,'C',false);
|
|
|
|
foreach ($prestations as $prestation)
|
|
{
|
|
$pdf->Cell(40,$ht,dateheureLang($prestation['dateSysteme']),1,0,'C',false);
|
|
$pdf->Cell(117,$ht,convertirc($prestation['libelleActe']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($prestation['valeurActe']),1,0,'C',false);
|
|
$pdf->Cell(10,$ht,format_N($prestation['quantite']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($prestation['fraisReel']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($prestation['montantTm']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($prestation['montantArembourser']),1,1,'C',false);
|
|
}
|
|
|
|
$pdf->SetFont('Arial','B', 10);
|
|
|
|
$pdf->Cell(187,$ht,convertirc("Total : "),1,0,'C',false);
|
|
|
|
$pdf->Cell(20,$ht,format_N($facture['fraisReel']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($facture['montantTm']),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($facture['montantArembourser']),1,1,'C',false);
|
|
|
|
$fichier="Temp/facture"."_".uniqid().".pdf";
|
|
$pdf->Output($fichier,"F");
|
|
|
|
$t_html =' <div id ="div_wait" class="alert alert-info"> ';
|
|
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
|
|
$t_html .=' </div ';
|
|
echo $t_html;
|
|
|
|
}
|
|
|
|
} |