⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_admin.asp

📁 本程序采用ACC数据核心构件!! 功能介绍: 程序代码重新设计与优化
💻 ASP
字号:
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/code.asp"-->
<!--#include file="../inc/SqlIn.Asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/check.asp"-->
<HTML><HEAD><TITLE>管理中心 - 管理员管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="admin_style.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
</head>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) >
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<tr> 
 <th>管理员管理</th>
 </tr>
<tr> 
 <td class="TableRow1"><b>管理选项:</b> <a href=admin_admin.asp>管理首页</a> &nbsp;<a href=admin_admin.asp?action=newadmin>添加管理员</a></td>
 </tr>
</table>
<br>
<%
select case request("action")
case ""
call admin()
case "editadmin"
call editadmin()
case "editadminok"
admin_name=request.Form("admin_name")
admin_super=request.Form("admin_super")
if MD5(trim(replace(request("admin_pass"),"'","")))=MD5(trim(replace(request("admin_pass_pass"),"'",""))) then
Response.Write("<script language=javascript>alert('密码和确认密码不同!请从新输入!');history.go(-1);</script>")
end if 
set rs=server.CreateObject("adodb.recordset")
sql="select * from Gq_admin where admin_id="&request("admin_id")
rs.open sql,conn,1,3
rs("admin_name")=admin_name
rs("admin_pass")=MD5(trim(replace(request("admin_pass"),"'","")))
rs("admin_super")=admin_super
rs.update
rs.close
call closeconn()
response.Redirect"admin_admin.asp"
case "newadmin"
call newadmin()
case "newadminok"
admin_name=request.Form("admin_name")
admin_super=request.Form("admin_super")
admin_pass=MD5(trim(replace(request("admin_pass"),"'","")))
admin_pass_pass=MD5(trim(replace(request("admin_pass_pass"),"'","")))
if admin_pass=admin_pass_pass then
Response.Write("<script language=javascript>alert('密码和确认密码不同!请从新输入!');history.go(-1);</script>")
end if 
set rs=server.CreateObject("adodb.recordset")
sql="select * from Gq_admin"
rs.open sql,conn,1,3
rs.addnew
rs("admin_name")=admin_name
rs("admin_pass")=admin_pass
rs("admin_super")=admin_super
rs.update
rs.close
call closeconn()
response.Redirect"admin_admin.asp"
case "lock"
Conn.Execute("update Gq_admin set admin_lock=true Where admin_id="&Request.QueryString("admin_id"))
Response.Write("<script language=javascript>alert('锁定成功!');this.location.href='admin_admin.asp';</script>")
call closeconn()
case "unlock"
Conn.Execute("update Gq_admin set admin_lock=false Where admin_id="&Request.QueryString("admin_id"))
Response.Write("<script language=javascript>alert('恢复成功!');this.location.href='admin_admin.asp';</script>")
call closeconn()
case "del"
Conn.Execute("Delete * From Gq_admin Where admin_id="&Request.QueryString("admin_id"))
Response.Write("<script language=javascript>alert('删除成功!');this.location.href='admin_admin.asp';</script>")
call closeconn()
end select
sub admin()
set rs=server.CreateObject("adodb.recordset")
sql="select * from Gq_admin order by admin_id desc"
rs.open sql,conn,1,1%>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<tr height="25">
<th>管理员名称</th>
<th>管理员权限</th>
<th>状  态</th>
<th>上次登陆时间</th>
<th>上次登陆IP</th>
<th>操 作</th>
</tr>
<%if not rs.bof and not rs.eof then
num=1
do while not rs.eof%>
<tr height="25">
<td align=center class="TableRow2"><%=rs("admin_name")%></td>
<td align=center class="TableRow1">
<%if rs("admin_super")="admin" then
response.write"超级管理员"
elseif rs("admin_super")="admin1" then
response.write"普通管理员"
end if%></td>
<td width=60 align=center class="TableRow2">
<%if rs("admin_lock")=true then
response.write"<font color=red>锁  定<font>"
else
response.write"正  常"
end if%></td>
<td width=150 align=center class="TableRow2"><%=rs("logintime")%></td>
<td width=120 align=center class="TableRow2"><%=rs("loginip")%></td>
<td align=center class="TableRow2"><a href=?action=del&admin_id=<%=rs("admin_id")%>>删除</a>&nbsp;<a href=?action=editadmin&admin_id=<%=rs("admin_id")%>>编辑</a>&nbsp;
<%if rs("admin_lock")=true then
response.write"<a href=?action=unlock&admin_id="&rs("admin_id")&">恢复</a>"
else
response.write"<a href=?action=lock&admin_id="&rs("admin_id")&">锁定</a>"
end if%>
</td></tr>
</form>
<%
num=num+1
rs.movenext
loop
end if
rs.close
set rs=nothing
Response.Write("</table>")
end sub
sub newadmin()%>
<script language="javascript">
function chk(){
if(document.form.admin_name.value==""){
alert("管理员名称不能为空!");
document.form.admin_name.focus();
return false;}
if(document.form.admin_pass.value==""){
alert("管理员密码不能为空!");
document.form.admin_pass.focus();
return false;}
if(document.form.admin_pass_pass.value==""){
alert("管理员确认密码不能为空!");
document.form.admin_pass_pass.focus();
return false;}
return true;}
</Script>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<form method="post" name="form" id="form" onsubmit="return chk();" action="?action=newadminok">
<tr> 
<th colspan=2>管理员管理--添加管理员</th>
</tr>
<tr height="25">
<td width="26%" align="right" class=tablerow1>管理员名称:</td>
<td class=tablerow1><input name="admin_name" type="text" id="admin_name" style="width:170px"></td>
</tr>
<tr height="25">
<td width="26%" align="right" class=tablerow1>管理员密码:</td>
<td class=tablerow1><input name="admin_pass" type="password" id="admin_pass" style="width:170px"></td>
</tr>
<tr height="25">
<td width="26%" align="right" class=tablerow1>请确认密码:</td>
<td class=tablerow1><input name="admin_pass_pass" type="password" id="admin_pass_pass" style="width:170px"></td>
</tr>
<tr height="25">
<td width="26%" align="right" class=tablerow1>管理员权限:</td>
<td class=tablerow1>
<input name="admin_super" type="radio" value="admin1" checked> 普通管理员
<input name="admin_super" type="radio" value="admin" checked> 超级管理员 (拥有最高权限)</td>
</tr>
<tr height="30">
<td colspan=2 align="center" class=tablerow1>
<input name="new" type="submit" class="adminbutton" id="new" value="添 加">&nbsp;
<input name="Submit2" type="reset" class="adminbutton" value="清 空" ></td>
</tr>
</form>
</table>
<%
end sub
sub editadmin()
set rs=server.CreateObject("adodb.recordset")
sql="select * from Gq_admin where admin_id="&request("admin_id")
rs.open sql,conn,1,1%>
<script language="javascript">
function chk(){
if(document.form.admin_name.value==""){
alert("管理员名称不能为空!");
document.form.admin_name.focus();
return false;}
return true;}
</Script>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<form method="post" name="form" id="form" onsubmit="return chk();" action="?action=editadminok">
<tr> 
<th colspan=2>管理员管理--编辑管理员</th>
</tr>		
<tr height="25">
<td width="26%" align="right" class=tablerow1>管理员名称:</td>
<td class=tablerow1><input name="admin_name" type="text" id="admin_name" style="width:100px" value=<%=rs("admin_name")%>></td>
</tr>
<tr height="25">
<td width="26%" align="right" class=tablerow1>管理员密码:</td>
<td class=tablerow1><input name="admin_pass" type="password" id="admin_pass" style="width:100px"> 不修改请留空!</td>
</tr>
<tr height="25">
<td width="26%" align="right" class=tablerow1>请确认密码:</td>
<td class=tablerow1><input name="admin_pass_pass" type="password" id="admin_pass_pass" style="width:100px"> 不修改请留空!</td>
</tr>
<tr height="25">
<td width="26%" align="right" class=tablerow1>管理员权限:</td>
<td class=tablerow1>
<input type=radio name=admin_super value="admin1" <%If Rs("admin_super")="admin1" Then response.write "checked"%>> 普通管理员
<input type=radio name=admin_super value="admin" <%If Rs("admin_super")="admin" Then response.write "checked"%>> 超级管理员 (拥有最高权限)</td>
</tr>
<tr height="30">
<td align="center" colspan=2 class="TableRow2">
<input name="new" type="submit" class="adminbutton" id="new" value=" 修 改 ">&nbsp;
<input name="Submit2" type="reset" class="adminbutton" value=" 清 空 " >
<input name="admin_id" type="hidden"  value="<%=rs("admin_id")%>" >
</td></tr>
</form>
</table>
<%
end sub
call closeconn()%>
<table width=98% align="center" border="0" cellspacing="0" cellpadding="0">
<tr align="middle">
<td height="30" valign="bottom">Copyright (c) 2004-2006 <a target="_blank" href="http://www.xuncms.cn"><b><font color="#708796">XunCms</font><font color="#cc0000">.Cn</font></b></font></a>. All Rights Reserved .</td>
</tr>
<tr align="middle">
<td>Powered by:<a href="http://www.xuncms.cn" target="_blank"><b><font color="#708796">讯图</font><font color="#cc0000">设计</font></b></font> XunCms <%=Version%></a></td>
</tr>
</table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -