103 lines
3.9 KiB
Plaintext
103 lines
3.9 KiB
Plaintext
<%--
|
|
Document : feuilleGardes
|
|
Created on : 6 déc. 2021, 15:07:45
|
|
Author : funcha.ahamadi
|
|
--%>
|
|
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
|
<%@include file= "jspf/debutJSP.jspf" %>
|
|
<body>
|
|
<%@include file= "jspf/header.jspf" %>
|
|
<div class="container">
|
|
<section id="contenueAffiche" class="row">
|
|
|
|
|
|
|
|
<fieldset class="row mt-1 mb-10">
|
|
|
|
<legend>
|
|
Feuille de gardes
|
|
</legend>
|
|
<form action="gardes" method="POST">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th rowspan="2">No</th>
|
|
<th rowspan="2">Nom Prenom</th>
|
|
<c:forEach items='${sessionScope.lesDatesEnString}' var="uneDate" varStatus="status">
|
|
<th colspan="4" class="text-center"> ${uneDate}</th>
|
|
</c:forEach>
|
|
|
|
</tr>
|
|
<tr>
|
|
<c:forEach var="i" begin="0" end="6" step="1">
|
|
<c:forEach items='${sessionScope.lesPeriodes}' var="unePeriode" varStatus="status">
|
|
|
|
<td class="text-center">${unePeriode.getCode()}</td>
|
|
</c:forEach>
|
|
</c:forEach>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<c:set var="oldId" value="-1" scope="page"/>
|
|
<tr>
|
|
|
|
<c:forEach items='${sessionScope.lesVentilInit}' var="uneVentil" varStatus="status">
|
|
<c:set var="newId" value='${uneVentil.getPompier().getId()}' scope="page"/>
|
|
<c:if test='${oldId != newId}' var="test" scope="page">
|
|
</tr><tr>
|
|
<td>${uneVentil.getPompier().getId()}</td>
|
|
<td>${uneVentil.getPompier().getNom()} ${uneVentil.getPompier().getPrenom()}</td>
|
|
|
|
<c:set var="oldId" value='${newId}' scope="page"/>
|
|
</c:if>
|
|
|
|
<c:set var="activite" value='${uneVentil.getDisponibilite()}' scope="page"/>
|
|
<td>
|
|
<input readonly type="text" value='${activite}' name="lesActivites"class="ztVentil ${sessionScope.lesCouleurs[activite]}"/>
|
|
<input type="checkbox" id="cbGarde"/>
|
|
|
|
</td>
|
|
</c:forEach>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
<div id="legendCouleur">
|
|
|
|
<span style="background-color: white">Dispo</span>
|
|
<span style="background-color: gray">Indispo</span>
|
|
<span style="background-color: yellow">Au travail</span>
|
|
<span>De garde : X</span>
|
|
|
|
</div>
|
|
<div class="text-center">
|
|
<button type="submit" value="Valider" class="btn btn-danger"><i class="bi bi-check2"></i> Valider</button>
|
|
</div>
|
|
</form>
|
|
</fieldset>
|
|
</section>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
var couleurs = ["blanc", "gris", "jaune"];
|
|
var lesAct = document.getElementsByClassName("ztVentil");
|
|
for (var uneAct of lesAct) {
|
|
uneAct.onclick = function () {
|
|
var act = this.value;
|
|
var newAct = (act + 1) % 3;
|
|
var coul = couleurs[newAct];
|
|
this.classList.remove(couleurs[act]);
|
|
this.classList.add(coul);
|
|
this.value = newAct;
|
|
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|