Пример #1
0
        }
        redirect($return);
    }
}
$PAGE->set_heading($course->fullname);
$PAGE->set_title(get_string('pluginname', 'enrol_attributes'));
$PAGE->requires->jquery();
$PAGE->requires->js('/enrol/attributes/js/jquery.json-2.3.min.js');
$PAGE->requires->js('/enrol/attributes/jsparams.php');
$PAGE->requires->js('/enrol/attributes/js/jquery.booleanEditor.js');
$PAGE->requires->js('/enrol/attributes/js/javascript.js');
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('pluginname', 'enrol_attributes'));
$mform->display();
// DEBUGGING : BEGIN
if ($instanceid) {
    debugging('customtext1= ' . print_r(json_decode($instance->customtext1), true), DEBUG_DEVELOPER);
    $debug_fieldsandrules = enrol_attributes_plugin::attrsyntax_toarray($instance->customtext1);
    debugging('fieldsandrules= ' . print_r($debug_fieldsandrules, true), DEBUG_DEVELOPER);
    $debug_arraysql = enrol_attributes_plugin::arraysyntax_tosql($debug_fieldsandrules);
    debugging('arraysql= ' . print_r($debug_arraysql, true), DEBUG_DEVELOPER);
    $debug_sqlquery = 'SELECT DISTINCT u.id FROM {user} u ' . $debug_arraysql['select'] . ' WHERE ' . $debug_arraysql['where'];
    debugging('sqlquery= ' . print_r($debug_sqlquery, true), DEBUG_DEVELOPER);
    $debug_users = $DB->get_records_sql($debug_sqlquery, $debug_arraysql['params']);
    debugging('countusers= ' . print_r(count($debug_users), true), DEBUG_DEVELOPER);
    //    debugging('force.php DEBUGGING:', DEBUG_DEVELOPER);
    //    $nbenrolled = enrol_attributes_plugin::process_enrolments(null, $instanceid);
    //    debugging('nbenrolled= ' . print_r($nbenrolled, true), DEBUG_DEVELOPER);
}
// DEBUGGING : END
echo $OUTPUT->footer();