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

数据库编程

开发平台:

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_Inc/Func_Page.asp"-->
  6. <%
  7. Dim Conn,CollectConn
  8. MF_Default_Conn
  9. MF_Collect_Conn
  10. MF_Session_TF
  11. Dim SiteID,Action,NewsSql,RsNewsObj,CurrPage,AllPageNum,RecordNum,i,SiteName,RsTempObj,AttributeStr,DelID,DelIDArray,str_History
  12. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  13. int_RPP=30 '设置每页显示数目
  14. int_showNumberLink_=8 '数字导航显示数目
  15. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  16. str_nonLinkColor_="#999999" '非热链接颜色
  17. toF_="<font face=webdings title=""首页"">9</font>"   '首页
  18. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  19. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  20. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  21. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  22. toL_="<font face=webdings title=""最后一页"">:</font>"
  23. Action = Request("Action")
  24. SiteID = Request("SiteID")
  25. if Action = "Del" then
  26. DelID = Request("ID")
  27. if DelID <> "" then
  28. if DelID = "record" then
  29. CollectConn.Execute("Delete from FS_News where History=1")
  30. else
  31. DelIDArray = Split(DelID,"***")
  32. for i = LBound(DelIDArray) to UBound(DelIDArray)
  33. if DelIDArray(i) <> "" then
  34. CollectConn.Execute("Delete from FS_News where ID=" & DelIDArray(i))
  35. end if
  36. Next
  37. end if
  38. end if
  39. end if
  40. CurrPage = Request("Page")
  41. if Request("check")="1" then
  42. str_History = " and History=true"
  43. elseif Request("check")="0" then
  44. str_History = " and History=false"
  45. else
  46. str_History = ""
  47. end if
  48. NewsSql = "Select * from FS_News where 0=0"&str_History&" Order by ID Desc"
  49. Set RsNewsObj = Server.CreateObject("ADODB.RecordSet")
  50. RsNewsObj.Open NewsSql,CollectConn,1,1
  51. %>
  52. <HTML>
  53. <HEAD>
  54. <META http-equiv="Content-Type" content="text/html; charset=gb2312">
  55. <head>
  56. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  57. <title>[site] 管理后台 -- 风讯内容管理系统 FoosunCMS V4.0</title>
  58. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  59. </head>
  60. <script language="JavaScript" src="js/PublicJS.js"></script>
  61. <BODY topmargin="2" leftmargin="2">
  62. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  63.   <tr> 
  64.     <td height="26" nowrap class="xingmu"> 
  65.       <div align="center"> 标题</div></td>
  66.     <td width="15%" height="20" nowrap class="xingmu"> 
  67.       <div align="center">状态</div></td>
  68.     <td width="15%" height="20" nowrap class="xingmu"> 
  69.       <div align="center">采集站点</div></td>
  70.     <td width="15%" height="20" nowrap class="xingmu"> 
  71.       <div align="center">添加日期</div></td>
  72.     <td width="15%" height="20" nowrap class="xingmu"> 
  73.       <div align="center">操作</div></td>
  74.   </tr>
  75.   <%
  76. if Not RsNewsObj.Eof then
  77. if CurrPage = "" then
  78. CurrPage = 1
  79. else
  80. CurrPage = CInt(CurrPage)
  81. end if
  82. RsNewsObj.PageSize = int_RPP
  83. RecordNum = RsNewsObj.RecordCount
  84. AllPageNum = RsNewsObj.PageCount
  85. if CurrPage > AllPageNum then CurrPage = AllPageNum
  86. RsNewsObj.AbsolutePage = Cint(CurrPage)
  87. for i = 1 to RsNewsObj.PageSize
  88. if RsNewsObj.Eof then Exit For
  89. Set RsTempObj = CollectConn.Execute("Select SiteName from FS_Site where ID=" & RsNewsObj("SiteID"))
  90. if Not RsTempObj.Eof then
  91. SiteName = RsTempObj("SiteName")
  92. else
  93. SiteName = "未知"
  94. end if
  95. RsTempObj.Close
  96. Set RsTempObj = Nothing
  97. %>
  98.   <tr class="hback"> 
  99.     <td height="26" nowrap> 
  100.       <table border="0" cellspacing="0" cellpadding="0">
  101.         <tr>
  102.           <td><input type="checkbox" CName="<% = RsNewsObj("Title") %>" value="<% = RsNewsObj("ID") %>" name="NewsID"></td>
  103.           <td><% = Left(RsNewsObj("Title"),20) %></td>
  104.         </tr>
  105.       </table></td>
  106.     <td nowrap><div align="center"> 
  107.         <%
  108. AttributeStr = ""
  109. if RsNewsObj("History") = True then
  110. AttributeStr = "<font color=""red"">已入库</fonr>"
  111. else
  112. AttributeStr = "未入库"
  113. end if
  114. Response.Write(AttributeStr)
  115. %>
  116.         </div></td>
  117.     <td nowrap><div align="center">
  118.         <% = SiteName %>
  119.       </div></td>
  120.     <td nowrap><div align="center">
  121.         <% = RsNewsObj("AddDate") %>
  122.       </div></td>
  123.     <td nowrap class="SpanStyle"> <div align="center"><span style="cursor:hand;" onClick="if (confirm('确定要修改吗?')) location='EditNews.asp?NewsIDStr=<% = RsNewsObj("ID") %>';">修改</span>&nbsp;&nbsp;<span style="cursor:hand;" onClick="if (confirm('确定要删除吗?')) location='?Action=Del&ID=<% = RsNewsObj("ID") %>';">删除</span></div></td>
  124.   </tr>
  125.   <%
  126. RsNewsObj.MoveNext
  127. next
  128. %>
  129.   <tr  class="hback"> 
  130.     <td height="30" colspan="5" nowrap>
  131.   <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  132.         <tr> 
  133.           <td> <div align="right">     
  134.               <input type="checkbox" name="checkAll" value="" onClick="selectAll(document.all.NewsID,this.checked)">
  135.               全选&nbsp;&nbsp;
  136.   <input onClick="DeleteNews('record');" type="button" name="Submit" value=" 删除全部已入库新闻 ">
  137.   &nbsp;&nbsp;
  138.   <input onClick="MoveNews('all');" type="button" name="Submit" value=" 全部入库 ">
  139.   &nbsp;&nbsp;
  140.               <input onClick="MoveNews('');" type="button" name="Submit" value=" 入 库 ">
  141.   &nbsp;&nbsp;<input onClick="DeleteNews('');" type="button" name="Submit" value=" 删 除 ">
  142.               <%
  143.   Response.Write"<br>"
  144. Response.Write(fPageCount(RsNewsObj,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,CurrPage))
  145. Response.Write"<br>"
  146. %>
  147.             </div></td>
  148.         </tr>
  149.       </table></td>
  150.   </tr>
  151.   <%
  152. end if
  153. %>
  154. </table>
  155. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  156.   <tr>
  157.     <td class="hback">选择状态:<a href="Check.asp?check=1">已入库</a> -- <a href="Check.asp?check=0">未入库</a> -- <a href="Check.asp?check=">所有</a> </td>
  158.   </tr>
  159. </table>
  160. </BODY>
  161. </HTML>
  162. <%
  163. Set CollectConn = Nothing
  164. Set Conn = Nothing
  165. Set RsNewsObj = Nothing
  166. %>
  167. <script language="JavaScript">
  168. function MoveNews(f_All_ID)
  169. {
  170. var ID_Str='',CName_Str='';
  171. if (f_All_ID=='')
  172. {
  173. if (document.all.NewsID.length)
  174. {
  175. for (var i=0;i<document.all.NewsID.length;i++)
  176. {
  177. if(document.all.NewsID(i).checked)
  178. {
  179. if (ID_Str!=''){ID_Str=ID_Str+'***'+document.all.NewsID(i).value;}else{ID_Str=document.all.NewsID(i).value;}
  180. if (CName_Str!=''){CName_Str=CName_Str+'***'+document.all.NewsID(i).CName;}else{CName_Str=document.all.NewsID(i).CName;}
  181. }
  182. }
  183. }
  184. else{if(document.all.NewsID.checked){ID_Str=document.all.NewsID.value;CName_Str=document.all.NewsID.CName;}}
  185. }
  186. else {ID_Str='all';CName_Str='全部新闻';}
  187. if (ID_Str!='')location='MoveNews.asp?ID='+ID_Str+'&CName='+CName_Str;
  188. else alert('请选择要入库的新闻');
  189. }
  190. function DeleteNews(f_ID_Type)
  191. {
  192. var ID_Str='';
  193. if (f_ID_Type=='')
  194. {
  195. if (document.all.NewsID.length)
  196. {
  197. for (var i=0;i<document.all.NewsID.length;i++)
  198. {
  199. if(document.all.NewsID(i).checked)
  200. {
  201. if (ID_Str!=''){ID_Str=ID_Str+'***'+document.all.NewsID(i).value;}else{ID_Str=document.all.NewsID(i).value;}
  202. }
  203. }
  204. }
  205. else{if(document.all.NewsID.checked)ID_Str=document.all.NewsID.value;}
  206. }
  207. else
  208. {
  209. ID_Str=f_ID_Type
  210. }
  211. if (ID_Str!='')
  212. {
  213. if(confirm('确定要删除吗?')) location='?Action=Del&ID='+ID_Str;
  214. }
  215. else alert('请选择要删除的新闻');
  216. }
  217. function selectAll(f_OBJ,f_Flag)
  218. {
  219. if (f_OBJ.length)
  220. {
  221. for (var i=0;i<f_OBJ.length;i++)
  222. {
  223. f_OBJ(i).checked=f_Flag;
  224. }
  225. }
  226. else{f_OBJ.checked=f_Flag;}
  227. }
  228. </script>