3 Commits

Author SHA1 Message Date
aa0701334e modification complète d'un pompier 2023-10-19 09:07:06 +02:00
5fdb28c44e Modification du pompier 2023-10-12 09:01:55 +02:00
ea3ea7cb5f modif pompiers pas finis 2023-10-05 11:53:36 +02:00
10 changed files with 607 additions and 381 deletions

View File

@ -0,0 +1,3 @@
<?php
$pdo

View File

@ -10,8 +10,7 @@
//*****************************************'
$action = $_REQUEST['action'];
switch ($action) {
case 'voir':
{
case 'voir': {
$formulaire = "choixP"; //Donne le focus dans le form
$champ = "lstPompiers";
include("vues/v_entete.php");
@ -47,8 +46,7 @@ case 'voir':
//----------------------------------------- FORMULAIRE DE SAISIE
case 'ajouter':
case 'modifier':
case 'supprimer':
{
case 'supprimer': {
$formulaire = "frmA";
$champ = "ztNom";
include("vues/v_entete.php");
@ -61,17 +59,20 @@ case 'supprimer':
break;
}
//----------------------------------------- VALIDATION
case 'validerAjouter':
case 'validerModifier':
case 'validerSupprimer':
{
$valeur = $_REQUEST['agent'];
if ($_REQUEST['zOk'] == "OK")
{
if ($action === "validerSupprimer") {
$valeur = $_REQUEST['pId'];
$pdo->supprimePompier($valeur);
break;
case 'validerAjouter':
case 'validerModifier': {
var_dump($_REQUEST);
if (!isset($pdo)) {
require_once ("../include/class.pdo.php");
$pdo = PdoBD::getPdoBD();
}
else {
$pId = $_REQUEST['pId'];
$nom = addslashes($_REQUEST['ztNom']);
$prenom = addslashes($_REQUEST['ztPrenom']);
$type = $_REQUEST['lstType'];
@ -79,60 +80,48 @@ case 'validerSupprimer':
$statut = $_REQUEST['lstStatut'];
$cis = $_REQUEST['zCis'];
$mail = $_REQUEST['ztMail'];
$login = $_REQUEST['ztLogin'];
$mdp = md5($_REQUEST['ztMdp']); if($_REQUEST['brMdp']==0 AND $action==="validerModifier") {$mdp="*";}
$login = strtolower($_REQUEST['ztPrenom'][0]) . strtoupper($_REQUEST['ztNom']);
$mdp = md5($login);
//$mdp = md5($_REQUEST['ztMdp']);
// if ($_REQUEST['brMdp'] == 0 and $action === "validerModifier") {
// $mdp = "*";
// }
$adresse = addslashes($_REQUEST['ztAdresse']);
if (strlen($_REQUEST['ztCP']) > 1) {
$cp = $_REQUEST['ztCP'];
if (strlen($_REQUEST['ztCodePostal']) > 1) {
$cp = $_REQUEST['ztCodePostal'];
} else {
$cp = "Null";
}
$ville = addslashes($_REQUEST['ztVille']);
if (strlen($_REQUEST['ztTel'])>1) {
if (strlen($_REQUEST['ztTel']) > 0) {
$tel = str_replace(" ", "", $_REQUEST['ztTel']);
$tel = str_replace(".", "", $tel);
$tel = str_replace("/", "", $tel);
} else {
$tel = "Null";
}
$commentaire = addslashes ($_REQUEST['ztObs']);
$commentaire = addslashes($_REQUEST['ztObservation']);
if ($action === "validerAjouter") {
$pdo->ajoutPompier($cis, $valeur,$nom,$prenom,$statut,$mail,$login,$mdp,$grade,$type,$adresse,$cp,$ville,$tel,$commentaire);
$sujet = "nouveau compte";
$msg = "Bonjour " . $prenom . " " . $nom . ", \r\nLe Castel vient de créer un compte pour vous ...\r\n";
} else {
$pdo->majPompier($cis, $valeur,$nom,$prenom,$statut,$mail,$login,$mdp,$grade,$type,$adresse,$cp,$ville,$tel,$commentaire);
$sujet = "nouveau mot de passe";
$msg = "Bonjour " . $prenom . " " . $nom . ", \r\nLe Castel vient de modifier votre mot de passe ...\r\n";
$pdo->ajoutPompier($cis, $pId, $nom, $prenom, $statut, $mail, $login, $mdp, $grade, $type, $adresse, $cp, $ville, $tel, $commentaire);
} elseif ($action === "validerModifier") {
$pdo->majPompier($cis, $pId, $nom, $prenom, $statut, $mail, $login, $mdp, $grade, $type, $adresse, $cp, $ville, $tel, $commentaire);
}
$entete = "From: Pascal Blain <pascal-blain@wanadoo.fr>\r\n";
$entete .= "Mime-Version: 1.0\r\n";
$entete .= "Content-type: text/html; charset=utf-8\r\n";
$entete .= "\r\n";
$msg .= "Statut : " . $statut."\r\n";
$msg .= "Identifiant : " . $login."\r\n";
$msg .= "Mot de passe : " . $_REQUEST['ztMdp'] . "\r\n";
//$pdo->envoyerMail($mail, $sujet, $msg, $entete);
}
}
header ('location: index.php?choixTraitement=pompiers&action=voir&lstPompiers=' . $valeur);
//header('location: index.php?choixTraitement=pompiers&action=voir&lstPompiers=' . $valeur);
break;
}
//-----------------------------------------
case 'majActivite':
{
case 'majActivite': {
$pdo->majActivite($_REQUEST["ztLaDate"], $_REQUEST["ztLaTranche"], $_REQUEST["ztExDispo"], $_REQUEST["brDispo"]);
header('location: index.php?choixTraitement=pompiers&action=voir&zSemaine=' . $_REQUEST["zSemaine"] . '&zAnnee=' . $_REQUEST["zAnnee"]);
break;
}
//-----------------------------------------
default :
{
default: {
echo 'erreur d\'aiguillage !' . $action;
break;
}

View File

@ -78,9 +78,31 @@ class PdoBD
*/
public function getInfosPompier($login, $mdp)
{
/*
$req = "SELECT pCis, pId as id, pNom as nom, pPrenom as prenom, pStatut, pMail, pLogin, pMdp, pGrade, pAdresse, pCp, pVille, pBip, pCommentaire,
'la caserne' as cNom, 'adresse' as cAdresse, 'telephone' as cTel, 'le groupement' as cGroupement, 'le grade' as wGrade, 'le statut' as wStatut, 'le type' as wType
FROM pompier";
*/
$req = "SELECT
pCis,
pId as id,
pNom as nom,
pPrenom as prenom,
pStatut, pMail,
pLogin, pMdp,
pAdresse,
pCp, pVille,
pBip, pCommentaire,
a.pLibelle AS wType,
b.pLibelle AS wGrade,
c.pLibelle AS wStatut,
cNom, cAdresse,
cTel, cGroupement
FROM pompier
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";
if ($login === "*") {
$req .= " WHERE pCis=" . $_SESSION['cis'] . " AND pId = $mdp";
} else {
@ -100,7 +122,7 @@ class PdoBD
*/
public function majActivite($cis, $idUser, $jour, $tranche, $newDispo)
{
$existedTranche = 'SELECT aDisponibilite FROM `activite`
$existedTranche = 'SELECT aDisponibilite FROM activite
WHERE aCis = ' . $cis . ' AND aDateGarde = "' . $jour . '" AND aTranche = ' . $tranche . ' AND aPompier = ' . $idUser . ';';
$rs = PdoBD::$monPdo->query($existedTranche);
var_dump($rs);
@ -152,14 +174,29 @@ class PdoBD
/**
* Met à jour une ligne de la table pompier
*/
public function majPompier($cis, $valeur, $nom, $prenom, $statut, $mail, $login, $mdp, $grade, $type, $adresse, $cp, $ville, $tel, $commentaire)
public function majPompier($cis, $pId, $nom, $prenom, $statut, $mail, $login, $mdp, $grade, $type, $adresse, $cp, $ville, $tel, $commentaire)
{
$grade = 7;
$type = 2;
$statut = 2;
date_default_timezone_set('Europe/Paris');
$dateUpdate = date('y-m-d h:i:s');
$req = "
UPDATE pompier
SET pCis ='$cis', pId ='$pId',
pNom ='$nom', pPrenom ='$prenom',
pStatut ='$statut', pType ='$type',
pMail ='$mail', pLogin ='$login',
pMdp ='$mdp', pAdresse ='$adresse',
pCp ='$cp', pVille ='$ville',
pBip ='$tel', pGrade ='$grade',
pCommentaire ='$commentaire', pDateModif ='$dateUpdate'
WHERE pCis='$cis' AND pId = '$pId'
;";
var_dump($req);
die;
$rs = PdoBD::$monPdo->exec($req);
if ($rs === false) {
afficherErreurSQL("Probleme lors de la mise à jour du pompier dans la base de donn&eacute;es.", $req, PdoBD::$monPdo->errorInfo());

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

@ -351,3 +351,66 @@ $(document).on('click', '.click-garde', function () {
});
}
})
/**
* Modifier
*/
$(document).on('click', '.btn-modif', function (e) {
e.preventDefault();
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 {
element.attr('disabled', true);
$('.btn-valid-modif').css('display', 'none');
}
})
$(document).on('click', '.btn-valid-modif', function (e) {
e.preventDefault();
$('.infoPompier-chef').attr('disabled', false);
data = $('.dataPompier').serialize()
$('.infoPompier-chef').attr('disabled', true);
$('.infoPompier').attr('disabled', true);
$('.btn-valid-modif').css('display', 'none');
$.ajax({
url: "/controleurs/c_pompiers.php?action=validerModifier", // URL de l'API ou de la ressource
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);
}
});
})
/**
* 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);
}
});
});

View File

@ -12,7 +12,7 @@ if ($_SESSION['statut'] == 1) {
$choix = $_SESSION['idUtilisateur'];
} else {
echo '
<select name="lstPompiers" STYLE="width:350px;" onchange="submit();">';
<select name="lstPompiers" STYLE="width:auto;" onchange="submit();">';
if (!isset($_REQUEST['lstPompiers'])) {
$choix = $_SESSION['idUtilisateur'];
@ -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" id="zModif" title="Modifier" src="images/modif.gif" onclick="faire('choixP', 'modifier')">
<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')">&nbsp;&nbsp;
<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')">
@ -56,11 +56,16 @@ if ($_SESSION['statut'] == 2) {?>
<?php
} else {
echo '
<input type="image" id="zModif" title="Modifier" src="images/modif.gif" onclick="faire(\'choixP\', \'modifier\')">';
<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="*">

View File

@ -20,7 +20,7 @@
$champ = $_REQUEST['zChamp'];
}
?>
<body onload="donner_focus('<?= $formulaire . ',' . $champ;?>');">
<body >
<div id="page">
<div id="entete">
<img src="./images/logo.png" id="logo" alt="SDIS29" title="SDIS 29" />

View File

@ -1,4 +1,3 @@
<!-- affichage du detail de la fiche pompier / Derniere modification le 18 septembre 2023 par Pascal Blain -->
<!-- ------------------------------------------------ fenetre modale en CSS -->
<style>
@ -56,7 +55,9 @@
box-shadow: 1px 1px 3px #000;
}
.fermer:hover { background: #00d9ff; }
.fermer:hover {
background: #00d9ff;
}
</style>
<?php
/*-----------------------------------------------------------------
@ -96,11 +97,18 @@ echo ("
<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="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 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>";?>
<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>"; ?>
<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>
<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 -->
@ -161,10 +169,10 @@ echo ("
<br>
<?php
$i = 0;
foreach ($lesTypesDispos as $uneLigne)
{
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>';}
echo '<input type="radio" name="brDispo" id="brDispo' . $i . '" value="' . $uneLigne["pIndice"] . '"/><label for="brDispo' . $i . '">' . $uneLigne["pLibelle"] . '</label><br>';
}
$i++;
}
?>
@ -183,22 +191,26 @@ echo ("
echo ("
<div style='display: none;' class='unOnglet' id='contenuOnglet2'>
<fieldset><legend>Gardes r&eacute;alis&eacute;es ");
if (count($lesGardes)==0) {echo "<i>(aucune garde enregistrée)</i></legend>";} else
{
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>");}
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;'>&nbsp;</td>"; $colonne++;}
foreach ($lesGardes as $uneLigne) {
if ($dateGarde != $uneLigne['wDate']) {
if ($dateGarde != "premiere") {
while ($colonne <= count($lesTranches)) {
echo "<td class='controle' style='text-align : center;'>&nbsp;</td>";
$colonne++;
}
echo "</tr>
";
}
@ -206,11 +218,17 @@ echo ("
$dateGarde = $uneLigne['wDate'];
$colonne = 1;
}
while ($colonne<$uneLigne['aTranche']) {echo "<td class='controle' style='text-align : center;'>&nbsp;</td>"; $colonne++;}
while ($colonne < $uneLigne['aTranche']) {
echo "<td class='controle' style='text-align : center;'>&nbsp;</td>";
$colonne++;
}
echo ("<td class='controle' style='text-align : center;background-color : lime;'>&nbsp;</td>");
$colonne = $uneLigne['aTranche'] + 1;
}
while ($colonne<=count($lesTranches)) {echo "<td class='controle' style='text-align : center;'>&nbsp;</td>"; $colonne++;}
while ($colonne <= count($lesTranches)) {
echo "<td class='controle' style='text-align : center;'>&nbsp;</td>";
$colonne++;
}
echo "</tr>";
echo ("</table>");
}
@ -220,28 +238,30 @@ echo ("
/*================================================================================================== COORDONNEES (3) */
echo ("
<div style='display: none;' class='unOnglet' id='contenuOnglet3'>
<form class='dataPompier' method='post'>
<table style='border: 0px solid white;'>
<tr>
<td style='border :0px;'>
<fieldset><legend>Coordonn&eacute;es</legend>
<table>
<tr><th style='width:130px;'>Nom</th> <td style='width:130px;'>".$lesInfosPompier['nom']."</td> </tr>
<tr><th>Pr&eacute;nom</th> <td>".$lesInfosPompier['prenom']."</td> </tr>
<tr><th>Adresse</th> <td>".$lesInfosPompier['pAdresse']."</td> </tr>
<tr><th>Code postal</th> <td>".$lesInfosPompier['pCp']."</td> </tr>
<tr><th>Ville</th> <td>".$lesInfosPompier['pVille']."</td> </tr>
<tr><th>T&eacute;l&eacute;phone</th> <td>".$lesInfosPompier['pBip']."</td> </tr>
<tr><th>Adresse &eacute;lectronique</th> <td>".$lesInfosPompier['pMail']."</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&eacute;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&eacute;l&eacute;phone</th> <td> <input name='ztTel' type='text' class='infoPompier-chef' value='" . $lesInfosPompier['pBip'] . "' disabled></td> </tr>
<tr><th>Adresse &eacute;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>
<tr><th>&nbsp;</th> <td>&nbsp;</td> </tr>
<input name='pId' type='hidden' class='infoPompier' value='" . $lesInfosPompier['id'] . "' disabled>
<br />");
echo (" </table>
echo ("
</table>
</fieldset>
</td>
<td style='border :0px;'>
<fieldset><legend>Centre d'Incendie et de Secours</legend>
<table>
<tr><th style='width:130px;'>Code</th> <td>".$lesInfosPompier['pCis']."</td> </tr>
<tr><th style='width:130px;'>Code</th> <td><input name='zCis' type='text' class='infoPompier-chef' value='" . $lesInfosPompier['pCis'] . "' disabled></td> </tr>
<tr><th>Nom</th> <td>" . $lesInfosPompier['cNom'] . "</td> </tr>
<tr><th>Adresse</th> <td>" . $lesInfosPompier['cAdresse'] . "</td> </tr>
<tr><th>T&eacute;l&eacute;phone</th> <td>" . $lesInfosPompier['cTel'] . "</td> </tr>
@ -250,9 +270,46 @@ echo (" </table>
</fieldset>
<fieldset><legend>Fonction</legend>
<table>
<tr><th>Type</th> <td>".$lesInfosPompier['wType']."</td> </tr>
<tr><th>Grade</th> <td>".$lesInfosPompier['wGrade']."</td> </tr>
<tr><th>Statut</th> <td>".$lesInfosPompier['wStatut']."</td> </tr> </table>
<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>
</table>
@ -260,12 +317,15 @@ echo (" </table>
<fieldset><legend>Observations</legend>
<table style='border: 0px solid white;'>
<tr>
<td>.".$lesInfosPompier['pCommentaire']."</td>
<td> <input name='ztObservation' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pCommentaire'] . "' disabled></td></td>
</tr>
</table>
</fieldset>
</div>");
</form>
<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'>

View File

@ -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');">

View File

@ -23,7 +23,7 @@
);
echo ('
<form name="frmA" action="index.php?choixTraitement=pompiers&action=validerModifier&type='
. $lesInfosPompier['pType'] . '&agent='
. $lesInfosPompier['wType'] . '&agent='
. $lesInfosPompier['id']
. '&caserne=' . $lesInfosPompier['pCis']
. '" method="post">'
@ -31,10 +31,13 @@
}
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)">';
}
//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>
@ -61,24 +64,78 @@ if ($_REQUEST['action'] == "modifier") {
");
}
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>
echo ("
<tr><th style='width:130px;'>Nom</th> <td style='width:130px;'><input name='ztNom' type='text' class='infoPompier' ></td> </tr>
<tr><th>Pr&eacute;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&eacute;l&eacute;phone</th> <td> <input name='ztTel' type='text' class='infoPompier-chef' ></td> </tr>
<tr><th>Adresse &eacute;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&eacute;l&eacute;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;'>
<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="zTypeAdm"
value="<? php // if ($type=="adm") {echo ("true");} else {echo ("false");} ?>">
<input type="hidden" name="zOk" value="OK">
</td>