97 lines
3.3 KiB
PHP
97 lines
3.3 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
require_once 'Modele/Beneficiaire.php';
|
|
require_once 'Modele/Detailprescription.php';
|
|
require_once 'Modele/Prescription_temp.php';
|
|
require_once 'Modele/Prestationactes.php';
|
|
require_once 'Modele/Finger.php';
|
|
|
|
class ControleurPharmacien extends Controleur {
|
|
private $menuvue;
|
|
private $beneficiaire;
|
|
private $prescription;
|
|
private $detailprescription;
|
|
private $prestation;
|
|
private $finger;
|
|
|
|
public function __construct() {
|
|
$this->menuvue = new Menuvueutilisateur();
|
|
$this->menuvue->getMenuVue('Pharmacien');
|
|
|
|
$this->prescription = new Prescription_temp();
|
|
$this->detailprescription = new Detailprescription();
|
|
$this->prestation = new Prestationactes();
|
|
|
|
$this->beneficiaire = new Beneficiaire();
|
|
viderContexte();
|
|
$_SESSION['p_okId'] = "-1";
|
|
|
|
$this->finger = new Finger();
|
|
|
|
$_SESSION['p_codeTypeFacture_C'] = "PHAR";
|
|
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$garantieadherent_temp = null;
|
|
$codePrestataire = $_SESSION['p_codePrestataire_C'];
|
|
|
|
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
|
|
|
|
if($numeroBonOrdonnance=="-1")
|
|
{
|
|
// $this->genererVue();
|
|
|
|
$this->genererVue();
|
|
|
|
}
|
|
else
|
|
{
|
|
$resultat = $this->beneficiaire->getBeneficiaireOrdonnancePha($numeroBonOrdonnance);
|
|
|
|
$idBeneficiaire = $resultat['idBeneficiaire'];
|
|
$beneficiaire = $this->beneficiaire->getContexteBeneficiaireId($idBeneficiaire);
|
|
|
|
$this->prescription->initpharmacie_pha($numeroBonOrdonnance);
|
|
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
|
|
$prescription = $this->prescription->getprescription_pha($numeroBonOrdonnance);
|
|
|
|
$detailprescriptions = $this->detailprescription->getdetailprescription_pha($numeroBonOrdonnance);
|
|
|
|
$detailnonlivres = $this->prescription->getdetailnonlivre();
|
|
|
|
// $detaillivres = $this->prescription->getdetaillivre();
|
|
$detaillivres = $this->prescription->getdetaillivrepha();
|
|
|
|
$factures = $this->prescription->getfactures_ordonnance($numeroBonOrdonnance);
|
|
$factures_toal = $this->prescription->getfactures_total_ordonnance($numeroBonOrdonnance);
|
|
|
|
$user_id = $_SESSION['p_user_id_C'];
|
|
$this->finger->vider_finger_temp($user_id);
|
|
|
|
$idPrestationactes = $prescription['idPrestationactes'];
|
|
$remplace = $prescription['remplace'];
|
|
$numeroRemplace = $prescription['numeroRemplace'];
|
|
$numeroFeuilleMaladie = $prescription['numeroFeuilleMaladie'];
|
|
$numeroPrescription = $prescription['numeroPrescription'];
|
|
|
|
$facturable=($numeroRemplace != $numeroBonOrdonnance);
|
|
|
|
$this->prestation->vider_garantieadherent_temp($numeroFeuilleMaladie, $codePrestataire);
|
|
|
|
// if($idPrestationactes==0)
|
|
// if($idPrestationactes==0 && $facturable)
|
|
if($facturable)
|
|
{
|
|
$garantieadherent_temp = $this->prestation->init_garantieadherent_temp_pha($numeroFeuilleMaladie, $codePrestataire);
|
|
}
|
|
|
|
$this->genererVue(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions, 'detailnonlivres' => $detailnonlivres,
|
|
'detaillivres' => $detaillivres, 'garantieadherent_temp' => $garantieadherent_temp, 'factures' => $factures, 'factures_toal' => $factures_toal));
|
|
}
|
|
}
|
|
} |