📄 manage.asp
字号:
<!--#include file="css.asp"-->
<!--#include file="conn.asp"-->
<%
strusn=Session("usn")
strpwd=Session("pwd")
strisadmin=Session("isAdmin")
strType=Trim(Request.QueryString("Type"))
struser=Trim(Request.QueryString("usn"))
strpass=Trim(Request.QueryString("pwd"))
stradminTB=Trim(Request.QueryString("adminTB"))
'==============================================================
if strusn<>"" and strpwd<>"" and strisadmin="T" then
strSQL="Select * from AdminLogin Where usn='" & strusn & "' and pwd='" & strpwd & "'"
set rs=Server.CreateObject("ADODB.RECORDSET")
rs.Open strSQL,con,1,3
if rs.RecordCount>0 then
'=============================================
if struser<>"" or strpass<>"" then
'=======================================================================
if strType<>"" and strType="修改密码" then
rs.Close
if stradminTB="True" then
strTB="adminLogin"
else
strTB="userLogin"
end if
strsql="select * from " & strTB &" Where usn='" & struser & "'"
rs.Open strsql,con,3,3
rs("pwd")=strpass
rs.Update
end if
'======================================================================
if strType<>"" and strType="删除帐号" then
rs.Close
if stradminTB="True" then
strTB="adminLogin"
strZT=" and zt=False"
else
strTB="userLogin"
strZT=""
end if
strsql="select * from " & strTB &" Where usn='" & struser & "'" & strZT
rs.Open strsql,con,3,3
if rs.RecordCount>0 then
rs.Delete
rs.Update
else
Response.Redirect "error.asp?info=对不起,超超级用户不能删除!!!!!!!"
end if
end if
'======================================================================
if strType<>"" and strType="新增帐号" then
rs.Close
if stradminTB="True" then
strTB="adminLogin"
else
strTB="userLogin"
end if
strsql="select * from " & strTB & " Where usn='" & struser & "'"
rs.Open strsql,con,1,3
if rs.RecordCount<=0 then
strsql="select * from " & strTB
rs.Close
rs.Open strsql,con,3,3
rs.AddNew
if struser<>"" then
rs("usn")=struser
else
rs.Cancel
rs.Close
response.Redirect "error.asp?info=新增数据,登录名不能为空!"
end if
rs("pwd")=strpass
rs.Update
end if
end if
'=========================================================================
%>
<body bgcolor=#0066FF>
<br><br><center><img src="image/manager.jpg"></center>
<hr>
<a href="main.asp"><font size=2 color=white>返回首页</font></a>
<center>
<table>
<tr><td colspan=4 align=center>管理员登录</td></tr>
<tr><td align=center>
<%
rs.Close
strSQL="Select * from AdminLogin"
rs.Open strSQL,con,1,3
count=0
do while not rs.EOF
count=count+1
if count mod 2 =0 then
bc="#ccccfff"
else
bc="#ccffcc"
end if
%>
<form action="manage.asp">
<table bgcolor=<%=bc%> border=0 width=400 align=center>
<tr><td>用户名:</td><td align=center width=70><font size=2 color=red><%= rs("usn")%></font></td><td>密码</td><td><input type=password value="<%= rs("pwd")%>" name=pwd></td></tr>
<tr><td colspan=4 align=center><input type=hidden value=<%= rs("usn")%> name="usn"><input type=hidden value="True" name="adminTB"><input type=submit value="修改密码" name="type"> <input type=submit value="删除帐号" name="type"></td></tr>
</table>
</form>
<%
rs.MoveNext
loop
%>
</td></tr>
<tr><td><hr>
<form action="manage.asp">
<table bgcolor=#ffcc33 border=0 width=500>
<tr><td>用户名:</td><td align=center width=70><input type=text value="" name="usn"></td><td>密码</td><td><input type=password value="" name=pwd ></td></tr>
<tr><td colspan=4 align=center><input type=hidden value="True" name="adminTB"><input type=submit value="新增帐号" name="type" ID="Submit2"></td></tr>
</table>
</form>
</td></tr>
</table>
<br><br><br>
<center><font size=3 color=#663300>普通工作人员登录帐号管理</font></center>
<hr>
<table>
<tr><td colspan=4 align=center>普通工作人员登录</td></tr>
<tr><td align=center>
<%
rs.Close
strSQL="Select * from UserLogin"
rs.Open strSQL,con,1,3
count=0
do while not rs.EOF
count=count+1
if count mod 2 =0 then
bc="#ffcc00"
else
bc="#ffccaa"
end if
%>
<form action="manage.asp" ID="Form1">
<table bgcolor=<%=bc%> border=0 width=400 align=center ID="Table2">
<tr><td>用户名:</td><td align=center width=70><font size=2 color=red><%= rs("usn")%></font></td><td>密码</td><td><input type=password value="<%= rs("pwd")%>" name=pwd ID="Password1"></td></tr>
<tr><td colspan=4 align=center><input type=hidden value=<%= rs("usn")%> name="usn" ID="Hidden1">
<input type=hidden value="False" name="adminTB" ID="Hidden3"><input type=submit value="修改密码" name="type" ID="Submit1"> <input type=submit value="删除帐号" name="type" ID="Submit3"></td></tr>
</table>
</form>
<%
rs.MoveNext
loop
%>
</td></tr>
<tr><td><hr>
<form action="manage.asp" >
<table bgcolor=#ccccccborder=0 width=500 ID="Table3">
<tr><td>用户名:</td><td align=center width=70><input type=text value="" name="usn" ID="Text1"></td><td>密码</td><td><input type=password value="" name=pwd ID="Password2"></td></tr>
<tr><td colspan=4 align=center><input type=hidden value="False" name="adminTB" ID="Hidden2"><input type=submit value="新增帐号" name="type" ID="Submit4"></td></tr>
</table>
</form>
</td></tr>
</table>
</center>
</body>
<%
else
%>
<body bgcolor=#0066FF>
<br><br><center><img src="image/manager.jpg"></center>
<hr>
<a href="main.asp"><font size=2 color=white>返回首页</font></a>
<center>
<table ID="Table1">
<tr><td colspan=4 align=center>管理员登录</td></tr>
<tr><td align=center>
<%
rs.Close
strSQL="Select * from AdminLogin"
rs.Open strSQL,con,1,3
count=0
do while not rs.EOF
count=count+1
if count mod 2 =0 then
bc="#ccccfff"
else
bc="#ccffcc"
end if
%>
<form action="manage.asp" ID="Form2">
<table bgcolor=<%=bc%> border=0 width=400 align=center ID="Table4">
<tr><td>用户名:</td><td align=center width=70><font size=2 color=red><%= rs("usn")%></font></td><td>密码</td><td><input type=password value="<%= rs("pwd")%>" name=pwd ID="Password3"></td></tr>
<tr><td colspan=4 align=center><input type=hidden value=<%= rs("usn")%> name="usn" ID="Hidden4"><input type=hidden value="True" name="adminTB" ID="Hidden5"><input type=submit value="修改密码" name="type" ID="Submit5"> <input type=submit value="删除帐号" name="type" ID="Submit6"></td></tr>
</table>
</form>
<%
rs.MoveNext
loop
%>
</td></tr>
<tr><td><hr>
<form action="manage.asp" ID="Form3">
<table bgcolor=#ffcc33 border=0 width=500 ID="Table5">
<tr><td>用户名:</td><td align=center width=70><input type=text value="" name="usn" ID="Text2"></td><td>密码</td><td><input type=password value="" name=pwd ID="Password4"></td></tr>
<tr><td colspan=4 align=center><input type=hidden value="True" name="adminTB" ID="Hidden6"><input type=submit value="新增帐号" name="type" ID="Submit7"></td></tr>
</table>
</form>
</td></tr>
</table>
<br><br><br>
<center><font size=3 color=#663300>普通工作人员登录帐号管理</font></center>
<hr>
<table ID="Table6">
<tr><td colspan=4 align=center>普通工作人员登录</td></tr>
<tr><td align=center>
<%
rs.Close
strSQL="Select * from UserLogin"
rs.Open strSQL,con,1,3
count=0
do while not rs.EOF
count=count+1
if count mod 2 =0 then
bc="#ffcc00"
else
bc="#ffccaa"
end if
%>
<form action="manage.asp" ID="Form4">
<table bgcolor=<%=bc%> border=0 width=400 align=center ID="Table7">
<tr><td>用户名:</td><td align=center width=70><font size=2 color=red><%= rs("usn")%></font></td><td>密码</td><td><input type=password value="<%= rs("pwd")%>" name=pwd ID="Password5"></td></tr>
<tr><td colspan=4 align=center><input type=hidden value=<%= rs("usn")%> name="usn" ID="Hidden7">
<input type=hidden value="False" name="adminTB" ID="Hidden8"><input type=submit value="修改密码" name="type" ID="Submit8"> <input type=submit value="删除帐号" name="type" ID="Submit9"></td></tr>
</table>
</form>
<%
rs.MoveNext
loop
%>
</td></tr>
<tr><td><hr>
<form action="manage.asp" ID="Form5">
<table bgcolor=#ccccccborder=0 width=500 ID="Table8">
<tr><td>用户名:</td><td align=center width=70><input type=text value="" name="usn" ID="Text3"></td><td>密码</td><td><input type=password value="" name=pwd ID="Password6"></td></tr>
<tr><td colspan=4 align=center><input type=hidden value="False" name="adminTB" ID="Hidden9"><input type=submit value="新增帐号" name="type" ID="Submit10"></td></tr>
</table>
</form>
</td></tr>
</table>
</center>
</body>
<%
end if
else
Response.Redirect "error.asp?info=对不起,你没有权限操作该界面!"
end if
else
Response.Redirect "error.asp?info=对不起,您的IE不支持Cookies!请打开该功能后重试!"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -