<% dim founderr,errmsg founderr=false errmsg="" if session("adminlogin")<>sessionvar then founderr=true errmsg=errmsg+"
"+"
  • 你尚未登录,或者超时了!请重新登录!" call diserror() response.end else if request.form("MM_insert") then if request.form("action")="modpass" then dim adminname,oldpwd,adminpwd,confirm adminname=trim(replace(request.form("adminname"),"'","")) oldpwd=trim(replace(request.form("oldpwd"),"'","")) adminpwd=trim(replace(request.form("adminpwd"),"'","")) confirm=trim(replace(request.form("confirm"),"'","")) if adminname="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须输入管理员名称!" end if if oldpwd="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须输入旧的管理员密码!" end if if adminpwd="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须输入新的管理员密码!" end if if adminpwd<>confirm then founderr=true errmsg=errmsg+"
    "+"
  • 你两次输入的管理员密码不相同!" end if if founderr then call diserror() response.end else sql="select * from admin where admin_name='"&adminname&"' and admin_password='"&oldpwd&"'" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 if rs.eof then errmsg=errmsg+"
    "+"
  • 管理员名称或密码错误!" call diserror() response.end else rs("admin_password")=adminpwd rs.update rs.close set rs=nothing end if end if end if if request.form("action")="newadmin" then adminname=trim(replace(request.form("adminname"),"'","")) adminpwd=trim(replace(request.form("adminpwd"),"'","")) confirm=trim(replace(request.form("confirm"),"'","")) if adminname="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须输入管理员名称!" end if if adminpwd="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须输入管理员密码!" end if if adminpwd<>confirm then founderr=true errmsg=errmsg+"
    "+"
  • 你两次输入的管理员密码不相同!" end if if founderr then call diserror() response.end else sql="select * from admin" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 rs.addnew rs("admin_name")=adminname rs("admin_password")=adminpwd rs.update rs.close set rs=nothing response.redirect "admin_admin.asp?action=admin" end if end if if request.form("action")="editadmin" then if request.Form("id")="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须指定操作的对象!" else if not isInteger(request.form("id")) then founderr=true errmsg=errmsg+"
    "+"
  • 非法的管理员id参数。" end if end if adminname=trim(replace(request.form("adminname"),"'","")) adminpwd=trim(replace(request.form("adminpwd"),"'","")) confirm=trim(replace(request.form("confirm"),"'","")) if adminname="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须输入管理员名称!" end if if adminpwd="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须输入管理员密码!" end if if adminpwd<>confirm then founderr=true errmsg=errmsg+"
    "+"
  • 你两次输入的管理员密码不相同!" end if if founderr then call diserror() response.end else sql="select * from admin where admin_id="&request.form("id") set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 rs("admin_name")=adminname rs("admin_password")=adminpwd rs.update rs.close set rs=nothing response.redirect "admin_admin.asp?action=admin" end if end if if request.form("action")="deladmin" then if request.Form("id")="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须指定操作的对象!" else if not isInteger(request.form("id")) then founderr=true errmsg=errmsg+"
    "+"
  • 非法的管理员分类id参数。" end if end if if founderr then call diserror() response.end else sql="select * from admin where admin_id="&request.form("id") set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 rs.delete rs.close set rs=nothing response.redirect "admin_admin.asp?action=admin" end if end if end if%> 管理中心 <%if request.querystring("action")="modpass" then %>
    修改管理员密码
    管理员名称- 旧密码-
    新密码- 确认新密码-
    <%end if if request.querystring("action")="admin" then sql="select * from admin" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 %> <%do while not rs.eof%> <%rs.movenext loop%>
    <%=rs("admin_name")%> 管理员组
    编号 管理员名称 操作
    <%=rs("admin_id")%>  <%=rs("admin_name")%>  <%if rs("issuper")<>1 then%> &action=editadmin">edit &action=deladmin">del <%end if%>

    新的管理员
    名称-   
    密码-      确认密码-
    <%end if if request.querystring("action")="editadmin" then if request.querystring("id")="" then errmsg=errmsg+"
    "+"
  • 请指定操作的对象!" call diserror() response.end else if not isinteger(request.querystring("id")) then errmsg=errmsg+"
    "+"
  • 非法的管理员ID参数!" call diserror() response.end end if end if sql="select * from admin where admin_id="&cint(request.querystring("id")) set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1%> ">
    编辑管理员
    名称- ">   
    密码- ">      确认密码- ">
    <%rs.close set rs=nothing end if if request.querystring("action")="deladmin" then if request.querystring("id")="" then errmsg=errmsg+"
    "+"
  • 请指定操作的对象!" call diserror() response.end else if not isinteger(request.querystring("id")) then errmsg=errmsg+"
    "+"
  • 非法的管理员ID参数!" call diserror() response.end end if end if sql="select * from admin where admin_id="&cint(request.querystring("id")) set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 %> ">
    删除管理员
    名称- <%=rs("admin_name")%>   
    密码- <%=rs("admin_password")%>      确认密码- <%=rs("admin_password")%>
    [返回]
    <%rs.close set rs=nothing end if%>
    <%end if %>