diff --git a/Controleur/ControleurAjaxdetailprescription.php b/Controleur/ControleurAjaxdetailprescription.php index 76f17fc..fcdec54 100644 --- a/Controleur/ControleurAjaxdetailprescription.php +++ b/Controleur/ControleurAjaxdetailprescription.php @@ -93,4 +93,14 @@ class ControleurAjaxdetailprescription extends Controleur { $this->executerAction("index"); } + public function envoyerprescription() + { + $numeroBondonnance = $this->requete->getParametre("numeroBondonnance"); + $smsOrdonnance = $this->requete->getParametreFormulaire("smsOrdonnance"); + + $this->detailprescription->envoyerprescription($numeroBondonnance, $smsOrdonnance); + + $this->executerAction("index"); + } + } \ No newline at end of file diff --git a/Js/fonctions.js b/Js/fonctions.js index ea378ea..a18c88d 100644 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -18843,6 +18843,17 @@ function envoyer_prescription_medicament() { numeroBondonnance = $('#numeroBon').val(); smsOrdonnance = $('#smsOrdonnance').val(); + const nbMedicamentSaisie = $('#nbMedicamentSaisie').val(); + + alert("nbMedicamentSaisie => "+nbMedicamentSaisie); + + if ( nbMedicamentSaisie <= "0") { + v_msg="Aucun médicament!"; + v_msgEng="No drug!"; + alert_ebene(v_msg, v_msgEng); + + return; + } const numero = telRwanda(smsOrdonnance); if (numero === null) { @@ -18858,7 +18869,8 @@ function envoyer_prescription_medicament() donnees = 'numeroBondonnance='+numeroBondonnance+"&smsOrdonnance="+numero; alert(donnees); - + return; + var div_wait = $('#div_wait'); div_wait.html('
  ' + 'Veuillez patienter...' + '
'); diff --git a/Modele/Detailprescription.php b/Modele/Detailprescription.php index f12ea66..b91ec40 100644 --- a/Modele/Detailprescription.php +++ b/Modele/Detailprescription.php @@ -120,10 +120,17 @@ class Detailprescription extends Modele { public function majposologie($idMedicament, $posologie) { - $sql = 'call sp_p_maj_posologie_medicament(?, ?)'; $this->executerRequete($sql, array($idMedicament, $posologie)); } + public function envoyerprescription($numeroBondonnance, $smsOrdonnance) + { + $user = $_SESSION['p_login']; + + $sql = 'call sp_p_maj_posologie_medicament(?, ?)'; + + $this->executerRequete($sql, array($numeroBondonnance, $smsOrdonnance, $user)); + } } \ No newline at end of file diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 4caea27..bf0461e 100644 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -262,7 +262,7 @@ - +