📄 mod_teacher.asp
字号:
<!--#include file = "inc/conn.asp" -->
<!--#include file = "CheckLogin.asp" -->
<!--#include file = "inc/zhuru.asp" -->
<%
Dim strID ,rs ,srtSql
strID = Request.QueryString("ID")
If strID &"" = "" Then
Response.Write("参数错误!")
Response.End
End If
Dim strTno ,strName ,strSynopsis , strSex ,strTel ,strEmail , strQQ , strMsn, strSchoolID ,strZhuanyeID
strSql = "SELECT * FROM Teacher WHERE ID = "& strID
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open strSql,conn,1,1
If Not rs.EOF Then
strTno = rs("Tno").value
strName = rs("name").value
strSynopsis = rs("Synopsis").value
strSex = rs("Sex").value
strTel = rs("Tel").value
strEmail = rs("Email").value
strQQ = rs("QQ").value
strMsn = rs("MSN").value
strSchoolID = rs("SchoolID").value
strZhuanyeID = rs("ZhuanyeID").value
rs.close
%>
<style type="text/css">
<!--
.STYLE9 {color: #003300; font-size: 12px; }
body,td,th {
font-size: 12px;
}
.STYLE10 {font-size: 14px}
-->
</style>
<SCRIPT language=JavaScript>
function CheckValue(thisform)
{
if (thisform.Tno.value.length == 0){
alert ('请输入教师号。');
}
if (thisform.Tno.value.length > 40){
alert ('教师号过长。');
}
if (thisform.Name.value.length == 0){
alert ('请输入教师名。');
}
if (thisform.Name.value.length > 60){
alert ('教师名过长。');
}
else if (thisform.Pwd.value.length == 0){
alert ('请输入密码。');
}
else if (thisform.Pwd.value.length > 50){
alert ('密码过长。');
}
else if (thisform.Pwd2.value.length == 0){
alert ('请输入确认密码。');
}
else if (thisform.Pwd2.value != thisform.Pwd.value){
alert ('两次密码不一致。');
}
else if (thisform.Tel.value.length > 50){
alert ('电话信息过长。');
}
else if (thisform.Email.value.length > 50){
alert ('Email信息过长。');
}
else if (thisform.QQ.value.length > 100){
alert ('QQ信息过长。');
}
else if (thisform.MSN.value.length > 50){
alert ('MSN信息过长。');
}
else if (thisform.Sex.value.length == 0){
alert ('请选择性别。');
}
else {
thisform.submit();
}
}
</SCRIPT>
<body bgcolor="#B1DB99" topmargin="5" leftmargin="5">
<table width="355" border="0" align="left">
<form id="form1" name="form1" method="post" action="ModTeacher.asp?ID=<%=strID%>" onSubmit="CheckValue(this);return false">
<tr>
<td colspan="4" background="images/Down_bg.gif"><div align="center" class="STYLE10">教师信息</div></td>
</tr>
<tr bgcolor="#66C06D">
<td><div align="right">教师号</div></td>
<td colspan="3"><input name="Tno" type="text" value="<%=strTno%>"></td>
</tr>
<tr bgcolor="#66C06D">
<td width="94"><div align="right"><span class="STYLE9">姓名:</span></div></td>
<td width="251" colspan="3">
<label>
<input type="text" name="Name" value=<%=strName%> />
</label> </td>
</tr>
<tr bgcolor="#66C06D">
<td height="17"><div align="right">学院:</div></td>
<td><select name="SchoolID">
<%
strSql = "SELECT * FROM School ORDER BY Name ASC"
rs.open strSql,conn,1,1
%>
<%
Do While Not rs.EOF
%>
<option value=<%=rs("ID").Value%> <%If rs("ID").value = strSchoolID Then%> selected="selected" <%End If%>><%=rs("name").Value%></option>
<%
rs.movenext
loop
rs.close
%>
</select> </td>
<td><div align="right">专业:</div></td>
<td><select name="ZhuanyeID">
<%
strSql = "SELECT * FROM zhuanye ORDER BY Name ASC"
rs.open strSql,conn,1,1
%>
<%
Do While Not rs.EOF
%>
<option value=<%=rs("ID").Value%> <%If rs("ID").value = strZhuanyeID Then%> selected="selected" <%End If%>><%=rs("name").Value%></option>
<%
rs.movenext
loop
rs.close
%>
</select></td>
</tr>
<tr bgcolor="#66C06D">
<td height="17"><div align="right"><span class="STYLE9">性别:</span></div></td>
<td colspan="3"><label>
<select name="Sex">
<option value="男" <%If strSex = "男" Then Response.Write("selected=selected") End IF %> >男</option>
<option value="女" <%If strSex = "女" Then Response.Write("selected=selected") End IF %> >女</option>
</select>
</label></td>
</tr>
<tr bgcolor="#66C06D">
<td height="17"><div align="right"><span class="STYLE9">电话:</span></div></td>
<td colspan="3"><input type="text" name="Tel" value=<%=strTel%> ></td>
</tr>
<tr bgcolor="#66C06D">
<td height="17"><div align="right"><span class="STYLE9">Email: </span></div></td>
<td colspan="3"><input type="text" name="Email" value=<%=strEmail%> ></td>
</tr>
<tr bgcolor="#66C06D">
<td height="17"><div align="right"><span class="STYLE9">MSN: </span></div></td>
<td colspan="3"><input type="text" name="MSN" value=<%=strMsn%> ></td>
</tr>
<tr bgcolor="#66C06D">
<td height="17"><div align="right"><span class="STYLE9">QQ: </span></div></td>
<td colspan="3"><input type="text" name="QQ" value=<%=strQQ%> ></td>
</tr>
<tr bgcolor="#66C06D">
<td height="17"><div align="right">
<div align="right"><span class="STYLE9">简介:</span></div>
</div></td>
<td colspan="3"><textarea name="Synopsis" rows="5"><%=strSynopsis%></textarea></td>
</tr>
<tr bgcolor="#66C06D">
<td height="18" colspan="4">
<div align="center">
<input name="清空" type="reset" value="清空" />
<input type="submit" name="Submit" value="修改" />
</div> </td>
</tr>
<tr>
<td colspan="4" background="images/Top_bg.gif"> </td>
</tr>
</form>
</table>
<%
Else
Response.Write("参数错误!")
Response.End
End IF
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -