moodle/course/request.php

50 lines
1.0 KiB
PHP
Raw Normal View History

<?php // $Id$
2006-10-17 11:38:46 +00:00
/// this allows a student to request a course be created for them.
require_once('../config.php');
2006-11-09 22:16:44 +00:00
require_once('request_form.php');
2006-10-17 11:38:46 +00:00
require_login();
2006-10-17 11:38:46 +00:00
if (isguest()) {
error("No guests here!");
}
if (empty($CFG->enablecourserequests)) {
error(get_string('courserequestdisabled'));
}
2006-10-17 11:38:46 +00:00
$requestform = new course_request_form('request.php');
$strtitle = get_string('courserequest');
2006-11-09 21:58:12 +00:00
print_header($strtitle, $strtitle, $strtitle, $requestform->focus());
2006-11-09 21:58:12 +00:00
print_simple_box_start('center');
2006-10-17 11:38:46 +00:00
print_string('courserequestintro');
print_simple_box_end();
2006-10-17 11:38:46 +00:00
if (($data = $requestform->data_submitted())) {
$data->requester = $USER->id;
2006-11-09 21:58:12 +00:00
if (insert_record('course_request', $data)) {
notice(get_string('courserequestsuccess'));
2006-10-17 11:38:46 +00:00
} else {
notice(get_string('courserequestfailed'));
}
print_footer();
exit;
2006-10-17 11:38:46 +00:00
}
$requestform->display();
print_footer();
2006-10-17 11:38:46 +00:00
exit;
?>