echo "<p>".$not_dev->date_visibilite_eleve."<br />"; echo mysql_date_to_unix_timestamp($not_dev->date_visibilite_eleve)."<br />"; echo $timestamp_courant."<br />"; echo $not_dev->contenu."<br />"; echo "</p>"; } */ if ($type_notice != "devoir" || $not_dev->date_visibilite_eleve == "" || $not_dev->date_visibilite_eleve != "" && mysql_date_to_unix_timestamp($not_dev->date_visibilite_eleve) <= $timestamp_courant || verif_groupe_appartient_prof($id_groupe) == 1) { // Passage en HTML // INSERT INTO setting SET name='depolluer_MSOffice', value='y'; if (getSettingValue('depolluer_MSOffice') == 'y') { $content =& preg_replace('#.*<\\!\\[endif\\]-->#', "", $not_dev->contenu); } else { $content =& $not_dev->contenu; } $content .= affiche_docs_joints($not_dev->id_ct, $not_dev->type); echo "<h3 class='see_all_h3'>\n<strong>\n"; if ($not_dev->type == "t") { echo "<a name='travail_" . $not_dev->id_ct . "'></a>"; echo "A faire pour le : "; } else { echo "<a name='compte_rendu_" . $not_dev->id_ct . "'></a>"; } echo strftime("%a %d %b %y", $not_dev->date_ct); echo "</strong>\n</h3>\n"; // Numérotation des notices si plusieurs notices sur la même journée if ($not_dev->type == "c") { if ($date_ct_old == $not_dev->date_ct) { $num_notice++; echo " <strong><em>(notice N° " . $num_notice . ")</em></strong>"; } else {
//echo "Prof ".$tab_ele['cdt'][$j]['entry'][$k]['id_login']."<br />\n"; //echo "Date ".jour_en_fr(date("D",$tab_ele['cdt'][$j]['dev'][$k]['date_ct']))." ".date("d/m/Y",$tab_ele['cdt'][$j]['dev'][$k]['date_ct'])."<br />\n"; //echo $tab_ele['cdt'][$j]['entry'][$k]['contenu']; $chaine_tmp .= "<table class='boireaus' border='1' style='margin:3px; width:100%;' summary='CDT'>\n"; $chaine_tmp .= "<tr style='background-color:{$couleur_entry};'>\n"; $chaine_tmp .= "<td>\n"; $chaine_tmp .= $tab_ele['groupes'][$tab_ele['index_grp'][$tab_ele['cdt'][$j]['entry'][$k]['id_groupe']]]['matiere_nom_complet'] . " <span style='font-size:x-small;'>(" . $tab_ele['groupes'][$tab_ele['index_grp'][$tab_ele['cdt'][$j]['entry'][$k]['id_groupe']]]['name'] . ")</span>"; $chaine_tmp .= "</td>\n"; $chaine_tmp .= "<td>\n"; $chaine_tmp .= $tab_ele['groupes'][$tab_ele['index_grp'][$tab_ele['cdt'][$j]['entry'][$k]['id_groupe']]]['prof_liste'] . "<br />\n"; $chaine_tmp .= "</td>\n"; $chaine_tmp .= "</tr>\n"; $chaine_tmp .= "<tr style='background-color:{$couleur_entry};'>\n"; $chaine_tmp .= "<td colspan='2' style='text-align:left;'>\n"; $chaine_tmp .= nl2br($tab_ele['cdt'][$j]['entry'][$k]['contenu']); $adj = affiche_docs_joints($tab_ele['cdt'][$j]['entry'][$k]['id_ct'], "c"); if ($adj != '') { $chaine_tmp .= "<div style='border: 1px dashed black'>\n"; $chaine_tmp .= $adj; $chaine_tmp .= "</div>\n"; } $chaine_tmp .= "</td>\n"; $chaine_tmp .= "</tr>\n"; $chaine_tmp .= "</table>\n"; } } //echo "</div>\n"; $chaine_tmp .= "</tr>\n"; } //echo "</div>\n"; $chaine_tmp .= "</table>\n";
// A VOIR: Cas des élèves qui changent de classe... $tab_grp = get_groups_for_eleve($login_eleve, $id_classe); } if (count($tab_grp) > 0) { $infos_generales = ""; foreach ($tab_grp as $current_group) { $id_groupe = $current_group['id']; // Affichage des informations générales //$sql="SELECT contenu, id_ct FROM ct_entry WHERE (id_groupe='$id_groupe' and (date_ct='' OR date_ct='0'));"; $sql = "SELECT contenu, id_ct FROM ct_entry WHERE (id_groupe='{$id_groupe}' and date_ct='');"; //echo "$sql<br />"; $appel_info_cahier_texte = mysqli_query($GLOBALS["mysqli"], $sql); $nb_cahier_texte = mysqli_num_rows($appel_info_cahier_texte); $content = @old_mysql_result($appel_info_cahier_texte, 0, 'contenu'); $id_ct = @old_mysql_result($appel_info_cahier_texte, 0, 'id_ct'); $content .= affiche_docs_joints($id_ct, "c"); if ($content != "") { $infos_generales .= "<div class='see_all_general couleur_bord_tableau_notice color_fond_notices_i' style='width:98%;'>"; $infos_generales .= "<h3>" . $current_group['name'] . " (<em>" . $current_group['description'] . " en " . $current_group['classlist_string'] . "</em>)" . "</h3>"; $infos_generales .= $content; $infos_generales .= "</div>"; } } if ($infos_generales != '') { echo "<div style='padding:1em;'>\n"; echo "<h2 class='grande_ligne couleur_bord_tableau_notice'>\n<strong>INFORMATIONS GENERALES</strong>\n</h2>\n"; echo $infos_generales; echo "</div>\n"; } } echo "<hr />\n";
function travaux_a_faire_cdt_cours($id_cours, $login_eleve, $id_classe) { global $ts_debut_jour, $ts_debut_jour_suivant, $ts_display_date, $display_date, $tab_group_edt, $tab_couleur_matiere, $CDTPeutPointerTravailFait; global $tab_etat_travail_fait, $image_etat, $texte_etat_travail, $class_color_fond_notice; $html = ""; $sql = "SELECT * FROM edt_cours WHERE id_cours='" . $_GET['id_cours'] . "';"; //$html.="$sql<br />"; $res = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res) == 0) { $html .= "Cours n°" . $_GET['id_cours'] . " non trouvé."; } else { $lig_cours = mysqli_fetch_object($res); $tmp_tab_display_date = explode("/", $display_date); $jour_display_date = $tmp_tab_display_date[0]; $mois_display_date = $tmp_tab_display_date[1]; $annee_display_date = $tmp_tab_display_date[2]; if (getSettingValue("GepiCahierTexteVersion") == '2') { if (in_array($_SESSION['statut'], array('eleve', 'responsable'))) { $url_cdt = "../cahier_texte_2/consultation.php?year={$annee_display_date}&month={$mois_display_date}&day={$jour_display_date}&login_eleve={$login_eleve}&id_groupe=" . $lig_cours->id_groupe; } else { $url_cdt = "../cahier_texte_2/see_all.php?year={$annee_display_date}&month={$mois_display_date}&day={$jour_display_date}&id_classe={$id_classe}&id_groupe=" . $lig_cours->id_groupe; } } else { if (in_array($_SESSION['statut'], array('eleve', 'responsable'))) { $url_cdt = "../cahier_texte/consultation.php?year={$annee_display_date}&month={$mois_display_date}&day={$jour_display_date}&login_eleve={$login_eleve}&id_groupe=" . $lig_cours->id_groupe; } else { $url_cdt = "../cahier_texte/see_all.php?year={$annee_display_date}&month={$mois_display_date}&day={$jour_display_date}&id_classe={$id_classe}&id_groupe=" . $lig_cours->id_groupe; } } if ($url_cdt != "") { $html .= "<div style='float:right; width:4em; font-size:x-small; text-align:right; margin: 3px;'><a href='{$url_cdt}' title=\"Consulter l'ensemble du cahier de textes pour l'enseignement choisi.\"><img src='../images/icons/chercher.png' class='icone16' alt='Tout voir' /></a></div>"; } $temoin_rss_ele = retourne_temoin_ou_lien_rss($login_eleve); if ($temoin_rss_ele != "") { $html .= "<div style='float:right; margin-right:0.5em; '>" . $temoin_rss_ele . "</div>\n"; } $html .= "<div style='font-weight:bold; font-size: large;' class='fieldset_opacite50'>Cahier de textes</div>"; if (!isset($tab_group_edt[$lig_cours->id_groupe])) { $tab_group_edt[$lig_cours->id_groupe] = get_group($lig_cours->id_groupe, array('matieres', 'classes', 'profs')); } $current_matiere_cdt = $tab_group_edt[$lig_cours->id_groupe]['matiere']['nom_complet']; if (!isset($tab_couleur_matiere[$tab_group_edt[$lig_cours->id_groupe]['matiere']['matiere']])) { $tab_couleur_matiere[$tab_group_edt[$lig_cours->id_groupe]['matiere']['matiere']] = get_couleur_edt_matiere($tab_group_edt[$lig_cours->id_groupe]['matiere']['matiere']); } $html .= "<p class='bold'>{$current_matiere_cdt}</p>"; $delai = getSettingValue("delai_devoirs"); if ($delai == "" || $delai == 0 || !preg_match("/^[0-9]{1,}\$/", $delai)) { $html .= "<p style='margin-left:4em; text-indent:-4em; color:red'>Erreur : Délai de visualisation du travail personnel non défini.<br />Contactez l'administrateur de GEPI de votre établissement.</p>"; $delai = 1; } $ts_max = time() + 3600 * 24 * $delai; $sql = "SELECT DISTINCT cde.* FROM ct_devoirs_entry cde\n\t\t\t\tWHERE cde.id_groupe='" . $lig_cours->id_groupe . "' AND \n\t\t\t\t\tcde.contenu!='' AND \n\t\t\t\t\tcde.date_ct>='" . $ts_debut_jour . "' AND \n\t\t\t\t\tcde.date_ct<'" . $ts_max . "' AND \n\t\t\t\t\tcde.date_visibilite_eleve<='" . strftime("%Y-%m-%d %H:%M:%S") . "'\n\t\t\t\t\tORDER BY date_ct;"; //$html.="$sql<br />"; $res = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res) == 0) { $html .= "Aucun travail à faire donné à ce jour pour les {$delai} jour(s) qui vien(nen)t."; } else { while ($lig = mysqli_fetch_object($res)) { $html .= "<p>Travaux personnels pour le " . strftime("%a %d %b", $lig->date_ct) . "</p>"; $class_color_fond_notice = ""; $temoin_travail_fait_ou_non = ""; if ($CDTPeutPointerTravailFait) { //$html.="plop"; get_etat_et_img_cdt_travail_fait($lig->id_ct); // La fonction renseigne les variables $tab_etat_travail_fait, $image_etat, $texte_etat_travail, $class_color_fond_notice; $temoin_travail_fait_ou_non = "<div id='div_etat_travail_" . $lig->id_ct . "' style='float:right; width: 16px; margin: 2px; text-align: center;'><a href=\"javascript:cdt_modif_etat_travail('" . $login_eleve . "', '" . $lig->id_ct . "')\" title=\"{$texte_etat_travail}\"><img src='{$image_etat}' class='icone16' /></a></div>\n"; } //background-color:".$tab_couleur_matiere[$tab_group_edt[$lig->id_groupe]['matiere']['matiere']]."; $html .= "\n\t\t\t<div style='border:1px solid black; margin:3px; background-color:" . $tab_couleur_matiere[$tab_group_edt[$lig_cours->id_groupe]['matiere']['matiere']] . ";' class='fieldset_opacite50'>\n\t\t\t<div id='div_travail_" . $lig->id_ct . "' style='padding:2px;' class='{$class_color_fond_notice}'>" . $temoin_travail_fait_ou_non . "\n\t\t\t\t" . $lig->contenu . "\n\t\t\t\t" . affiche_docs_joints($lig->id_ct, "t") . "\n\t\t\t</div>\n\t\t</div>"; } } } return $html; }