diff --git a/include/class.pdo.php b/include/class.pdo.php index cdb6778..d7ad829 100644 --- a/include/class.pdo.php +++ b/include/class.pdo.php @@ -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 { diff --git a/include/fct.inc.php b/include/fct.inc.php index 41fce0c..318282d 100644 --- a/include/fct.inc.php +++ b/include/fct.inc.php @@ -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; } diff --git a/include/proceduresJava.js b/include/proceduresJava.js index 5303e8f..c048f04 100644 --- a/include/proceduresJava.js +++ b/include/proceduresJava.js @@ -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); + } + }); +}); diff --git a/vues/v_choixPompier.php b/vues/v_choixPompier.php index 08d062c..2b4f4f0 100644 --- a/vues/v_choixPompier.php +++ b/vues/v_choixPompier.php @@ -44,7 +44,7 @@ echo (' if ($_SESSION['statut'] == 2) {?> - +    @@ -54,13 +54,18 @@ if ($_SESSION['statut'] == 2) {?> '; - }?> +} else { + echo ' + '; +}?> - "> + "> diff --git a/vues/v_fichePompier.php b/vues/v_fichePompier.php index 9597b53..edd8f35 100644 --- a/vues/v_fichePompier.php +++ b/vues/v_fichePompier.php @@ -1,64 +1,65 @@ - -' . $titre1 . '
  • ' . $titre2 . '
  • ' . $titre3 . '
  • - '); + '); /*================================================================================================== DISPONIBILITEES (1) */ echo ("
    X indique une garde"); ?> - - -
    - - -
    - - - - - + - ";?> + + + + +
    ')" onmouseover="document.gauche.src='images/gauche_.gif'" onmouseout="document.gauche.src='images/gauche.gif'"type="image">Semaine
    + + + + - - + "; ?> - - + + + + + ' . $nomJour[$jour] . ' ' . date('d/m', strtotime('+' . $jour . ' day', $premierJour)) . '' ); } - ?> - + ?> + - - - ' . $tranche . ''; - } - } - ?> - - - - + + getDisposHebdo() return les dispo - for($jour = 0; $jour <= 6; $jour++) { + for ($jour = 0; $jour <= 6; $jour++) { + for ($tranche = 1; $tranche <= 4; $tranche++) { + echo ''; + } + } + ?> + + + + + getDisposHebdo() return les dispo + for ($jour = 0; $jour <= 6; $jour++) { $leJour = date('Y-m-d', strtotime('+' . $jour . ' day', $premierJour)); $dateTab = date('d/m/Y', strtotime('+' . $jour . ' day', $premierJour)); - for($tranche = 1; $tranche <= 4; $tranche++){ - $couleur = 'c' . $tranche; - $garde = 'g' . $tranche; - $dispo = 'd' . $tranche; - echo(' + for ($tranche = 1; $tranche <= 4; $tranche++) { + $couleur = 'c' . $tranche; + $garde = 'g' . $tranche; + $dispo = 'd' . $tranche; + echo (' '); } } } - ?> - - -
    ')" + onmouseover="document.gauche.src='images/gauche_.gif'" + onmouseout="document.gauche.src='images/gauche.gif'" type="image">')" onmouseover="document.droite.src='images/droite_.gif'" onmouseout="document.droite.src='images/droite.gif'"type="image">
    Semaine +
    ')" + onmouseover="document.droite.src='images/droite_.gif'" + onmouseout="document.droite.src='images/droite.gif'" type="image">
    ' . $tranche . '
    ' . (($uneLigne[$dateTab][$garde] == 1) ? 'X' : '') . '
    -
    -
    - X -

    ma disponibilité
    pour le

    -
    - - - - - -
    - 3) { - echo '
    ';} - $i++; + ?> + + + +
    +
    + X +

    ma disponibilité
    pour le

    + + + + + + +
    + 3) { + echo '
    '; } - ?> -
    - - - -
    -
    - + $i++; + } + ?> +
    + + + +
    +
    +
    "); -/*================================================================================================== GARDES (2)*/ +/*================================================================================================== GARDES (2)*/ echo (" "); /*================================================================================================== COORDONNEES (3) */ - echo (" +echo (" - - "); + + + "); /*================================================================================================== Onglet X */ echo (" -"); +"); ?> \ No newline at end of file diff --git a/vues/v_unParam.php b/vues/v_unParam.php index 512795b..00c8fa7 100644 --- a/vues/v_unParam.php +++ b/vues/v_unParam.php @@ -19,13 +19,23 @@ Indice "); - if ($action==="ajouter") {echo "";} - else {echo $infosParam['pIndice'];} + if ($action === "ajouter") { + echo ""; + } else { + echo $infosParam['pIndice']; + } echo (" Valeur "); - if ($action==="ajouter") {echo "";$actif=null;} - if ($action==="modifier") {echo "";$actif=null;} - if ($action==="supprimer") {echo $infosParam['pLibelle'];$actif="disabled='disabled'";} + if ($action === "ajouter") { + echo ""; + $actif = null; + } else if ($action === "modifier") { + echo ""; + $actif = null; + } else if ($action === "supprimer") { + echo $infosParam['pLibelle']; + $actif = "disabled='disabled'"; + } echo (" "); echo (" Plancher @@ -39,7 +49,7 @@ echo (" -

    +

    diff --git a/vues/v_unPompier.php b/vues/v_unPompier.php index 178663e..aabaa0b 100644 --- a/vues/v_unPompier.php +++ b/vues/v_unPompier.php @@ -1,87 +1,144 @@

    -getInfosPompier()); - */ - if ($_REQUEST['action'] == "supprimer") { - echo '

    SUPPRESSION DU POMPIER '.$lesInfosPompier['nom'].' '.$lesInfosPompier['prenom'].'

    '; - echo ( + getInfosPompier()); + */ + if ($_REQUEST['action'] == "supprimer") { + echo '

    SUPPRESSION DU POMPIER ' . $lesInfosPompier['nom'] . ' ' . $lesInfosPompier['prenom'] . '

    '; + echo ( '
    '); } - if ($_REQUEST['action'] == "modifier") { + if ($_REQUEST['action'] == "modifier") { var_dump($lesInfosPompier); - echo (' -

    MODIFICATION DU POMPIER ' - . $lesInfosPompier['nom'] . ' ' - . $lesInfosPompier['prenom'] . '

    ' - ); echo (' - ' ); } - if ($_REQUEST['action'] == "ajouter") { + if ($_REQUEST['action'] == "ajouter") { echo "

    AJOUT D'UN NOUVEAU POMPIER

    "; - echo ' - '; - } - echo (" + + //action = index.php?choixTraitement=pompiers&action=validerAjouter&type='' + //onsubmit="return valider(this)"> + echo(' +
    Coordonnées - "); - if ($_REQUEST['action'] == "supprimer"){ //-------------------------------------------------------- cas suppression - echo (" + "); + if ($_REQUEST['action'] == "supprimer") { //-------------------------------------------------------- cas suppression + echo ("
    - "); -} -//------------------------------------------------------------------------------------ cas ajout ou modification + "); + } + //------------------------------------------------------------------------------------ cas ajout ou modification -if ($_REQUEST['action'] == "modifier") { - echo (" + if ($_REQUEST['action'] == "modifier") { + echo (" "); -} -if ($_REQUEST['action'] == "ajouter") { - echo (" Nom - -
    "); -} -?> - - - - - - -
    -
    Observations - -
    -
    - - - - "> - + } + if ($_REQUEST['action'] == "ajouter") { -
    - \ No newline at end of file + echo (" + Nom + Prénom + Adresse + Code postal + Ville + Téléphone + Adresse électronique + Nom de compte + + Code + Nom " . $lesInfosPompier['cNom'] . " + Adresse " . $lesInfosPompier['cAdresse'] . " + Téléphone " . $lesInfosPompier['cTel'] . " + Groupement " . $lesInfosPompier['cGroupement'] . " + + Type + "); + foreach ($pdo->getParametre('grade') as $key => $value) { + echo (""); + } + + + echo (" + + Statut + + + +
    +
    + + +
    + +
    + + "); + } + } + ?> + + + + +
    + "> + + +
    + \ No newline at end of file