 <?php
    require_once '../service/TeacherService.class.php';
    require_once '../phpbean/Teacher.class.php';
    $teacherNumber = $_GET['teacherNumber'];
    $teacherService = new TeacherService();
    $teacher = $teacherService->GetTeacher($teacherNumber);
 ?>
<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 teacherName = document.getElementById("teacherName").value;
            if (teacherName == "") {
                alert("请输入教师姓名...");
                document.getElementById("teacherName").focus();
                return false;
            }

            var teacherSex = document.getElementById("teacherSex").value;
            if (teacherSex == "") {
                alert("请输入性别...");
                document.getElementById("teacherSex").focus();
                return false;
            }

            var teacherBirthday = document.getElementById("teacherBirthday").value;
            if (teacherBirthday == "") {
                alert("请输入出生日期...");
                document.getElementById("teacherBirthday").focus();
                return false;
            }

            var teacherArriveDate = document.getElementById("teacherArriveDate").value;
            if (teacherArriveDate == "") {
                alert("请输入入职日期...");
                document.getElementById("teacherArriveDate").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/TeacherAction.php?action=update" enctype="multipart/form-data">
				<p>
					教师编号: &nbsp;
					<input id="teacherNumber" class="text" type="text" readOnly style="width: 200px" value="<?php echo $teacher->getTEACHERNUMBER()?>" name="teacher[teacherNumber]" />
					<font color=red>*</font>
				</p>
				<p>
					教师姓名: &nbsp;
					<input id="teacherName" class="text" type="text" style="width: 120px" value="<?php echo $teacher->getTeacherName()?>" name="teacher[teacherName]" />
					<font color=red>*</font>
				</p>
				<p>
					登录密码: &nbsp;
					<input id="teacherPassword" class="text" type="text" style="width: 300px" value="<?php echo $teacher->getTeacherPassword()?>" name="teacher[teacherPassword]" />
				</p>
				<p>
					性别: &nbsp;
					<input id="teacherSex" class="text" type="text" style="width: 20px" value="<?php echo $teacher->getTeacherSex()?>" name="teacher[teacherSex]" />
					<font color=red>*</font>
				</p>
				<p>

					出生日期:&nbsp; <input id="teacherBirthday" type="text" class="text" readonly id="teacher[teacherBirthday]" name="teacher[teacherBirthday]" value="<?php echo date("Y-m-d",strtotime($teacher->getTeacherBirthday()));?>" onclick="setDay(this);" />
					<font color=red>*</font>
				</p>
				<p>

					入职日期:&nbsp; <input id="teacherArriveDate" type="text" class="text" readonly id="teacher[teacherArriveDate]" name="teacher[teacherArriveDate]" value="<?php echo date("Y-m-d",strtotime($teacher->getTeacherArriveDate()));?>" onclick="setDay(this);" />
					<font color=red>*</font>
				</p>
				<p>
					身份证号: &nbsp;
					<input id="teacherCardNumber" class="text" type="text" style="width: 200px" value="<?php echo $teacher->getTeacherCardNumber()?>" name="teacher[teacherCardNumber]" />
				</p>
				<p>
					联系电话: &nbsp;
					<input id="teacherPhone" class="text" type="text" style="width: 200px" value="<?php echo $teacher->getTeacherPhone()?>" name="teacher[teacherPhone]" />
				</p>
				<p>
					教师照片:&nbsp; <img src="<?php echo $teacher->getTeacherPhoto()?>" width="200px" border="0px" /><br/>
				</p>
				<p>
					家庭地址: &nbsp;
					<input id="teacherAddress" class="text" type="text" style="width: 1000px" value="<?php echo $teacher->getTeacherAddress()?>" name="teacher[teacherAddress]" />
				</p>
				<p>
					附加信息: &nbsp;
					<input id="teacherMemo" class="text" type="text" style="width: 1000px" value="<?php echo $teacher->getTeacherMemo()?>" name="teacher[teacherMemo]" />
				</p>
			</form>
		</div>
	</div>
</body>
</html>
