administrator.asp
Upload User: suhf168
Upload Date: 2020-12-12
Package Size: 4345k
Code Size: 4k
Development Platform:

ASP/ASPX

  1. <%@language=vbscript%>
  2. <!--#include file="../../inc/md5.asp"-->
  3. <%dbdns="../../"%>
  4. <!--#include file="../../inc/conn.asp"-->
  5. <!--#include file="../cook.asp"-->
  6. <%if fla11<>1 then
  7. response.write "<script>alert('操作权限出错,您没有权限操作些功能');history.go(-1);</Script>"
  8. Response.End 
  9. end if%>
  10. <%if request("action")="save" then
  11. user=replace(trim(request("user")),"'","")
  12. password=replace(trim(Request("pass")),"'","")   
  13. if user="" then
  14. response.write "<script>alert('请输入登录用户名');history.go(-1);</Script>"
  15. Response.End 
  16. elseif password="" then
  17. response.write "<script>alert('请输入登录密码');history.go(-1);</Script>"
  18. Response.End 
  19. end if
  20. set rs=server.createobject("adodb.recordset")
  21. sql="select * from SMT_admin where SMT_nick='"&user&"'"
  22. rs.open sql,conn,1,3
  23. if not(rs.bof and rs.eof) then
  24. response.write "<script>alert('此用户已存在,请重新输入');history.go(-1);</Script>"
  25. Response.End 
  26. else
  27. rs.addnew
  28. rs("SMT_password")=md5(password)
  29. rs("SMT_nick")=user
  30. rs("SMT_flag")="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
  31. rs.update
  32. end if
  33. rs.close
  34. set rs=nothing
  35. response.redirect "administrator.asp?action=reh"
  36. elseif request("action")="del" then
  37. conn.execute("Delete From SMT_admin Where SMT_id="&request("id")&"")
  38. response.redirect "administrator.asp?action=reh"
  39. elseif request("action")="pass" then
  40. set rs=server.createobject("adodb.recordset")
  41. sql="select * from SMT_admin where SMT_id="&request("id")&""
  42. rs.open sql,conn,1,3
  43. if not(rs.bof and rs.eof) then
  44. rs("SMT_password")=md5("123")
  45. rs.update
  46. end if
  47. rs.close
  48. set rs=nothing
  49. response.redirect "administrator.asp?action=reh"
  50. elseif request("action")="reh" then
  51. response.write"<meta http-equiv=""refresh"" content=""0;URL=administrator.asp"">"
  52. response.end
  53. end if%>
  54. <%=citycss%>
  55. <html>
  56. <head>
  57. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  58. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  59. <meta name="ProgId" content="FrontPage.Editor.Document">
  60. </head>
  61. <body style="margin:10">
  62. <table width="95%" height="0" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#cccccc">
  63.   <form name="form1" method="post" action="administrator.asp?action=save">
  64.     <tr bgcolor="#efefef"> 
  65.       <td height="30" colspan=2> <strong>添加管理员::</strong></td>
  66.     </tr>
  67.     <tr bgcolor="#ffffff"> 
  68.       <td width="18%" height="30" align="center">用 户 名</td>
  69.       <td width="82%"> 
  70.         <input name="user" type="text" size=20 style="width:150" maxlength="30"></td>
  71.     </tr>
  72.     <tr bgcolor="#ffffff"> 
  73.       <td width="18%" height="30" align="center">初始密码</td>
  74.       <td width="82%"> 
  75.         <input name="pass" type="password" size=20 style="width:150" maxlength="30"></td>
  76.     </tr>
  77.     <tr bgcolor="#ffffff" align="center"> 
  78.       <td height="30" colspan=2><input type="submit" name="Submit" value="添 加" class=input1></td>
  79.     </tr>
  80.   </form>
  81. </table>
  82. <br>
  83. <table width="95%" height="0" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#cccccc">
  84.     <tr bgcolor="#efefef" align="center"> 
  85.       <td width="18%" height="30"><strong>用户名</strong></td>
  86.       <td width="51%"><strong>操 作</strong></td>
  87.     </tr>
  88. <%set rs=server.createobject("adodb.recordset")
  89. sql="select * from SMT_admin order by SMT_id desc"
  90. rs.open sql,conn,1,1
  91. do while not rs.eof%>
  92.     <tr bgcolor="#ffffff" align="center"> 
  93.       <td height="30"><%=rs("SMT_nick")%></td>
  94.       <td><input type="button" name="Submit" value="恢复密码为123" onclick="javascript:window.open('administrator.asp?action=pass&id=<%=rs("SMT_id")%>','_self')" class=input1>&nbsp;
  95. <input type="button" name="Submit" value="删 除" onclick="javascript:window.open('administrator.asp?action=del&id=<%=rs("SMT_id")%>','_self')" class=input1></td>
  96.     </tr>
  97. <%rs.movenext
  98. loop
  99. rs.close
  100. set rs=nothing%>
  101. </table>
  102. </body>
  103. </html>