//$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 .= "<td align=center>" . $cname . " " . (int) ($minutes / 60) . ":" . sprintf("%02d", $minutes % 60) . "</td></tr>"; } //$b .= make_attendance_table($att); } $b .= "</table>\n </center>"; $main .= make_box($t, $b); } elseif (isset($_SESSION[$_CONF['sess_name'] . '_selected_course'])) { $result = get_students_for_course($cid); $students = make_array_from_mysql($result, "user_id", array('first_name', 'last_name'), " "); $t = "Student WBL Hours Report"; $b = "\n <center>\n <table>\n "; foreach ($students as $uid => $uname) { $minutes = 0; $sname = $uname; $sid = $uid; $loc = get_student_core_class_list($sid, $tid); foreach ($loc as $cid => $cname) { $att = array(); $b .= "<tr><td>" . $sname . "</td>"; 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 {
$pdf->SetFont('Times', 'B', $termfs); $pdf->Cell($studentw, 2 * $termh, 'Student Names', 0, 0, 'C', 1); $x_coord += $studentw; $classes = get_teacher_classes_by_course($courseID); foreach ($terms as $termID => $termInfo) { $pdf->Cell($termw, $termh, $termInfo['term_name'], 0, 2, 'C', 1); $page .= $termInfo['term_name'] . " "; $pdf->Cell($termw, $termh, $termInfo['term_weight'] . "%", 0, 0, 'C', 1); $x_coord += $termw; $pdf->SetXY($x_coord, $y_coord); } $pdf->Cell($overallavw, 2 * $termh, 'Overall Avg.', 0, 1, 'C', 1); $pdf->SetFillColor(255, 255, 255); $x_coord = $lm; $y_coord += 2 * $termh; $result = get_students_for_course($courseID); $students = make_assoc_array_from_sql($result, 'user_id', 'my'); foreach ($students as $sid => $studentInfoArray) { $avgSum = $percentSum = $termCount = 0; $pdf->SetFont('Times', '', $studentfs); $pdf->Cell($studentw, $studenth, $studentInfoArray['first_name'] . " " . $studentInfoArray['last_name'], 0, 0, 'C', 1); $page .= $studentInfoArray['first_name'] . " " . $studentInfoArray['last_name'] . " "; foreach ($classes as $class_id => $classTitle) { $reports = getReportForStudent($sid, $courseInfo['user_id'], $class_id); if (!empty($reports)) { $termID = $reports[$sid]['classInfo']['term_id']; if ($reports[$sid]['overallCalculatedAverage'] > 0) { $termWeight = $terms[$termID]['term_weight']; $avgSum += $reports[$sid]['overallCalculatedAverage'] * ($termWeight / 100); $percentSum += $termWeight; $termCount++;
$msg .= $sql . "<br>"; $result = $db->query($sql); $wbl[$id] = "\n\t\t\t<tr id=\"wbl_" . $id . "\">\n\t\t\t\t<td bgcolor=white>\n\t\t\t\t\t<input type=checkbox name=job_" . $id . " id=job_" . $id . " value=job_" . $id . " />\n\t\t\t\t</td>\n\t\t\t\t<td bgcolor=white><span style=white-space:nowrap>" . $fields['type'] . "</span></td>\n <td bgcolor=white><span style=white-space:nowrap>" . substr($fields['job'], 0, 50) . "...</span></td>\n <td bgcolor=white><span style=white-space:nowrap>" . $fields['date'] . "</span></td>\n <td bgcolor=white><span style=white-space:nowrap>" . $fields['contact'] . "</span></td>\n <td bgcolor=white><span style=white-space:nowrap>" . $fields['location'] . "</span></td>\n <td bgcolor=white><span style=white-space:nowrap>" . $fields['minutes'] . "</span></td>\n <td><input type=submit class=\"wblStudents\" jobID=\"" . $id . "\" value=\"Students\" /></td>\n\t\t\t</tr>"; } $wblArray = array('error' => $error, 'message' => $msg, 'updateWBL' => $wbl); echo json_encode($wblArray); } // end updateWBL if (isset($_POST['student2wbl'])) { $sql = "SELECT job from wbl where wbl_id=" . $_POST['jobID']; $result = $db->query($sql); $row = $result->fetch_assoc(); $error = false; $courseID = $_SESSION[$_CONF['sess_name'] . '_selected_course']; // get the list of students for the current course... $myStudents_ID = make_assoc_array_from_sql(get_students_for_course($courseID), 'user_id', 'my'); // get students already assigned to the job $sql2 = "SELECT * from student2wbl where wbl_id=" . $_POST['jobID']; $result2 = $db->query($sql2); $students = make_assoc_array_from_sql($result2, 'student_id', 'my'); $ret .= "<center>" . "<table>"; foreach ($myStudents_ID as $id => $info) { $ret .= "\n <tr>\n <td>\n <input type=checkbox id=\"student_" . $id . "\" name=\"student_" . $id . "\""; if (array_key_exists($id, $students)) { $ret .= " checked"; } $ret .= " />" . $info['first_name'] . " " . $info['last_name'] . "</td>\n </tr>\n "; } $ret .= "\n </table>\n <input type=hidden name=jobID value=" . $_POST['jobID'] . " id=\"jobID\" />\n </center>"; $wbl = $ret; $wblArray = array('error' => $error, 'message' => $msg, 'students2WBL' => $wbl);
require 'fpdf.php'; include '_includeSessionConfig.php'; $loginError = check_auth($_SESSION[$_CONF['sess_name'] . '_username'], $_SESSION[$_CONF['sess_name'] . '_password']); $today = date('Y-m-d'); if (!$loginError['error_value']) { $cid = $_SESSION[$_CONF['sess_name'] . '_selected_course']; $tid = $_POST['teacherID']; $row = get_teacher_info($tid); $teaacherName = $row['first_name'] . " " . $row['last_name']; $yid = $_SESSION[$_CONF['sess_name'] . '_current_school_year']; $sid = $_SESSION[$_CONF['sess_name'] . '_myCenter']; $terms = get_terms($yid, $sid); $termsArray = make_assoc_array_from_sql($terms, 'term_id', 'my'); if ($cid != -1) { $result = get_students_for_course($cid); $students = make_assoc_array_from_sql(get_students_for_course($cid), 'user_id', 'my'); $result = get_course_info($cid); $row = $result->fetch_assoc(); $courseName = $row['course_name']; /** NOW FOR THE PDF STUFF **/ $lm = 0.5; /** left marging**/ $tm = 0.5; /** top margin**/ $ph = 11 - 2 * $tm; /** page width - margins**/ $pw = 8.5 - 2 * $lm; /** page height - margins**/ $rh = 0.25; /** height for attendance row **/ $hh = 0.4;
$absRecord = array('AbsType' => $_POST['attendValue'], 'AbsDate' => $_POST['dateSelector'], 'ExtraHours' => '', 'Comment' => $note, 'SectionID' => '', 'STGUID' => ''); foreach ($coursesArray as $course) { if ($_POST['attendValue'] == 0) { $absRecord['ExtraHours'] = 0; } elseif ($_POST['attendValue'] == 'Unexcused-Abs' || $_POST['attendValue'] == 'Excused-Abs' || $_POST['attendValue'] == 'Suspended' || $_POST['attendValue'] == 'WBL-Abssent') { $absRecord['ExtraHours'] = 0; } else { $absRecord['ExtraHours'] = $course['minutes'] - $_POST['a_minutes']; } if ($absRecord['ExtraHours'] < 0) { $absRecord['ExtraHours'] = 0; // just in case a class is shorter than the post minutes.... } $absRecord['SectionID'] = $course['SectionID']; //."{".$course['course_name']."}"; $result2 = get_students_for_course($course['course_id']); //$SMSmsg .= "$ schoolID = ".$schoolID." course = ".$course['course_name']."<br>"; while ($row2 = $result2->fetch_assoc()) { //$SMSmsg .= displayArray2($row2)."<hr>"; if ($schoolID == $row2['school_id']) { $absRecord['STGUID'] = $row2['STGUID']; //."{".$row2['first_name']." ".$row2['last_name']."}"; //array_push($studentList, $absRecord); $SMSmsg .= $course['course_name'] . " - " . $row2['first_name'] . " " . $row2['last_name'] . "<br>"; $SMSmsg .= updateSMSAttend($absRecord) . "<br />"; //$sql2 = "INSERT into AbsTransactions (".implode(',', array_keys($absRecord)).") VALUES('". implode("','", $absRecord)."')"; } } } } $main .= make_box("Bulk Attend", $SMSmsg);
// used to create query for SMS system... if ($_SESSION[$_CONF['sess_name'] . '_isTeacher']) { /** * SMS Attendace values differ from mine, so create an array for translating... */ $myStudents_GUID = ""; $myStudents_ID = ""; $ait2smsAttend = array('absent' => 'Unexcused-Abs', 'excused' => 'Excused-Abs', 'tardy' => 'Tardy', 'present' => 'Present'); $sms2aitAttend = array('Unexcused-Abs' => 'absent', 'Excused-Abs' => 'excused', 'Tardy' => 'tardy', 'Present' => 'present'); /** create js function to deal with attend_".$row['user_id']."_student.checked=true from the notes ...**/ /** Display the list of classes **/ $cid = -1; if (isset($_SESSION[$_CONF['sess_name'] . '_selected_course']) && $_SESSION[$_CONF['sess_name'] . '_selected_course'] != -1) { $cid = $_SESSION[$_CONF['sess_name'] . '_selected_course']; $myStudents_ID = make_assoc_array_from_sql(get_students_for_course($cid), 'user_id', 'my'); $myStudents_GUID = make_assoc_array_from_sql(get_students_for_course($cid), 'STGUID', 'my'); $result = get_course_info($cid); $row = $result->fetch_assoc(); $cname = $row['course_name']; $classMinutes = $row['minutes']; $SectionID = $row['SectionID']; } $core_classes = get_teacher_course_list($_SESSION[$_CONF['sess_name'] . '_myUID'], $_SESSION[$_CONF['sess_name'] . '_current_school_year'], $_SESSION[$_CONF['sess_name'] . '_myCenter'], 'Y'); $displayForm = false; if (array_key_exists($cid, $core_classes)) { $displayForm = true; } else { $cid = $_SESSION[$_CONF['sess_name'] . '_selected_course'] = -1; } $t = "Teacher Attendance"; $b = "\n\t\t<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=\"post\" name=courses>\n\t\t<center>" . make_selection_list($core_classes, $cid, 'course_id', 'courses', 'Course', 'on') . "</center>\n\t\t</form>\n";