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

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>③“清空回收站”将彻底删除回收站中的照片,不可恢复;<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 founderr=true then
  30. call txl_error()
  31. else
  32. if request("action")="删除" then
  33. call delete()
  34. elseif request("action")="还原" then
  35. call redel()
  36. elseif request("action")="清空回收站" then
  37. call Alldel()
  38. else
  39. call main()
  40. end if
  41. end if
  42. conn.close
  43. set conn=nothing
  44. sub main()
  45. %>
  46. <tr>
  47. <th colspan=6 align=left height=23>已经删除照片列表</th>
  48. </tr>
  49. <%
  50. dim currentpage,page_count,Pcount
  51. dim totalrec,endpage
  52. currentPage=request("page")
  53. if currentpage="" or not isInteger(currentpage) then
  54. currentpage=1
  55. else
  56. currentpage=clng(currentpage)
  57. if err then
  58. currentpage=1
  59. err.clear
  60. end if
  61. end if
  62. Set rs= Server.CreateObject("ADODB.Recordset")
  63. sql="select * from imgdata where picset=2 order by addtime desc"
  64. rs.open sql,conn,1,1
  65. if rs.eof and rs.bof then
  66. response.write "<tr><td colspan=6 class=txlrow>没有找到相关记录。</td></tr>"
  67. else
  68. %>
  69. <FORM name=recycle action=admin_precycle.asp method=post>
  70. <tr align=center>
  71. <td class=txlHeaderBackgroundAlternate><B>操作</B></td>
  72. <td class=txlHeaderBackgroundAlternate><B>上传人</B></td>
  73. <td class=txlHeaderBackgroundAlternate><B>照片说明</B></td>
  74. <td class=txlHeaderBackgroundAlternate><B>所属类别</B></td>
  75. </tr>
  76. <%
  77. dim trs
  78. rs.PageSize = Cint(txl_set(12))
  79. rs.AbsolutePage=currentpage
  80. page_count=0
  81. totalrec=rs.recordcount
  82. while (not rs.eof) and (not page_count = Cint(txl_set(12)))
  83. set trs=conn.execute("select classname from imgclass where classID="&rs("classID"))
  84. %>
  85. <tr>
  86. <td width=10% class=txlrow align=center><input type=checkbox name="delid" value="<%=rs("picid")%>"></td>
  87. <td width=10% class=txlrow align=center><%=rs("postuser")%></td>
  88. <td width=70% class=txlrow><a href=<%=txl_info(12)&rs("filename")%> target=_blank><%=rs("picinfo")%></a></td>
  89. <td width=10% class=txlrow align=center><%=trs("classname")%></td>
  90. </tr>
  91. <%
  92. page_count = page_count + 1
  93. rs.movenext
  94. wend
  95. Pcount=rs.PageCount
  96. %>
  97. <tr><td colspan=4 class=txlrow align=center>分页:
  98. <%
  99. if currentpage > 4 then
  100. response.write "<a href=""?page=1"">[1]</a> ..."
  101. end if
  102. if Pcount>currentpage+3 then
  103. endpage=currentpage+3
  104. else
  105. endpage=Pcount
  106. end if
  107. for i=currentpage-3 to endpage
  108. if not i<1 then
  109. if i = clng(currentpage) then
  110. response.write " <font color=#ce0000>["&i&"]</font>"
  111. else
  112. response.write " <a href=""?page="&i&""">["&i&"]</a>"
  113. end if
  114. end if
  115. next
  116. if currentpage+3 < Pcount then
  117. response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
  118. end if
  119. %>
  120. </td>
  121. </tr>
  122. <tr>
  123. <td colspan=4 class=txlrow><input type=submit name=action value="还原"  onclick="{if(confirm('确定执行选择的操作吗?')){return true;}return false;}"> <input type=submit name=action value="删除"  onclick="{if(confirm('确定执行选择的操作吗?')){return true;}return false;}"> <input type=submit name=action value="清空回收站"  onclick="{if(confirm('确定执行选择的操作吗?')){return true;}return false;}"></td>
  124. </tr>
  125. </FORM>
  126. </table>
  127. <%
  128. end if
  129. rs.close
  130. set rs=nothing
  131. end sub
  132. '还原回收站内容
  133. sub redel()
  134. response.write "<tr><th colspan=4 height=23 align=left>执行结果</th></tr>"
  135. if isnull(delid) or delid="" then
  136. response.write "<tr><td colspan=4 class=txlrow>请指定相关参数。</td></tr>"
  137. response.end
  138. else
  139. conn.execute("update imgdata set picset=0 where picid in ("&delid&")")
  140. end if
  141. response.write "<tr><td colspan=4 class=txlrow>还原成功。</td></tr>"
  142. end sub
  143. '删除回收站内容
  144. sub delete()
  145. response.write "<tr><th colspan=4 height=23 align=left>执行结果</th></tr>"
  146. if isnull(delid) or delid="" then
  147. response.write "<tr><td colspan=4 class=txlrow>请指定相关参数。</td></tr>"
  148. response.end
  149. else
  150. conn.execute("delete from imgdata where picid in ("&delid&")")
  151. response.write "<tr><td colspan=4 class=txlrow>删除成功。</td></tr>"
  152. end if
  153. end sub
  154. '全部删除回收站内容
  155. sub AllDel()
  156. response.write "<tr><th colspan=4 height=23 align=left>执行结果</th></tr>"
  157. conn.execute("delete from imgdata where picset=2")
  158. response.write "<tr><td colspan=4 class=txlrow>清空回收站成功。</td></tr>"
  159. end sub
  160. %>