diff --git a/Js/fonctions.js b/Js/fonctions.js index 90fcd49..6080ee4 100644 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -18841,4 +18841,76 @@ function add_selected_acte_medicaux(controle) { } } }); -} \ No newline at end of file +} + +function telRwanda(valeur) +{ + if (valeur == null) return null; + // On enlève espaces, tirets, points, parenthèses + let s = String(valeur).trim().replace(/[\s.\-()]/g, ''); + // Préfixe international : +250, 00250, 250 + s = s.replace(/^(?:\+|00)/, ''); + if (s.startsWith('250')) s = s.slice(3); + else if (s.startsWith('0')) s = s.slice(1); + // Numéro national significatif : 7 + [2389] + 7 chiffres + return /^7[2389]\d{7}$/.test(s) ? '+250' + s : null; +} + +function envoyer_prescription_medicament() +{ + smsOrdonnance = $('#smsOrdonnance').val(); + alert("envoyer_prescription_medicament => "+smsOrdonnance); + + const numero = telRwanda(smsOrdonnance); + if (numero === null) { + alert('Numéro invalide : '+smsOrdonnance); + console.error('Numéro invalide :', smsOrdonnance); + } else { + alert('Numéro valide : '+smsOrdonnance); + console.log('Numéro valide :', numero); // ex. +250788123456 + } + + /* + if(smsOrdonnance<=" "){ + v_msg="No de téléphone obligatoire obligatoire!"; + v_msgEng="An appointment date is required!"; + alert_ebene(v_msg, v_msgEng); + + $("#dateRdvAccordee").focus(); + + return; + } + + + if(controle_numerique(controle)) + { + if(quantite==0) + { + controle.focus(); + v_msg="Veuillez saisir la quantité!"; + v_msgEng="Please enter the quantity!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + donnees = 'idMedicament='+idMedicament+"&quantite="+quantite; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxdetailpharmacien/majquantitepha/", + type: 'POST', + data: donnees, + success: function(data) { + // $("#medicaments").html(data); + $("#livraison").html(data); + }, + error: function(data) { + }, + complete: function() { + alerter_depassement_limite(); + controle.focus(); + } + }); + } + */ +} diff --git a/Vue/Prescription/index.php b/Vue/Prescription/index.php index c60899a..d299bce 100644 --- a/Vue/Prescription/index.php +++ b/Vue/Prescription/index.php @@ -269,17 +269,12 @@ - - - " onClick="javascript:click_btn_add_drug();" style='font-size:10pt;'> - - - +
diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 6163c1b..ee324ca 100644 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -16,7 +16,7 @@ - +