<?php
	require_once '../controller/CheckLoginState.php';
?>
<html>
<head>
<title>专业信息管理</title>
<link href="/css/manage.css" rel="Stylesheet" type="text/css" />
<script src="/opennew/alert.js" type="text/javascript"></script>
<script src="/opennew/Dialog.js" type="text/javascript"></script>
<script src="/js/ajax.js" type="text/javascript"></script>
<script src="/js/util.js" type="text/javascript"></script>
<script src="../js/calendar.js"></script>
<script>
function changepage(totalPage)
{
    var pageValue=document.specialFieldInfoQueryForm.pageValue.value;
    if(pageValue>totalPage) {
        alert('你输入的页码超出了总页数!');
        return ;
    }
    document.specialFieldInfoQueryForm.pageNow.value = pageValue;
    document.specialFieldInfoQueryForm.submit();
}

/*跳转到查询结果的某页*/
function GoToPage(currentPage/*,totalPage*/) {
    //if(currentPage==0) return;
    //if(currentPage>totalPage) return;
    document.forms[0].pageNow.value = currentPage;
    document.forms[0].submit();
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
	<div id="container">
		<div id="title">
			<table width="98%" border="0" cellpadding="0" cellspacing="2" align="center">
				<tr>
					<td height="21"><img src="../images/ico/ico08.gif" alt="" />
						<strong>专业信息管理</strong><script type="text/javascript">writeSpaces(105);</script>
						<img src="../images/print.jpg" title="打印" style="cursor: hand;" alt="" onclick="preview();">
					</td>
				</tr>
			</table>
		</div>

		<div id="content">
			<form id="specialFieldInfoQueryForm" name="specialFieldInfoQueryForm" action="/controller/SpecialFieldInfoAction.php?action=query" method="post">
				<!--startprint-->
				<table width="98%" border="1" cellspacing="1" cellpadding="2" align="center" style="margin: 0px;">
					<tr>
						<td colspan="9">
							专业编号: <input class="text" type="text" style="width: 200px" value="<?php echo $specialFieldNumber?>" name="specialFieldNumber" />
							专业名称: <input class="text" type="text" style="width: 200px" value="<?php echo $specialFieldName?>" name="specialFieldName" />
							所在学院: <select name="specialCollegeNumber">
								<option value="">不限制</option>
							<?php
								for($i = 0; $i < count ( $collegeInfo_res ); $i ++) {
									$row = $collegeInfo_res [$i];
									if ($specialCollegeNumber != $row ['collegeNumber'])
										echo "<option value={$row['collegeNumber']}>{$row['collegeName']}</option>";
									else
										echo "<option selected value={$row['collegeNumber']}>{$row['collegeName']}</option>";
								}
							?>
							</select> 
							成立日期:<input type="text" class="text" readonly value="<?php echo $specialBirthDate?>" name="specialBirthDate" onclick="setDay(this);" />
							<input type="button" class="btn" value="查询" onClick="javascript:document.forms[0].submit();" />
							<input type=hidden name=pageNow value="1" />
						</td>
					</tr>
				</table>


				<table width="98%" border="1" cellspacing="1" cellpadding="2" align="center" style="margin: 0px;">
					<tr class="a1" style="color: #ffffff; font-size: 12px;" height="30">
						<th>专业编号</th>
						<th>专业名称</th>
						<th>所在学院</th>
						<th>成立日期</th>
						<th>联系人</th>
						<th>联系电话</th>
						<th width="60px">操作</th>
					</tr> 
<?php
for($i = 0; $i < count ( $fenyePage->res_array ); $i ++) {
	$row = $fenyePage->res_array [$i];
	$row ['specialCollegeNumber'] = $collegeInfoService->GetCollegeInfo ( $row ['specialCollegeNumber'] )->getCollegeName ();
	echo "<td id=specialFieldNumber_{$row['specialFieldNumber']}>{$row['specialFieldNumber']}</td>";
	echo "<td id=specialFieldName_{$row['specialFieldNumber']}>{$row['specialFieldName']}</td>";
	echo "<td id=specialCollegeNumber_{$row['specialFieldNumber']}>{$row['specialCollegeNumber']}</td>";
	echo "<td id=specialBirthDate_{$row['specialFieldNumber']}>" . date ( "Y-m-d", strtotime ( $row ['specialBirthDate'] ) ) . "</td>";
	echo "<td id=specialMan_{$row['specialFieldNumber']}>{$row['specialMan']}</td>";
	echo "<td id=specialTelephone_{$row['specialFieldNumber']}>{$row['specialTelephone']}</td>";
	echo "<td><div align='left'><a href='#' onclick=\"OpenEditSpecialFieldInfo('{$row['specialFieldNumber']}', '修改专业信息','{$row['specialFieldNumber']}');\">修改</a>&nbsp;&nbsp;</div><div align=\"right\"><a href='SpecialFieldInfoAction.php?action=del&specialFieldNumber={$row['specialFieldNumber']}' onclick=\"return confirm('警告：您确认删除吗？');\">删除</a></div></td>";
	echo "</tr>";
}
echo "<input type=button id='Ajax_Btn' style='display:none;' onclick='Ajax_GetSpecialFieldInfo();' />";
echo "</table>";
// 显示上一页和下一页
echo $fenyePage->navigate;
?>
&nbsp;跳转到： <input name="pageValue" type="text" size="4" style="height: 20px; width: 30px; border: 1px solid #999999;" />页
<img src="../images/go.gif" style="cursor: hand;" onclick="changepage(<?php echo $fenyePage->pageCount ?>);" width="37" height="15" />
				<!--endprint-->
			</form>
		</div>
	</div>
</body>
</html>
