116 lines
3.6 KiB
PHP
116 lines
3.6 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
require_once 'Modele/Beneficiaire.php';
|
|
require_once 'Modele/Detailoptique.php';
|
|
require_once 'Modele/Optique_temp.php';
|
|
require_once 'Modele/Prestationactes.php';
|
|
require_once 'Modele/Finger.php';
|
|
require_once 'Modele/Detailtarifoptique.php';
|
|
|
|
class ControleurOpticien extends Controleur {
|
|
private $beneficiaire;
|
|
private $prescription;
|
|
private $detailprescription;
|
|
private $prestation;
|
|
private $finger;
|
|
|
|
public function __construct() {
|
|
$this->menuvue = new Menuvueutilisateur();
|
|
$this->menuvue->getMenuVue('Opticien');
|
|
|
|
$this->prescription = new Optique_temp();
|
|
$this->detailprescription = new Detailoptique();
|
|
$this->prestation = new Prestationactes();
|
|
$this->acte = new Detailtarifoptique();
|
|
|
|
$this->beneficiaire = new Beneficiaire();
|
|
|
|
if ($_SESSION['p_codeProfil_C']=="OPT")
|
|
{
|
|
viderContexte();
|
|
}
|
|
|
|
$_SESSION['p_okId'] = "-1";
|
|
|
|
$this->finger = new Finger();
|
|
|
|
$_SESSION['p_codeTypeFacture_C'] = "OPT";
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$_SESSION['p_nbActesVerres'] = "0";
|
|
$_SESSION['p_nbActesMonture'] = "0";
|
|
|
|
/*
|
|
// $id0 = $this->requete->getParametre("id");
|
|
// $id0 = $this->requete->getParametreFormulaire("id", "numerique");
|
|
|
|
if($id0=="0")
|
|
{
|
|
// throw new Exception("id0 : ".$id0);
|
|
$_SESSION['p_numeroBonOptique_C'] = "-1";
|
|
}
|
|
*/
|
|
|
|
$garantieadherent_temp = null;
|
|
$limite_beneficiaire = null;
|
|
|
|
$codePrestataire = $_SESSION['p_codePrestataire_C'];
|
|
$numeroBonOptique = $_SESSION['p_numeroBonOptique_C'];
|
|
|
|
if($numeroBonOptique=="-1" or $numeroBonOptique=="0")
|
|
{
|
|
$this->genererVue(array('nbActesVerres' => 0));
|
|
}
|
|
else
|
|
{
|
|
$resultat = $this->beneficiaire->getBeneficiaireOrdonnanceOpt($numeroBonOptique);
|
|
$idBeneficiaire = $resultat['idBeneficiaire'];
|
|
$_SESSION['p_hospitalisation_C'] = $resultat['hospitalisation'];
|
|
$beneficiaire = $this->beneficiaire->getContexteBeneficiaireId($idBeneficiaire);
|
|
|
|
if($_SESSION['p_hospitalisation_C']>0 && $_SESSION['p_appliquerTmHospit_C']>0)
|
|
{
|
|
$_SESSION['p_tm_C'] = "0";
|
|
}
|
|
|
|
$this->prescription->initoptique_opt();
|
|
|
|
$numeroOptique = $_SESSION['p_numeroOptique_C'];
|
|
|
|
$prescription = $this->prescription->getoptique_opt($numeroBonOptique);
|
|
|
|
$detailprescriptions = $this->detailprescription->getdetailoptique_opt($numeroBonOptique);
|
|
|
|
$detailnonlivres = $this->prescription->getdetailnonlivre();
|
|
|
|
$detaillivres = $this->prescription->getdetaillivre();
|
|
|
|
$user_id = $_SESSION['p_user_id_C'];
|
|
$this->finger->vider_finger_temp($user_id);
|
|
|
|
$idPrestationactes = $prescription['idPrestationactes'];
|
|
$numeroFeuilleMaladie = $prescription['numeroFeuilleMaladie'];
|
|
$numeroOptique = $prescription['numeroOptique'];
|
|
|
|
$this->prestation->vider_garantieadherent_temp($numeroFeuilleMaladie, $codePrestataire);
|
|
|
|
if($idPrestationactes==0)
|
|
{
|
|
$garantieadherent_temp = $this->prestation->init_garantieadherent_temp_opt($numeroFeuilleMaladie, $codePrestataire);
|
|
|
|
$this->beneficiaire->controlerplafondbeneficiaireannuel($idBeneficiaire);
|
|
|
|
$limite_beneficiaire = $this->prestation->getLimitesBeneficiaireTemp();
|
|
}
|
|
|
|
$acte = $this->acte->getverrespossibles();
|
|
|
|
$this->genererVue(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions,
|
|
'detailnonlivres' => $detailnonlivres, 'detaillivres' => $detaillivres, 'garantieadherent_temp' => $garantieadherent_temp,
|
|
'acte' => $acte, 'limite_beneficiaire' => $limite_beneficiaire));
|
|
}
|
|
}
|
|
} |