id); if (!isteacheredit($course->id)) { error("You must be an editing teacher in this course, or an admin"); } if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) { if (count($form->userid) != count($form->extendperiod)) { error('Parameters malformation', $CFG->wwwroot.'/user/index.php?id='.$id); } foreach ($form->userid as $k => $v) { if ($student = get_record('user_students', 'userid', $v, 'course', $id)) { enrol_student($v, $id, $student->timestart, $student->timeend + $form->extendperiod[$k]); } } redirect("$CFG->wwwroot/user/index.php?id=$id", get_string('changessaved')); } /// Print headers if ($course->id != SITEID) { print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, "id\">$course->shortname -> ". get_string('extendenrol'), "", "", true, " ", navmenu($course)); } else { print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, get_string('extendenrol'), "", "", true, " ", navmenu($course)); } for ($i=1; $i<=365; $i++) { $seconds = $i * 86400; $periodmenu[$seconds] = get_string('numdays', '', $i); } print_heading(get_string('extendenrol')); echo "
\n"; print_footer($course); ?>