342 lines
		
	
	
		
			13 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			342 lines
		
	
	
		
			13 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <!-- 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: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);
 | |
| 	}
 | |
| 
 | |
| 	.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;
 | |
| 	}
 | |
| </style>
 | |
| <?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
 | |
| <?php 
 | |
| $action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
 | |
| 
 | |
| // La ligne ci-dessus est identique à la condition suivante :
 | |
| if (empty($_POST['action'])) {
 | |
|    $action = 'default';
 | |
| } else {
 | |
|    $action = $_POST['action'];
 | |
| }
 | |
| -----------------------------------------------------------------------*/
 | |
| $titre1 = ($_SESSION['statut'] == 1) ? "Mes disponibilités" : "Disponibilités";
 | |
| $titre2 = ($_SESSION['statut'] == 1) ? "Mes gardes" : "Gardes";
 | |
| $titre3 = ($_SESSION['statut'] == 1) ? "Mon profil" : "Profil";
 | |
| echo ('
 | |
|  	<div id="fiche">
 | |
| 		<ul class="lesOnglets">	
 | |
| 			<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>');
 | |
| /*================================================================================================== 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>
 | |
| 
 | |
| 			<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>
 | |
| 		</tr>
 | |
| 
 | |
| 		<!-- PARTIE AFFICHAGE DES JOURS -->
 | |
| 		<tr>
 | |
| 			<?php
 | |
| 			$nomJour = array('Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche');
 | |
| 			for ($jour = 0; $jour <= 6; $jour++) {
 | |
| 				echo ('<th colspan="4">'
 | |
| 					. $nomJour[$jour] . ' '
 | |
| 					. date('d/m', strtotime('+' . $jour . ' day', $premierJour)) . '</th>'
 | |
| 				);
 | |
| 			}
 | |
| 			?>
 | |
| 		</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>
 | |
| 			<?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 ('
 | |
| 								<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++;
 | |
| 			}
 | |
| 			?>
 | |
| 			<br>
 | |
| 			<button onclick="document.forms['frmActivites'].submit()">Valider</button>
 | |
| 			<button href="#contenuOnglet1">Annuler</button>
 | |
| 		</form>
 | |
| 	</div>
 | |
| </div>
 | |
| <!-- /div -->
 | |
| <?php
 | |
| echo ("
 | |
| 			</fieldset>
 | |
| 		</div>");
 | |
| /*================================================================================================== 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>
 | |
| 			<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;
 | |
| 	}
 | |
| 	while ($colonne <= count($lesTranches)) {
 | |
| 		echo "<td class='controle' style='text-align : center;'> </td>";
 | |
| 		$colonne++;
 | |
| 	}
 | |
| 	echo "</tr>";
 | |
| 	echo ("</table>");
 | |
| }
 | |
| echo ("
 | |
| 		</fieldset>
 | |
| 		</div>");
 | |
| /*================================================================================================== 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ées</legend>
 | |
| 					<table>
 | |
| 						<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>
 | |
| 						<br />");
 | |
| 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><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éléphone</th>		<td>" . $lesInfosPompier['cTel'] . "</td> </tr>
 | |
| 						<tr><th>Groupement</th>						<td>" . $lesInfosPompier['cGroupement'] . "</td> </tr>
 | |
| 					</table>
 | |
| 				</fieldset>
 | |
| 				<fieldset><legend>Fonction</legend> 
 | |
| 					<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>
 | |
| 			
 | |
| 			<fieldset><legend>Observations</legend>
 | |
| 			<table style='border: 0px solid white;'>
 | |
| 				<tr> 
 | |
| 					 <td> <input name='ztObservation' type='text' class='infoPompier infoPompier-chef' value='" . $lesInfosPompier['pCommentaire'] . "' disabled></td></td>
 | |
| 				</tr>
 | |
| 			</table>
 | |
| 			</fieldset>
 | |
| 			</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'>
 | |
| 			<fieldset><legend>XXXX</legend>
 | |
| 			<table>
 | |
| 				<tr><th style='width:130px;'>.....</th></tr>
 | |
| 				<tr><td>xxxx</td></tr>
 | |
| 			</table>
 | |
| 			</fieldset>
 | |
| 		</div>
 | |
| 
 | |
| 	</div>
 | |
| </div>");
 | |
| ?>
 |