diff --git a/Controleur/ControleurAjaxparamseuilalerte.php b/Controleur/ControleurAjaxparamseuilalerte.php index 12bed764..0ec00023 100755 --- a/Controleur/ControleurAjaxparamseuilalerte.php +++ b/Controleur/ControleurAjaxparamseuilalerte.php @@ -115,5 +115,16 @@ class ControleurAjaxparamseuilalerte extends Controleurrequete // $this->genererVueAjax(); } + + public function actualisegarantieproduit() + { + $codeProduit = $this->requete->getParametreFormulaire("codeProduit"); + + $garanties_sans_seuils = $this->produit->getgarantiessansseuil($codeProduit); + + $garanties_avec_seuils = $this->produit->getgarantiesavecseuil($codeProduit); + + $this->genererVueAjax(array('garanties_sans_seuils' => $garanties_sans_seuils, 'garanties_avec_seuils' => $garanties_avec_seuils)); + } } \ No newline at end of file diff --git a/Js/fonctions.js b/Js/fonctions.js index 9c9ceb6e..6dbb7a28 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -34462,7 +34462,6 @@ function afficher_garantie_produit() { function ajouter_tous_garantie_produit() { - idProduit = $("#idProduit").val(); codeProduit = $("#codeProduit").val(); if (codeProduit<=" ") @@ -34494,7 +34493,6 @@ function ajouter_tous_garantie_produit() }, complete: function() { //afficher_garantie_produit(); - garanties_produit($idProduit); } }); } else { @@ -34605,7 +34603,7 @@ function ajouter_un_garantie_produit(codeGarantie) }, complete: function() { //afficher_garantie_produit(); - garanties_produit($idProduit); + //garanties_produit($idProduit); } }); } @@ -92268,3 +92266,66 @@ function nouveau_produit() window.location.assign($("#racineWeb" ).val()+"Nouveauproduit/"); } +function actualiser_garantie_produit() { + // 1. Définition des constantes et cibles + const codeGcAssureur = $("#codeGcAssureur").val(); + const codeProduit = $("#codeProduit").val(); + const div_cible = $('#div_garantieproduit'); + const racineWeb = $("#racineWeb").val(); + const codeLangue = $("#codeLangue").val(); + + // 2. Validation du Garant via alert_ebene + if (!codeGcAssureur || codeGcAssureur.trim() === "") { + let v_msg = "Garant manquant ! Veuillez sélectionner un garant pour continuer."; + let v_msg_eng = "Guarantor missing ! Please select a guarantor to continue."; + + alert_ebene(v_msg, v_msg_eng); + + $("#codeGcAssureur").focus(); + div_cible.html(""); + return; + } + + // 3. Validation du Produit via alert_ebene + if (!codeProduit || codeProduit.trim() === "") { + let v_msg = "Produit manquant ! Veuillez sélectionner un produit."; + let v_msg_eng = "Product missing ! Please select a product."; + + alert_ebene(v_msg, v_msg_eng); + + div_cible.html(""); + return; + } + + // 4. Préparation et affichage du loader bilingue + const donnees = { codeProduit: codeProduit }; + let loadingTxt = (codeLangue === "en_US") ? "Loading the entry form..." : "Chargement du formulaire de saisie..."; + + div_cible.html(` +
+
+ Loading... +
+
${loadingTxt}
+
+ `); + + // 5. Exécution de la requête AJAX + $.ajax({ + url: racineWeb + "Ajaxparamseuilalerte/actualisegarantieproduit/", + type: 'post', + data: donnees, + success: function(data) { + div_cible.html(data); + }, + error: function() { + let errorTxt = (codeLangue === "en_US") ? "Technical error while retrieving the form." : "Erreur technique lors de la récupération du formulaire."; + div_cible.html(` + + `); + } + }); +} \ No newline at end of file diff --git a/Vue/Ajaxparamseuilalerte/actualisegarantieproduit.php b/Vue/Ajaxparamseuilalerte/actualisegarantieproduit.php new file mode 100755 index 00000000..10f96702 --- /dev/null +++ b/Vue/Ajaxparamseuilalerte/actualisegarantieproduit.php @@ -0,0 +1,105 @@ + + +
+
+
+
+
+ + + +
+
+
+ + + + + + + + + + + + + + + + + +
nettoyer($v['garantie']) ?> + +
+
+
+
+
+ +
+
+
+ +
+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + nettoyer($v['garantie']) ?> +
+ + onchange="this.value=supprimer_espace_nombre(this.value); if(controle_numerique(this)){maj_taux_seuil_alerte_garantie('', this.value);}"> + % +
+
+ + onfocus="formatNumerique(this);" onkeyup="controle_numerique(this);" + onblur="formatMonetaire(this); maj_seuil_alerte_garantie('', supprimer_espace_string(this.value));"> +
+
+
+
+
+
diff --git a/Vue/Garantieproduit/index.php b/Vue/Garantieproduit/index.php index 7f640482..1d23a807 100755 --- a/Vue/Garantieproduit/index.php +++ b/Vue/Garantieproduit/index.php @@ -1,7 +1,6 @@ -