diff --git a/Controleur/ControleurAjaxcontrolepiece.php b/Controleur/ControleurAjaxcontrolepiece.php
new file mode 100644
index 0000000..dd12684
--- /dev/null
+++ b/Controleur/ControleurAjaxcontrolepiece.php
@@ -0,0 +1,61 @@
+ben = new Beneficiaire();
+ }
+
+ public function index()
+ {
+ $numeroPiece = $this->requete->getParametreFormulaire("numeroPiece");
+
+ $controle_piece = $this->ben->controlenopieceglobal($numeroPiece);
+
+ $resultatPiece = $controle_piece['resultatPiece'];
+ $nomBeneficiaire = $controle_piece['nomBeneficiaire'];
+
+ /*
+ var_dump
+ (
+ array
+ (
+ "numeroPiece" => $numeroPiece,
+ "controle_piece" => $controle_piece,
+ // "resultatPiece" => $resultatPiece,
+ )
+ );
+ exit();
+
+/*
+- Longueur < 13 => 1
+- Doublon => 2
+- OK, Bon => 0
+*/
+ $MessagePiece = "";
+
+ // Un autre bénéficiaire possède déjà le même numéro d’identification : $nomBeneficiaire.
+
+ switch ($resultatPiece)
+ {
+ case "1":
+ $MessagePiece = (est_anglophone()) ? "Length shorter than the standard!" : "Longueur inférieur à la norme!";
+ break;
+ case "2":
+ $MessagePiece = (est_anglophone()) ? "Length shorter than the standard!" : "Un autre bénéficiaire possède déjà le même numéro d’identification : $nomBeneficiaire .";
+ break;
+ case "0":
+ $MessagePiece = (est_anglophone()) ? "Numberr OK!" : "Numéro OK!";
+ break;
+ default:
+ $MessagePiece = (est_anglophone()) ? "Numberr OK!" : "Numéro OK!";
+ }
+
+ $this->genererVueAjax(array('resultatPiece' => $resultatPiece, 'MessagePiece' => $MessagePiece));
+
+ }
+
+}
\ No newline at end of file
diff --git a/Controleur/ControleurAjaxlocalite.php b/Controleur/ControleurAjaxlocalite.php
new file mode 100644
index 0000000..0006007
--- /dev/null
+++ b/Controleur/ControleurAjaxlocalite.php
@@ -0,0 +1,43 @@
+requete->getSession()->getAttribut('codeSociete');
+
+ $codePays = $this->requete->getParametreFormulaire("codePays");
+ $codeVille = $this->requete->getParametreFormulaire("codeVille");
+
+ $listelocalite = (new Localite())->getListe($codePays, $codeVille);
+ $this->genererVueAjax(array('listelocalite' => $listelocalite));
+ }
+
+ public function consultation()
+ {
+ $codeSociete = $this->requete->getSession()->getAttribut('codeSociete');
+
+ $codePays = $this->requete->getParametreFormulaire("codePays");
+ $codeVille = $this->requete->getParametreFormulaire("codeVille");
+
+ $listelocalite = (new Localite())->getListe($codePays, $codeVille);
+ $this->genererVueAjax(array('listelocalite' => $listelocalite));
+ }
+
+ public function filtreadherentlocalite()
+ {
+ $codeSociete = $this->requete->getSession()->getAttribut('codeSociete');
+
+ $codePays = $this->requete->getParametreFormulaire("codePays");
+ $codeVille = $this->requete->getParametreFormulaire("codeVille");
+
+ $listelocalite = (new Localite())->getListe($codePays, $codeVille);
+ $this->genererVueAjax(array('listelocalite' => $listelocalite));
+ }
+
+}
\ No newline at end of file
diff --git a/Controleur/ControleurAjaxville.php b/Controleur/ControleurAjaxville.php
new file mode 100644
index 0000000..47a85bf
--- /dev/null
+++ b/Controleur/ControleurAjaxville.php
@@ -0,0 +1,27 @@
+requete->getSession()->getAttribut('codeSociete');
+ $codePays = $this->requete->getParametreFormulaire("codePays");
+ $listeville = (new Ville())->getListe($codePays);
+ $this->genererVueAjax(array('listeville' => $listeville));
+ }
+
+ public function consultation()
+ {
+ $codeSociete = $this->requete->getSession()->getAttribut('codeSociete');
+ $codePays = $this->requete->getParametreFormulaire("codePays");
+ $listeville = (new Ville())->getListe($codePays);
+ $this->genererVueAjax(array('listeville' => $listeville));
+ }
+
+}
\ No newline at end of file
diff --git a/Js/fonctions.js b/Js/fonctions.js
index 17ba4c2..b73c159 100755
--- a/Js/fonctions.js
+++ b/Js/fonctions.js
@@ -1185,4 +1185,119 @@ function changer_avenant_incorporation()
prorater_prime_adherent();
}
});
-}
\ No newline at end of file
+}
+
+function controle_age(dater, codeLienParente)
+{
+ age = get_age(dater);
+ $("#agepersonne").val("Âge : "+age);
+
+ if (age>65)
+ {
+ v_msg="Âge "+age+" supérieur à 65 ans!";
+ v_msgEng="Age "+age+" over 65!";
+ alert_ebene(v_msg, v_msgEng);
+
+ return false;
+ }
+
+ if ( (codeLienParente=="E")&& (age>21) )
+ {
+ v_msg="Âge "+age+" => Enfant âgé de plus de 21 ans!";
+ v_msgEng="Âge "+age+" => Child over 21 years old!";
+ alert_ebene(v_msg, v_msgEng);
+
+ return false;
+ }
+
+ if ( (codeLienParente=="O")&& (age>21) )
+ {
+ v_msg="Âge "+age+" => Enfant âgé de plus de 21 ans!";
+ v_msgEng="Âge "+age+" => Child over 21 years old!";
+ alert_ebene(v_msg, v_msgEng);
+
+ return false;
+ }
+
+ return true;
+}
+
+function controler_piece_beneficiaire()
+{
+ v_codeNaturePiece = $("#codeNaturePiece").val();
+
+ if(v_codeNaturePiece<=' ')
+ {
+ v_msg="Veuillez sélection la nature de la pièce!";
+ v_msgEng="Please select the type of document!";
+ alert_ebene(v_msg, v_msgEng);
+
+ $("#codeNaturePiece").focus();
+ return;
+ }
+
+ $('#numeroPiece').removeAttr('minlength');
+
+ if(v_codeNaturePiece=="CNI")
+ {
+ $('#div_controle_piece').html("");
+
+ v_numeroPiece = $("#numeroPiece").val();
+
+ $('#numeroPiece').attr('minlength', 13);
+
+ donnees = "numeroPiece="+v_numeroPiece;
+
+ $.ajax({
+ url: $("#racineWeb").val()+"Ajaxcontrolepiece/",
+ type: 'POST',
+ data: donnees,
+ success: function(data) {
+ $('#div_controle_piece').html(data);
+
+ var resultatPiece = $("#resultatPiece").val();
+
+ if(resultatPiece!="0")
+ {
+ $("#numeroPiece").focus();
+ return;
+ }
+ },
+ error: function(data) {
+ },
+ complete: function()
+ {
+ }
+ });
+ }
+}
+
+function ajaxListerVille()
+{
+ $.ajax({
+ url: $("#racineWeb").val()+"Ajaxville/",
+ type : 'post',
+ data: "codePays="+$("#codePays").val(),
+ error: function(errorData) {
+ },
+ success: function(data) {
+ $("#listeville").html(data);
+ },
+ complete: function() {
+ }
+ });
+}
+
+function ajaxListerLocalite()
+{
+ $.ajax({
+ url: $("#racineWeb").val()+"Ajaxlocalite/",
+ type : 'post',
+ data: "codePays="+$("#codePays").val()+"&codeVille="+$("#codeVille").val(),
+ error: function(errorData) {
+ },
+ success: function(data) {
+ $("#listelocalite").html(data);
+ }
+ });
+}
diff --git a/Modele/Avenant.php b/Modele/Avenant.php
index 508b3af..e4f8a30 100644
--- a/Modele/Avenant.php
+++ b/Modele/Avenant.php
@@ -63,6 +63,7 @@ class Avenant extends Modele {
JOIN typeavenant B ON (B.codeTypeAvenant=A.codeTypeAvenant)
JOIN police P ON (P.id=A.idPolice)
WHERE (A.idPolice=?) AND (B.ajoutAliment="1")
+ AND (A.codeTypeAvenant IN ("AFN","INC","RET"))
AND (A.dateEffet>=P.dateEffet)
ORDER BY A.numeroAvenant DESC;';
}
@@ -73,6 +74,7 @@ class Avenant extends Modele {
JOIN typeavenant B ON (B.codeTypeAvenant=A.codeTypeAvenant)
JOIN police P ON (P.id=A.idPolice)
WHERE (A.idPolice=?) AND (B.ajoutAliment="1")
+ AND (A.codeTypeAvenant IN ("AFN","INC","RET"))
AND (A.dateEffet>=P.dateEffet)
ORDER BY A.numeroAvenant DESC;';
}
diff --git a/Vue/Ajaxcontrolepiece/index.php b/Vue/Ajaxcontrolepiece/index.php
new file mode 100644
index 0000000..ba81e8a
--- /dev/null
+++ b/Vue/Ajaxcontrolepiece/index.php
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/Vue/Ajaxlocalite/consultation.php b/Vue/Ajaxlocalite/consultation.php
new file mode 100644
index 0000000..3cce2d7
--- /dev/null
+++ b/Vue/Ajaxlocalite/consultation.php
@@ -0,0 +1,3 @@
+
diff --git a/Vue/Ajaxlocalite/filtreadherentlocalite.php b/Vue/Ajaxlocalite/filtreadherentlocalite.php
new file mode 100644
index 0000000..0b89fb2
--- /dev/null
+++ b/Vue/Ajaxlocalite/filtreadherentlocalite.php
@@ -0,0 +1,3 @@
+
diff --git a/Vue/Ajaxlocalite/index.php b/Vue/Ajaxlocalite/index.php
new file mode 100644
index 0000000..5d8d05a
--- /dev/null
+++ b/Vue/Ajaxlocalite/index.php
@@ -0,0 +1,3 @@
+
diff --git a/Vue/Ajaxville/consultation.php b/Vue/Ajaxville/consultation.php
new file mode 100644
index 0000000..e265964
--- /dev/null
+++ b/Vue/Ajaxville/consultation.php
@@ -0,0 +1,3 @@
+
diff --git a/Vue/Ajaxville/index.php b/Vue/Ajaxville/index.php
new file mode 100644
index 0000000..525b819
--- /dev/null
+++ b/Vue/Ajaxville/index.php
@@ -0,0 +1,3 @@
+
diff --git a/Vue/gabarit.php b/Vue/gabarit.php
index 678e697..6377d61 100755
--- a/Vue/gabarit.php
+++ b/Vue/gabarit.php
@@ -595,7 +595,7 @@ $activeChildId = $menuData['child'];
-
+