Ejemplo n.º 1
0
<h2>Classes</h2>
<br>
<?php 
$classes = Classe::getClasses();
foreach ($classes as $class) {
    echo '<div class="sidebar-link"><a href="main.php?sidebar=subject&class_id=' . $class->getId() . '">' . $class->getClass() . '</a></div>';
}
Ejemplo n.º 2
0
 public static function GenerateCalendarList()
 {
     $result = '';
     $calendriers = Calendrier::getCalendriers();
     $classes = Classe::getClasses();
     if ($calendriers) {
         $i = 0;
         $jointure = new jointure_calendar_classes();
         while (isset($calendriers['id'][$i])) {
             $result .= "<div id=\"calendrier_" . $calendriers['id'][$i] . "\" class=\"cadre_calendrier\">";
             $result .= "<div style=\"float:left;width:30px;\"><img style=\"border:0px;padding:0px;margin:0;\" src=\"./lib/template/images/calendar.png\" alt=\"\" \\></div>";
             $result .= "<div style=\"padding-top:3px;float:left;width:60%;top:0px;padding-left:10px;\">" . $calendriers['nom'][$i] . "</div>";
             $result .= "<div class=\"bouton_loupe\">\r\n\t\t\t\t\t\t\t<a href=\"index.php?action=calendrier&id_calendrier=" . $calendriers['id'][$i] . "\">\r\n\t\t\t\t\t\t\t<img src=\"./lib/template/images/loupe.png\" alt=\"voir les périodes calendaires\" title=\"voir les périodes calendaires\"/>\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t</div>";
             $result .= "<div class=\"bouton_supprimer\">\r\n\t\t\t\t\t\t\t<a href=\"index.php?action=calendriermanager&operation=delete&id_calendrier=" . $calendriers['id'][$i] . add_token_in_url() . "\">\r\n\t\t\t\t\t\t\t<img src=\"./lib/template/images/erase.png\" alt=\"supprimer\" title=\"supprimer le calendrier\"/>\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t</div>";
             $result .= "<div class=\"bouton_modifier\">\r\n\t\t\t\t\t\t\t<a href=\"index.php?action=calendriermanager&operation=modify_name&id_calendrier=" . $calendriers['id'][$i] . add_token_in_url() . "\">\r\n\t\t\t\t\t\t\t<img src=\"./lib/template/images/modif.png\" alt=\"modifier le nom\" title=\"modifier le nom du calendrier\"/>\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t</div>";
             $result .= "</div>";
             $result .= "<div style=\"background-color:white;\r\n\t\t\t\t\t\t\t\t\t\twidth:73%;\r\n\t\t\t\t\t\t\t\t\t\tmargin:0 auto;\r\n\t\t\t\t\t\t\t\t\t\tborder-top:3px solid #aaaaaa;\r\n\t\t\t\t\t\t\t\t\t\tborder-right:1px solid #bbbbbb;\r\n\t\t\t\t\t\t\t\t\t\tborder-left:1px solid #bbbbbb;\r\n\t\t\t\t\t\t\t\t\t\tborder-bottom:1px solid #bbbbbb;\r\n\t\t\t\t\t\t\t\t\t\tposition:relative;\r\n\t\t\t\t\t\t\t\t\t\tpadding:20px;\">";
             $result .= "<form action=\"index.php?action=calendriermanager\" method=\"post\">";
             $result .= add_token_field();
             $result .= "<input name=\"operation\" type=\"hidden\" value=\"edit_classes\">";
             $result .= "<input name=\"id_calendrier\" type=\"hidden\" value=\"" . $calendriers['id'][$i] . "\">";
             $j = 0;
             $jointure->id_calendar = $calendriers['id'][$i];
             while (isset($classes['id'][$j])) {
                 $jointure->id_classe = $classes['id'][$j];
                 if ($jointure->exists()) {
                     $result .= "\t<p style=\"width:70px;font-size:12px;float:left;\">\r\n\t\t\t\t\t\t\t\t\t<input style=\"border:0px\" type=\"checkbox\" checked name=\"classes_" . $calendriers['id'][$i] . "[]\" value=\"" . $classes['id'][$j] . "\">" . $classes['nom'][$j] . "\r\n\t\t\t\t\t\t\t\t\t</p>";
                 } else {
                     if ($jointure->bad_calendar()) {
                         $result .= "\t<p style=\"width:70px;font-size:12px;float:left;\">\r\n\t\t\t\t\t\t\t\t\t<input style=\"border:0px\" type=\"checkbox\" disabled name=\"classes_" . $calendriers['id'][$i] . "[]\" value=\"" . $classes['id'][$j] . "\">" . $classes['nom'][$j] . "\r\n\t\t\t\t\t\t\t\t\t</p>";
                     } else {
                         $result .= "\t<p style=\"width:70px;font-size:12px;float:left;\">\r\n\t\t\t\t\t\t\t\t\t<input style=\"border:0px\" type=\"checkbox\" name=\"classes_" . $calendriers['id'][$i] . "[]\" value=\"" . $classes['id'][$j] . "\">" . $classes['nom'][$j] . "\r\n\t\t\t\t\t\t\t\t\t</p>";
                     }
                 }
                 $j++;
             }
             $result .= "<div style=\"clear:both;\">";
             $result .= "<input type=\"submit\" value=\"Valider les classes\">";
             $result .= "</form>";
             $result .= "</div></div>";
             $i++;
         }
     }
     return $result;
 }