forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
importstudents.html
81 lines (77 loc) · 4.17 KB
/
importstudents.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<form id="studentform" method="post" action="importstudents.php">
<input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>" />
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<input type="hidden" name="id" value="<?php echo $id?>" />
<table summary="" align="center" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
<label for="removeselect"><?php echo count($alreadycourses) . " ". $stralreadycourses ?></label>
<br />
<select name="removeselect[]" size="20" id="removeselect" multiple="multiple"
onFocus="getElementById('studentform').add.disabled=true;
getElementById('studentform').remove.disabled=false;
getElementById('studentform').addselect.selectedIndex=-1;">
<?php
foreach ($alreadycourses as $course) {
echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
}
?>
</select></td>
<td valign="top">
<?php check_theme_arrows(); ?>
<p class="arrow_button">
<input name="add" id="add" type="submit" value="<?php echo ' '.$THEME->larrow.' '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
<br />
<input name="remove" id="remove" type="submit" value="<?php echo ' '.$THEME->rarrow.' '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
</p>
</td>
<td valign="top">
<label for="addselect"><?php echo $numcourses . " " . $strpotentialcourses ?></label>
<br />
<select name="addselect[]" size="20" id="addselect" multiple="multiple"
onFocus="getElementById('studentform').add.disabled=false;
getElementById('studentform').remove.disabled=true;
getElementById('studentform').removeselect.selectedIndex=-1;">
<?php
if (!empty($searchcourses)) {
echo "<optgroup label=\"$strsearchresults (" . count($searchcourses) . ")\">\n";
foreach ($searchcourses as $course) {
echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
}
echo "</optgroup>\n";
}
if (!empty($courses)) {
if ($numcourses > MAX_COURSES_PER_PAGE) {
echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
.'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
}
else {
foreach ($courses as $course) {
echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
}
}
}
?>
</select>
<br />
<label for="searchtext" class="accesshide"><?php p($strsearch) ?></label>
<input type="text" name="searchtext" id="searchtext" size="30" value="<?php p($searchtext) ?>"
onFocus ="getElementById('studentform').add.disabled=true;
getElementById('studentform').remove.disabled=true;
getElementById('studentform').removeselect.selectedIndex=-1;
getElementById('studentform').addselect.selectedIndex=-1;"
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
if (keyCode == 13) {
getElementById('studentform').previoussearch.value=1;
getElementById('studentform').submit();
} " />
<input name="search" id="search" type="submit" value="<?php p($strsearch) ?>" />
<?php
if (!empty($searchcourses)) {
echo '<input name="showall" id="showall" type="submit" value="'.$strshowall.'" />'."\n";
}
?>
</td>
</tr>
</table>
</form>