Ejemplo n.º 1
0
$PAGE->navbar->add(get_string('viewtranscript', 'local_request'));
$mform = new transcriptform();
$data = $mform->get_data();
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('viewtranscript', 'local_request'));
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('transcriptdesc', 'local_request'));
}

$mform->display();
$returnurl = new moodle_url('/local/myacademics/index.php');
if ($mform->is_cancelled()) {
    redirect($returnurl);
}
if ($data) {
    $grades = $request->myacademics_grades($data->programid, $data->semesterid);
    $data = array();
    foreach ($grades as $grade) {
        $result = array();
        $result[] = $DB->get_field('local_clclasses', 'fullname', array('id' => $grade->classid));
        $result[] = $DB->get_field('local_semester', 'fullname', array('id' => $grade->semesterid));
        $result[] = $DB->get_field('local_program', 'fullname', array('id' => $grade->programid));
        $result[] = $grade->coursetotal;
        $result[] = $grade->percentage;
        $result[] = $grade->gradeletter;
        $wgp = $request->total_grade_points($grade->gradepoint, $grade->classid);
        $result[] = $wgp;
        $data[] = $result;
        $totalgradepoints = $totalgradepoints + $wgp;
        $credits = $request->total_grade_credits($grade->classid);
        $totalcredits = $totalcredits + $credits;