<?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();
/** * Send a report to the student */ function notify_student($student, $referral, $recovered = false) { global $CFG; $referral->source = $recovered ? 4 : $referral->source; $a->fullname = fullname($student); $a->course_name = $referral->fullname; $a->grade_link = $CFG->wwwroot . '/grade/report/user/index.php?id=' . $referral->courseid . '&userid=' . $student->moodleid; $report_form = new report_form(); $report_form->user = get_record('user', 'id', $referral->referrerid); $report_form->notify_student($student, $a, $referral); }
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. require_once '../../../config.php'; require_once 'report.class.php'; require_once 'report_create_pivot_form.class.php'; require_login(); $PAGE->set_context(context_system::instance()); $PAGE->set_pagelayout('standard'); $PAGE->set_url(new moodle_url('/blocks/dial_rewards/info_pages/report_create_pivot.php')); $title = 'Generate New Pivot Table'; $PAGE->set_heading($title); $PAGE->set_title($title); $mform = new report_form(); //Form processing and displaying is done here if ($mform->is_cancelled()) { // Redircet user to dashbosrd page redirect(new moodle_url('/blocks/dial_rewards/reports/report_home.php')); } elseif ($mform->no_submit_button_pressed()) { echo 'Fetching data '; if ($data = $mform->get_data()) { echo 'No Data! '; } else { echo 'Here is the data: '; print_r($data); } } elseif ($data = $mform->get_data()) { //In this case you process validated data. //$mform->get_data() returns data posted in form.