80 lines
2.4 KiB
PHP
80 lines
2.4 KiB
PHP
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Prescription.php';
|
|
require_once 'Modele/Detailprescription.php';
|
|
require_once 'Modele/Menuvueutilisateur.php';
|
|
|
|
class ControleurAjaxdetailprescription extends Controleur {
|
|
private $prescription;
|
|
private $detailprescription;
|
|
|
|
public function __construct() {
|
|
$this->prescription = new Prescription();
|
|
$this->detailprescription = new Detailprescription();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$numeroPrescription = $_SESSION['p_numeroPrescription_C'];
|
|
|
|
$prescription = $this->prescription->getprescription($numeroPrescription);
|
|
|
|
$detailprescriptions = $this->detailprescription->getdetailprescription($numeroPrescription);
|
|
|
|
$this->genererVueAjax(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions));
|
|
}
|
|
|
|
public function ajoutermedicament()
|
|
{
|
|
$codeMedicament = $this->requete->getParametreFormulaire("codeMedicament");
|
|
|
|
$this->detailprescription->ajoutermedicament($codeMedicament);
|
|
|
|
// $this->executerAction("index");
|
|
}
|
|
|
|
public function majquantite()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
$quantite = $this->requete->getParametreFormulaire("quantite", "numerique");
|
|
|
|
$this->detailprescription->majquantite($idMedicament, $quantite);
|
|
|
|
$this->executerAction("index");
|
|
}
|
|
|
|
public function supprimer()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
|
|
$this->detailprescription->supprimer($idMedicament);
|
|
|
|
// $this->executerAction("index");
|
|
}
|
|
|
|
public function initremplacement()
|
|
{
|
|
$idMedicament = $this->requete->getParametre("idMedicament");
|
|
|
|
$_SESSION['p_idMedicament_a_remplacer'] = $idMedicament;
|
|
}
|
|
|
|
public function consulterremplacement()
|
|
{
|
|
$numeroBonOrdonnance = $_SESSION['p_numeroBonOrdonnance_C'];
|
|
|
|
$medicaments_remplaces = $this->detailprescription->getmedicamentsremplaces($numeroBonOrdonnance);
|
|
|
|
$this->genererVueAjax(array('medicaments_remplaces' => $medicaments_remplaces));
|
|
}
|
|
|
|
public function remplacermedicament()
|
|
{
|
|
$codeMedicamentNouv = $this->requete->getParametreFormulaire("codeMedicamentNouv");
|
|
|
|
$this->detailprescription->remplacermedicament($codeMedicamentNouv);
|
|
|
|
// $this->executerAction("index");
|
|
}
|
|
|
|
} |