<% If session("admin_flag")=1 Then %> <% set rs=server.createobject("adodb.recordset") sql="select * from jjh_admin order by admin_id DESC" rs.open sql,conn,1,1 %> <%do while not rs.eof%> <% rs.movenext loop If rs.EOF And rs.BOF Then%> <% end if%>
管理员管理 添加新管理员
ID
管理员姓名
管理权限
管理
<%=rs("admin_id")%> <%=rs("admin_name")%> <%if rs("admin_flag")=1 then%>超级管理员<% Else %>一般管理员<% End If %> ">修改 ">删除
当前还没有 管理员!
<% if request("type")="new" then%>
添加新管理员
管理员姓名
管理员密码
管理权限 超级管理员 一般管理员
<% End If %> <% dim rs1,rs2 dim sql1,sql2 If Request.Form("ok")="确定新增" Then admin_name=request("admin_name") admin_flag=request("admin_flag") admin_password=md5(request("admin_password")) End If If request("action")="add" Then set rs1=server.CreateObject("adodb.recordset") rs1.Open "jjh_admin",conn,3,3 rs1.addnew rs1("admin_name")=admin_name rs1("admin_flag")=admin_flag rs1("admin_password")=admin_password rs1.update rs1.close response.Redirect("zl.asp") end if %> <% if request("type")="edit" then if request.querystring("admin_id")="" then errmsg=errmsg+"
"+"
  • 请指定操作的对象!" call diserror() response.end else if not isinteger(request.querystring("admin_id")) then errmsg=errmsg+"
    "+"
  • 非法的新闻ID参数!" call diserror() response.end end if end if sql2="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id")) set rs2=server.createobject("adodb.recordset") rs2.open sql2,conn,1,1 %>
    ">
    密码修改
    管理员姓名 ">
    管理员密码 ">
    管理权限 value="1"> 超级管理员 value="2"> 一般管理员 
    <% rs2.close set rs2=nothing End If %> <% dim rs3,rs4,rs5 dim sql3,sql4,sql5 if request.form("okla")="确定修改" then admin_name=request("admin_name") admin_flag=request("admin_flag") admin_password=md5(request("admin_password")) End If If request("action")="edit" Then set rs3=server.CreateObject("adodb.recordset") sql3="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id")) rs3.open sql3,conn,3,3 rs3("admin_name")=admin_name rs3("admin_flag")=admin_flag rs3("admin_password")=admin_password rs3.update rs3.close response.Redirect("zl.asp") end if %> <% If request("type")="del" Then if request.querystring("admin_id")="" then errmsg=errmsg+"
    "+"
  • 请指定操作的对象!" call diserror() response.end else if not isinteger(request.querystring("admin_id")) then errmsg=errmsg+"
    "+"
  • 非法的新闻ID参数!" call diserror() response.end end if end if sql4="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id")) set rs4=server.createobject("adodb.recordset") rs4.open sql4,conn,1,1 %>
    ">
    删除管理员
    管理员姓名 <%=rs4("admin_name")%>
    管理员密码 <%=rs4("admin_password")%>
    管理权限 <%if rs4("admin_flag")=1 then%>超级管理员<% Else %>一般管理员<% End If %>
    <% End If %> <% dim rs6 dim sql6 if request.Form("oklala")="确定删除" then if request.Form("admin_id")="" then founderr=true errmsg=errmsg+"
    "+"
  • 你必须指定操作的对象!" else if not isInteger(request.form("admin_id")) then founderr=true errmsg=errmsg+"
    "+"
  • 非法的新闻id参数。" end if end if if request("action")="del" then set rs6=server.createobject("adodb.recordset") sql6="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id")) rs6.open sql6,conn,1,3 rs6.delete rs6.close set rs6=nothing response.Redirect("zl.asp") end if end if else %> <% dim rs9,sql9 set rs9=server.CreateObject("adodb.recordset") sql9="select * from jjh_admin where admin_id="&session("admin_id")&"" rs9.open sql9,conn,3,3 %>
    密码修改
    管理员姓名 ">
    管理员密码 ">
    <% rs9.close dim rs8 dim sql8 if request.form("okla1")="确定修改" then admin_name=request("admin_name") admin_password=md5(request("admin_password")) End If If request("action")="edit" Then set rs8=server.CreateObject("adodb.recordset") sql8="select * from jjh_admin where admin_id="&session("admin_id")&"" rs8.open sql8,conn,3,3 rs8("admin_name")=admin_name rs8("admin_password")=admin_password rs8.update rs8.close response.Redirect("zl.asp") end if %> <% End If %>