a
This commit is contained in:
@@ -18841,4 +18841,76 @@ function add_selected_acte_medicaux(controle) {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user