prestation/Controleur/ControleurAjaxetatreponsesubstitution.php
2025-12-01 18:54:33 +00:00

40 lines
1.5 KiB
PHP

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Demandesubstitution.php';
class ControleurAjaxetatreponsesubstitution extends Controleur {
private $dmd;
public function __construct() {
$this->dmd = new Demandesubstitution();
}
public function index()
{
$idMedicament = $this->requete->getParametreFormulaire("idMedicament");
$idSubstitut = $this->requete->getParametreFormulaire("idSubstitut");
$prixSubstitut = $this->requete->getParametreFormulaire("prixSubstitut", "numerique");
$posologie = $this->requete->getParametreFormulaire("posologie");
$nvellePosologie = $this->requete->getParametreFormulaire("nvellePosologie");
//var_dump($prixSubstitut, $posologie, $nvellePosologie);die();
$codeMedicamentPrescrit = $this->dmd->getCodeMedicament($idMedicament);
$codeMedicamentSubstitution = $this->dmd->getCodeMedicament($idSubstitut);
$demandesubstitution = $this->dmd->getDemandesubstitution($codeMedicamentPrescrit,
$codeMedicamentSubstitution, $prixSubstitut, $posologie, $nvellePosologie);
$_SESSION['p_idDemandeSubstitution_C'] = $demandesubstitution['id'];
$libelleReponse = $this->dmd->getLibelleReponse($demandesubstitution['codeReponseEntentePrealable']);
//var_dump($libelleReponse);
//die();
$this->genererVueAjax(array('demandesubstitution' => $demandesubstitution, 'libelleReponse' => $libelleReponse));
}
}