 <?php
    require_once '../service/StudentSelectCourseInfoService.class.php';
    require_once '../phpbean/StudentSelectCourseInfo.class.php';
    $selectId = $_GET['selectId'];
    $studentSelectCourseInfoService = new StudentSelectCourseInfoService();
    $studentSelectCourseInfo = $studentSelectCourseInfoService->GetStudentSelectCourseInfo($selectId);
 ?>
<html>
<head>
<title>查看选课信息</title>
<link href="/css/add_modify.css" rel="stylesheet" type="text/css" />
<script src="/js/util.js" type="text/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">
			<table width="100%" border="0" cellpadding="0" cellspacing="2" align="center">
				<tr>
					<td height="21"><img src="../images/ico/ico29.gif" width="32" height="32" hspace="2" vspace="2" align="absmiddle">
					    <strong> 选课信息修改 </strong>
					</td>
				</tr>
			</table>
		</div>

		<div id="content">
			<form id="form1" method="post" action="/controller/StudentSelectCourseInfoAction.php?action=update" enctype="multipart/form-data">
				<p>
					记录编号: &nbsp;
					<input id="selectId" class="text" type="text" readOnly style="width: 60px" value="<?php echo $studentSelectCourseInfo->getSELECTID()?>" name="studentSelectCourseInfo[selectId]" />
					<font color=red>*</font>
				</p>
				<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];
						  if($row['studentNumber'] == $studentSelectCourseInfo->getStudentNumber())
						    echo "<option selected value={$row['studentNumber']}>{$row['studentName']}</option>";
						  else
						    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];
						  if($row['courseNumber'] == $studentSelectCourseInfo->getCourseNumber())
						    echo "<option selected value={$row['courseNumber']}>{$row['courseName']}</option>";
						  else
						    echo "<option value={$row['courseNumber']}>{$row['courseName']}</option>";
						}
					?>
					</select>
				</p>

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