modification complète d'un pompier
This commit is contained in:
parent
5fdb28c44e
commit
aa0701334e
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -44,7 +44,7 @@ echo ('
|
||||
if ($_SESSION['statut'] == 2) {?>
|
||||
|
||||
<input type="image" id="zNouveau" title="Ajouter" src="images/ajout.gif" onclick="faire('choixP', 'ajouter')">
|
||||
<input type="image" class="btn-modif" id="zModif" title="Modifier" src="images/modif.gif">
|
||||
<input type="image" class="btn-modif" id="zModifChef" title="Modifier" src="images/modif.gif">
|
||||
<input type="image" id="zSupprime" title="Supprimer" src="images/supprimer.gif" onclick="faire('choixP', 'supprimer')">
|
||||
<input type="image" id="zPremier" title="premier" src="images/goPremier.gif" onclick="premier('choixP','lstPompiers')">
|
||||
<input type="image" id="zPrecedent" title="précédent" src="images/goPrecedent.gif" onclick="precedent('choixP','lstPompiers')">
|
||||
@ -54,13 +54,18 @@ if ($_SESSION['statut'] == 2) {?>
|
||||
<input type="image" id="zSuivant" title="suivant" src="images/goSuivant.gif" onclick="suivant('choixP','lstPompiers')">
|
||||
<input type="image" id="zDernier" title="dernier" src="images/goDernier.gif" onclick="dernier('choixP','lstPompiers')">
|
||||
<?php
|
||||
} else {
|
||||
echo '
|
||||
<input type="image" class="btn-modif" id="zModif" title="Modifier" src="images/modif.gif">';
|
||||
}?>
|
||||
} else {
|
||||
echo '
|
||||
<input type="image" class="btn-modif" id="zModif" title="Modifier" src="images/modif.gif">';
|
||||
}?>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="action" value="<?php if($_REQUEST['action']=="liste") {echo "voir";} else {echo $_REQUEST['action'];}?>">
|
||||
<input type="hidden" name="action" value="<?php
|
||||
if($_REQUEST['action'] == "liste") {
|
||||
echo "voir";
|
||||
} else {
|
||||
echo $_REQUEST['action'];
|
||||
}?>">
|
||||
<input type="hidden" name="type" value="<?= isset($_REQUEST['type']) ? $_REQUEST['type'] : '';?>">
|
||||
<input type="hidden" name="zType" value="*">
|
||||
<input type="hidden" name="zIndice" value="*">
|
||||
|
@ -1,64 +1,65 @@
|
||||
|
||||
<!-- affichage du detail de la fiche pompier / Derniere modification le 18 septembre 2023 par Pascal Blain -->
|
||||
<!-- ------------------------------------------------ fenetre modale en CSS -->
|
||||
<style>
|
||||
.fModale {
|
||||
position : fixed;
|
||||
font-family : Arial, Helvetica, sans-serif;
|
||||
top : 0;
|
||||
right : 0;
|
||||
bottom : 0;
|
||||
left : 0;
|
||||
background : rgba(0,0,0,0.8);
|
||||
z-index : 99999;
|
||||
//display : none;
|
||||
opacity : 0;
|
||||
-webkit-transition: opacity 400ms ease-in;
|
||||
-moz-transition: opacity 400ms ease-in;
|
||||
transition : opacity 400ms ease-in;
|
||||
pointer-events: none;
|
||||
}
|
||||
.fModale {
|
||||
position: fixed;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
z-index: 99999;
|
||||
//display : none;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 400ms ease-in;
|
||||
-moz-transition: opacity 400ms ease-in;
|
||||
transition: opacity 400ms ease-in;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.fModale:target {
|
||||
//display : block;
|
||||
opacity : 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.fModale:target {
|
||||
//display : block;
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.fModale > div {
|
||||
width : 200px;
|
||||
position : relative;
|
||||
margin : 10% auto;
|
||||
padding : 5px 20px 13px 20px;
|
||||
border-radius: 10px;
|
||||
background : #fff;
|
||||
background : -moz-linear-gradient(#fff, #999);
|
||||
background : -webkit-linear-gradient(#fff, #999);
|
||||
background : -o-linear-gradient(#fff, #999);
|
||||
}
|
||||
.fModale>div {
|
||||
width: 200px;
|
||||
position: relative;
|
||||
margin: 10% auto;
|
||||
padding: 5px 20px 13px 20px;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
background: -moz-linear-gradient(#fff, #999);
|
||||
background: -webkit-linear-gradient(#fff, #999);
|
||||
background: -o-linear-gradient(#fff, #999);
|
||||
}
|
||||
|
||||
.fermer {
|
||||
background : #606061;
|
||||
color : #FFFFFF;
|
||||
line-height : 25px;
|
||||
position : absolute;
|
||||
right : -12px;
|
||||
text-align : center;
|
||||
top : -10px;
|
||||
width : 24px;
|
||||
text-decoration: none;
|
||||
font-weight : bold;
|
||||
-webkit-border-radius: 12px;
|
||||
-moz-border-radius: 12px;
|
||||
border-radius: 12px;
|
||||
-moz-box-shadow: 1px 1px 3px #000;
|
||||
-webkit-box-shadow: 1px 1px 3px #000;
|
||||
box-shadow : 1px 1px 3px #000;
|
||||
}
|
||||
.fermer {
|
||||
background: #606061;
|
||||
color: #FFFFFF;
|
||||
line-height: 25px;
|
||||
position: absolute;
|
||||
right: -12px;
|
||||
text-align: center;
|
||||
top: -10px;
|
||||
width: 24px;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
-webkit-border-radius: 12px;
|
||||
-moz-border-radius: 12px;
|
||||
border-radius: 12px;
|
||||
-moz-box-shadow: 1px 1px 3px #000;
|
||||
-webkit-box-shadow: 1px 1px 3px #000;
|
||||
box-shadow: 1px 1px 3px #000;
|
||||
}
|
||||
|
||||
.fermer:hover { background: #00d9ff; }
|
||||
.fermer:hover {
|
||||
background: #00d9ff;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
<?php
|
||||
/*-----------------------------------------------------------------
|
||||
Il existe en PHP un opérateur conditionnel dit opérateur ternaire ("?:")
|
||||
Exemple d'utilisation pour l'opérateur ternaire : Affectation d'une valeur par défaut
|
||||
@ -81,140 +82,153 @@ echo ('
|
||||
<li class="actif onglet" id="onglet1" onclick="javascript:Affiche(\'1\',3);">' . $titre1 . '</li>
|
||||
<li class="inactif onglet" id="onglet2" onclick="javascript:Affiche(\'2\',3);">' . $titre2 . '</li>
|
||||
<li class="inactif onglet" id="onglet3" onclick="javascript:Affiche(\'3\',3);">' . $titre3 . '</li>
|
||||
</ul>');
|
||||
</ul>');
|
||||
/*================================================================================================== DISPONIBILITEES (1) */
|
||||
echo ("
|
||||
<div style='display: block;' class='unOnglet' id='contenuOnglet1'>
|
||||
<fieldset><legend>X indique une garde</legend>"); ?>
|
||||
<!-- div class="boite" style="margin: 0px 10px;" -->
|
||||
|
||||
<form name="frmDispos" action="index.php?choixTraitement=pompiers&action=voir" method="post">
|
||||
<input type="hidden" maxlength="2" name="zSemaine" value='<?php echo $semaine;?>'>
|
||||
<input type="hidden" maxlength="2" name="zAnnee" value='<?php echo $annee;?>'>
|
||||
</form>
|
||||
<table id="tableau" class="tableau">
|
||||
<tbody>
|
||||
<!-- PARTIE SELCTION SEMAINE -->
|
||||
<tr>
|
||||
<th><input id="sPrecedente" name="gauche" title="semaine précédente" src="images/gauche.gif" onclick="autreSemaine('<?php echo date('W',strtotime("-7 days",$premierJour))."', '".date('Y',strtotime("-7 days",$premierJour))?>')" onmouseover="document.gauche.src='images/gauche_.gif'" onmouseout="document.gauche.src='images/gauche.gif'"type="image"></th>
|
||||
<!-- div class="boite" style="margin: 0px 10px;" -->
|
||||
|
||||
<th colspan="26"><b><big>Semaine <?php echo $semaine." : du lundi ".date('d/m/Y',$premierJour)." au dimanche ".date('d/m/Y',strtotime("6 days",$premierJour))."</big></b></th>";?>
|
||||
<form name="frmDispos" action="index.php?choixTraitement=pompiers&action=voir" method="post">
|
||||
<input type="hidden" maxlength="2" name="zSemaine" value='<?php echo $semaine; ?>'>
|
||||
<input type="hidden" maxlength="2" name="zAnnee" value='<?php echo $annee; ?>'>
|
||||
</form>
|
||||
<table id="tableau" class="tableau">
|
||||
<tbody>
|
||||
<!-- PARTIE SELCTION SEMAINE -->
|
||||
<tr>
|
||||
<th><input id="sPrecedente" name="gauche" title="semaine précédente" src="images/gauche.gif"
|
||||
onclick="autreSemaine('<?php echo date('W', strtotime("-7 days", $premierJour)) . "', '" . date('Y', strtotime("-7 days", $premierJour)) ?>')"
|
||||
onmouseover="document.gauche.src='images/gauche_.gif'"
|
||||
onmouseout="document.gauche.src='images/gauche.gif'" type="image"></th>
|
||||
|
||||
<th><input id="sSuivante" name="droite" title="semaine suivante" src="images/droite.gif" onclick="autreSemaine('<?php echo date('W',strtotime("+7 day",$premierJour))."', '".date('Y',strtotime("+7 day",$premierJour));?>')" onmouseover="document.droite.src='images/droite_.gif'" onmouseout="document.droite.src='images/droite.gif'"type="image"></th>
|
||||
</tr>
|
||||
<th colspan="26"><b><big>Semaine
|
||||
<?php echo $semaine . " : du lundi " . date('d/m/Y', $premierJour) . " au dimanche " . date('d/m/Y', strtotime("6 days", $premierJour)) . "</big></b></th>"; ?>
|
||||
|
||||
<!-- PARTIE AFFICHAGE DES JOURS -->
|
||||
<tr>
|
||||
<th><input id="sSuivante" name="droite" title="semaine suivante" src="images/droite.gif"
|
||||
onclick="autreSemaine('<?php echo date('W', strtotime("+7 day", $premierJour)) . "', '" . date('Y', strtotime("+7 day", $premierJour)); ?>')"
|
||||
onmouseover="document.droite.src='images/droite_.gif'"
|
||||
onmouseout="document.droite.src='images/droite.gif'" type="image"></th>
|
||||
</tr>
|
||||
|
||||
<!-- PARTIE AFFICHAGE DES JOURS -->
|
||||
<tr>
|
||||
<?php
|
||||
$nomJour = array('Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche');
|
||||
for($jour = 0; $jour <= 6; $jour++) {
|
||||
for ($jour = 0; $jour <= 6; $jour++) {
|
||||
echo ('<th colspan="4">'
|
||||
. $nomJour[$jour] . ' '
|
||||
. date('d/m', strtotime('+' . $jour . ' day', $premierJour)) . '</th>'
|
||||
);
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
?>
|
||||
</tr>
|
||||
|
||||
<!-- PARTIE AFFICHAGE DES TRANCHES DANS CHAQUE JOURS -->
|
||||
<tr>
|
||||
<?php
|
||||
for($jour = 0; $jour <= 6; $jour++) {
|
||||
for($tranche = 1; $tranche <= 4; $tranche++) {
|
||||
echo '<th class="semaine" style="text-align : center;">' . $tranche . '</th>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
|
||||
<!-- PARTIE SELCTION DES DISPO -->
|
||||
<tr>
|
||||
<!-- PARTIE AFFICHAGE DES TRANCHES DANS CHAQUE JOURS -->
|
||||
<tr>
|
||||
<?php
|
||||
foreach ($lesDispos as $uneLigne) { // $pdo->getDisposHebdo() return les dispo
|
||||
for($jour = 0; $jour <= 6; $jour++) {
|
||||
for ($jour = 0; $jour <= 6; $jour++) {
|
||||
for ($tranche = 1; $tranche <= 4; $tranche++) {
|
||||
echo '<th class="semaine" style="text-align : center;">' . $tranche . '</th>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
|
||||
<!-- PARTIE SELCTION DES DISPO -->
|
||||
<tr>
|
||||
<?php
|
||||
foreach ($lesDispos as $uneLigne) { // $pdo->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 ('
|
||||
<td style="height: 20px; background-color: ' . $uneLigne[$dateTab][$couleur] . ';" class="select-dispo" id="' . $leJour . '/' . $tranche . '">' . (($uneLigne[$dateTab][$garde] == 1) ? 'X' : '') . '</td>
|
||||
');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="fenetreDispo" class="fModale">
|
||||
<div>
|
||||
<a href="#" title="Fermer" class="fermer">X</a>
|
||||
<h2>ma disponibilité<br>pour le <label id="ztJour"> </label></h2>
|
||||
<form name="frmActivites" action="index.php?choixTraitement=pompiers&action=majActivite" method="post">
|
||||
<input type="hidden" name="zSemaine" value='<?php echo $semaine;?>'>
|
||||
<input type="hidden" name="zAnnee" value='<?php echo $annee;?>'>
|
||||
<input type="hidden" name="ztLaDate" value=''>
|
||||
<input type="hidden" name="ztLaTranche" value=''>
|
||||
<input type="hidden" name="ztExDispo" value=''>
|
||||
<br>
|
||||
<?php
|
||||
$i=0;
|
||||
foreach ($lesTypesDispos as $uneLigne)
|
||||
{
|
||||
if ($uneLigne["pIndice"]<>3) {
|
||||
echo '<input type="radio" name="brDispo" id="brDispo'.$i.'" value="'.$uneLigne["pIndice"].'"/><label for="brDispo'.$i.'">'.$uneLigne["pLibelle"].'</label><br>';}
|
||||
$i++;
|
||||
?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="fenetreDispo" class="fModale">
|
||||
<div>
|
||||
<a href="#" title="Fermer" class="fermer">X</a>
|
||||
<h2>ma disponibilité<br>pour le <label id="ztJour"> </label></h2>
|
||||
<form name="frmActivites" action="index.php?choixTraitement=pompiers&action=majActivite" method="post">
|
||||
<input type="hidden" name="zSemaine" value='<?php echo $semaine; ?>'>
|
||||
<input type="hidden" name="zAnnee" value='<?php echo $annee; ?>'>
|
||||
<input type="hidden" name="ztLaDate" value=''>
|
||||
<input type="hidden" name="ztLaTranche" value=''>
|
||||
<input type="hidden" name="ztExDispo" value=''>
|
||||
<br>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($lesTypesDispos as $uneLigne) {
|
||||
if ($uneLigne["pIndice"] <> 3) {
|
||||
echo '<input type="radio" name="brDispo" id="brDispo' . $i . '" value="' . $uneLigne["pIndice"] . '"/><label for="brDispo' . $i . '">' . $uneLigne["pLibelle"] . '</label><br>';
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<button onclick="document.forms['frmActivites'].submit()">Valider</button>
|
||||
<button href="#contenuOnglet1">Annuler</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /div -->
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<button onclick="document.forms['frmActivites'].submit()">Valider</button>
|
||||
<button href="#contenuOnglet1">Annuler</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /div -->
|
||||
<?php
|
||||
echo ("
|
||||
</fieldset>
|
||||
</div>");
|
||||
/*================================================================================================== GARDES (2)*/
|
||||
/*================================================================================================== GARDES (2)*/
|
||||
echo ("
|
||||
<div style='display: none;' class='unOnglet' id='contenuOnglet2'>
|
||||
<fieldset><legend>Gardes réalisées ");
|
||||
if (count($lesGardes)==0) {echo "<i>(aucune garde enregistrée)</i></legend>";} else
|
||||
{
|
||||
echo ("<i>(".count($lesGardes)." gardes)</i></legend>
|
||||
if (count($lesGardes) == 0) {
|
||||
echo "<i>(aucune garde enregistrée)</i></legend>";
|
||||
} else {
|
||||
echo ("<i>(" . count($lesGardes) . " gardes)</i></legend>
|
||||
<table style='border: 0px solid white;'>
|
||||
<tr><th class='controleLong'>Date de la garde</th>");
|
||||
foreach ($lesTranches as $uneLigne) { echo ("<th>".$uneLigne['pLibelle']."</th>");}
|
||||
$dateGarde="premiere";
|
||||
$colonne=1;
|
||||
echo "</tr>";
|
||||
|
||||
foreach ($lesGardes as $uneLigne)
|
||||
{
|
||||
if ($dateGarde != $uneLigne['wDate'])
|
||||
{
|
||||
if ($dateGarde != "premiere")
|
||||
{
|
||||
while ($colonne <= count($lesTranches)) {
|
||||
echo "<td class='controle' style='text-align : center;'> </td>";
|
||||
$colonne++;
|
||||
}
|
||||
echo "</tr>
|
||||
";
|
||||
}
|
||||
echo "<tr><td class='controle' style='text-align : center;'>".$uneLigne['wDate']."</td>";
|
||||
$dateGarde = $uneLigne['wDate'];
|
||||
$colonne=1;
|
||||
}
|
||||
while ($colonne<$uneLigne['aTranche']) {echo "<td class='controle' style='text-align : center;'> </td>"; $colonne++;}
|
||||
echo ("<td class='controle' style='text-align : center;background-color : lime;'> </td>");
|
||||
$colonne=$uneLigne['aTranche']+1;
|
||||
foreach ($lesTranches as $uneLigne) {
|
||||
echo ("<th>" . $uneLigne['pLibelle'] . "</th>");
|
||||
}
|
||||
$dateGarde = "premiere";
|
||||
$colonne = 1;
|
||||
echo "</tr>";
|
||||
|
||||
foreach ($lesGardes as $uneLigne) {
|
||||
if ($dateGarde != $uneLigne['wDate']) {
|
||||
if ($dateGarde != "premiere") {
|
||||
while ($colonne <= count($lesTranches)) {
|
||||
echo "<td class='controle' style='text-align : center;'> </td>";
|
||||
$colonne++;
|
||||
}
|
||||
echo "</tr>
|
||||
";
|
||||
}
|
||||
echo "<tr><td class='controle' style='text-align : center;'>" . $uneLigne['wDate'] . "</td>";
|
||||
$dateGarde = $uneLigne['wDate'];
|
||||
$colonne = 1;
|
||||
}
|
||||
while ($colonne < $uneLigne['aTranche']) {
|
||||
echo "<td class='controle' style='text-align : center;'> </td>";
|
||||
$colonne++;
|
||||
}
|
||||
echo ("<td class='controle' style='text-align : center;background-color : lime;'> </td>");
|
||||
$colonne = $uneLigne['aTranche'] + 1;
|
||||
}
|
||||
while ($colonne <= count($lesTranches)) {
|
||||
echo "<td class='controle' style='text-align : center;'> </td>";
|
||||
$colonne++;
|
||||
}
|
||||
while ($colonne<=count($lesTranches)) {echo "<td class='controle' style='text-align : center;'> </td>"; $colonne++;}
|
||||
echo "</tr>";
|
||||
echo ("</table>");
|
||||
}
|
||||
@ -222,7 +236,7 @@ echo ("
|
||||
</fieldset>
|
||||
</div>");
|
||||
/*================================================================================================== COORDONNEES (3) */
|
||||
echo ("
|
||||
echo ("
|
||||
<div style='display: none;' class='unOnglet' id='contenuOnglet3'>
|
||||
<form class='dataPompier' method='post'>
|
||||
<table style='border: 0px solid white;'>
|
||||
@ -230,15 +244,15 @@ echo ("
|
||||
<td style='border :0px;'>
|
||||
<fieldset><legend>Coordonnées</legend>
|
||||
<table>
|
||||
<tr><th style='width:130px;'>Nom</th> <td style='width:130px;'><input name='ztNom' type='text' class='infoPompier' value='".$lesInfosPompier['nom']."' disabled></td> </tr>
|
||||
<tr><th>Prénom</th> <td> <input name='ztPrenom' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['prenom']."' disabled></td> </tr>
|
||||
<tr><th>Adresse</th> <td> <input name='ztAdresse' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pAdresse']."' disabled></td> </tr>
|
||||
<tr><th>Code postal</th> <td> <input name='ztCodePostal' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pCp']."' disabled></td> </tr>
|
||||
<tr><th>Ville</th> <td> <input name='ztVille' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pVille']."' disabled></td> </tr>
|
||||
<tr><th>Téléphone</th> <td> <input name='ztTel' type='text' class='infoPompier-chef' value='" . $lesInfosPompier['pBip']."' disabled></td> </tr>
|
||||
<tr><th>Adresse électronique</th> <td> <input name='ztMail' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pMail']."' disabled></td> </tr>
|
||||
<tr><th style='width:130px;'>Nom</th> <td style='width:130px;'><input name='ztNom' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['nom'] . "' disabled></td> </tr>
|
||||
<tr><th>Prénom</th> <td> <input name='ztPrenom' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['prenom'] . "' disabled></td> </tr>
|
||||
<tr><th>Adresse</th> <td> <input name='ztAdresse' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pAdresse'] . "' disabled></td> </tr>
|
||||
<tr><th>Code postal</th> <td> <input name='ztCodePostal' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pCp'] . "' disabled></td> </tr>
|
||||
<tr><th>Ville</th> <td> <input name='ztVille' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pVille'] . "' disabled></td> </tr>
|
||||
<tr><th>Téléphone</th> <td> <input name='ztTel' type='text' class='infoPompier-chef' value='" . $lesInfosPompier['pBip'] . "' disabled></td> </tr>
|
||||
<tr><th>Adresse électronique</th> <td> <input name='ztMail' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pMail'] . "' disabled></td> </tr>
|
||||
<tr><th>Nom de compte</th> <td>" . $lesInfosPompier['pLogin'] . "</td></tr>
|
||||
<input name='pId' type='hidden' class='infoPompier' value='" . $lesInfosPompier['id']."' disabled>
|
||||
<input name='pId' type='hidden' class='infoPompier' value='" . $lesInfosPompier['id'] . "' disabled>
|
||||
<br />");
|
||||
echo ("
|
||||
</table>
|
||||
@ -256,9 +270,45 @@ echo ("
|
||||
</fieldset>
|
||||
<fieldset><legend>Fonction</legend>
|
||||
<table>
|
||||
<tr><th>Type</th> <td> <input name='lstType' type='text' class='infoPompier-chef' value='" . $lesInfosPompier['wType'] . "' disabled></td> </tr>
|
||||
<tr><th>Grade</th> <td> <input name='lstGrade' type='text' class='infoPompier-chef' value='" . $lesInfosPompier['wGrade'] . "' disabled></td> </tr>
|
||||
<tr><th>Statut</th> <td> <input name='lstStatut' type='text' class='infoPompier-chef' value='" . $lesInfosPompier['wStatut'] . "' disabled></td> </tr>
|
||||
<tr><th>Type</th> <td>
|
||||
<select name='lstType' class='infoPompier-chef' disabled>");
|
||||
foreach ($pdo->getParametre('typePer') as $key => $value) {
|
||||
if ($lesInfosPompier['wType'] == $value['pLibelle']) {
|
||||
echo ("<option value=" . $value['pIndice'] . " selected> " . $value['pLibelle'] . "</option>");
|
||||
} else {
|
||||
echo ("<option value=" . $value['pIndice'] . "> " . $value['pLibelle'] . "</option>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo ("</td> </tr>
|
||||
|
||||
<tr><th>Grade</th> <td>
|
||||
<select name='lstGrade' class='infoPompier-chef' disabled>");
|
||||
foreach ($pdo->getParametre('grade') as $key => $value) {
|
||||
if ($lesInfosPompier['wGrade'] == $value['pLibelle']) {
|
||||
echo ("<option value=" . $value['pIndice'] . " selected> " . $value['pLibelle'] . "</option>");
|
||||
} else {
|
||||
echo ("<option value=" . $value['pIndice'] . "> " . $value['pLibelle'] . "</option>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo ("</td> </tr>
|
||||
|
||||
<tr><th>Statut</th> <td>
|
||||
<select name='lstStatut' class='infoPompier-chef' disabled>");
|
||||
foreach ($pdo->getParametre('statAgt') as $key => $value) {
|
||||
if ($lesInfosPompier['wStatut'] == $value['pLibelle']) {
|
||||
echo ("<option value=" . $value['pIndice'] . " selected> " . $value['pLibelle'] . "</option>");
|
||||
} else {
|
||||
echo ("<option value=" . $value['pIndice'] . "> " . $value['pLibelle'] . "</option>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo ("</td> </tr>
|
||||
</td> </tr>
|
||||
</table>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
@ -267,15 +317,15 @@ echo ("
|
||||
<fieldset><legend>Observations</legend>
|
||||
<table style='border: 0px solid white;'>
|
||||
<tr>
|
||||
<td> <input name='ztObservation' type='text' class='infoPompier' value='" . $lesInfosPompier['pCommentaire'] . "' disabled></td></td>
|
||||
<td> <input name='ztObservation' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pCommentaire'] . "' disabled></td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<input type='image' class='btn-valid-modif' id='validModif' title='Modifier' src='images/valider.jpg' style='display:none; margin: 0 auto;'>
|
||||
");
|
||||
<input type='image' class='btn-valid-modif' id='validModif' title='Modifier' src='images/valider.jpg' style='display:none; margin: 0 auto;'>
|
||||
|
||||
</div>
|
||||
");
|
||||
/*================================================================================================== Onglet X */
|
||||
echo ("
|
||||
<div style='display: none;' class='unOnglet' id='contenuOngletX'>
|
||||
@ -288,5 +338,5 @@ echo ("
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>");
|
||||
</div>");
|
||||
?>
|
@ -19,13 +19,23 @@
|
||||
<?php
|
||||
echo (" <table>
|
||||
<tr> <th>Indice</th> <td>");
|
||||
if ($action==="ajouter") {echo "<input class='controle' type='text' name='valeur' value='".$infosParam['pIndice']."'>";}
|
||||
else {echo $infosParam['pIndice'];}
|
||||
if ($action === "ajouter") {
|
||||
echo "<input class='controle' type='text' name='valeur' value='" . $infosParam['pIndice'] . "'>";
|
||||
} else {
|
||||
echo $infosParam['pIndice'];
|
||||
}
|
||||
echo (" </td> </tr>
|
||||
<tr> <th>Valeur</th> <td>");
|
||||
if ($action==="ajouter") {echo "<input class='controle' type='text' name='zLibelle'>";$actif=null;}
|
||||
if ($action==="modifier") {echo "<input class='controleLong' type='text' name='zLibelle' value='".$infosParam['pLibelle']."'>";$actif=null;}
|
||||
if ($action==="supprimer") {echo $infosParam['pLibelle'];$actif="disabled='disabled'";}
|
||||
if ($action === "ajouter") {
|
||||
echo "<input class='controle' type='text' name='zLibelle'>";
|
||||
$actif = null;
|
||||
} else if ($action === "modifier") {
|
||||
echo "<input class='controleLong' type='text' name='zLibelle' value='" . $infosParam['pLibelle'] . "'>";
|
||||
$actif = null;
|
||||
} else if ($action === "supprimer") {
|
||||
echo $infosParam['pLibelle'];
|
||||
$actif = "disabled='disabled'";
|
||||
}
|
||||
echo (" </td> </tr>");
|
||||
echo ("
|
||||
<tr> <th>Plancher</th> <td><input class='controle' type='text' name='zPlancher' value='".$infosParam['pPlancher']."'></td> </tr>
|
||||
@ -39,7 +49,7 @@ echo ("
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p align="right">
|
||||
<p style='margin: 0 auto;'>
|
||||
<input type="hidden" name="zOk" value="OK">
|
||||
<input type="image" name="btValider" alt="Valider" src="images/valider.jpg" onclick="this.form.submit();">
|
||||
<input type="image" name="btAnnuler" alt="Annuler" src="images/annuler.jpg" onclick="annuler('frmParam');">
|
||||
|
@ -1,87 +1,144 @@
|
||||
<!-- v_unPompier.php / Derniere modification le 18 septembre 2023 par Pascal Blain -->
|
||||
<div id="contenu">
|
||||
<?php
|
||||
/**
|
||||
* Boutons d'action a coté du nom
|
||||
* *lesInfosPompiers = pdo->getInfosPompier());
|
||||
*/
|
||||
if ($_REQUEST['action'] == "supprimer") {
|
||||
echo '<h2>SUPPRESSION DU POMPIER '.$lesInfosPompier['nom'].' '.$lesInfosPompier['prenom'].'</h2>';
|
||||
echo (
|
||||
<?php
|
||||
/**
|
||||
* Boutons d'action a coté du nom
|
||||
* *lesInfosPompiers = pdo->getInfosPompier());
|
||||
*/
|
||||
if ($_REQUEST['action'] == "supprimer") {
|
||||
echo '<h2>SUPPRESSION DU POMPIER ' . $lesInfosPompier['nom'] . ' ' . $lesInfosPompier['prenom'] . '</h2>';
|
||||
echo (
|
||||
'<form name="frmA" action="index.php?choixTraitement=pompiers&action=validerSupprimer&type='
|
||||
. $lesInfosPompier['pType']
|
||||
. $lesInfosPompier['pType']
|
||||
. '&agent=' . $lesInfosPompier['id']
|
||||
. '&caserne=' . $lesInfosPompier['pCis']
|
||||
. '" method="post">');
|
||||
}
|
||||
if ($_REQUEST['action'] == "modifier") {
|
||||
if ($_REQUEST['action'] == "modifier") {
|
||||
var_dump($lesInfosPompier);
|
||||
echo ('
|
||||
<h2>MODIFICATION DU POMPIER '
|
||||
. $lesInfosPompier['nom'] . ' '
|
||||
. $lesInfosPompier['prenom'] . '</h2>'
|
||||
);
|
||||
echo ('
|
||||
<form name="frmA" action="index.php?choixTraitement=pompiers&action=validerModifier&type='
|
||||
<h2>MODIFICATION DU POMPIER '
|
||||
. $lesInfosPompier['nom'] . ' '
|
||||
. $lesInfosPompier['prenom'] . '</h2>'
|
||||
);
|
||||
echo ('
|
||||
<form name="frmA" action="index.php?choixTraitement=pompiers&action=validerModifier&type='
|
||||
. $lesInfosPompier['wType'] . '&agent='
|
||||
. $lesInfosPompier['id']
|
||||
. '&caserne=' . $lesInfosPompier['pCis']
|
||||
. '" method="post">'
|
||||
);
|
||||
}
|
||||
if ($_REQUEST['action'] == "ajouter") {
|
||||
if ($_REQUEST['action'] == "ajouter") {
|
||||
echo "<h2>AJOUT D'UN NOUVEAU POMPIER</h2>";
|
||||
echo '
|
||||
<form name="frmA" action="index.php?choixTraitement=pompiers&action=validerAjouter&type='
|
||||
. $lesInfosPompier['pType'].'" method="post" onsubmit="return valider(this)">';
|
||||
}
|
||||
echo ("
|
||||
|
||||
//action = index.php?choixTraitement=pompiers&action=validerAjouter&type=''
|
||||
//onsubmit="return valider(this)">
|
||||
echo('
|
||||
<form class="dataPompierAjout" name="frmA" action="index.php?choixTraitement=pompiers&action=validerAjouter&type="
|
||||
method="post"
|
||||
');
|
||||
echo ("
|
||||
<table style='border: 0px solid white;'>
|
||||
<tr>
|
||||
<td style='border :0px;'>
|
||||
<fieldset><legend>Coordonnées</legend>
|
||||
<table>
|
||||
");
|
||||
if ($_REQUEST['action'] == "supprimer"){ //-------------------------------------------------------- cas suppression
|
||||
echo ("
|
||||
");
|
||||
if ($_REQUEST['action'] == "supprimer") { //-------------------------------------------------------- cas suppression
|
||||
echo ("
|
||||
<div style='display: none;' class='unOnglet' id='contenuOnglet3'>
|
||||
<table style='border: 0px solid white;'>
|
||||
<tr>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
");
|
||||
}
|
||||
//------------------------------------------------------------------------------------ cas ajout ou modification
|
||||
");
|
||||
}
|
||||
//------------------------------------------------------------------------------------ cas ajout ou modification
|
||||
|
||||
if ($_REQUEST['action'] == "modifier") {
|
||||
echo (" <tr>
|
||||
if ($_REQUEST['action'] == "modifier") {
|
||||
echo (" <tr>
|
||||
</tr>
|
||||
</table>
|
||||
");
|
||||
}
|
||||
if ($_REQUEST['action'] == "ajouter") {
|
||||
echo (" <tr><th style='width:130px;'>Nom</th> <td style='width:130px;'><input id='ztNom' type='text' name='ztNom'></td> </tr>
|
||||
|
||||
<br />");
|
||||
}
|
||||
?>
|
||||
<table style='border: 0px solid white; '>
|
||||
<tr>
|
||||
<td style='border: 0px solid white;'>
|
||||
<fieldset><legend>Observations</legend>
|
||||
<textarea name='ztObs' cols='70' rows='1'></textarea>
|
||||
</fieldset>
|
||||
</td>
|
||||
<td>
|
||||
<input type="image" name="btValider" alt="Valider" src="images/valider.jpg" value="OK" >
|
||||
<input type="image" name="btAnnuler" alt="Annuler" src="images/annuler.jpg" value="nonOK" onclick="annuler('frmA');">
|
||||
</td>
|
||||
<td style='border: 0px solid white; witdh:130px; text-align:right;'>
|
||||
<input type="hidden" name="zTypeAdm" value="<?php// if ($type=="adm") {echo ("true");} else {echo ("false");} ?>">
|
||||
<input type="hidden" name="zOk" value="OK">
|
||||
}
|
||||
if ($_REQUEST['action'] == "ajouter") {
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
echo ("
|
||||
<tr><th style='width:130px;'>Nom</th> <td style='width:130px;'><input name='ztNom' type='text' class='infoPompier' ></td> </tr>
|
||||
<tr><th>Prénom</th> <td> <input name='ztPrenom' type='text' class='infoPompier infoPompier-chef' ></td> </tr>
|
||||
<tr><th>Adresse</th> <td> <input name='ztAdresse' type='text' class='infoPompier infoPompier-chef' ></td> </tr>
|
||||
<tr><th>Code postal</th> <td> <input name='ztCodePostal' type='text' class='infoPompier infoPompier-chef' ></td> </tr>
|
||||
<tr><th>Ville</th> <td> <input name='ztVille' type='text' class='infoPompier infoPompier-chef' ></td> </tr>
|
||||
<tr><th>Téléphone</th> <td> <input name='ztTel' type='text' class='infoPompier-chef' ></td> </tr>
|
||||
<tr><th>Adresse électronique</th> <td> <input name='ztMail' type='text' class='infoPompier infoPompier-chef' ></td> </tr>
|
||||
<tr><th>Nom de compte</th> <td><input name='ztMail' type='text' class='infoPompier infoPompier-chef' ></td></tr>
|
||||
<input name='pId' type='hidden' class='infoPompier' value='" . $lesInfosPompier['id'] . "' >
|
||||
<tr><th style='width:130px;'>Code</th> <td><input name='zCis' type='text' class='infoPompier-chef' value='" . $lesInfosPompier['pCis'] . "' ></td> </tr>
|
||||
<tr><th>Nom</th> <td>" . $lesInfosPompier['cNom'] . "</td> </tr>
|
||||
<tr><th>Adresse</th> <td>" . $lesInfosPompier['cAdresse'] . "</td> </tr>
|
||||
<tr><th>Téléphone</th> <td>" . $lesInfosPompier['cTel'] . "</td> </tr>
|
||||
<tr><th>Groupement</th> <td>" . $lesInfosPompier['cGroupement'] . "</td> </tr>
|
||||
|
||||
<tr><th>Type</th> <td>
|
||||
<select name='lstType' class='infoPompier-chef'>");
|
||||
foreach ($pdo->getParametre('typePer') as $key => $value) {
|
||||
echo ("<option value=" . $value['pIndice'] . "> " . $value['pLibelle'] . "</option>");
|
||||
}
|
||||
echo ("</td> </tr>
|
||||
<tr><th>Grade</th> <td>
|
||||
<select name='lstGrade' class='infoPompier-chef'>");
|
||||
foreach ($pdo->getParametre('grade') as $key => $value) {
|
||||
echo ("<option value=" . $value['pIndice'] . "> " . $value['pLibelle'] . "</option>");
|
||||
}
|
||||
|
||||
|
||||
echo ("</td> </tr>
|
||||
|
||||
<tr><th>Statut</th> <td>
|
||||
<select name='lstStatut' class='infoPompier-chef'>");
|
||||
foreach ($pdo->getParametre('statAgt') as $key => $value) {
|
||||
echo ("<option value=" . $value['pIndice'] . "> " . $value['pLibelle'] . "</option>");
|
||||
}
|
||||
|
||||
|
||||
echo ("</td> </tr>
|
||||
<br />");
|
||||
|
||||
echo ("
|
||||
</td> </tr>
|
||||
</table>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<fieldset><legend>Observations</legend>
|
||||
<table style='border: 0px solid white;'>
|
||||
<tr>
|
||||
<td> <input name='ztObservation' type='text' class='infoPompier' value='" . $lesInfosPompier['pCommentaire'] . "' ></td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<div style='text-align:center; '>
|
||||
<input type= 'image' class='validerAjout' alt='Valider' src= 'images/Valider.jpg'>
|
||||
<input type= 'image' class='btAnnulerAjout' alt='Annuler' src= 'images/Annuler.jpg'>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<input type='image' class='btn-valid-modif' id='validModif' title='Modifier' src='images/valider.jpg' style='display:none; margin: 0 auto;'>
|
||||
");
|
||||
}
|
||||
}
|
||||
?>
|
||||
<table style='border: 0px solid white; '>
|
||||
<tr>
|
||||
<td style='border: 0px solid white; witdh:130px; text-align:right;'>
|
||||
<input type="hidden" name="zTypeAdm"
|
||||
value="<? php // if ($type=="adm") {echo ("true");} else {echo ("false");} ?>">
|
||||
<input type="hidden" name="zOk" value="OK">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
Loading…
x
Reference in New Issue
Block a user