3 /// this allows a student to request a course be created for them.
5 require_once('../config.php');
6 require_once('request_form.php');
11 error("No guests here!");
14 if (empty($CFG->enablecourserequests
)) {
15 print_error('courserequestdisabled');
18 $requestform = new course_request_form();
20 $strtitle = get_string('courserequest');
21 print_header($strtitle, $strtitle, $strtitle, $requestform->focus());
23 print_simple_box_start('center');
24 print_string('courserequestintro');
25 print_simple_box_end();
28 if ($requestform->is_cancelled()){
30 redirect($CFG->wwwroot
);
32 }elseif ($data = $requestform->get_data()) {
33 $data->requester
= $USER->id
;
35 if (insert_record('course_request', $data)) {
36 notice(get_string('courserequestsuccess'));
38 notice(get_string('courserequestfailed'));
43 $requestform->display();