<?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]*]*$/ ;
            var specialFieldNumber = document.getElementById("specialFieldNumber").value;
            if (specialFieldNumber == "") {
                alert("请输入专业编号...");
                document.getElementById("specialFieldNumber").focus();
                return false;
            }

            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">
			<img src="../images/ADD.gif" />专业信息录入 (带*号的为必填项)
		</div>
		<div id="content">
			<form method="post" name="specialFieldInfoAddForm"
				action="/controller/SpecialFieldInfoAction.php?action=add"
				enctype="multipart/form-data">
				<br />
				<p>
					专业编号: &nbsp;
					<input id="specialFieldNumber" class="text" type="text" style="width: 200px" value="" name="specialFieldInfo[specialFieldNumber]" />
					<font color=red>*</font>
				</p>
				<p>
					专业名称: &nbsp;
					<input id="specialFieldName" class="text" type="text" style="width: 200px" value="" 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];
						  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]" onclick="setDay(this);" />
					<font color=red>*</font>
				</p>
				<p>
					联系人: &nbsp;
					<input id="specialMan" class="text" type="text" style="width: 100px" value="" name="specialFieldInfo[specialMan]" />
				</p>
				<p>
					联系电话: &nbsp;
					<input id="specialTelephone" class="text" type="text" style="width: 200px" value="" name="specialFieldInfo[specialTelephone]" />
				</p>
				<p>
					附加信息: &nbsp;
					<input id="specialMemo" class="text" type="text" style="width: 1000px" value="" name="specialFieldInfo[specialMemo]" />
				</p>
				<p>
					<input type="button" style="cursor: hand;" class="btn" value="添加" onClick="CheckForm();" />
				</p>

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