214 lines
7.1 KiB
PHP
Executable File
214 lines
7.1 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Detailoptique.php';
|
|
require_once 'Modele/Optique_temp.php';
|
|
require_once 'Modele/Prestationactes.php';
|
|
require_once 'Modele/Detailtarifoptique.php';
|
|
require_once 'Modele/Garantiesbaremepriseencharge.php';
|
|
|
|
class ControleurAjaxdetailopticien extends Controleur {
|
|
private $prescription;
|
|
private $detailprescription;
|
|
private $prestation;
|
|
private $detailoptique;
|
|
private $garantie;
|
|
|
|
public function __construct() {
|
|
$this->prescription = new Optique_temp();
|
|
$this->detailprescription = new Detailoptique();
|
|
$this->prestation = new Prestationactes();
|
|
$this->detailoptique = new Detailtarifoptique();
|
|
$this->garantie = new Garantiesbaremepriseencharge();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
$codePrestataire = $_SESSION['p_codePrestataire_C'];
|
|
$numeroBonOptique = $_SESSION['p_numeroBonOptique_C'];
|
|
$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();
|
|
|
|
$garantieadherent_temp = null;
|
|
|
|
$detail_total = $this->prescription->getTotalPrestationoptiques_temp();
|
|
|
|
$numeroEntentePrealable = $this->detailprescription->getNumeroDemandeaccord($numeroBonOptique);
|
|
|
|
$idDemandeAccord = $this->detailprescription->getIdDemanderaccord($numeroEntentePrealable);
|
|
|
|
$codeReponseEntentePrealable = $this->detailprescription->getReponseDemande($idDemandeAccord);
|
|
|
|
$this->genererVueAjax(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions,
|
|
'detailnonlivres' => $detailnonlivres, 'detaillivres' => $detaillivres, 'garantieadherent_temp' => $garantieadherent_temp,
|
|
'detail_total' => $detail_total, 'idDemandeAccord' => $idDemandeAccord, 'numeroEntentePrealable' => $numeroEntentePrealable,
|
|
'codeReponseEntentePrealable' => $codeReponseEntentePrealable));
|
|
}
|
|
|
|
public function ajouterverre()
|
|
{
|
|
$idOptique = $this->requete->getParametreFormulaire("idOptique");
|
|
|
|
$this->prescription->ajouterverre($idOptique);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function ajouterverretous()
|
|
{
|
|
$this->prescription->ajouterverretous();
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function retirerverre()
|
|
{
|
|
$idOptique = $this->requete->getParametreFormulaire("idOptique");
|
|
|
|
$this->prescription->retirerverre($idOptique);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function retirerverretous()
|
|
{
|
|
$this->prescription->retirerverretous();
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function enregistreroptique()
|
|
{
|
|
$this->prescription->factureropotique();
|
|
}
|
|
|
|
public function majmonture()
|
|
{
|
|
$idOptique = $this->requete->getParametreFormulaire("idOptique");
|
|
$monture = $this->requete->getParametreFormulaire("monture");
|
|
|
|
$this->prescription->majmonturetemp($idOptique, $monture);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function ajouterverreprescription()
|
|
{
|
|
$codeOptique = $this->requete->getParametreFormulaire("codeOptique");
|
|
|
|
$this->detailprescription->ajouterverreopt($codeOptique);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function creerverre()
|
|
{
|
|
$libelleOptique = $this->requete->getParametreFormulaire("libelleOptique");
|
|
$prixVerre = $this->requete->getParametreFormulaire("prixVerre", "numerique");
|
|
|
|
$this->prescription->creerverre($libelleOptique, $prixVerre);
|
|
|
|
// $this->genererVueAjax();
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function demanderaccordopt()
|
|
{
|
|
$idDetailOptique = $this->requete->getParametreFormulaire("idDetailOptique");
|
|
|
|
$this->detailprescription->demanderaccordopt($idDetailOptique);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majprix()
|
|
{
|
|
$idDetail = $this->requete->getParametre("idDetail");
|
|
$valeurActe = $this->requete->getParametreFormulaire("valeurActe", "numerique");
|
|
|
|
$this->prescription->majprix($idDetail, $valeurActe);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function majquantite()
|
|
{
|
|
$idDetail = $this->requete->getParametre("idDetail");
|
|
$quantite = $this->requete->getParametreFormulaire("quantite", "numerique");
|
|
|
|
$this->prescription->majquantite($idDetail, $quantite);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
//13-07-2021
|
|
public function plafondacte()
|
|
{
|
|
$idBeneficiaire = $_SESSION['p_idBeneficiaire_C'];
|
|
$codeActe = $this->requete->getParametreFormulaire("codeActe");
|
|
$datePrescription = $this->requete->getParametreDate("datePrescription");
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
|
|
$codeGarantie = "OPT";
|
|
|
|
$this->garantie->getsourcebaremenew($idBeneficiaire, $codeActe, $datePrescription);
|
|
|
|
|
|
$plafondActe = $this->detailoptique->plafondacte($numeroFeuilleMaladie, $idBeneficiaire, $codeActe, $datePrescription);
|
|
|
|
$_SESSION['p_tm_C'] = $plafondActe['tm'];
|
|
|
|
$statutActe = $this->garantie->getstatutacte($idBeneficiaire, $codeActe, $codeGarantie);
|
|
|
|
$motifStatutActe = $this->garantie->getlibellemotifdepassement($statutActe);
|
|
//highlight_string("<?php\n\$datas =\n" . var_export($plafondActe, true) . ";\n>");
|
|
//die();
|
|
|
|
$this->genererVueAjax(array('plafondActe' => $plafondActe, 'statutActe' => $statutActe,
|
|
'motifStatutActe' => $motifStatutActe));
|
|
}
|
|
|
|
public function ajouteracteprescription()
|
|
{
|
|
$codeActe = $this->requete->getParametreFormulaire("codeActe");
|
|
$soldeConsommation = $this->requete->getParametreFormulaire("soldeConsommation");
|
|
$soldeNbreTransaction = $this->requete->getParametreFormulaire("soldeNbreTransaction");
|
|
|
|
$this->prescription->ajouteracteopt($codeActe, $soldeConsommation, $soldeNbreTransaction);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function supprimeracte()
|
|
{
|
|
$idDetail = $this->requete->getParametreFormulaire("idDetail", "numerique");
|
|
$this->prescription->supprimeracte($idDetail);
|
|
//$this->executerAction("index");
|
|
}
|
|
|
|
public function supprimedemande()
|
|
{
|
|
$idDetailOptique = $this->requete->getParametreFormulaire("idDetailOptique", "numerique");
|
|
|
|
//var_dump($idDetailOptique); die();
|
|
|
|
$this->prescription->supprimerdemande($idDetailOptique);
|
|
}
|
|
|
|
public function reponseopt()
|
|
{
|
|
$numeroBonOptique = $_SESSION['p_numeroBonOptique_C'];
|
|
$numeroEntentePrealable = $this->detailprescription->getNumeroDemandeaccord($numeroBonOptique);
|
|
$idDemandeAccord = $this->detailprescription->getIdDemanderaccord($numeroEntentePrealable);
|
|
|
|
$codeReponseEntentePrealable = $this->detailprescription->getReponseDemande($idDemandeAccord);
|
|
|
|
$this->genererVueAjax(array('codeReponseEntentePrealable' => $codeReponseEntentePrealable));
|
|
}
|
|
} |