admin_padmin.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:4k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!--#include file="conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <!--#include file="md5.asp"-->
  4. <title><%=txl_info(0)%>--管理页面</title>
  5. <!--#include file="inc/admin_css.asp"-->
  6. <meta NAME=GENERATOR Content="Microsoft FrontPage 3.0" CHARSET=GB2312>
  7. <BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">
  8. <%
  9. if not supermaster or session("flag")="" then
  10. Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
  11. call txl_error()
  12. response.end
  13. end if
  14. %>
  15. <table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
  16. <tr>
  17. <th align=left colspan=6 height=23>照片管理</th>
  18. </tr>
  19. <tr>
  20. <td width=10% class=txlrow>注意事项</td>
  21. <td width=90% class=txlrow colspan=3 style="line-height: 150%">①点击上传人,可以查看其用户资料;<br>②点击照片说明,可以查看此照片内容;<br>③选择要删除的照片,点击删除按钮即可删除照片,但照片文件还保留在文件夹<%=txl_info(12)%>中;<br>④当误删除照片后,可到“照片回收站”中还原。</td>
  22. </tr>
  23. <%
  24. dim delid
  25. delid=replace(request("delid"),"'","")
  26. delid=replace(delid,";","")
  27. delid=replace(delid,"--","")
  28. delid=replace(delid,"(","")
  29. if request("action")="del" then
  30. call delete()
  31. else
  32. call main()
  33. end if
  34. conn.close
  35. set conn=nothing
  36. sub main()
  37. %>
  38. <tr>
  39. <th colspan=6 align=left height=23>照片列表</th>
  40. </tr>
  41. <%
  42. dim currentpage,page_count,Pcount
  43. dim totalrec,endpage
  44. currentPage=request("page")
  45. if currentpage="" or not isInteger(currentpage) then
  46. currentpage=1
  47. else
  48. currentpage=clng(currentpage)
  49. if err then
  50. currentpage=1
  51. err.clear
  52. end if
  53. end if
  54. Set rs= Server.CreateObject("ADODB.Recordset")
  55. sql="select * from imgdata where picset<2 order by addtime desc"
  56. rs.open sql,conn,1,1
  57. if rs.eof and rs.bof then
  58. response.write "<tr><td colspan=6 class=txlrow>没有找到相关记录。</td></tr>"
  59. else
  60. %>
  61. <FORM METHOD=POST ACTION="?action=del">
  62. <tr align=center>
  63. <td class=txlHeaderBackgroundAlternate><B>上传人</B></td>
  64. <td class=txlHeaderBackgroundAlternate><B>照片说明</B></td>
  65. <td class=txlHeaderBackgroundAlternate><B>所属类别</B></td>
  66. <td class=txlHeaderBackgroundAlternate><B>操作</B></td>
  67. </tr>
  68. <%
  69. dim trs
  70. rs.PageSize = Cint(txl_set(12))
  71. rs.AbsolutePage=currentpage
  72. page_count=0
  73. totalrec=rs.recordcount
  74. while (not rs.eof) and (not page_count = Cint(txl_set(12)))
  75. set trs=conn.execute("select classname from imgclass where classID="&rs("classID"))
  76. %>
  77. <tr>
  78. <td width=10% class=txlrow align=center><%=rs("postuser")%></td>
  79. <td width=70% class=txlrow><a href=<%=txl_info(12)&rs("filename")%> target=_blank><%=rs("picinfo")%></a></td>
  80. <td width=10% class=txlrow align=center><%=trs("classname")%></td>
  81. <td width=10% class=txlrow align=center><input type=checkbox name="delid" value="<%=rs("picid")%>"></td>
  82. </tr>
  83. <%
  84. page_count = page_count + 1
  85. rs.movenext
  86. wend
  87. Pcount=rs.PageCount
  88. %>
  89. <tr><td colspan=4 class=txlrow align=center>分页:
  90. <%
  91. if currentpage > 4 then
  92. response.write "<a href=""?page=1"">[1]</a> ..."
  93. end if
  94. if Pcount>currentpage+3 then
  95. endpage=currentpage+3
  96. else
  97. endpage=Pcount
  98. end if
  99. for i=currentpage-3 to endpage
  100. if not i<1 then
  101. if i = clng(currentpage) then
  102. response.write " <font color=#ce0000>["&i&"]</font>"
  103. else
  104. response.write " <a href=""?page="&i&""">["&i&"]</a>"
  105. end if
  106. end if
  107. next
  108. if currentpage+3 < Pcount then
  109. response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
  110. end if
  111. %>
  112. </td>
  113. </tr>
  114. <tr>
  115. <td colspan=4 class=txlrow align=right><input type=submit name=submit1 value="删 除"  onclick="{if(confirm('确定执行选择的操作吗?')){return true;}return false;}"></td>
  116. </tr>
  117. </FORM>
  118. </table>
  119. <%
  120. end if
  121. rs.close
  122. set rs=nothing
  123. end sub
  124. sub delete()
  125. dim filename,objfso
  126. response.write "<tr><th colspan=4 height=23 align=left>执行结果</th></tr>"
  127. if isnull(delid) or delid="" then
  128. response.write "<tr><td colspan=4 class=txlrow>请指定相关参数。</td></tr>"
  129. response.end
  130. else
  131. conn.execute("update imgdata set picset=2 where picid in ("&delid&")")
  132. end if
  133. response.write "<tr><td colspan=4 class=txlrow>删除成功。</td></tr>"
  134. end sub
  135. %>