function getJourSemaine($index) { return jourSemaine()[$index - 1]; }
echo SITE_ROOT . "public/img/icons/apercu.png"; ?> " /> Aperçu</a> </li> </ul></div> <div id="onglet1" class="onglet" style="display: block;height: 80%"> <div id = 'emplois-content'><table id="tableEmplois" class='dataTable'> <thead><th>Jour</th><th>Début</th><th>Fin</th><th>Enseignant</th><th>Matière</th><th></th></thead> <tbody></tbody> </table></div> <div id="ajout-emplois-dialog" class="dialog" title="Sélectionner les horaires"> <span><label>Jour de la semaine:</label> <select name = 'jour' style="width:100%;"><?php $i = 1; $jours = jourSemaine(); foreach ($jours as $j) { echo "<option value = '{$i}'>{$j}</option>"; $i++; } ?> </select> </span> <span><label>Matières : </label><select name = 'enseignement' style="width: 100%"></select></span> <span style="width: 150px; float: left;"><label>Heure début:</label><input type="text" name="heuredebut" size="15" id="heuredebut" /></span> <span style="width: 150px;float: left;"><label>Heure fin:</label><input type="text" name="heurefin" id="heurefin" size="15" /></span> </div> </div> <div id="onglet2" class="onglet" style="display: none;height: 80%"> <div id="apercu-content"></div>
$corps = '<table style="text-align:center" cellpadding="2"> <tr style="font-weight:bold"> <th border="0.5" width ="' . $col[0] . '%">DATES</th> <th border="0.5" width ="' . $col[1] . '%">LUNDI</th> <th border="0.5" width ="' . $col[2] . '%">MARDI</th> <th border="0.5" width ="' . $col[3] . '%">MERCREDI</th> <th border="0.5" width ="' . $col[4] . '%">JEUDI</th> <th border="0.5" width ="' . $col[5] . '%">VENDREDI</th> <th border="0.5" width ="' . $col[6] . '%">SAMEDI</th> </tr>'; $date = $datedebut; $d = new DateFR(); while ($date <= $datefin) { $d->setSource($date); $corps .= '<tr><td border="0.5">' . $d->getDate() . ' ' . $d->getMois(3) . ' ' . $d->getYear() . '</td>'; $semaine = jourSemaine(); for ($i = 1; $i < 7; $i++) { $absents = enseignantAbsentByPeriode($date, $absences); $corps .= '<td border="0.5">'; foreach ($absents as $abs) { $corps .= substr($abs['NOM'], 0, 10) . "<br/>"; } $corps .= "</td>"; # Passer au jour suivant $date = date("Y-m-d", strtotime("+1 day", strtotime($date))); $d->setSource($date); } $date = date("Y-m-d", strtotime("+1 day", strtotime($date))); $d->setSource($date + 1); $corps .= '</tr>'; }