diff --git a/Js/fonctions.js b/Js/fonctions.js index 97691a97..eeb20ee1 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -44843,4 +44843,142 @@ function activer_user_rh_client(codeUtilisateur) function afficher_users_client_id(idUtilisateur) { window.location.assign($("#racineWeb" ).val()+"Ficheuserrhclient/"+idUtilisateur+"/"); +} + +function retour_a_users_rh_client() +{ + window.location.assign($("#racineWeb" ).val()+"Usersrhclient/"); +} + +function enregistrer_modif_user_rh() +{ + idUtilisateur = $("#idUtilisateur").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + actif = $("#actif").val(); + actVisible = "0"; + codeLangue = $("#codeLangueUser").val(); + AffectionVisible = "0"; + + telephone = $("#telephone").val(); + email = $("#email").val(); + + codeProfil = $("#codeProfil").val(); + + + if (nom<=" ") + { + v_msg="Veuillez saisir le nom!"; + v_msgEng="Please enter the name!"; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + + return; + }); + + + $("#nom").focus(); + return; + } + + if (actif<=" ") + { + v_msg="Utilisateur actif oui ou non?"; + v_msgEng="Is the user active yes or no?"; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + + return; + }); + + $("#actif").focus(); + return; + } + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + + return; + }); + + $("#codeLangueUser").focus(); + return; + } + + + if (codeProfil<=" ") + { + v_msg="Le profil utilisateur est obligatoire!"; + v_msgEng="The user profile is required!"; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + + return; + }); + + $("#codeProfil").focus(); + return; + } + + + if(!verifMailValeur(email)) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + + return; + }); + + $("#email").focus(); + return; + } + + donnees = 'idUtilisateur=' + idUtilisateur; + donnees += '&nom=' + nom; + donnees += '&prenoms=' + prenoms; + donnees += '&actif=' + actif; + donnees += '&actVisible=' + actVisible; + donnees += '&codeLangue=' + codeLangue; + donnees += '&codeProfil=' + codeProfil; + donnees += '&AffectionVisible=' + AffectionVisible; + donnees += '&telephone='+telephone+'&email='+email; + + v_msg="Confirmez-vous ces modifications?"; + v_msgEng="Do you confirm these modifications?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxuserrhclient/enregistrermodifuser/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + //$('#div_test_gabarit').html(data); + }, + complete: function() { + retour_a_users_rh_client(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + } \ No newline at end of file diff --git a/Vue/Ficheuserrhclient/index.php b/Vue/Ficheuserrhclient/index.php index 31deae69..f2b62e96 100644 --- a/Vue/Ficheuserrhclient/index.php +++ b/Vue/Ficheuserrhclient/index.php @@ -12,9 +12,22 @@
+ +
+ + + + + + + + + +
+