/** * * Renvoi le creneau precedent du type donné * * @return EdtCreneau EdtCreneau * */ public function getPrevEdtCreneau($type_creneau = null) { $found = false; //on recupere la liste complete des creneaux $all_creneau = EdtCreneauPeer::retrieveAllEdtCreneauxOrderByTime(); //on parcourt la liste $all_creneau->getFirst(); while (!$found && ($all_creneau->getCurrent() != null)) { if ($all_creneau->getCurrent()->getIdDefiniePeriode() == $this->getIdDefiniePeriode()) { $found = true; } else { $all_creneau->getNext(); } } if (!$found) { return null; } if ($type_creneau == null) { return $all_creneau->getPrevious(); } else { $all_creneau->getNext(); while ($all_creneau->getCurrent() != null) { if ($all_creneau->getCurrent()->getTypeCreneaux() == $type_creneau) { return $all_creneau->getCurrent(); } $all_creneau->getPrevious(); } } }
function format_selectbox_heure($utilisateur, $id_creneau, $dt_date_absence_eleve, $id_box) { if ($utilisateur->getStatut() != 'professeur' || getSettingValue("abs2_saisie_prof_decale_journee") == 'y' || getSettingValue("abs2_saisie_prof_decale") == 'y') { ?> <label class="invisible" for="<?php echo $id_box; ?> ">heure</label> <select id="<?php echo $id_box; ?> " name="id_creneau" class="small"> <?php //echo ("<select name=\"id_creneau\" class=\"small\">"); $edt_creneau_col = EdtCreneauPeer::retrieveAllEdtCreneauxOrderByTime(); ?> <option value='-1'>choisissez un créneau</option> <?php foreach ($edt_creneau_col as $edt_creneau) { if ($edt_creneau->getTypeCreneaux() == EdtCreneau::TYPE_PAUSE || $edt_creneau->getTypeCreneaux() == EdtCreneau::TYPE_REPAS) { continue; } echo "<option value='" . $edt_creneau->getIdDefiniePeriode() . "'"; if ($id_creneau == $edt_creneau->getIdDefiniePeriode()) { echo " selected='selected' "; } echo ">"; echo $edt_creneau->getDescription(); echo "</option>\n"; } ?> </select> <?php } else { $current_creneau = EdtCreneauPeer::retrieveEdtCreneauActuel(); if ($current_creneau != null) { echo $current_creneau->getDescription() . ' '; echo '<input type="hidden" name="id_creneau" value="' . $current_creneau->getIdDefiniePeriode() . '"/>'; } else { echo "Aucun creneau actuellement. "; } } if ($utilisateur->getStatut() != 'professeur' || getSettingValue("abs2_saisie_prof_decale") == 'y' && getSettingValue("abs2_saisie_prof_decale_journee") == 'y') { $rand_id = rand(0, 10000000); echo '<label class="invisible" for="date_absence_eleve_' . $rand_id . '">date</label>'; echo '<input size="9" id="date_absence_eleve_' . $rand_id . '" name="date_absence_eleve" value="' . $dt_date_absence_eleve->format('d/m/Y') . '" onKeyDown="clavier_date(this.id,event);" AutoComplete="off" /> '; echo ' <script type="text/javascript"> Calendar.setup({ inputField : "date_absence_eleve_' . $rand_id . '", // id of the input field ifFormat : "%d/%m/%Y", // format of the input field button : "date_absence_eleve_1", // trigger for the calendar (button ID) align : "Bl", // alignment (defaults to "Bl") singleClick : true }); </script>'; } else { echo ' Le ' . $dt_date_absence_eleve->format('d/m/Y') . ' '; } }
/** * Retrieve a single object by pkey. * * @param int $pk the primary key. * @param PropelPDO $con the connection to use * @return EdtCreneau */ public static function retrieveByPK($pk, PropelPDO $con = null) { foreach (EdtCreneauPeer::retrieveAllEdtCreneauxOrderByTime() as $edtCreneau) { if ((string)$edtCreneau->getPrimaryKey() === (string)$pk) { return $edtCreneau; } } return null; }
echo "<td style='width:270px; vertical-align: top;'>"; echo '<div style="border-width: 1px; border-style: solid; text-align: left; padding : 4px;">'; echo '<p>'; echo 'Début : <input size="9" id="date_absence_eleve_debut_saisir_eleve" name="date_absence_eleve_debut_saisir_eleve" value="'.$dt_date_absence_eleve_debut_saisir_eleve->format('d/m/Y').'" /> '; echo '</p>'; echo ' <script type="text/javascript"> Calendar.setup({ inputField : "date_absence_eleve_debut_saisir_eleve", // id of the input field ifFormat : "%d/%m/%Y", // format of the input field button : "date_absence_eleve_debut_saisir_eleve", // trigger for the calendar (button ID) align : "Bl", // alignment (defaults to "Bl") singleClick : true }); </script> '; $edt_creneau_col = EdtCreneauPeer::retrieveAllEdtCreneauxOrderByTime(); echo '<br/>'; echo '<p>'; echo 'Fin : <input size="9" id="date_absence_eleve_fin_saisir_eleve" name="date_absence_eleve_fin_saisir_eleve" value="'.$dt_date_absence_eleve_fin_saisir_eleve->format('d/m/Y').'" /> '; echo '</p>'; echo ' <script type="text/javascript"> Calendar.setup({ inputField : "date_absence_eleve_fin_saisir_eleve", // id of the input field ifFormat : "%d/%m/%Y", // format of the input field button : "date_absence_eleve_fin_saisir_eleve", // trigger for the calendar (button ID) align : "Bl", // alignment (defaults to "Bl") singleClick : true }); </script><br/>';
echo ' Sans lieu défini'."\n"; echo ' </button>'."\n"; $lieux=AbsenceEleveLieuQuery::create()->findList(); if (!$lieux->isempty()) { foreach($lieux as $lieu){ echo ' <button dojoType="dijit.MenuItem" onClick="document.getElementById(\'filtre_actif\').value = \'lieu\'; document.getElementById(\'id_lieu\').value = \''.$lieu->getId().'\';document.totaux_du_jour.submit() ">'."\n"; echo ' Lieu : '.$lieu->getNom()."\n"; echo ' </button>'."\n"; } } ?> </div> </div> </form> <?php $col_creneaux = EdtCreneauPeer::retrieveAllEdtCreneauxOrderByTime(); echo'<table class="sortable resizable" border="1" style="border: 1px solid black; background-color:lightgrey">'; echo'<tr align="center"> <th style="border: 1px solid black; background-color: grey;" class="nosort">Créneau</th> <th style="border: 1px solid black; background-color: grey;" title ="Cliquez pour trier sur la colonne" class="text">Heure</th> <th style="border: 1px solid black; background-color: grey;" title ="Cliquez pour trier sur la colonne" class="number">Nombre d\'élèves absents</th> <th style="border: 1px solid black; background-color: grey;" title ="Cliquez pour trier sur la colonne" class="number">Nombre de demi_pensionnaires </th> <th style="border: 1px solid black; background-color: grey;" title ="Cliquez pour trier sur la colonne" class="number">Nombre d\'internes</th> <th style="border: 1px solid black; background-color: grey;" title ="Cliquez pour trier sur la colonne" class="number">Nombre d\'externes</th> </tr>'; $cpt_eleve=0; $nbre_total_retards=0; $eleves_absents=array (); foreach($col_creneaux as $creneau){ $decompte_du_creneau =0;
function isAffichable($abs, $date, $eleve) { $creneau_col = EdtCreneauPeer::retrieveAllEdtCreneauxOrderByTime(); $test_ouverture = false; foreach ($creneau_col as $creneau) { $datedebutabs = explode(" ", $abs->getDebutAbs()); $dt_date_debut_abs = new DateTime($datedebutabs[0]); $heure_debut = explode(":", $datedebutabs[1]); $dt_date_debut_abs->setTime($heure_debut[0], $heure_debut[1], $heure_debut[2]); $tab_heure = explode(":", $creneau->getHeuredebutDefiniePeriode()); $date->setTime($tab_heure[0], $tab_heure[1], $tab_heure[2]); //on verifie si le creneau est ouvert et s'il est posterieur au debut de l'absence if ($date->Format('U') > $dt_date_debut_abs->Format('U') && EdtHelper::isEtablissementOuvert($date)) { $test_ouverture = true; } } if ($test_ouverture && $abs->getManquementObligationPresence()) { return true; } else { return false; } }
<table class="tb_absences" style="padding-bottom:1em;"> <caption class="invisible no_print"><?php echo $eleve_col->count(); ?> élèves.</caption> <thead> <tr class="titre_tableau_gestion" style="white-space: nowrap;"> <th class="center" >Veille</th> <th class="center" abbr="élèves">Liste des élèves</th> <th colspan="<?php echo (EdtCreneauPeer::retrieveAllEdtCreneauxOrderByTime()->count()*2); ?>" class="th_abs_suivi" abbr="Créneaux">Suivi sur la journée</th> <th></th> <th></th> </tr> <tr> <td></td> <td class="center" ></td> <?php $i=0; foreach(EdtCreneauPeer::retrieveAllEdtCreneauxOrderByTime() as $edt_creneau){ ?> <td class="td_nom_creneau center" colspan="2"> <?php echo $edt_creneau->getNomDefiniePeriode();?> </td> <?php $i++; }?> <td colspan="2" title="Créer un traitement différent pour chaque saisie">Plusieurs traitements</td> </tr> </thead> <tbody> <?php $cpt=0; foreach($afficheEleve as $eleve) {