/** * Delete all reports. * * @return void * @uses $DB */ function report_ncccscensus_bulk_report_delete_all() { global $DB; $batches = $DB->get_records('report_ncccscensus_batch', null); foreach ($batches as $batch) { report_ncccscensus_bulk_report_cancel($batch->id); } }
* @author Remote-Learner.net Inc * @copyright 2014 Remote Learner - http://www.remote-learner.net/ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once '../../config.php'; require_once 'lib.php'; require_login(); $context = context_system::instance(); require_capability('report/ncccscensus:view', $context); $PAGE->set_url('/report/ncccscensus/status.php'); $PAGE->set_context($context); $PAGE->set_title(get_string('setupquery', 'report_ncccscensus')); $PAGE->set_heading($SITE->fullname); $PAGE->set_pagelayout('report'); $PAGE->navbar->add(get_string('reportlink', 'report_ncccscensus')); $mode = optional_param('mode', '', PARAM_RAW); echo $OUTPUT->header(); echo $OUTPUT->box_start(); if ($mode == 'all') { echo '<h1>' . get_string('allreportsdeleted', 'report_ncccscensus') . '</h1>'; report_ncccscensus_bulk_report_delete_all(); } else { echo '<h1>' . get_string('reportdeleted', 'report_ncccscensus') . '</h1>'; $batchid = required_param('batchid', PARAM_INT); report_ncccscensus_bulk_report_cancel($batchid); } echo '<div style="text-align: center">'; $statusurl = new moodle_url('/report/ncccscensus/status.php'); echo '<a href="' . $statusurl . '">' . get_string('continue') . '</a></div>'; echo $OUTPUT->box_end(); echo $OUTPUT->footer();