Merge origin/master

Conflicts:
	src/java/bdd/PompierMySql.java
	src/java/com/test/servlets/authentifServlet.java
	web/WEB-INF/CreaPompier.jsp
This commit is contained in:
funcha.ahamadi
2021-12-13 10:28:40 +01:00
commit 68bf428f4f
42 changed files with 4577 additions and 0 deletions

28
web/js/ctrlCodePostal.js Normal file
View File

@@ -0,0 +1,28 @@
// Recherche de la ou des villes correspondantes au code postal saisi (exemple 54490 --> 7 villes)
ztCP.onchange = function () {
//alert("ztCP a changé");
msgCP.textContent = "";
zlVille.length = 0;
const XHTTP = new XMLHttpRequest();
XHTTP.onload = function () {
if (this.status != 200) {
msgCP.textContent = "Code postal erroné";
} else {
var lesVilles = JSON.parse(this.responseText);
var info = "";
if (lesVilles.length > 1) {
info += "<optgroup label='Les villes du code postal' />";
}
for (var i = 0; i < lesVilles.length; i++) {
var uneVille = lesVilles[i];
info += "<option value='" + uneVille.libelleAcheminement + "'>";
info += uneVille.libelleAcheminement + '</option>';
}
zlVille.innerHTML = info;
}
}
var cp = ztCP.value;
XHTTP.open("GET", "https://apicarto.ign.fr/api/codes-postaux/communes/" + cp);
XHTTP.send();
}