<?php if ($_SESSION[$_CONF['sess_name'] . '_isParent']) { $pid = $_SESSION[$_CONF['sess_name'] . '_myUID']; $t = "Student Attendance"; $b = "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=studentClasses>"; //$b=""; $sid = -1; if (isset($_SESSION[$_CONF['sess_name'] . '_selected_student'])) { $sid = $_SESSION[$_CONF['sess_name'] . '_selected_student']; } $b .= "<center>" . make_selection_list(get_students_for_parent($pid), $sid, 'student_id', 'studentClasses', 'Student', 'on') . "</center>"; if ($sid != -1) { $sql2 = "SELECT user_id,first_name,last_name from users where user_id=" . $sid; $result2 = $db->query($sql2); $colcount = 0; $row2 = $result2->fetch_assoc(); $sname = $row2['first_name'] . " " . $row2['last_name']; $b .= "<div style=\"text-align:center\"><a href=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . "&s_id=" . $sid . ">" . $sname . "</a></div><br />"; $loc = get_student_classes_for_attendance($sid); foreach ($loc as $cname => $info) { $att = array(); $b .= "<div style=\"text-align:center;font-weight:bold\">" . $cname . "</div><br />"; foreach ($info as $cid => $name_term) { if (isset($_POST['year'])) { $att = array_merge($att, get_student_attendance($sid, $cid, $_POST['year'])); //$att = array_merge($att,get_student_attendance($sid,$cid, $name, $_POST['year'])); //$att = array_merge($att,getSMSStudentAttendance($sid,$cid, $_POST['year'],$_SESSION[$_CONF['sess_name'].'_myCenter'])); } else { $att = array_merge($att, get_student_attendance($sid, $cid, $_SESSION[$_CONF['sess_name'] . '_current_school_year'])); //$att = array_merge($att,get_student_attendance($sid,$cid,$name, $_SESSION[$_CONF['sess_name'].'_current_school_year']));
if ($_SESSION[$_CONF['sess_name'] . '_isParent']) { $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>";
$sql1 = "SELECT users.user_id, users.first_name, users.last_name, users.email\n\t\tFROM users, user2center\n\t\tWHERE user2center.isParent='Y'\n\t\tAND user2center.isActive='Y'\n\t\tAND users.user_id=user2center.user_id\n\t\tAND users.weekly_progress='Y'\n Group By users.user_id"; } else { /** for testing only **/ $web .= "<h2>Testing Email System</h2>"; $sql1 = "SELECT * from users where user_id=1"; } //print $sql1."<br>"; $result1 = $db->query($sql1); while ($row1 = $result1->fetch_assoc()) { $pemail = $row1['email']; $pname = $row1['first_name'] . " " . $row1['last_name']; if ($testing || $printWeb) { $web .= "<h2>Working on Parent {" . $pname . "}</h2>\n"; } /** Get the list of students for each parent above **/ $los = get_students_for_parent($row1['user_id']); //displayArray($los); foreach ($los as $sid => $sname) { /** Get the list of classes for each student above for current term **/ /** let the function handle the current term by checking class.term_id and term.start&end **/ $loc = get_student_classes_for_term($sid); $web .= "<h4>Working on Student {" . $sname . " (" . $sid . ")}</h4>\n"; $web .= displayArray2($loc); foreach ($loc as $cid => $cname) { /** Retrieve the report for each of the classes above **/ //$web .= displayArray2($row2); $result2 = get_class_info($cid); $web .= "<hr>Working on Class {" . $cname . "}<br />\n"; $row2 = $result2->fetch_assoc(); $className = $row2['course_name']; $tid = $row2['user_id'];
<?php if ($_SESSION[$_CONF['sess_name'] . '_isParent']) { $pid = $_SESSION[$_CONF['sess_name'] . '_myUID']; $bc = "blue"; // default box color $print_button = ""; $t = "Student List"; $los = get_students_for_parent($pid); $sid = -1; if (isset($_SESSION[$_CONF['sess_name'] . '_selected_student'])) { $sid = $_SESSION[$_CONF['sess_name'] . '_selected_student']; if (!array_key_exists($sid, $los)) { $sid = -1; } } $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>"; $b .= "<br /></form>"; $body = "<center>" . $b . "</center>"; $main .= make_box($t, $body, $bc); if ($sid != -1) { include 'multiClassProgress_report.php'; $report = $b; //.$print_button; $main .= make_box($t, $report); } } else { $main .= login_error(); }
$sql2 = "SELECT student_id from parent2student where parent_id=" . $_POST['parentid']; $result2 = $db->query($sql2); $stud_array = array(); while ($row2 = $result2->fetch_assoc()) { array_push($stud_array, $row2['student_id']); } $t = "Parent -> Students"; $b .= "\n\t\t\t<br />\n\t\t\t<center>\n\t\t\t<TABLE width=350 border=0 cellspacing=0 cellpadding=2 bgcolor=white>\n\t\t\t<TR><TH colspan=2>Parent to Student Link</TH></TR>"; // get parents name... $sql = "SELECT first_name, last_name from users where user_id=" . $_POST['parentid']; $result = $db->query($sql); $row = $result->fetch_assoc(); $b .= "\n <TR><TH colspan=2>Linking to Parent : " . $row['first_name'] . " " . $row['last_name'] . "</TH></TR>\n </table>"; /** now for the new way of adding/removing students. Use a selection list with "Add" button Then use checkboxes next to names and a remove button. Keep the copy from **/ $paired = get_students_for_parent($_POST['parentid']); $list = get_users_for_center($_SESSION[$_CONF['sess_name'] . '_adminCenterID'], 'isStudent', 'Y', 'users.last_name, users.first_name'); $studentList = make_selection_list($list, $selected, 'student_id', 'studentSelectList', 'Student', 'off'); $b .= "\n <div id=pairedStudentsDiv><h2>Current List</h2>\n <table id=\"pairedTable\" background=white cellspacing=1 cellpadding=3>\n <thead>\n <tr>\n <th colspan=2>\n <form id=studentSelectList name=studentSelectList action\"\" method=post>" . $studentList . "<input type=submit name=pairStudent id=pairStudent value=Add />\n <input type=hidden name=parentid id=parentid value=" . $_POST['parentid'] . " />\n </form>\n </th>\n </tr>\n </thead>\n <tbody id=\"pairedTableBody\">\n <form id=studentListForm name=studentListForm action=\"\" method=post>"; foreach ($paired as $id => $name) { $b .= "\n <tr><td><input type=checkbox id=s_" . $id . " name=s_" . $id . " class=studentCheckbox></td><td>" . $name . "</td></tr>"; } $b .= "\n </tbody>\n <tfoot>\n <tr>\n <td colspan=2>\n <input type=submit id=unPairStudent name=unPairStudent value=Remove />\n <input type=hidden name=parentid id=parentid value=" . $_POST['parentid'] . " />\n </td>\n </tr>\n </tfoot>\n </table>\n </form>\n </div>\n "; $b .= "\n </center>"; } $main .= make_box($t, $b); } else { $main .= login_error(); }