Пример #1
0
//$course         = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
//$att            = $DB->get_record('attendance', array('id' => $cm->instance), '*', MUST_EXIST);

$att = $DB->get_record('local_attendance', array('id' => $id), '*', MUST_EXIST);
$classinfo = $DB->get_record('local_clclasses', array('id' => $att->classid));
//$sacademicyearinfo  = $DB->get_record('local_academicyear', array('id' =>$sessioninfo ->academicyearid ));
$PAGE->set_context(context_system::instance());

require_login();

$pageparams->init($classinfo);
$att = new local_attendance($att, $classinfo, $PAGE->context, $pageparams);

$att->perm->require_view_reports_capability();

$PAGE->set_url($att->url_report());
$PAGE->set_pagelayout('report');
//$PAGE->set_title($course->shortname. ": ".$att->name.' - '.get_string('report', 'attendance'));
//$PAGE->set_heading($course->fullname);
$PAGE->set_cacheable(true);
//$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'attendance'));
$PAGE->navbar->add(get_string('report', 'local_attendance'));

$output = $PAGE->get_renderer('local_attendance');
$tabs = new local_attendance_tabs($att, local_attendance_tabs::TAB_REPORT);
$filtercontrols = new local_attendance_filter_controls($att, true);
$reportdata = new local_attendance_report_data($att);

$args = array($classinfo->id, 'attendance', 'report viewed', '/local/attendance/report.php?id=' . $id, '', $att->id);
//call_user_func_array('add_to_log', $args);
// Output starts here.