2006-04-12 16:41:10 +00:00
|
|
|
<?php // $Id$
|
2006-10-17 11:38:46 +00:00
|
|
|
|
2005-08-16 06:15:49 +00:00
|
|
|
/// this allows a student to request a course be created for them.
|
|
|
|
|
2006-04-12 16:41:10 +00:00
|
|
|
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
|
|
|
|
2005-08-16 06:15:49 +00:00
|
|
|
require_login();
|
2006-10-17 11:38:46 +00:00
|
|
|
|
2006-04-12 16:41:10 +00:00
|
|
|
if (isguest()) {
|
|
|
|
error("No guests here!");
|
|
|
|
}
|
|
|
|
|
2005-08-16 06:15:49 +00:00
|
|
|
if (empty($CFG->enablecourserequests)) {
|
|
|
|
error(get_string('courserequestdisabled'));
|
|
|
|
}
|
2006-10-17 11:38:46 +00:00
|
|
|
|
2006-10-24 11:43:51 +00:00
|
|
|
$requestform = new course_request_form('request.php');
|
2005-08-16 06:15:49 +00:00
|
|
|
|
|
|
|
$strtitle = get_string('courserequest');
|
2006-11-09 21:58:12 +00:00
|
|
|
print_header($strtitle, $strtitle, $strtitle, $requestform->focus());
|
2005-08-16 06:15:49 +00:00
|
|
|
|
2006-11-09 21:58:12 +00:00
|
|
|
print_simple_box_start('center');
|
2006-10-17 11:38:46 +00:00
|
|
|
print_string('courserequestintro');
|
2005-08-16 06:15:49 +00:00
|
|
|
print_simple_box_end();
|
2006-10-17 11:38:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (($data = $requestform->data_submitted())) {
|
|
|
|
|
2006-10-17 11:08:13 +00:00
|
|
|
$data->requester = $USER->id;
|
2005-08-16 06:15:49 +00:00
|
|
|
|
2006-11-09 21:58:12 +00:00
|
|
|
if (insert_record('course_request', $data)) {
|
2006-10-17 11:08:13 +00:00
|
|
|
notice(get_string('courserequestsuccess'));
|
2006-10-17 11:38:46 +00:00
|
|
|
} else {
|
2006-10-17 11:08:13 +00:00
|
|
|
notice(get_string('courserequestfailed'));
|
2005-08-16 06:15:49 +00:00
|
|
|
}
|
2006-10-17 11:08:13 +00:00
|
|
|
print_footer();
|
|
|
|
exit;
|
2006-10-17 11:38:46 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-10-17 11:08:13 +00:00
|
|
|
$requestform->display();
|
|
|
|
|
|
|
|
print_footer();
|
2006-10-17 11:38:46 +00:00
|
|
|
|
2006-10-17 11:08:13 +00:00
|
|
|
exit;
|
|
|
|
|
2005-08-16 06:15:49 +00:00
|
|
|
|
|
|
|
?>
|