2005-01-24 22:23:01 +00:00
|
|
|
|
|
|
|
<form name="studentform" id="studentform" method="post" action="importstudents.php">
|
|
|
|
<input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>">
|
2005-02-02 19:13:24 +00:00
|
|
|
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>">
|
2005-01-24 22:23:01 +00:00
|
|
|
<input type="hidden" name="id" value="<?php echo $id?>">
|
|
|
|
<table align="center" border="0" cellpadding="5" cellspacing="0">
|
|
|
|
<tr>
|
2006-11-22 22:41:01 +00:00
|
|
|
<th valign="top">
|
2005-01-24 22:23:01 +00:00
|
|
|
<?php echo count($alreadycourses) . " ". $stralreadycourses ?>
|
2006-11-22 22:41:01 +00:00
|
|
|
</th>
|
|
|
|
<th></th>
|
|
|
|
<th valign="top">
|
2005-01-24 22:23:01 +00:00
|
|
|
<?php echo $numcourses . " " . $strpotentialcourses ?>
|
2006-11-22 22:41:01 +00:00
|
|
|
</th>
|
2005-01-24 22:23:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">
|
|
|
|
<select name="removeselect[]" size="20" id="removeselect" multiple
|
|
|
|
onFocus="document.studentform.add.disabled=true;
|
|
|
|
document.studentform.remove.disabled=false;
|
|
|
|
document.studentform.addselect.selectedIndex=-1;">
|
|
|
|
<?php
|
2005-05-16 19:38:21 +00:00
|
|
|
foreach ($alreadycourses as $course) {
|
|
|
|
echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
|
|
|
|
}
|
2005-01-24 22:23:01 +00:00
|
|
|
?>
|
|
|
|
</select></td>
|
|
|
|
<td valign="top">
|
|
|
|
<br />
|
|
|
|
<input name="add" type="submit" id="add" value="←" />
|
|
|
|
<br />
|
|
|
|
<input name="remove" type="submit" id="remove" value="→" />
|
|
|
|
<br />
|
|
|
|
</td>
|
|
|
|
<td valign="top">
|
|
|
|
<select name="addselect[]" size="20" id="addselect" multiple
|
|
|
|
onFocus="document.studentform.add.disabled=false;
|
|
|
|
document.studentform.remove.disabled=true;
|
|
|
|
document.studentform.removeselect.selectedIndex=-1;">
|
|
|
|
<?php
|
2005-05-16 19:38:21 +00:00
|
|
|
|
2005-01-24 22:23:01 +00:00
|
|
|
if (!empty($searchcourses)) {
|
|
|
|
echo "<optgroup label=\"$strsearchresults (" . count($searchcourses) . ")\">\n";
|
|
|
|
foreach ($searchcourses as $course) {
|
2005-05-16 19:38:21 +00:00
|
|
|
echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
|
2005-01-24 22:23:01 +00:00
|
|
|
}
|
|
|
|
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) {
|
2006-05-17 16:47:44 +00:00
|
|
|
echo "<option value=\"$course->id\">".course_format_name($course,60)."</option>\n";
|
2005-01-24 22:23:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<br />
|
2006-04-14 08:02:32 +00:00
|
|
|
<input type="text" name="searchtext" size="30" value="<?php p($searchtext, true) ?>"
|
2005-01-24 22:23:01 +00:00
|
|
|
onFocus ="document.studentform.add.disabled=true;
|
|
|
|
document.studentform.remove.disabled=true;
|
|
|
|
document.studentform.removeselect.selectedIndex=-1;
|
|
|
|
document.studentform.addselect.selectedIndex=-1;"
|
|
|
|
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
|
|
|
|
if (keyCode == 13) {
|
|
|
|
document.studentform.previoussearch.value=1;
|
|
|
|
document.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>
|
|
|
|
|
|
|
|
|