<?php
	require_once '../controller/CheckLoginState.php';
?>
<html>
<head>
<title>选课信息登记</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../css/add_modify.css" rel="stylesheet" type="text/css" />
<script src="../js/util.js" language="JavaScript"></script>
<script src="../js/calendar.js"></script>
<script type="text/javascript">
        function CheckForm() {
            var re = /^[0-9]+.?[0-9]*$/;
            var resc=/^[1-9]+[0-9]*]*$/ ;
            document.forms[0].submit();
       } 
    </script>
</head>
<body>
	<div id="container">
		<div id="title">
			<img src="../images/ADD.gif" />选课信息录入 (带*号的为必填项)
		</div>
		<div id="content">
			<form method="post" name="studentSelectCourseInfoAddForm"
				action="/controller/StudentSelectCourseInfoAction.php?action=add"
				enctype="multipart/form-data">
				<br />
				<p>
					学生对象:&nbsp;
					<select name="studentSelectCourseInfo[studentNumber]">
					<?php
						require_once '../service/StudentService.class.php';
						$studentService = new StudentService ();
						$student_res = $studentService->QueryAllStudent ();
						for($i = 0; $i < count ( $student_res ); $i ++) {
						  $row = $student_res [$i];
						  echo "<option value={$row['studentNumber']}>{$row['studentName']}</option>";
						}
					?>
					</select>
				</p>

				<p>
					课程对象:&nbsp;
					<select name="studentSelectCourseInfo[courseNumber]">
					<?php
						require_once '../service/CourseInfoService.class.php';
						$courseinfoService = new CourseInfoService ();
						$courseinfo_res = $courseinfoService->QueryAllCourseInfo ();
						for($i = 0; $i < count ( $courseinfo_res ); $i ++) {
						  $row = $courseinfo_res [$i];
						  echo "<option value={$row['courseNumber']}>{$row['courseName']}</option>";
						}
					?>
					</select>
				</p>

				<p>
					<input type="button" style="cursor: hand;" class="btn" value="添加" onClick="CheckForm();" />
				</p>

			</form>
		</div>
	</div>
</body>
</html>
