$result = get_students_for_district($_POST['school_id']); $students = make_assoc_array_from_sql($result, "user_id", "my"); $t = "Student WBL Hours Report"; $b = "\n <center>\n <table>\n "; foreach ($students as $sid => $student) { $sname = $uname; $loc = get_student_core_class_list($sid); foreach ($loc as $cid => $cname) { $minutes = 0; $att = array(); if (isset($_POST['year'])) { //$att = array_merge($att,getSMSStudentAttendance($sid,$cid, $_POST['year'],$_SESSION[$_CONF['sess_name'].'_myCenter'])); $att = array_merge($att, get_student_attendance($sid, $cid, $_POST['year'], $_SESSION[$_CONF['sess_name'] . '_myCenter'])); } else { //$att = array_merge($att,getSMSStudentAttendance($sid,$cid, $_SESSION[$_CONF['sess_name'].'_current_school_year'],$_SESSION[$_CONF['sess_name'].'_myCenter'])); $att = array_merge($att, get_student_attendance($sid, $cid, $_SESSION[$_CONF['sess_name'] . '_current_school_year'], $_SESSION[$_CONF['sess_name'] . '_myCenter'])); } foreach ($att as $a => $i) { foreach ($i as $d => $info) { $minutes += $info['minutes']; } } $b .= "<tr><td>" . $student['first_name'] . " " . $student['last_name'] . " {" . $cname . "} " . (int) ($minutes / 60) . ":" . sprintf("%02d", $minutes % 60) . "</td></tr>"; } } $b .= "</table>\n </center>"; $main .= make_box($t, $b); } else { /** *This is the default selection ie. teacher... */
$student_result = mysql_query($sql_str); // Lecture Details $sql_str = "SELECT LectureTable.ID, Number, Password, Active\r\n\t\t\tFROM classtable\r\n\t\t\tINNER JOIN lecturetable ON classtable.id = lecturetable.classid\r\n\t\t\tWHERE classtable.id = {$classid}"; $lec_result = mysql_query($sql_str); $num_lectures = mysql_num_rows($lec_result); $num_students = mysql_num_rows($student_result); // Student Attendance UI echo "<br><br>"; echo "<table>"; echo "<tr><td colspan=2>"; echo "Student Attendance"; echo "</td></tr>"; while ($row = mysql_fetch_array($student_result)) { $sicID = $row['ID']; $sn = $row['StudentNumber']; $attended = get_student_attendance($sicID); echo "<tr>"; echo "<td>{$sn}</td>"; echo "<td>{$attended}/{$num_lectures}</td>"; echo "</tr>"; } echo "</table>"; // Lecture UI echo "<br>"; echo "<form name=active_lecture action='updatelecture.php?classid={$classid}' method=post>"; echo "<table>"; echo "<tr>"; echo "<td>Lecture</td>"; echo "<td>Attendance</td>"; echo "<td>Password</td>"; echo "<td>Active?</td>";