/** Get Ed Centers **/ $centers = get_edCenters(); foreach ($centers as $center_id => $short_name) { /** Get Teachers **/ $teachers = get_users_for_center($center_id, 'isTeacher', 'Y', "users.last_name, users.first_name"); foreach ($teachers as $teacher_id => $teacher_name) { $tinfo = get_teacher_info($teacher_id); $tuname = $tinfo['u_name']; /** Get Courses **/ $sql = "\n SELECT courses.course_id, courses.course_name\n FROM courses\n WHERE courses.teacher_id=" . $teacher_id . "\n AND courses.school_year_id=" . $yid . "\n AND courses.ed_center=" . $center_id; $result = $db->query($sql); $courses = make_array_from_sql($result, 'course_id', array('course_name'), ''); foreach ($courses as $course_id => $course_name) { /** Get Classes **/ /** class_id=>term_name course_name **/ $classes = get_teacher_classes_by_course($course_id); foreach ($classes as $class_id => $class_name) { list($term, $course) = preg_split("/ - /", $class_name); if ($term == $current_term_name) { $save_path = $start_path . $short_name . "/" . $tuname . "/" . $course_name . "/" . $term . "/"; $save_file = $today . ".sql"; if (!is_dir($save_path)) { mkdir($save_path); chgrp($save_path, "AIT_Grades"); chmod($save_path, 0774); } /** check to see if there are more than 7 files and remove to 7 **/ $open_path = preg_replace("/ /i", "\\ ", $save_path); $dir = opendir($save_path); $list = array(); while ($file = readdir($dir)) {
$pdf->Cell($pw, $titleh, $pageTitle, 0, 1, 'C', 1); $page .= $pageTitle . "<br>"; $y_coord += $titleh; $pdf->SetXY($x_coord, $y_coord); $pdf->SetTextColor(255, 0, 0); $pdf->SetFont('Times', '', '12'); $pdf->Cell($pw, $termh, $note, 0, 1, 'C', 1); $page .= $note . "<br>"; $pdf->SetTextColor(0, 0, 0); $y_coord += $termh; $pdf->SetXY($x_coord, $y_coord); $termw = ($pw - ($overallavw + $studentw)) / $numTerms; $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;