From fc2e0ea425b305a05a1975b78d664535da371463 Mon Sep 17 00:00:00 2001 From: KONE SOREL Date: Wed, 14 Jan 2026 10:16:46 +0000 Subject: [PATCH] ger --- Controleur/ControleurFicheuserrhclient.php | 45 +++ Js/fonctions.js | 309 +++++++++++++++++++++ Modele/Client.php | 22 ++ Vue/Ficheuserrhclient/index.php | 73 +++++ Vue/gabarit.php | 2 +- 5 files changed, 450 insertions(+), 1 deletion(-) create mode 100755 Controleur/ControleurFicheuserrhclient.php create mode 100755 Vue/Ficheuserrhclient/index.php diff --git a/Controleur/ControleurFicheuserrhclient.php b/Controleur/ControleurFicheuserrhclient.php new file mode 100755 index 0000000..08570cd --- /dev/null +++ b/Controleur/ControleurFicheuserrhclient.php @@ -0,0 +1,45 @@ +menuvue = new Menuvueutilisateur(); + $this->menuvue->getMenuVue("Ficheuserrhclient"); + + $this->client = new Client(); + $this->oui_non = new Ouinon(); + $this->langue = new Langue(); + } + + + public function index() + { + $idUtilisateur = $this->requete->getParametreFormulaire("id"); + $user_actif = $this->oui_non->getListe(); + $user_actVisible = $this->oui_non->getListe(); + $langue = $this->langue->getListe(); + $user_AffectionVisible = $this->oui_non->getListe(); + + $user_rh = $this->client->getunuserrhclient($idUtilisateur); + $user_profil = $this->client->getListeProfilRh(); + + $this->genererVue(array( + 'user_rh' => $user_rh, + 'user_actif' => $user_actif, + 'user_actVisible' => $user_actVisible, + 'langue' => $langue, + 'user_AffectionVisible' => $user_AffectionVisible, + 'user_profil' => $user_profil + )); + } +} \ No newline at end of file diff --git a/Js/fonctions.js b/Js/fonctions.js index 31b1231..9fd11d2 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -4214,4 +4214,313 @@ function ajax_contexter_police(){ function ouvrir_vue(vue) { window.location.assign($("#racineWeb" ).val()+vue+"/"); +} + +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_gc() +{ + idUtilisateur = $("#idUtilisateur").val(); + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + actif = $("#actif").val(); + actVisible = $("#actVisibleUser").val(); + codeLangue = $("#codeLangueUser").val(); + AffectionVisible = $("#AffectionVisibleUser").val(); + + telephone = $("#telephone").val(); + email = $("#email").val(); + + + if (nom<=" ") + { + v_msg="Veuillez saisir le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#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); + + $("#actif").focus(); + return; + } + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + if (actVisible<=" ") + { + v_msg="Actes visbles oui ou non?"; + v_msgEng="Acts are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actVisibleUser").focus(); + return; + } + + if (AffectionVisible<=" ") + { + v_msg="Affections visbles oui ou non?"; + v_msgEng="Affections are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#AffectionVisible").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); + + $("#email").focus(); + return; + } + + donnees = 'idUtilisateur=' + idUtilisateur; + donnees += '&nom=' + nom; + donnees += '&prenoms=' + prenoms; + donnees += '&actif=' + actif; + donnees += '&actVisible=' + actVisible; + donnees += '&codeLangue=' + codeLangue; + 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()+"Ajaxgcassureur/enregistrermodifusergc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + // $('#div_test_gabarit').html(data); + }, + complete: function() { + retour_a_users_gc(); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +function creer_user_gc() +{ + codeGcAssureur = $("#codeGcAssureur").val(); + codeUtilisateur = $("#codeUtilisateur").val(); + codeUtilisateur = codeUtilisateur.trim(); + codeUtilisateur = supprimer_espace_string(codeUtilisateur); + codeUtilisateur = codeUtilisateur.toLowerCase(); + + codeModeGenerationPass = $("#codeModeGenerationPass").val(); + codeModeEnvoiPass = $("#codeModeEnvoiPass").val(); + + nom = $("#nom").val(); + prenoms = $("#prenoms").val(); + telephone = $("#telephone").val(); + email = $("#email").val(); + + codeLangue = $("#codeLangueUser").val(); + actVisible = $("#actVisibleUser").val(); + AffectionVisible = $("#AffectionVisibleUser").val(); + + nvmdp = $("#nvmdp").val(); + cfnvmdp = $("#cfnvmdp").val(); + + if(nom<=" ") + { + v_msg="Veuillez indiquer le nom!"; + v_msgEng="Please enter the name!"; + alert_ebene(v_msg, v_msgEng); + + $("#nom").focus(); + return; + } + + if(codeGcAssureur<=" ") + { + v_msg="Veuillez sélectionner un garant!"; + v_msgEng="Please select a guarantor!"; + alert_ebene(v_msg, v_msgEng); + + return; + } + + if(codeUtilisateur<=" ") + { + v_msg="Veuillez indiquer le login!"; + v_msgEng="Please enter the login!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeUtilisateur").focus(); + return; + } + + + if(codeLangue<=" ") + { + v_msg="Veuillez indiquer la langue!"; + v_msgEng="Please select the language"; + alert_ebene(v_msg, v_msgEng); + + $("#codeLangueUser").focus(); + return; + } + + if (actVisible<=" ") + { + v_msg="Actes visbles oui ou non?"; + v_msgEng="Acts are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#actVisibleUser").focus(); + return; + } + + if (AffectionVisible<=" ") + { + v_msg="Affections visbles oui ou non?"; + v_msgEng="Affections are visible yes or no?"; + alert_ebene(v_msg, v_msgEng); + + $("#AffectionVisibleUser").focus(); + return; + } + + if ((codeModeEnvoiPass=="1" || codeModeEnvoiPass=="2") && (telephone <=" ") ) + { + v_msg="Veuillez revoir le téléphone!"; + v_msgEng="Please review the phone!"; + alert_ebene(v_msg, v_msgEng); + + $("#telephone").focus(); + return; + } + + if ((codeModeEnvoiPass=="0" || codeModeEnvoiPass=="2") && (email <=" ") ) + { + v_msg="Veuillez revoir l'adresse mail!"; + v_msgEng="Please review the email address!"; + alert_ebene(v_msg, v_msgEng); + + $("#email").focus(); + return; + } + + if(codeModeGenerationPass=="0") + { + if(nvmdp<=" ") + { + v_msg="Veuillez indiquer le mot de passe!"; + v_msgEng="Please enter the password!"; + alert_ebene(v_msg, v_msgEng); + + $("#nvmdp").focus(); + return; + } + + if(nvmdp != cfnvmdp) + { + v_msg="Veuillez confirmer votre mot de passe!"; + v_msgEng="Please confirm your password!"; + alert_ebene(v_msg, v_msgEng); + + $("#cfnvmdp").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); + + $("#email").focus(); + return; + } + + motPass = nvmdp; + + donnees = 'codeGcAssureur='+codeGcAssureur+'&codeUtilisateur='+codeUtilisateur; + donnees += '&nom='+nom+'&prenoms='+prenoms; + donnees += '&telephone='+telephone+'&email='+email+'&motPass='+motPass; + donnees += '&codeLangue='+codeLangue+'&actVisible='+actVisible; + donnees += '&AffectionVisible='+AffectionVisible; + donnees += '&codeModeGenerationPass='+codeModeGenerationPass; + donnees += '&codeModeEnvoiPass='+codeModeEnvoiPass; + + v_msg="Confirmez-vous ce nouvel utilisateur?"; + v_msgEng="Do you confirm this new user?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgcassureur/creerusergc/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) { + $('#div_unicite_login').html(data); + }, + complete: function() + { + uniciteLogin = $("#uniciteLogin").val(); + if(uniciteLogin==1) + { + v_msg="Utilisateur ( "+codeUtilisateur+" ) créé avec succès!"; + v_msgEng="User ( "+codeUtilisateur+" ) created succssfully!"; + alert_ebene(v_msg, v_msgEng); + + retour_a_users_gc(); + } + else + { + v_msg="Login " + codeUtilisateur +" déjà utilisé!"; + v_msgEng="Login " + codeUtilisateur +" already in use!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeUtilisateur").focus(); + } + } + }); + } + }); } \ No newline at end of file diff --git a/Modele/Client.php b/Modele/Client.php index dc0a5e4..9a38814 100755 --- a/Modele/Client.php +++ b/Modele/Client.php @@ -296,4 +296,26 @@ class Client extends Modele { return $resultat->fetchAll(PDO::FETCH_ASSOC); } + + public function getunuserrhclient($idUtilisateur) + { + $sql = 'call sp_un_user_rh_client(?)'; + + $resultat = $this->executerRequete($sql, array($idUtilisateur)); + + return $resultat->fetch(PDO::FETCH_ASSOC); + } + + public function getListeProfilRh() + { + if (est_anglophone()){ + $sql = 'call sp_get_liste_profil_rh_eng()'; + }else{ + $sql = 'call sp_get_liste_profil_rh()'; + } + + $resultat = $this->executerRequete($sql); + + return $resultat->fetchAll(PDO::FETCH_ASSOC); + } } \ No newline at end of file diff --git a/Vue/Ficheuserrhclient/index.php b/Vue/Ficheuserrhclient/index.php new file mode 100755 index 0000000..99a1660 --- /dev/null +++ b/Vue/Ficheuserrhclient/index.php @@ -0,0 +1,73 @@ +titre = "ISA WEB - Modifier Utilisteur Portail RH"; + + $idClient = $this->nettoyer($user_rh['idClient']); + $idUtilisateur = $user_rh['id']; + $codeUtilisateur = $user_rh['codeUtilisateur']; + $actif = $user_rh['actif']; + $actVisible = $user_rh['actVisible']; + $reInit = $user_rh['reInit']; + $codeLangue = $user_rh['codeLangue']; + $AffectionVisible = $user_rh['AffectionVisible']; + $codeProfil = $user_rh['codeProfil']; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
E-mail
+ + + + + +
" onClick="javascript:enregistrer_modif_user_rh();" style='font-size:10pt;' > " onClick="javascript:retour_a_users_rh_client();" style='font-size:9pt;' >
diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 16aaa44..c593fef 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -662,7 +662,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte']; - +