function pretty_hour($int_hour) { $minutes = $int_hour % 100; $heure = floor($int_hour / 100) + floor($minutes / 60); $minutes = $minutes % 60; if ($heure == 0 && $minutes == 0) { return ""; } else { return pad_zero($heure) . 'h' . pad_zero($minutes); } }
unset($req_type); /* $sqlType="SELECT * FROM types_activites WHERE codeTypeActivite=".$res_4['codeTypeActivite']; $req_type=$dbh->prepare($sqlType); $req_type->execute(); while($res_type = $req_type->fetch()) { $nom_type_seance = $res_type['alias']; } $req_type->closeCursor(); */ // enseignement $enseignement = $res_4['alias']; $nom_type_seance = ''; $duree = pad_zero(floor($res_4["seanceDuree"] / 100)) . 'h' . pad_zero(floor($res_4["seanceDuree"] % 100)); $heure = pad_zero(floor($res_4["heureSeance"] / 100)) . 'h' . pad_zero(floor($res_4["heureSeance"] % 100)); //recherche des profs associés à la seance $code_seance = $res_4['codeSeance']; $nom_prof = ""; $sql = "SELECT nom, prenom from seances_profs left join ressources_profs on (seances_profs.codeRessource=ressources_profs.codeProf) WHERE seances_profs.codeSeance=" . $code_seance . " and seances_profs.deleted='0' and ressources_profs.deleted='0' order by ressources_profs.nom"; $req5 = $dbh->prepare($sql); $req5->execute(); $premierProf = TRUE; while ($res_5 = $req5->fetch()) { $prenom = ucwords(strtolower($res_5['prenom'])); if ($premierProf == FALSE) { $nom_prof .= " - "; } $nom_prof .= $prenom . " " . $res_5['nom']; $premierProf = FALSE; }
} ?> </select> <select id="gram_<?php echo $gram_id; ?> _minute" name="gram_<?php echo $gram_id; ?> _minute"> <? //$midnight = strtotime(date("n/j/Y", time())); $interval = 15; for ($i=0; $i<60; $i+=$interval) { echo "<option value=\"" . pad_zero($i, 2) . "\"".($i == $minutes ? " selected" : "").">" . pad_zero($i, 2) . "</option>\n"; } ?> </select> <select id="gram_<?php echo $gram_id; ?> _ampm" name="gram_<?php echo $gram_id; ?> _ampm"> <option value="am"<? echo ($ampm == "am" ? " selected" : "") ?>>am</option> <option value="pm"<? echo ($ampm == "pm" ? " selected" : "") ?>>pm</option> </select> </div> <a href="#" onclick="return DeleteGram<?php