📄 teacher_edit.asp
字号:
<!--#include file="open.asp" -->
<!--#include file="inc/md5.inc" -->
<%self_name="teacher_edit.asp"%>
<%
doing=request.querystring("doing")
if doing="login" then '用户登录
user_id=trim(request.form("user_id"))
pass=trim(request.form("pass"))
if user_id<>"" and pass<>"" and instr(user_id,"'")=0 and instr(user_id,"&")=0 then
pass=ucase(md5(pass))
str="select * from user_teacher where teacher_user='"&user_id&"' and teacher_pass='"&pass&"'"
set rs=conn.execute(str)
if not rs.eof then
session("zzteacher")=true
session("name")=rs("teacher_name")
session("teacher_user")=user_id
if rs("teacher_class")="超级管理员" then session("zzadmin")=true end if
else
str="select * from user_student where 学籍号='"&user_id&"' and 密码='"&pass&"'"
set rs=conn.execute(str)
if not rs.eof then
session("zzstudent")=true
session("student_id")=user_id
session("name")=rs("姓名")
session("student_bj")=rs("班级")
end if
end if
end if
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><!--#include file="inc/css.css" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>增加删除教师操作</title>
</head>
<body topmargin="1">
<!--#include file="top.asp" -->
<!--#include file="menu.asp" -->
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
<%if session("zzteacher")=true or session("zzstudent")=true then%>
<tr>
<td height="20" class="unnamed12"><div align="center">用户已登录 用户类别:
<%if session("zzstudent")=true then%>学生 学籍号:<%=session("student_id")%> 姓名:<%=session("name")%> 班级:<%=session("student_bj")%><%end if%>
<%if session("zzteacher")=true then%>教师 姓名:<%=session("name")%><%end if%>
<%if session("zzadmin")=true then%><a href=system_setup.asp>系统设置</a><%end if%>
<a href="quit.asp?back=<%=self_name%>">退出</a></div></td>
</tr>
<%else%>
<tr>
<td height="20" class="unnamed12"> <form name="form1" method="post" action="<%=self_name%>?doing=login">
<div align="center">用户登录 输入学籍号或用户名:
<input name="user_id" type="text" id="user_id" value=<%=id_disp%> size="20">
密码:
<input name="pass" type="password" id="pass" size="16">
<input type="submit" name="Submit" class="unnamed12" value="登录">
<input type="reset" name="Submit2" class="unnamed12" value="重填">
<a href="reg.asp?back=<%=self_name%>">注册</a> <a href="rereg.asp">忘记密码</a></div>
</td></form>
</tr>
<%end if%>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="unnamed4"> </td>
</tr>
</table>
<%if session("zzadmin")=true then%>
<%'增加教师操作开始
if doing="insert" then
user_in=trim(request.form("user_in"))
name_in=trim(request.form("name_in"))
class_in=request.form("class_in")
pass1_in=trim(request.form("pass1_in"))
pass2_in=trim(request.form("pass2_in"))
if user_in="" or name_in="" or pass1_in="" then
msg="用户名,用户姓名,密码不能为空"
else
str="select teacher_user from user_teacher where teacher_user='"&user_in&"'"
set rs=conn.execute(str)
if not rs.eof then
msg="此用户名已经使用,请换一个用户名"
else
if pass1_in<>pass2_in then
msg="二次输入的密码不相同,请重新输入"
else
if len(pass1_in)<6 then
msg="密码不能少于六个字符"
else
pass1_in=ucase(md5(pass1_in))
if class_in="教师" then jb_in=9 end if
if class_in="超级管理员" then jb_in=99 end if
str="insert into user_teacher(teacher_user,teacher_name,teacher_pass,teacher_class,teacher_jb) values('"&user_in&"','"&name_in&"','"&pass1_in&"','"&class_in&"',"&jb_in&")"
conn.execute(str)
end if
end if
end if
end if
end if
'增加教师操作结束%>
<%'删除教师操作开始
if doing="dele_teacher" then
dele_id=request.querystring("dele_id")
str="delete from user_teacher where id="&dele_id&""
conn.execute(str)
doing=""
end if
'删除教师操作结束%>
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
<tr>
<td width="200" valign="top"><table width="163" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="unnamed10"> </td>
</tr>
<tr>
<td background="images/top01.gif" class="unnamed10"> </td>
</tr>
<tr>
<td height="30" background="images/mid01.gif" class="unnamed14"> <div align="center"><strong>学生信息操作</strong></div></td>
</tr>
<tr>
<td height="30" background="images/mid01.gif" class="unnamed12"> <div align="center"><a href="student_insert.asp" class="unnamed12wu">增加学生</a></div></td>
</tr>
<tr>
<td height="30" background="images/mid01.gif" class="unnamed12"><div align="center"><a href="student_list.asp" class="unnamed12wu">浏览编辑</a></div></td>
</tr>
<%if session("zzadmin")=true then%>
<tr>
<td height="30" background="images/mid01.gif" class="unnamed12"> <div align="center"><a href="teacher_edit.asp" class="unnamed12wu">增删教师</a></div></td>
</tr>
<%end if%>
<tr>
<td background="images/bottom01.gif" class="unnamed10"> </td>
</tr>
<tr>
<td class="unnamed10"> </td>
</tr>
</table></td>
<td width="570" valign="top">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="unnamed10"> </td>
</tr>
</table>
<table width="540" border="1" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#CCCCCC">
<td height="40" colspan="4"> <div align="center" class="unnamed18"><strong>已
有 教 师 列 表</strong></div></td>
</tr>
<tr class="unnamed14h20">
<td width="25%" height="30"> <div align="center">用户名</div></td>
<td width="25%"> <div align="center">姓名</div></td>
<td width="25%"> <div align="center">类别</div></td>
<td width="25%"><div align="center">删除</div></td>
</tr>
<%str="select * from user_teacher"
set rs=conn.execute(str)
do while not rs.eof%>
<tr class="unnamed12">
<td width="25%" height="20"><div align="center"><%=rs("teacher_user")%></div></td>
<td width="25%" height="20"><div align="center"><%=rs("teacher_name")%></div></td>
<td width="25%" height="20"><div align="center"><%=rs("teacher_class")%></div></td>
<td width="25%" height="20">
<div align="center"><a href="teacher_edit.asp?doing=dele_teacher&dele_id=<%=rs("id")%>"><img src="images/delete.gif" alt="删除 <%=rs("teacher_name")%>" width="11" height="14" border="0"></a></div></td>
</tr>
<% rs.movenext
loop%>
</table>
<hr>
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form2" method="post" action="teacher_edit.asp?doing=insert">
<table width="540" border="1" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#CCCCCC">
<td height="40" colspan="2" class="unnamed18"><div align="center"><strong>增
加 教 师 及 管 理 员</strong></div></td>
</tr>
<tr>
<td width="40%" height="30" class="unnamed14"><div align="right">用
户 名: </div></td>
<td height="30">
<input name="user_in" type="text" id="user_in"></td>
</tr>
<tr>
<td width="40%" height="30" class="unnamed14"><div align="right">用户姓名: </div></td>
<td height="30">
<input name="name_in" type="text" id="name_in"></td>
</tr>
<tr>
<td height="30" class="unnamed14"><div align="right">用户类别: </div></td>
<td height="30">
<select name="class_in" id="class_in">
<option value="教师" selected> 一般教师</option>
<option value="超级管理员">超级管理员</option>
</select></td>
</tr>
<tr>
<td height="30" class="unnamed14"><div align="right">用户密码: </div></td>
<td height="30"> <input name="pass1_in" type="password" id="pass1_in"></td>
</tr>
<tr>
<td width="40%" height="30" class="unnamed14"><div align="right">重复密码: </div></td>
<td height="30"> <input name="pass2_in" type="password" id="pass2_in"></td>
</tr>
<tr>
<td height="40" colspan="2"><div align="center">
<input type="submit" name="Submit3" value=" 增 加 ">
<input type="reset" name="Submit4" value=" 重 填 ">
</div></td>
</tr>
</table>
</td></form>
</tr>
</table>
<div align="center"> <span class="unnamed14h20"><font color="#FF0000">
<%if msg<>"" then response.write msg end if%>
</font></span></div>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="unnamed10"> </td>
</tr>
</table> </td>
</tr>
</table>
<%end if%>
<!--#include file="inc/bottom.asp" -->
<%conn.close%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -