Exemple #1
0
<?php

require_once '../../config.php';
require_once $CFG->dirroot . '/blocks/student_gradeviewer/report/lib.php';
require_login();
$courseid = required_param('id', PARAM_INT);
$course = has_reporting_permission($courseid);
// If they came here from a GET, redirect back
$data = data_submitted();
if (!$data) {
    redirect($CFG->wwwroot . '/course/view.php?id=' . $courseid);
}
// Instantiate report form
$report_form = new report_form($courseid, $data);
// Print the header and heading
$blockname = get_string('blockname', 'block_athelete_reporting');
$heading = get_string('report', 'block_athelete_reporting');
$navigation = array(array('name' => $course->idnumber, 'link' => $CFG->wwwroot . '/course/view.php?id=' . $courseid, 'type' => 'title'), array('name' => $blockname, 'link' => '', 'type' => 'title'), array('name' => $heading, 'link' => '', 'type' => 'title'));
print_header_simple($heading, '', build_navigation($navigation));
// Print report heading
$report_form->print_heading($heading);
// If they submitted a report form, then process it and die
if ($report_form->submitted()) {
    $report_form->process($data);
    print_footer();
    die;
}
// Print the list of selected users
$report_form->print_selected_users();
$report_form->print_form();
print_footer();
Exemple #2
0
require_once '../../config.php';
require_once 'lib.php';
require_login();
// Course id required
$courseid = required_param('id', PARAM_INT);
$course = has_reporting_permission($courseid);
// Print the header and heading
$blockname = get_string('blockname', 'block_student_reporting');
$heading = get_string('report', 'block_student_reporting');
$navigation = array(array('name' => $course->shortname, 'link' => $CFG->wwwroot . '/course/view.php?id=' . $courseid, 'type' => 'title'), array('name' => $blockname, 'link' => '', 'type' => 'title'), array('name' => get_string('select', 'block_student_reporting'), 'link' => $CFG->wwwroot . '/blocks/student_reporting/select.php?id=' . $courseid, 'type' => 'title'), array('name' => $heading, 'link' => '', 'type' => 'title'));
print_header_simple($heading, '', build_navigation($navigation));
// If they selected some members, then get those;
// otherwise prepare a report for every student
// in this course
if ($data = data_submitted()) {
    $referral_form = new report_form($courseid, $data);
} else {
    $referral_form = new report_form($courseid);
    $referral_form->users = get_all_students($course);
}
$referral_form->print_heading($heading);
if ($referral_form->submitted()) {
    // Notify students that they have been referred
    $referral_form->process($data);
    print_footer();
    die;
}
$referral_form->print_selected_users();
$referral_form->print_form();
print_footer();