From db45261d546eb4958b55030f62ef4230f3ae580f Mon Sep 17 00:00:00 2001 From: KANE LAZENI Date: Mon, 20 Apr 2026 14:36:06 +0000 Subject: [PATCH] a --- Controleur/ControleurAjaxcomposantetarif.php | 7 ++ Js/fonctions.js | 118 +++++++++---------- Vue/gabarit.php | 2 +- 3 files changed, 67 insertions(+), 60 deletions(-) diff --git a/Controleur/ControleurAjaxcomposantetarif.php b/Controleur/ControleurAjaxcomposantetarif.php index 791c5acf..85955303 100755 --- a/Controleur/ControleurAjaxcomposantetarif.php +++ b/Controleur/ControleurAjaxcomposantetarif.php @@ -146,6 +146,13 @@ class ControleurAjaxcomposantetarif extends Controleur public function validertarif() { + $csrf_token = trim($this->requete->getParametreFormulaire("csrf_token")); + + if (!Csrf::validateToken($csrf_token)) { + $_SESSION['flash_error'] = 'Votre session a expiré. Veuillez réessayer.'; + exit; + } + $codeTarifActe = $this->requete->getParametreFormulaire("codeTarifActe"); $this->detailtarifacte->validertarif($codeTarifActe); diff --git a/Js/fonctions.js b/Js/fonctions.js index 699702cb..780a664b 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -63767,64 +63767,6 @@ function actualiserActesTarifes() } -//21-05-2023 -function valider_tarif() -{ - codeTarifActe=$("#codeTarifActe").val(); - codeFamilleActe=$("#codeFamilleActe").val(); - - if(codeTarifActe<=' ') - { - v_msg="Veuillez sélectionner un tarif!"; - v_msgEng="Please select a rate!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeTarifActe").focus(); - return; - } - - if(codeFamilleActe<=' ') - { - v_msg="Veuillez saisir une famille!"; - v_msgEng="Please select a family!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeFamilleActe").focus(); - return; - } - - donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; - - v_msg="Validez-vous cette composition de tarif?"; - v_msgEng="Do you validate this price composition?"; - - - confirm_ebene(v_msg, v_msgEng) - .then((isConfirmed) => { - if (isConfirmed) { - // L'utilisateur a confirmé - $.ajax({ - url: $("#racineWeb").val()+"Ajaxcomposantetarif/validertarif/", - type: 'POST', - data: donnees, - success: function(data) - { - - }, - error: function(data) { - }, - complete: function() { - ajax_composante_tarif("1"); - } - }); - } else { - // L'utilisateur a annulé - console.log("Confirmation refusée"); - } - }); - -} - function ajouter_tous_prestataires_tarifclient() { idClient = $("#idClient").val(); @@ -92591,7 +92533,7 @@ function ajouter_un_acte_au_tarif(idActe) donnees = 'idActe='+idActe+'&codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; donnees = charger_csrf_token(donnees); - + $.ajax({ url: $("#racineWeb").val()+"Ajaxcomposantetarif/ajouterunacteautarif/", type: 'POST', @@ -92605,3 +92547,61 @@ function ajouter_un_acte_au_tarif(idActe) } }); } + +function valider_tarif() +{ + codeTarifActe=$("#codeTarifActe").val(); + codeFamilleActe=$("#codeFamilleActe").val(); + + if(codeTarifActe<=' ') + { + v_msg="Veuillez sélectionner un tarif!"; + v_msgEng="Please select a rate!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeTarifActe").focus(); + return; + } + + if(codeFamilleActe<=' ') + { + v_msg="Veuillez saisir une famille!"; + v_msgEng="Please select a family!"; + alert_ebene(v_msg, v_msgEng); + + $("#codeFamilleActe").focus(); + return; + } + + donnees = 'codeTarifActe='+codeTarifActe+'&codeFamilleActe='+codeFamilleActe; + + donnees = charger_csrf_token(donnees); + + v_msg="Validez-vous cette composition de tarif?"; + v_msgEng="Do you validate this price composition?"; + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxcomposantetarif/validertarif/", + type: 'POST', + data: donnees, + success: function(data) + { + + }, + error: function(data) { + }, + complete: function() { + ajax_composante_tarif("1"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} diff --git a/Vue/gabarit.php b/Vue/gabarit.php index f963f068..025f4160 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -985,7 +985,7 @@ - +