a
This commit is contained in:
parent
2cd7ac0821
commit
51bc5c4f4b
148
Js/fonctions.js
148
Js/fonctions.js
|
|
@ -18452,3 +18452,151 @@ function listerrdv()
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function selectionner_rdv(idDemande)
|
||||
{
|
||||
donnees = 'idDemande='+idDemande;
|
||||
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxdemanderdv/selectionner/",
|
||||
type: 'POST',
|
||||
data: donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
// alert(data);
|
||||
|
||||
|
||||
|
||||
},
|
||||
complete: function() {
|
||||
ouvrir_rdv();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function ouvrir_rdv()
|
||||
{
|
||||
window.location.assign($("#racineWeb" ).val()+"Rendezvous/");
|
||||
|
||||
}
|
||||
|
||||
function historique_rdv()
|
||||
{
|
||||
window.location.assign($("#racineWeb" ).val()+"Historiquerdv/");
|
||||
|
||||
}
|
||||
|
||||
function valider_rdv()
|
||||
{
|
||||
numeroDemandeRdv = $("#numeroDemandeRdv").val();
|
||||
codeEtatRdv = $("#codeEtatRdv").val();
|
||||
|
||||
motifReponseRdv = $("#motifReponseRdv").val();
|
||||
motifReponseRdv = motifReponseRdv.trim();
|
||||
|
||||
if(codeEtatRdv=="0"){
|
||||
|
||||
v_msg="Un autre état de réponse est obligatoire!";
|
||||
v_msgEng="Another response status is required!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#codeEtatRdv").focus();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (codeEtatRdv=="1"){
|
||||
dateRdvAccordee = $("#dateRdvAccordee").val();
|
||||
heureRdvAccordee = $("#heureRdvAccordee").val();
|
||||
|
||||
if(dateRdvAccordee<=" "){
|
||||
v_msg="Une date de rendez-vous est obligatoire!";
|
||||
v_msgEng="An appointment date is required!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#dateRdvAccordee").focus();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(heureRdvAccordee<=" "){
|
||||
v_msg="Une heure de rendez-vous est obligatoire!";
|
||||
v_msgEng="An appointment time is required!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#heureRdvAccordee").focus();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}else{
|
||||
dateRdvAccordee = "";
|
||||
heureRdvAccordee = "";
|
||||
}
|
||||
|
||||
|
||||
if(codeEtatRdv=="9" && motifReponseRdv<=" "){
|
||||
v_msg="Le motif est obligatoire!";
|
||||
v_msgEng="The pattern is mandatory!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#motifReponseRdv").focus();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
donnees = 'numeroDemandeRdv='+ numeroDemandeRdv+'&codeEtatRdv='+codeEtatRdv;
|
||||
donnees += '&dateRdvAccordee='+dateRdvAccordee+'&heureRdvAccordee='+heureRdvAccordee;
|
||||
donnees += '&motifReponseRdv='+motifReponseRdv;
|
||||
|
||||
|
||||
v_msg="Confirmez-vous la modification de votre demande?";
|
||||
v_msgEng="Do you confirm the modification of your request?";
|
||||
|
||||
confirm_ebene_sweet(v_msg, v_msgEng)
|
||||
.then((isConfirmed) => {
|
||||
if (isConfirmed) {
|
||||
// L'utilisateur a confirmé
|
||||
|
||||
vLink = "Ajaxdemanderdv/valider/";
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: $("#racineWeb").val()+vLink,
|
||||
data:donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
//alert(data);
|
||||
// $('#div_test_gabarit').html(data);
|
||||
|
||||
},
|
||||
complete: function() {
|
||||
|
||||
historique_rdv();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
// L'utilisateur a annulé
|
||||
console.log("Confirmation refusée");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function visibilite_date_rdv()
|
||||
{
|
||||
codeEtatRdv = $('#codeEtatRdv').val();
|
||||
|
||||
if(codeEtatRdv=="0" || codeEtatRdv=="1"){
|
||||
$('#tr_date').show();
|
||||
}else{
|
||||
|
||||
$('#tr_date').hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user