示例#1
0
 $pid = $_SESSION[$_CONF['sess_name'] . '_myUID'];
 $bc = "blue";
 $t = "Parent Homework Site";
 $b = "<FORM action=" . $_SERVER['PHP_SELF'] . "?lev=" . $_GET['lev'] . "&cat=" . $_GET['cat'] . " method=POST name=studentHomework>";
 if (isset($_REQUEST['student'])) {
     $sid = $_REQUEST['student'];
 } else {
     $sid = -1;
 }
 if (isset($_REQUEST['class_id'])) {
     $cid = $_REQUEST['class_id'];
 } else {
     $cid = -1;
 }
 $b .= "<center>" . get_students_for_parent($pid, 'student', "studentHomework", $_REQUEST['student']) . "</center>";
 if ($_POST['student'] && check_parent2student($pid, $sid)) {
     $b .= "<center>" . make_selection_list(student_class_list($sid), $cid, 'class_id', 'studentHomework', 'Class', 'on') . "</center>";
     if ($_REQUEST['class_id']) {
         if (isset($_REQUEST['view'])) {
             // retrieve and display the assignment
             $sql = "SELECT assignment,date from homework where homework_id=" . $_REQUEST['assignment_num'];
             $result = mysql_query($sql);
             $row = mysql_fetch_assoc($result);
             list($y, $m, $d) = split("-", $row['date']);
             $b .= "<hr width=80%>";
             $b .= "HW for <b>" . date("l, F j, Y", mktime(0, 0, 0, $m, $d, $y)) . "</b>";
             $b .= "<table border=0 cellspacing=1 cellpadding=3 width=70%>";
             $b .= "<tr><td>";
             $b .= nl2br($row['assignment']);
             $b .= "</td></tr>";
             $b .= "</table>";
示例#2
0
文件: par_rep.php 项目: knichel/AIT
             $cid = -1;
         }
     }
 }
 /** the following is used for sorting the grades on this page only... **/
 if (!isset($_SESSION[$_CONF['sess_name'] . '_progress_sortBy'])) {
     //session_register($_CONF['sess_name'].'_progress_sortBy');
     $_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] = "assignments.due_date asc";
 }
 if (isset($_POST['progress_sortBy'])) {
     $_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] = $_POST['progress_sortBy'];
 }
 $order_by = $_SESSION[$_CONF['sess_name'] . '_progress_sortBy'];
 $b = "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=students>";
 $b .= "<center>" . make_selection_list($los, $sid, 'student_id', 'students', 'Student', 'on') . "</center></form>";
 if ($sid != -1 && check_parent2student($pid, $sid)) {
     $sql = "SELECT first_name, last_name from users where user_id=" . $sid;
     $result = $db->query($sql);
     $myrow = $result->fetch_assoc();
     $fname = $myrow['first_name'];
     $lname = $myrow['last_name'];
     $fullName = $los[$sid];
     $t = "Class List for " . $fname . " " . $lname;
     $t = "Class List for " . $fullName;
     $b .= "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=studentClasses>";
     $b .= "<center>" . make_selection_list($loc, $cid, 'class_id', 'studentClasses', 'Class', 'on') . "\n                <br />\n            Sort Assignments by : \n                <select name=progress_sortBy onChange=document.forms['studentClasses'].submit();>\n                <option value=\"assignments.due_date desc\"";
     if ($_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] == "assignments.due_date desc") {
         $b .= " selected";
     }
     $b .= ">Date (descending)</option>\n                <option value=\"assignments.due_date asc\"";
     if ($_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] == "assignments.due_date asc") {