modification complète d'un pompier

This commit is contained in:
pierre renaudot
2023-10-19 09:07:06 +02:00
parent 5fdb28c44e
commit aa0701334e
7 changed files with 394 additions and 245 deletions

View File

@@ -102,7 +102,7 @@ class PdoBD
INNER JOIN caserne ON pompier.pCis = caserne.cId
INNER JOIN parametre AS a ON a.pType = 'typePer' AND pompier.pType = a.pIndice
INNER JOIN parametre AS b ON b.pType = 'grade' AND pompier.pGrade = b.pIndice
INNER JOIN parametre AS c ON c.pType = 'statAgt' AND pompier.pStatut = c.pIndice;";
INNER JOIN parametre AS c ON c.pType = 'statAgt' AND pompier.pStatut = c.pIndice";
if ($login === "*") {
$req .= " WHERE pCis=" . $_SESSION['cis'] . " AND pId = $mdp";
} else {

View File

@@ -125,7 +125,9 @@ function estTableauEntiers($tabEntiers)
$ok = true;
foreach($tabEntiers as $unEntier)
{
if(!estEntierPositif($unEntier)){$ok=false;}
if(!estEntierPositif($unEntier)){
$ok=false;
}
}
return $ok;
}

View File

@@ -358,11 +358,17 @@ $(document).on('click', '.click-garde', function () {
$(document).on('click', '.btn-modif', function (e) {
e.preventDefault();
if ($('.infoPompier').attr('disabled') == 'disabled') {
$('.infoPompier').attr('disabled', false);
if ($(this).attr('id') == 'zModifChef'){ //si le bouton modifier est celui du chef ou nom
element = $('.infoPompier-chef')
} else {
element = $('.infoPompier')
}
if (element.attr('disabled') == 'disabled') {
element.attr('disabled', false);
$('.btn-valid-modif').css('display', 'block');
} else {
$('.infoPompier').attr('disabled', true);
element.attr('disabled', true);
$('.btn-valid-modif').css('display', 'none');
}
})
@@ -385,7 +391,26 @@ $(document).on('click', '.btn-valid-modif', function (e) {
console.error("Erreur lors de la requête AJAX :", status, error);
}
});
})
/**
* Ajout d'un pompier
*/
$(document).on('click', '.validerAjout', function (e) {
e.preventDefault();
console.log('toto');
data = $('.dataPompierAjout').serialize()
$.ajax({
url: "/controleurs/c_pompiers.php?action=validerAjouter",
method: "POST", // Méthode HTTP (GET, POST, etc.)
dataType: "json", // Type de données attendu
data : data,
error: function(xhr, status, error) {
// Gérer les erreurs de la requête AJAX
console.error("Erreur lors de la requête AJAX :", status, error);
}
});
});