News_Recyle.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:30k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  6. <!--#include file="../../FS_Inc/Func_page.asp" -->
  7. <!--#include file="lib/cls_main.asp" -->
  8. <%'Copyright (c) 2006 Foosun Inc. Code by 邓西
  9. response.buffer=true
  10. Response.CacheControl = "no-cache"
  11. Dim Conn,User_Conn,Fs_News
  12. MF_Default_Conn
  13. MF_Session_TF 
  14. '权限判断
  15. 'Call MF_Check_Pop_TF("NS_Class_000001")
  16. Dim Recyle_Type,Rec_Table_Style,strShowErr
  17. Dim Re_Sql_Str,Re_Temp,Re_ClassRecordset,Re_Temp_IsURL,Re_Class_Flag,Re_News_Flag
  18. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_
  19. Dim Page,cPageNo,fso_tmprs_,NewsSavePath
  20. Recyle_Type=Request.QueryString("Recyle_Type")
  21. Re_Class_Flag=False
  22. Re_News_Flag=False
  23. int_RPP=30 '设置每页显示数目
  24. int_showNumberLink_=8 '数字导航显示数目
  25. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  26. str_nonLinkColor_="#999999" '非热链接颜色
  27. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  28. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  29. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  30. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  31. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  32. toL_="<font face=webdings title=""最后一页"">:</font>" '尾页
  33. set Fs_News=new Cls_News
  34. %>
  35. <html>
  36. <head>
  37. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  38. <title>专题管理___Powered by foosun Inc.</title>
  39. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  40. </head>
  41. <body>
  42. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  43. <tr class="hback">
  44. <td class="xingmu"><a href="#" onMouseOver="this.T_BGCOLOR='#404040';this.T_FONTCOLOR='#FFFFFF';return escape('<div align='center'>FoosunCMS4.0<br> Code by 邓西 <BR>Copyright (c) 2006 Foosun Inc</div>')" class="sd"><strong>回收站管理</strong></a></td>
  45. </tr>
  46. <tr>
  47. <td width="100%" height="18" class="hback">
  48. <div align="left"> <a href="News_Recyle.asp">管理首页</a> | <a href="News_Recyle.asp?Recyle_Type=Class">栏目管理</a> | <a href="News_Recyle.asp?Recyle_Type=News">新闻管理</a> | <a href="News_Recyle.asp?Recyle_Type=DelAll">操作</a></div>
  49. </td>
  50. </tr>
  51. </table>
  52. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table" id="Rec_Class" style="display:none">
  53. <form name="for_Re_ClassOPType" method="post" action="?Recyle_Type=Class&Rec_OP_Class_Type=P">
  54. <tr class="xingmu">
  55. <input name="Hi_Re_OP_Class_Type" type="hidden" value="">
  56. <td height="20" class="xingmu" width="24%">
  57. <div align="center">栏目中文</div>
  58. </td>
  59. <td class="xingmu" width="24%">
  60. <div align="center">父栏目</div>
  61. </td>
  62. <td class="xingmu" width="15%">
  63. <div align="center">栏目类型</div>
  64. </td>
  65. <td class="xingmu" width="15%">
  66. <div align="center">新闻数</div>
  67. </td>
  68. <td class="xingmu" width="20%">
  69. <div align="center">操作</div>
  70. </td>
  71. </tr>
  72. <%
  73. If Recyle_Type="Class" then
  74. Dim Recyle_OP,Resume_Sql_Str,Resume_ClassID,Resume_Rs,ReCyle_Action,Re_Class_OPType,Re_Class_I,Re_Class_P_Flag
  75. Recyle_OP=Cstr(Request.QueryString("Recyle_OP"))
  76. Resume_ClassID=Cstr(Replace(Request.QueryString("ClassID"),"'",""))
  77. Re_Class_OPType=Cstr(Request.QueryString("Rec_OP_Class_Type"))
  78. If Re_Class_OPType="P" Then
  79. Dim Re_Class_Temp_OPType,Re_Class_Temp_ID
  80. Re_Class_Temp_OPType=Cstr(Request.Form("Hi_Re_OP_Class_Type"))
  81. Re_Class_Temp_ID=Request.Form("Che_ClassOPType")
  82. If Re_Class_Temp_ID="" or IsNull(Re_Class_Temp_ID) Then
  83. strShowErr = "<li>请选择要批量操作的内容!</li>"
  84. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  85. Response.end
  86. End If
  87. If instr(Re_Class_Temp_ID,",")=0 Then
  88. Re_Class_Temp_ID=Cstr(trim(Re_Class_Temp_ID))
  89. Re_Class_P_Flag=True
  90. Else
  91. Re_Class_Temp_ID=Split(Re_Class_Temp_ID,",")
  92. int_arr_Class_ub=Ubound(Re_Class_Temp_ID)+1
  93. Re_Class_P_Flag=False
  94. End If
  95. Select Case Re_Class_Temp_OPType
  96. Case "P_Class_Del"
  97. If Re_Class_P_Flag=True Then
  98. Recyle_DelClassID(Re_Class_Temp_ID)
  99. strShowErr = "<li>批量删除成功</li>"
  100. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  101. Response.end
  102. Else
  103. For Re_Class_I=0 To Ubound(Re_Class_Temp_ID)
  104. Recyle_DelClassID(Cstr(Trim(Re_Class_Temp_ID(Re_Class_I))))
  105. Next
  106. strShowErr = "<li>批量删除成功</li>"
  107. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  108. Response.end
  109. End If
  110. Case "P_Class_Resmue"
  111. Dim obj_Ser_ParendID_Rs,str_Ser_Par_Sql,int_Class_Count,int_Class_Error_Count,int_arr_Class_ub
  112. If Re_Class_P_Flag=True Then
  113. str_Ser_Par_Sql="Select ClassID from FS_NS_NewsClass Where ParentID in(Select ClassID from FS_NS_NewsClass Where ReycleTF=1) and ClassID='"&Re_Class_Temp_ID&"'"
  114. Set obj_Ser_ParendID_Rs=Conn.execute(str_Ser_Par_Sql)
  115. If Not obj_Ser_ParendID_Rs.Eof Then
  116. strShowErr = "<li>当前栏目的父栏目在回收站中,请先恢复父栏目!</li>"
  117. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  118. Response.end
  119. Else
  120. Conn.execute("Update FS_NS_NewsClass Set ReycleTF=0 Where ClassID='"&Re_Class_Temp_ID&"'")
  121. strShowErr = "<li>恢复成功!</li>"
  122. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  123. Response.end
  124. End If 
  125. Set obj_Ser_ParendID_Rs=Nothing
  126. Else
  127. Re_Class_Temp_ID=Split(Serch_ClassID(Re_Class_Temp_ID),",")
  128. For Re_Class_I=0 To Ubound(Re_Class_Temp_ID)
  129. Conn.execute("Update FS_NS_NewsClass Set ReycleTF=0 Where ClassID='"&Cstr(trim(Re_Class_Temp_ID(Re_Class_I)))&"'")
  130. Next
  131. strShowErr = "<li>选中"&int_arr_Class_ub&"条,已恢复"&Ubound(Re_Class_Temp_ID)&",失败"&int_arr_Class_ub-Ubound(Re_Class_Temp_ID)&"条</li>"
  132. strShowErr = strShowErr&"<li>恢复成功!</li>"
  133. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  134. Response.end
  135. End If
  136. End Select
  137. End If
  138. If Recyle_OP="ResumeClass" then
  139. Resume_Sql_Str="Select ClassID from FS_NS_NewsClass Where ParentID in(Select ClassID from FS_NS_NewsClass Where ReycleTF=1) and ClassID='"&Resume_ClassID&"'"
  140. Set Resume_Rs=Conn.execute(Resume_Sql_Str)
  141. If Not Resume_Rs.Eof Then
  142. strShowErr = "<li>当前栏目的父栏目在回收站中,请先恢复父栏目!</li>"
  143. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  144. Response.end
  145. Else
  146. Conn.execute("Update FS_NS_NewsClass Set ReycleTF=0 Where ClassID='"&Resume_ClassID&"'")
  147. strShowErr = "<li>恢复成功!</li>"
  148. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  149. Response.end
  150. End if
  151. Set Resume_Rs=Nothing
  152. End if
  153. ReCyle_Action=Request.QueryString("Action")
  154. If ReCyle_Action="Submit" Then
  155. Recyle_DelClassID(Resume_ClassID)
  156. strShowErr = "<li>删除成功!</li>"
  157. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  158. Response.end
  159. End if
  160. Re_Sql_Str="Select ClassID,ClassName,IsURL from FS_NS_NewsClass where ReycleTF=1 order by parentID Asc"
  161. Set Re_ClassRecordset= CreateObject(G_FS_RS)
  162. Re_ClassRecordset.Open Re_Sql_Str,Conn,1,1
  163. If Not Re_ClassRecordset.Eof Then
  164. Re_Class_Flag=True
  165. Re_ClassRecordset.PageSize=int_RPP
  166. cPageNo=NoSqlHack(Request.QueryString("page"))
  167. If cPageNo="" Then cPageNo = 1
  168. If not isnumeric(cPageNo) Then cPageNo = 1
  169. cPageNo = Clng(cPageNo)
  170. If cPageNo<=0 Then cPageNo=1
  171. If cPageNo>Re_ClassRecordset.PageCount Then cPageNo=Re_ClassRecordset.PageCount 
  172. Re_ClassRecordset.AbsolutePage=cPageNo
  173. For int_Start=1 TO int_RPP  
  174. Re_Temp_IsURL=Re_ClassRecordset("IsURL")
  175. If Re_Temp_IsURL=0 Then
  176. Re_Temp_IsURL="内部栏目"
  177. Else
  178. Re_Temp_IsURL="外部栏目"
  179. End if
  180. %>
  181. <tr class="hback">
  182. <td height="22" class="hback" align=center><%=Re_ClassRecordset("ClassName")%></td>
  183. <%
  184. Dim Re_Sql_ParName,Re_Rs_ParName,Re_Temp_Parname
  185. Re_Sql_ParName="Select ClassName from FS_NS_NewsClass where ClassID in(Select ParentID from FS_NS_NewsClass where ClassID='"&Re_ClassRecordset("ClassID")&"')"
  186. Set Re_Rs_ParName=Conn.execute(Re_Sql_ParName)
  187. If not Re_Rs_ParName.Eof Then
  188. Re_Temp_Parname=Re_Rs_ParName("ClassName")
  189. If Re_Temp_Parname="0" then Re_Temp_Parname="顶级栏目"
  190. Else
  191. Re_Temp_Parname="顶级栏目"
  192. End if
  193. Set Re_Rs_ParName =Nothing
  194. %>
  195. <td align="center" class="hback"><%=Re_Temp_Parname%></td>
  196. <td align="center" class="hback"><%=Re_Temp_IsURL%></td>
  197. <td align="center" class="hback"><%=Conn.execute("Select Count(*) from FS_NS_News Where ClassID='"&Re_ClassRecordset("ClassID")&"'")(0)%></td>
  198. <td class="hback" align=center><a href ="?Recyle_Type=Class&Page=<%=Request.QueryString("Page")%>&Recyle_OP=ResumeClass&ClassID=<%=Re_ClassRecordset("ClassID")%>">恢复</a> | <a href ="javascript:DelOneClass('<%=Re_ClassRecordset("ClassID")%>');">删除</a> |
  199. <input type="checkbox" name="Che_ClassOPType" value="<%=Re_ClassRecordset("ClassID")%>">
  200. </td>
  201. </tr>
  202. <%
  203. Re_ClassRecordset.MoveNext
  204. If Re_ClassRecordset.Eof or Re_ClassRecordset.Bof Then Exit For
  205. Next
  206. Response.Write "<tr><td class=""hback"" colspan=""3"" align=""left"">"&fPageCount(Re_ClassRecordset,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)&"&nbsp;</td><td colspan=""2"" class=hback><table border=0 align=left cellpadding=0 cellspacing=0 class=table><tr><td class=""hback""  align=""left""><input type=""button"" value="" 批量恢复 "" name=""But_P_Class_Resmue"" onclick=""javascript:P_Class_Resmue();"">&nbsp;&nbsp;&nbsp;&nbsp;<input type=""button"" value="" 批量删除 "" name=""But_P_Class_Del"" onclick=""javascript:P_Class_Del();""></td><td class=hback>&nbsp;全选<input type=""checkbox"" name=""Che_ClassOPType"" onclick=""CheckAll('Che_ClassOPType');""></td></tr></table></td></tr>"
  207. Else
  208. Re_Class_Flag=False
  209.       Response.write"<table width=""98%"" border=0 align=center cellpadding=2 cellspacing=1 class=table><tr class=""hback""><td>回收站中没有栏目!</td></tr></table>"
  210. End if
  211. End If
  212. Set Re_ClassRecordset=Nothing
  213. %>
  214. </form>
  215. </table>
  216. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table" id="Rec_News" style="display:none">
  217. <form name="for_Re_OPType" method="post" action="?Recyle_Type=News&Rec_OP_Type=P">
  218. <tr class="xingmu">
  219. <input name="Hi_Re_OP_Type" type="hidden" value="">
  220. <td height="25" class="xingmu" width="68%">
  221. <div align="center">新闻标题</div>
  222. </td>
  223. <td class="xingmu" width="15%">
  224. <div align="center">新闻所属栏目</div>
  225. </td>
  226. <td class="xingmu" width="15%">
  227. <div align="center">操作</div>
  228. </td>
  229. </tr>
  230. <%
  231. If Recyle_Type="News" then
  232. Dim Rec_News_OP,Rec_News_Sql_Str,Rec_News_Rs,Rec_News_ClassRs,Rec_News_Class_TempName,Rec_News_Ser_Flag,ReCyle_News_Action,Rec_OP_Type,Rec_News_Temp_Serch,Rec_News_Temp_Serch_Keyword,News_Temp_Serch_Flag
  233. News_Temp_Serch_Flag=False
  234. Rec_News_OP=Request.QueryString("Recyle_News_OP")
  235. Rec_News_NewsID=Cstr(Replace(Request.QueryString("NewsID"),"'",""))
  236. Rec_OP_Type=Cstr(Request.QueryString("Rec_OP_Type")) 
  237. If Rec_OP_Type="P" Then
  238. Dim Rec_TempOp,Rec_TempID,Rec_Temp_I,Rec_Temp_OPFlag
  239. Rec_TempOp=Request.Form("Hi_Re_OP_Type")
  240. Rec_TempID=Request.Form("Che_OPType")
  241. If Rec_TempID="" or IsNull(Rec_TempID) Then
  242. strShowErr = "<li>请选择要批量操作的内容!</li>"
  243. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  244. Response.end
  245. End If
  246. Select Case Rec_TempOp
  247. Case "P_Resmue"
  248. Conn.execute("Update FS_NS_News Set isRecyle=0 where NewsID in ('"&Replace(Replace(Rec_TempID," ",""),",","','")&"')")
  249. strShowErr = "<li>批量恢复成功</li>"
  250. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  251. Response.end
  252. Case "P_Del"
  253. '删除静态文件
  254. set fso_tmprs_ = Conn.execute("select FS_NS_News.SaveNewsPath,FS_NS_News.FileName,FS_NS_News.FileExtName,FS_NS_NewsClass.SavePath,FS_NS_NewsClass.ClassEName from FS_NS_News,FS_NS_NewsClass where FS_NS_News.NewsID in ('"&Replace(Replace(Rec_TempID," ",""),",","','")&"') and FS_NS_News.IsURL=0 and FS_NS_NewsClass.ClassID=FS_NS_News.ClassID")
  255. While Not fso_tmprs_.eof
  256. If G_VIRTUAL_ROOT_DIR = "" Then
  257. NewsSavePath = ""
  258. Else
  259. NewsSavePath = "/" & G_VIRTUAL_ROOT_DIR
  260. End If
  261. NewsSavePath=NewsSavePath&fso_tmprs_("SavePath")&"/"&fso_tmprs_("ClassEName")&fso_tmprs_("SaveNewsPath")&"/"&fso_tmprs_("FileName")&"."&fso_tmprs_("FileExtName")
  262. fso_DeleteFile(NewsSavePath)
  263. fso_tmprs_.movenext
  264. Wend
  265. '删除静态文件结束
  266. Conn.execute("Delete from FS_NS_News where NewsID in ('"&Replace(Replace(Rec_TempID," ",""),",","','")&"')")
  267. Call MF_Insert_oper_Log("回收站","批量删除了新闻",now,session("admin_name"),"NS")
  268. strShowErr = "<li>批量删除成功</li>"
  269. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  270. Response.end
  271. End Select
  272. End If
  273. If Rec_News_OP="ResumeNews" Then
  274. Dim Rec_News_NewsID,Rec_News_NewsIDRs
  275. Rec_News_Sql_Str="Select ID from FS_NS_NewsClass where ClassID in(Select ClassID from FS_NS_News Where NewsID='"&Rec_News_NewsID&"' and ReycleTF=0) "
  276. Set Rec_News_NewsIDRs=Conn.execute(Rec_News_Sql_Str)
  277. If Not Rec_News_NewsIDRs.Eof Then
  278. Conn.execute("Update FS_NS_News Set isRecyle=0 where NewsID='"&Rec_News_NewsID&"'")
  279. strShowErr = "<li>恢复成功!</li>"
  280. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  281. Response.end
  282. Else
  283. Conn.execute("Update FS_NS_News Set isRecyle=0,ClassID='0' where NewsID='"&Rec_News_NewsID&"'")
  284. strShowErr = "<li>恢复成功!</li>"
  285. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  286. Response.end
  287. End If
  288. Set Rec_News_NewsIDRs=Nothing
  289. End If
  290. ReCyle_News_Action=Request.QueryString("Action")
  291. If ReCyle_News_Action="Submit" Then
  292. '删除静态文件
  293. set fso_tmprs_ = Conn.execute("select FS_NS_News.SaveNewsPath,FS_NS_News.FileName,FS_NS_News.FileExtName,FS_NS_NewsClass.SavePath,FS_NS_NewsClass.ClassEName from FS_NS_News,FS_NS_NewsClass where FS_NS_News.NewsID in ('"&Replace(Replace(Rec_News_NewsID," ",""),",","','")&"') and FS_NS_News.IsURL=0 and FS_NS_NewsClass.ClassID=FS_NS_News.ClassID")
  294. While Not fso_tmprs_.eof
  295. If G_VIRTUAL_ROOT_DIR = "" Then
  296. NewsSavePath = ""
  297. Else
  298. NewsSavePath = "/" & G_VIRTUAL_ROOT_DIR
  299. End If
  300. NewsSavePath=NewsSavePath&fso_tmprs_("SavePath")&"/"&fso_tmprs_("ClassEName")&fso_tmprs_("SaveNewsPath")&"/"&fso_tmprs_("FileName")&"."&fso_tmprs_("FileExtName")
  301. fso_DeleteFile(NewsSavePath)
  302. fso_tmprs_.movenext
  303. Wend
  304. '删除静态文件结束
  305. Conn.execute("Delete from FS_NS_News where NewsID='"&Rec_News_NewsID&"'")
  306. strShowErr = "<li>删除成功!</li>"
  307. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  308. Response.end
  309. End if
  310. Rec_News_Ser_Flag=False
  311. Rec_News_Temp_Serch=Request.QueryString("Serch")
  312. Rec_News_Temp_Serch_Keyword=Request.Form("Ser_Keyword")
  313. If Rec_News_Temp_Serch="Submit" Then
  314. Rec_News_Sql_Str="Select NewsID,NewsTitle,ClassID From FS_NS_News where isRecyle=1 and NewsTitle like'%"&Rec_News_Temp_Serch_Keyword&"%'"
  315. News_Temp_Serch_Flag=True
  316. Else
  317. Rec_News_Sql_Str="Select NewsID,NewsTitle,ClassID From FS_NS_News where isRecyle=1"
  318. End If
  319. Set Rec_News_Rs= CreateObject(G_FS_RS)
  320. Rec_News_Rs.Open Rec_News_Sql_Str,Conn,1,1
  321. If Not Rec_News_Rs.Eof Then
  322. Rec_News_Rs.PageSize=int_RPP
  323. cPageNo=NoSqlHack(Request.QueryString("page"))
  324. If cPageNo="" Then cPageNo = 1
  325. If not isnumeric(cPageNo) Then cPageNo = 1
  326. cPageNo = Clng(cPageNo)
  327. If cPageNo<=0 Then cPageNo=1
  328. If cPageNo>Rec_News_Rs.PageCount Then cPageNo=Rec_News_Rs.PageCount 
  329. Rec_News_Rs.AbsolutePage=cPageNo
  330. Re_News_Flag=True
  331. Rec_News_Ser_Flag=True
  332. For int_Start=1 TO int_RPP  
  333. %>
  334. <tr class="hback">
  335. <td height="22" class="hback"><%=Rec_News_Rs("NewsTitle")%></td>
  336. <%
  337. Set Rec_News_ClassRs=Conn.execute("Select ClassName from FS_NS_NewsClass where ClassID='"&Rec_News_Rs("ClassID")&"'")
  338. If Not Rec_News_ClassRs.Eof Then
  339. Rec_News_Class_TempName=Rec_News_ClassRs("ClassName")
  340. Else
  341. Rec_News_Class_TempName="栏目不存在"
  342. End if
  343. Set Rec_News_ClassRs=Nothing
  344. %>
  345. <td align="center" class="hback" width="221"><%=Rec_News_Class_TempName%></td>
  346. <td align="center" class="hback" width="151"><a href="?Recyle_Type=News&Page=<%=Request.QueryString("Page")%>&Recyle_News_OP=ResumeNews&NewsID=<%=Rec_News_Rs("NewsID")%>">恢复</a> | <a href="javascript:DelOneNews('<%=Rec_News_Rs("NewsID")%>')">删除</a> |
  347. <input type="checkbox" name="Che_OPType" value="<%=Rec_News_Rs("NewsID")%>">
  348. </td>
  349. </tr>
  350. <%
  351. Rec_News_Rs.MoveNext
  352. If Rec_News_Rs.Eof or Rec_News_Rs.Bof Then Exit For
  353. Next
  354. Response.Write "<tr><td class=""hback"" colspan=""6"" align=""left""><table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0""><tr><td align=""left"">"&fPageCount(Rec_News_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)&"</td><td align=""right""><input type=""button"" value="" 批量恢复 "" name=""But_P_UnLock"" onclick=""javascript:P_Resmue();"">&nbsp;&nbsp;&nbsp;&nbsp;<input type=""button"" value="" 批量删除 "" name=""But_P_Del"" onclick=""javascript:P_Del();"">&nbsp;&nbsp;&nbsp;&nbsp;全选<input type=""checkbox"" name=""Che_OPType"" onclick=""CheckAll('Che_OPType');"" ></td></tr></table></td></tr>"
  355. Else
  356. If News_Temp_Serch_Flag=True Then
  357. strShowErr = "<li>没有找到符合条件的新闻,请重试!</li>"
  358. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  359. Response.end
  360. Else
  361.        Response.write"<table width=""98%"" border=0 align=center cellpadding=2 cellspacing=1 class=table><tr class=""hback""><td>回收站中没有新闻!</td></tr></table>"
  362. End If
  363. End if
  364. Set Rec_News_Rs=Nothing
  365. End if
  366. Response.write "<script language=""javascript"">document.all.Rec_News.style.display=""none"";</script>"
  367. %>
  368. </form>
  369. </table>
  370. <%
  371. Recyle_Type=Request.QueryString("Recyle_Type")
  372. If Recyle_Type="DelAll" Then
  373. Dim Recyle_Del_OP,Recyle_DelAll_Type
  374. Recyle_Del_OP=Request.QueryString("Recyle_Del_OP")
  375. Recyle_DelAll_Type=Request.QueryString("Action")
  376. If Recyle_DelAll_Type="S_DelAllClass" Then
  377. Conn.execute("Delete From FS_NS_News Where isRecyle=1")
  378. Call MF_Insert_oper_Log("回收站","清空了回收站所有栏目",now,session("admin_name"),"NS")
  379. strShowErr = "<li>删除成功!</li>"
  380. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  381. Response.End
  382. End If
  383. If Recyle_DelAll_Type="S_DelAllNews" Then
  384. '删除静态文件
  385. set fso_tmprs_ = Conn.execute("select FS_NS_News.SaveNewsPath,FS_NS_News.FileName,FS_NS_News.FileExtName,FS_NS_NewsClass.SavePath,FS_NS_NewsClass.ClassEName from FS_NS_News,FS_NS_NewsClass where FS_NS_News.isRecyle=1 and FS_NS_News.IsURL=0 and FS_NS_NewsClass.ClassID=FS_NS_News.ClassID")
  386. While Not fso_tmprs_.eof
  387. If G_VIRTUAL_ROOT_DIR = "" Then
  388. NewsSavePath = ""
  389. Else
  390. NewsSavePath = "/" & G_VIRTUAL_ROOT_DIR
  391. End If
  392. NewsSavePath=NewsSavePath&fso_tmprs_("SavePath")&"/"&fso_tmprs_("ClassEName")&fso_tmprs_("SaveNewsPath")&"/"&fso_tmprs_("FileName")&"."&fso_tmprs_("FileExtName")
  393. fso_DeleteFile(NewsSavePath)
  394. fso_tmprs_.movenext
  395. Wend
  396. '删除静态文件结束
  397. Conn.execute("Delete From FS_NS_News Where isRecyle=1")
  398. Call MF_Insert_oper_Log("回收站","清空了回收站所有新闻",now,session("admin_name"),"NS")
  399. strShowErr = "<li>删除成功!</li>"
  400. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  401. Response.End
  402. End If
  403. If Recyle_DelAll_Type="S_DelAll" Then
  404. '删除静态文件
  405. set fso_tmprs_ = Conn.execute("select FS_NS_News.SaveNewsPath,FS_NS_News.FileName,FS_NS_News.FileExtName,FS_NS_NewsClass.SavePath,FS_NS_NewsClass.ClassEName from FS_NS_News,FS_NS_NewsClass where FS_NS_News.isRecyle=1 and FS_NS_News.IsURL=0 and FS_NS_NewsClass.ClassID=FS_NS_News.ClassID")
  406. While Not fso_tmprs_.eof
  407. If G_VIRTUAL_ROOT_DIR = "" Then
  408. NewsSavePath = ""
  409. Else
  410. NewsSavePath = "/" & G_VIRTUAL_ROOT_DIR
  411. End If
  412. NewsSavePath=NewsSavePath&fso_tmprs_("SavePath")&"/"&fso_tmprs_("ClassEName")&fso_tmprs_("SaveNewsPath")&"/"&fso_tmprs_("FileName")&"."&fso_tmprs_("FileExtName")
  413. fso_DeleteFile(NewsSavePath)
  414. fso_tmprs_.movenext
  415. Wend
  416. '删除静态文件结束
  417. Conn.execute("Delete From FS_NS_News Where isRecyle=1")
  418. Conn.execute("Delete From FS_NS_NewsClass Where ReycleTF=1")
  419. Call MF_Insert_oper_Log("回收站","清空了回收站所有信息",now,session("admin_name"),"NS")
  420. strShowErr = "<li>清空回收站成功!</li>"
  421. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  422. Response.End
  423. End If
  424. If Recyle_Del_OP="ResumeAll" Then
  425. Conn.execute("Update FS_NS_News Set isRecyle=0 Where isRecyle=1")
  426. Conn.execute("Update FS_NS_NewsClass Set ReycleTF=0 Where ReycleTF=1")
  427. strShowErr = "<li>恢复成功!</li>"
  428. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  429. Response.end
  430. End If
  431. If Recyle_Del_OP="ResumeClass" Then
  432. Conn.execute("Update FS_NS_NewsClass Set ReycleTF=0 Where ReycleTF=1")
  433. strShowErr = "<li>恢复成功!</li>"
  434. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  435. Response.end
  436. End If
  437. If Recyle_Del_OP="ResumeNews" Then
  438. Conn.execute("Update FS_NS_News Set isRecyle=0 Where isRecyle=1")
  439. strShowErr = "<li>恢复成功!</li>"
  440. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  441. Response.end
  442. End If
  443. End If
  444. %>
  445. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table" id="Rec_Op" style="display:none">
  446. <tr class="hback">
  447. <td height="47" align="center"><a href=?Recyle_Type=DelAll&Recyle_Del_OP=ResumeAll>全部恢复</a> | <a href=?Recyle_Type=DelAll&Recyle_Del_OP=ResumeClass>只恢复栏目</a> | <a href=?Recyle_Type=DelAll&Recyle_Del_OP=ResumeNews>只恢复新闻</a> | <a href="javascript:DelClass();">删除栏目</a> | <a href="javascript:DelNews()">删除新闻</a> | <a href="javascript:DelAll()">清空回收站</a>
  448. <div align="center"> </div>
  449. </td>
  450. </tr>
  451. </table>
  452. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table" id="Rec_ZhuJie" style="display:none">
  453. <tr class="hback">
  454. <td height="47"><font color="#FF3300">注:
  455. <p>1、栏目管理:是对放入回收站中的栏目而进行的管理。</p>
  456. <p>2、新闻管理:是对放入回收站中的新闻而进行的管理。</p>
  457. <p>3、操作:对放入回收站中的内容进行恢复和删除操作。 
  458. </font></td>
  459. </tr>
  460. </table>
  461. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table" id="Rec_Serch" style="display:none">
  462. <form name="for_Ser_News" method="post" action="?Recyle_Type=News&Serch=Submit">
  463. <tr>
  464. <td height="18" class="hback">新闻搜索:关键字
  465. <input name="Ser_Keyword" type="text" size="20">
  466. <select name="NewsType" id="NewsType">
  467. <option value="title" selected>标题</option>
  468. </select>
  469. <input type="submit" name="But_Ser_Submit" value="  搜 索  ">
  470. </td>
  471. </tr>
  472. </form>
  473. </table>
  474. <%
  475. If Rec_News_Ser_Flag=True Then
  476. Response.write "<script language=""javascript"">document.all.Rec_Serch.style.display="""";</script>"
  477. End if
  478. %>
  479. <script language="javascript" type="text/javascript" src="../../FS_Inc/wz_tooltip.js"></script>
  480. </body>
  481. </html>
  482. <%
  483. Sub Recyle_DelClassID(ClassID)
  484. Dim Recyle_ClassID_Sql_Str,Recyle_ClassID_Rs
  485. Recyle_ClassID_Sql_Str="Select ClassID from FS_NS_NewsClass where ParentID='"&ClassID&"'"
  486. Set Recyle_ClassID_Rs=Conn.execute(Recyle_ClassID_Sql_Str)
  487. While Not Recyle_ClassID_Rs.Eof 
  488. Recyle_DelClassID(Recyle_ClassID_Rs("ClassID"))
  489. Recyle_ClassID_Rs.MoveNext
  490. Wend
  491. Conn.execute("Delete from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  492. Response.write("Delete from FS_NS_NewsClass where ClassID='"&ClassID&"'")
  493. Set Recyle_ClassID_Rs=Nothing
  494. End Sub
  495. Function Serch_ClassID(arr_CLassID)
  496. Dim int_i,str_s_sql,obj_ser_pa_Rs
  497. For int_i=0 To Ubound(arr_CLassID)
  498. str_s_sql="Select ClassID from FS_NS_NewsClass Where ParentID in(Select ClassID from FS_NS_NewsClass Where ReycleTF=1) and ClassID='"&Cstr(trim(arr_CLassID(int_i)))&"'"
  499. Set obj_ser_pa_Rs=Conn.execute(str_s_sql)
  500. If obj_ser_pa_Rs.Eof Then
  501. Serch_ClassID=Serch_ClassID&arr_CLassID(int_i)&","
  502. End If 
  503. Set obj_ser_pa_Rs=Nothing
  504. Next
  505. End Function
  506. %>
  507. <script language="javascript">
  508. function DelClass()
  509. {
  510. if(confirm('此操作不可逆,将会删除所有回收站的栏目n你确定删除吗?'))
  511. {
  512. location='?Recyle_Type=DelAll&Action=S_DelAllClass';
  513. }
  514. }
  515. function DelNews()
  516. {
  517. if(confirm('此操作不可逆,将会删除所有回收站的新闻n你确定删除吗?'))
  518. {
  519. location='?Recyle_Type=DelAll&Action=S_DelAllNews';
  520. }
  521. }
  522. function DelAll()
  523. {
  524. if(confirm('此操作不可逆,将会删除所有回收站的栏目以及新闻n你确定删除吗?'))
  525. {
  526. location='?Recyle_Type=DelAll&Action=S_DelAll';
  527. }
  528. }
  529. function DelOneNews(NewsId)
  530. {
  531. if(confirm('将删除一条新闻n你确定删除吗?'))
  532. {
  533. location='?Recyle_Type=News&Page=<%=Request.QueryString("Page")%>&NewsID='+NewsId+'&Action=Submit';
  534. }
  535. }
  536. function DelOneClass(ClassID)
  537. {
  538. if(confirm('此操作将删除此栏目下的所有子栏目?n你确定删除吗?'))
  539. {
  540. location='?Recyle_Type=Class&Page=<%=Request.QueryString("Page")%>&ClassID='+ClassID+'&Action=Submit';
  541. }
  542. }
  543. function P_Class_Del()
  544. {
  545. if(confirm('此操作将删除选中栏目下的所有子栏目?n你确定删除吗?'))
  546. {
  547. document.for_Re_ClassOPType.Hi_Re_OP_Class_Type.value="P_Class_Del";
  548. document.for_Re_ClassOPType.submit();
  549. }
  550. }
  551. function P_Class_Resmue()
  552. {
  553. if(confirm('此操作将恢复选中的栏目?n你确定恢复吗?'))
  554. {
  555. document.for_Re_ClassOPType.Hi_Re_OP_Class_Type.value="P_Class_Resmue";
  556. document.for_Re_ClassOPType.submit();
  557. }
  558. }
  559. function SelectTableShow(ShowType)
  560. {
  561. switch(ShowType)
  562. {
  563. case 0://显示回收站注解首页
  564. document.all.Rec_ZhuJie.style.display="";
  565. document.all.Rec_Class.style.display="none";
  566. document.all.Rec_News.style.display="none";
  567. document.all.Rec_Serch.style.display="none";
  568. document.all.Rec_Op.style.display="none";
  569. break;
  570. case 1://显示回收站栏目管理首页
  571. <%
  572. If Re_Class_Flag=False Then
  573. Response.write "document.all.Rec_Class.style.display=""none"";"
  574. Else
  575. Response.write"document.all.Rec_Class.style.display="""";"
  576. End If
  577. %>
  578. document.all.Rec_ZhuJie.style.display="none";
  579. document.all.Rec_News.style.display="none";
  580. document.all.Rec_Serch.style.display="none";
  581. document.all.Rec_Op.style.display="none";
  582. break;
  583. case 2://显示回收站新闻管理首页
  584. <%
  585. If Re_News_Flag=False Then
  586. Response.write "document.all.Rec_News.style.display=""none"";"
  587. Response.write "document.all.Rec_Serch.style.display=""none"";"
  588. Else
  589. Response.write"document.all.Rec_News.style.display="""";"
  590. Response.write "document.all.Rec_Serch.style.display="""";"
  591. End If
  592. %>
  593. document.all.Rec_ZhuJie.style.display="none";
  594. document.all.Rec_Class.style.display="none";
  595. document.all.Rec_Op.style.display="none";
  596. break;
  597. case 3://显示回收站管理操作首页
  598. document.all.Rec_Op.style.display="";
  599. document.all.Rec_ZhuJie.style.display="none";
  600. document.all.Rec_Class.style.display="none";
  601. document.all.Rec_News.style.display="none";
  602. document.all.Rec_Serch.style.display="none";
  603. break;
  604. }
  605. }
  606. function CheckAll(CheckType)
  607. {
  608. var checkBoxArray=document.all(CheckType)
  609. if(checkBoxArray[checkBoxArray.length-1].checked)
  610. {
  611. for(var i=0;i<checkBoxArray.length-1;i++)
  612. {
  613. checkBoxArray[i].checked=true;
  614. }
  615. }else
  616. {
  617. for(var i=0;i<checkBoxArray.length-1;i++)
  618. {
  619. checkBoxArray[i].checked=false;
  620. }
  621. }
  622. }
  623. function P_Resmue()
  624. {
  625. if(confirm('此操作将恢复选中的新闻?n你确定恢复吗?'))
  626. {
  627. document.for_Re_OPType.Hi_Re_OP_Type.value="P_Resmue";
  628. document.for_Re_OPType.submit();
  629. }
  630. }
  631. function P_Del()
  632. {
  633. var chkJss_Array=document.all.Che_OPType;
  634. var chkTF=false;
  635. if (chkJss_Array[0]==null)
  636. {
  637. return 
  638. }
  639. else
  640. {
  641. //判断是否选择了记录
  642. for(var i=1;i<chkJss_Array.length;i++)
  643. {
  644. if (chkJss_Array[i].checked)
  645. {
  646. chkTF=true
  647. }
  648. }
  649. }
  650. if(chkTF)
  651. {
  652. if(confirm("确认要删除选中的记录?"))
  653. //document.for_Re_ClassOPType.submit();
  654. document.for_Re_OPType.Hi_Re_OP_Type.value="P_Del";
  655. document.for_Re_OPType.submit();
  656. }else
  657. {
  658. alert("请选择你要删除的对象");
  659. }
  660. //以上判断有没选项选中
  661. }
  662. </script>
  663. <%
  664. If Recyle_Type="" Then
  665. Response.write"<script language=""javascript"">SelectTableShow(0);</script>"
  666. Else
  667. Recyle_Type=Cstr(Recyle_Type)
  668. Select Case Recyle_Type
  669. Case "Class"
  670. Response.write"<script language=""javascript"">SelectTableShow(1);</script>"
  671. Case "News"
  672. Response.write"<script language=""javascript"">SelectTableShow(2);</script>"
  673. Case "DelAll"
  674. Response.write"<script language=""javascript"">SelectTableShow(3);</script>"
  675. Case else
  676. Response.write"<script language=""javascript"">SelectTableShow(0);</script>"
  677. End Select
  678. End IF
  679. Set Conn=Nothing
  680. %>
  681. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->