 <?php
    require_once '../service/ClassInfoService.class.php';
    require_once '../phpbean/ClassInfo.class.php';
    $classNumber = $_GET['classNumber'];
    $classInfoService = new ClassInfoService();
    $classInfo = $classInfoService->GetClassInfo($classNumber);
 ?>
<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]*]*$/ ;
            var className = document.getElementById("className").value;
            if (className == "") {
                alert("请输入班级名称...");
                document.getElementById("className").focus();
                return false;
            }

            var classBirthDate = document.getElementById("classBirthDate").value;
            if (classBirthDate == "") {
                alert("请输入成立日期...");
                document.getElementById("classBirthDate").focus();
                return false;
            }

            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/ClassInfoAction.php?action=update" enctype="multipart/form-data">
				<p>
					班级编号: &nbsp;
					<input id="classNumber" class="text" type="text" readOnly style="width: 200px" value="<?php echo $classInfo->getCLASSNUMBER()?>" name="classInfo[classNumber]" />
					<font color=red>*</font>
				</p>
				<p>
					班级名称: &nbsp;
					<input id="className" class="text" type="text" style="width: 200px" value="<?php echo $classInfo->getClassName()?>" name="classInfo[className]" />
					<font color=red>*</font>
				</p>
				<p>
					所属专业:&nbsp;
					<select name="classInfo[classSpecialFieldNumber]">
					<?php
						require_once '../service/SpecialFieldInfoService.class.php';
						$specialfieldinfoService = new SpecialFieldInfoService ();
						$specialfieldinfo_res = $specialfieldinfoService->QueryAllSpecialFieldInfo ();
						for($i = 0; $i < count ( $specialfieldinfo_res ); $i ++) {
						  $row = $specialfieldinfo_res [$i];
						  if($row['specialFieldNumber'] == $classInfo->getClassSpecialFieldNumber())
						    echo "<option selected value={$row['specialFieldNumber']}>{$row['specialFieldName']}</option>";
						  else
						    echo "<option value={$row['specialFieldNumber']}>{$row['specialFieldName']}</option>";
						}
					?>
					</select>
				</p>

				<p>

					成立日期:&nbsp; <input id="classBirthDate" type="text" class="text" readonly id="classInfo[classBirthDate]" name="classInfo[classBirthDate]" value="<?php echo date("Y-m-d",strtotime($classInfo->getClassBirthDate()));?>" onclick="setDay(this);" />
					<font color=red>*</font>
				</p>
				<p>
					班主任: &nbsp;
					<input id="classTeacherCharge" class="text" type="text" style="width: 120px" value="<?php echo $classInfo->getClassTeacherCharge()?>" name="classInfo[classTeacherCharge]" />
				</p>
				<p>
					联系电话: &nbsp;
					<input id="classTelephone" class="text" type="text" style="width: 200px" value="<?php echo $classInfo->getClassTelephone()?>" name="classInfo[classTelephone]" />
				</p>
				<p>
					附加信息: &nbsp;
					<input id="classMemo" class="text" type="text" style="width: 1000px" value="<?php echo $classInfo->getClassMemo()?>" name="classInfo[classMemo]" />
				</p>
			</form>
		</div>
	</div>
</body>
</html>
