} //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']; $termName = $row2['term_name']; $teacherName = $row2['first_name'] . " " . $row2['last_name']; $web .= "Working on Teacher {" . $teacherName . "}<br />\n"; $result3 = get_user_info($tid); $row3 = $result3->fetch_assoc();
<?php /** * Get classes for each student in $los for selected Term */ foreach ($los as $sid) { $classesArray = get_student_classes_for_term($sid, $termID); // teacherID, not termID ???? $studentGradeInfo = array(); foreach ($classesArray as $cid => $className) { $classes[$cid] = array(); $result = get_class_info($cid); $row = $result->fetch_assoc(); $termName = $row['term_name']; $tid = $row['user_id']; $teacherName = $row['first_name'] . " " . $row['last_name']; /** Get the list of categories for this class **/ $cat_names_array = array(); /** holds the names of the categories for this class **/ $info = array(); /** used to hold grade info like category weight and grade **/ $cat_weight_sum = 0; /** holds category weight sum **/ $my_cat_avg_sum = 0; /** holds my category avg's sum **/ $custom_scores = array(); $custom_scores = get_custom_scores($tid, $_SESSION[$_CONF['sess_name'] . '_current_school_year']); $sql = "SELECT * from categories where class_id=" . $cid; $result = $db->query($sql); if ($result) { while ($row = $result->fetch_assoc()) {