</SELECT>
			</td>
		</tr>
		<tr>
			<td>UID</td>
			<td><input type="text" name="uid" id="uid"/></td>
		</tr>
		<tr>
			<td></td>
			<td><input type="submit" value="Zuteilen" name="add" /></td>
		</tr>
	</table>
</form>
';
if (isset($_POST['add'])) {
    if (isset($_POST['uid']) && $_POST['uid'] != '' && isset($_POST['role']) && $_POST['role'] != '' && isset($_POST['mdl_course_ids']) && $_POST['mdl_course_ids'] != '') {
        $mdl_course_id_array = explode(',', $_POST['mdl_course_ids']);
        $uid = $_POST['uid'];
        $role_id = $_POST['role'];
        $moodle = new moodle24_user();
        if ($moodle->MassEnroll($uid, $mdl_course_id_array, $role_id)) {
            echo 'Zuteilung erfolgreich';
        } else {
            echo 'Fehler bei der Zuteilung:' . $moodle->errormsg;
        }
    } else {
        echo 'Fehler: Bitte füllen Sie alle Felder aus';
    }
}
echo '</body>
</html>';