📄 admin_manage.asp
字号:
<!--#include file="conn.asp" -->
<!--#include file="admin_check.asp" -->
<%
call manager(session("grade"),session("adminname"),3)
id =trim(request("id"))
adminname=trim(request.form("adminname"))
adminpass=trim(request.form("adminpass"))
grade=trim(request.form("grade"))
if id<>"" and request("action")="del" then
conn.execute "delete * from admin where 编号="&id&""
response.write "<center><b>已成功删除此管理员!</b><br>"
response.write ref("admin_manage.asp",3)
response.end
end if
if adminname<>"" and adminpass<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from admin where 管理员名='"&adminname&"'",conn,1,1
if not rs.eof then
response.Write "<br><font color=red>"&adminname&"</font>这个用户名已经存在了!"
response.write ref("admin_manage.asp",2)
response.end
else
conn.execute"insert into admin (管理员名,密码,级别) values ('"&adminname&"','"&adminpass&"','"&grade&"')"
response.Write "<br><font color=red>"&adminname&"</font>管理员添加成功!"
response.write ref("admin_manage.asp",2)
response.end
end if
rs.close
set rs=nothing
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台管理 - 管理员</title>
<link href="admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="760" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td width="160" valign="top">
<!--#include file="admin_left.asp" -->
</td>
<td width="600" valign="top">
<table width="98%" border="0" cellspacing="0" cellpadding="1" height="91">
<tr>
<td height="48">
<font color="#FF0000">注意,此操作不可逆!</font></td>
</tr>
<tr>
<td height="48">
<form name="adminform" method="post" action="admin_manage.asp">
<span class="fontline1">级别暂时没有启用,请选择默认3 </span>
<font color="#FF0000"><br>
管理员添加</font>|用户名
<input name="adminname" type="text" id="adminname" size="10" maxlength="12">
密码
<input name="adminpass" type="password" id="adminpass" size="10" maxlength="20">
类
<select name="grade" id="grade">
<option value="1">1</option>
<option value="2">2</option>
<option selected value="3">3</option>
<option value="4">4</option>
</select>
<input type="submit" name="bu" value="提交"">
</form>
</td>
</tr>
<tr>
<td height="39"><table width="73%" border="0" cellpadding="3" cellspacing="1" bgcolor="#666666">
<tr>
<td width="31%"><font color="#FFFFFF">用 户 名</font></td>
<td width="30%"><font color="#FFFFFF">密 码</font></td>
<td width="20%" align="center"><font color="#FFFFFF">级 别</font></td>
<td width="19%" align="center"><font color="#FFFFFF">操 作</font></td>
</tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.open"select * from admin",conn,1,1
if rs.eof then response.write"暂无管理员,请添加!"
do while not rs.eof
%>
<tr bgcolor="#FFFFFF">
<td><%=rs("管理员名")%></td>
<td><%=Replace(rs("密码"),left(rs("密码"),len(rs("密码"))),"********")%></td>
<td align="center"><%=rs("级别")%></td>
<td align="center"><a href=admin_modiuser.asp?id=<%=rs("编号")%>>修改</a> | <a href="?action=del&id=<%=rs("编号")%>">删除</a></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -