56770_admin.asp
上传用户:feitengda
上传日期:2022-07-20
资源大小:73k
文件大小:3k
源码类别:

企业管理

开发平台:

ASP/ASPX

  1. <!--#include file="conn.asp"-->
  2. <%
  3. call admintop()
  4. if session("admin_name")="" then
  5. adminflag()
  6. else
  7. dim action, s_id,s_paixu
  8. s_id=request.QueryString("s_id")
  9. action=request("action")
  10. s_paixu=request("s_paixu")
  11. select case action
  12. case "add"
  13. if trim(request("s_name"))<>"" then
  14. set rs=server.CreateObject("adodb.recordset")
  15. rs.Open "select * from 56770_admin", conn, 1, 3
  16. rs.AddNew
  17. rs("a_name")=trim(request("s_name"))
  18. rs("a_pass")=trim(request("s_paixu"))
  19. rs.Update
  20. rs.Close
  21. set rs=nothing
  22. response.Redirect "56770_admin.asp"
  23. response.end
  24. end if
  25. '----------------------------------------
  26. case "edit"
  27. set rs=server.CreateObject("adodb.recordset")
  28. rs.open "select * from 56770_admin where a_id=" &s_id, conn, 1, 3
  29. rs("a_name")=request("s_name")
  30. rs("a_pass")=request("s_paixu")
  31. rs.update
  32. rs.close
  33. response.Redirect "56770_admin.asp"
  34. response.end
  35. set rs=nothing
  36. '--------------------------------
  37. case "del"
  38. conn.execute "delete from 56770_admin where a_id="&s_id
  39. response.Redirect "56770_admin.asp"
  40. response
  41. end select
  42. %>
  43. <table border="0" cellspacing="1" cellpadding="0" height="0" align=center width="98%" bgcolor="#183789">
  44.   <tr>
  45.   <td>
  46.    <table border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF" align="center" width="100%">
  47.   <tr>
  48.  <td height=15  align=center colspan=17 class=classtop>管理员管理</td>
  49. </tr>
  50. <%set rs=server.CreateObject("adodb.recordset")
  51. rs.open "select * from 56770_admin order by a_id desc", conn, 1, 1
  52. dim i
  53. i=rs.recordcount%>
  54. <tr class=classtop1>
  55. <td  height="15" align="center">管理员名</td>
  56. <td  height="15" align="center">管理员密码</font></td>
  57. <td  height="15" align="center">操作</td>
  58. </tr>
  59. <%if rs.eof and rs.bof then
  60. response.write "还没有数据,请添加!"
  61. else
  62.         do while not rs.eof%>
  63. <tr>
  64. <form name="form1" method="post" action="56770_admin.asp?action=edit&s_id=<%=rs("a_id")%>">
  65. <td class="classtd">
  66. <div align="center">
  67. <input name="s_name" type="text" id="s_name" value="<%=trim(rs("a_name"))%>" size="25">
  68. </div>
  69. </td>
  70. <td class="classtd">
  71. <div align="center">
  72. <input name="s_paixu" type="text" id="s_paixu" value=<%=rs("a_pass")%>  size="25">
  73. </div>
  74. </td>
  75. <td class="classtd">
  76. <div align="center">
  77. <input type="submit" name="Submit" value="修 改">
  78. <input type="button" name="Submit2" value="删 除" onClick="location.href='56770_admin.asp?action=del&s_id=<%=rs("a_id")%>'">
  79. </div>
  80. </td>
  81. </form>
  82. </tr>
  83. <%rs.movenext
  84. loop
  85. end if
  86. rs.close
  87. set rs=nothing%>
  88. <form name="form2" method="post" action="56770_admin.asp?action=add">
  89. <tr>
  90. <td height="15" class="classtd">
  91. <div align="center">
  92. <input name="s_name" type="text" id="s_name" size="25">
  93. </div>
  94. </td>
  95. <td class="classtd">
  96. <div align="center">
  97. <input name="s_paixu" type="text" id="s_paixu" value=0 size="25">
  98. </div>
  99. </td>
  100. <td class="classtd">
  101. <div align="center">
  102. <input type="submit" name="Submit2" value="添 加">
  103. </div>
  104. </td>
  105. </form>
  106. </tr>
  107. </table>
  108. </td>
  109. </tr>
  110. </table>
  111. <%end if%>