 <?php
    require_once '../controller/CheckLoginState.php'; 
    require_once '../service/SpecialFieldInfoService.class.php';
    require_once '../phpbean/SpecialFieldInfo.class.php';
    $specialFieldNumber = $_GET['specialFieldNumber'];
    $specialFieldInfoService = new SpecialFieldInfoService();
    $specialFieldInfo = $specialFieldInfoService->GetSpecialFieldInfo($specialFieldNumber);
 ?>
<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 specialFieldName = document.getElementById("specialFieldName").value;
            if (specialFieldName == "") {
                alert("请输入专业名称...");
                document.getElementById("specialFieldName").focus();
                return false;
            }

            var specialBirthDate = document.getElementById("specialBirthDate").value;
            if (specialBirthDate == "") {
                alert("请输入成立日期...");
                document.getElementById("specialBirthDate").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/SpecialFieldInfoAction.php?action=update" enctype="multipart/form-data">
				<p>
					专业编号: &nbsp;
					<input id="specialFieldNumber" class="text" type="text" readOnly style="width: 200px" value="<?php echo $specialFieldInfo->getSPECIALFIELDNUMBER()?>" name="specialFieldInfo[specialFieldNumber]" />
					<font color=red>*</font>
				</p>
				<p>
					专业名称: &nbsp;
					<input id="specialFieldName" class="text" type="text" style="width: 200px" value="<?php echo $specialFieldInfo->getSpecialFieldName()?>" name="specialFieldInfo[specialFieldName]" />
					<font color=red>*</font>
				</p>
				<p>
					所在学院:&nbsp;
					<select name="specialFieldInfo[specialCollegeNumber]">
					<?php
						require_once '../service/CollegeInfoService.class.php';
						$collegeinfoService = new CollegeInfoService ();
						$collegeinfo_res = $collegeinfoService->QueryAllCollegeInfo ();
						for($i = 0; $i < count ( $collegeinfo_res ); $i ++) {
						  $row = $collegeinfo_res [$i];
						  if($row['collegeNumber'] == $specialFieldInfo->getSpecialCollegeNumber())
						    echo "<option selected value={$row['collegeNumber']}>{$row['collegeName']}</option>";
						  else
						    echo "<option value={$row['collegeNumber']}>{$row['collegeName']}</option>";
						}
					?>
					</select>
				</p>

				<p>

					成立日期:&nbsp; <input id="specialBirthDate" type="text" class="text" readonly id="specialFieldInfo[specialBirthDate]" name="specialFieldInfo[specialBirthDate]" value="<?php echo date("Y-m-d",strtotime($specialFieldInfo->getSpecialBirthDate()));?>" onclick="setDay(this);" />
					<font color=red>*</font>
				</p>
				<p>
					联系人: &nbsp;
					<input id="specialMan" class="text" type="text" style="width: 100px" value="<?php echo $specialFieldInfo->getSpecialMan()?>" name="specialFieldInfo[specialMan]" />
				</p>
				<p>
					联系电话: &nbsp;
					<input id="specialTelephone" class="text" type="text" style="width: 200px" value="<?php echo $specialFieldInfo->getSpecialTelephone()?>" name="specialFieldInfo[specialTelephone]" />
				</p>
				<p>
					附加信息: &nbsp;
					<input id="specialMemo" class="text" type="text" style="width: 1000px" value="<?php echo $specialFieldInfo->getSpecialMemo()?>" name="specialFieldInfo[specialMemo]" />
				</p>
				<p>
					<input type="button" style="cursor: hand;" class="btn" value="修改" onClick="CheckForm();" />
				</p>
			</form>
		</div>
	</div>
</body>
</html>
