<!--#include file="../../fy.Function.asp"-->
<!--#include file="../../../fy_inc/cls_pageview.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="inc/function.asp"-->
<!doctype html>
<html>
<head>
<title>采集系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../../css/base.css">
<link rel="stylesheet" type="text/css" href="../../css/content.css">
 </head>
<body>

<% 
		Dim Action,ID,ItemID
  
		ID = ChkNumeric(Request.QueryString("ID"))
		ItemID = ChkNumeric(Request.QueryString("ItemID"))
		Action=Request("allDel")
 		 
		IF Action  = "Del" Then 
			 ConnItem.execute("Delete from Histroly  where  ItemID="&ItemID&" ")
   			 Call fycms.ActErr("指定的历史记录已经删除！","Sys_fy/collection/index.asp","")
		End IF
	
		IF Action  = "删除失败记录" Then 
			ConnItem.execute("Delete from Histroly  where  Result=false ")
   			 Call fycms.ActErr("指定的历史记录已经删除！","Sys_fy/collection/index.asp","")
		End IF
	
		IF Action = "清空所有记录" Then 
			ConnItem.execute("Delete from Histroly  ")
   			 Call fycms.ActErr("指定的历史记录已经删除！","Sys_fy/collection/index.asp","")
		End IF
	
 		IF Action = "删除所有成功记录" Then 
			ConnItem.execute("Delete from Histroly   where  Result=true ")
   			 Call fycms.ActErr("指定的历史记录已经删除！","Sys_fy/collection/index.asp","")
		End IF
	
		IF Action = "删除选中记录" Then'单一删除
			ID = Request.Form("ID")
			IF ID = "" Then
				ShowErr = "请先选定！"
				Call fycms.ActErr(ShowErr,"","1")
				Response.End
			End IF		
			ID = Split(ID,",")
			 For I = LBound(ID) To UBound(ID)
				ConnItem.execute("Delete from Histroly  Where HistrolyID=" & ChkNumeric(ID(I)) & "")
			Next
			set conn=nothing	
			Call fycms.ActErr("指定的历史记录已经删除！","Sys_fy/collection/index.asp","")
	  End IF

	Dim strLocalUrl
	strLocalUrl = request.ServerVariables("SCRIPT_NAME")
	
	Dim intPageNow
	intPageNow = request.QueryString("page")
	
	Dim intPageSize, strPageInfo
	intPageSize = 20
	
	Dim arrinfo, i
	Dim sql, sqlCount,Sqls,pages
	pages = "Type="&Request("Type")&"&page"
	Select Case Request.QueryString("Type")
		Case "OK"
			Sqls = " Where  Result=True "
		Case "NO"
			Sqls = " Where Result=False "
		Case Else
			Sqls = " Where 1=1 "
	End Select
	sql = "SELECT [HistrolyID], [ItemID], [ChannelID], [ClassID],[SpecialID],[ArticleID],[Title],[CollecDate],[NewsUrl],[Result]" & _
		" FROM [Histroly]" &Sqls& _
		"ORDER BY [HistrolyID] DESC"
  	sqlCount = "SELECT Count([HistrolyID])" & _
			" FROM [Histroly]  " &Sqls

		Dim clsRecordInfo
		Set clsRecordInfo = New Cls_PageView
			clsRecordInfo.intRecordCount = 2816
			clsRecordInfo.strSqlCount = sqlCount
			clsRecordInfo.strSql = sql
			clsRecordInfo.intPageSize = intPageSize
			clsRecordInfo.intPageNow = intPageNow
			clsRecordInfo.strPageUrl = strLocalUrl
			clsRecordInfo.strPageVar = pages
		clsRecordInfo.objConn = ConnItem		
		arrinfo = clsRecordInfo.arrinfo
		strPageInfo = clsRecordInfo.strPageInfo
		Set clsRecordInfo = nothing
	 %>
<form name="Article" method="post" action="?">
<!--#include file="top.asp"-->
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  <tr>
    <td  class="bg_tr"><strong>您现在的位置：文章中心管理 &gt;&gt; 历史记录管理
    
  </select>
  </td>
  </tr>
  <tr>
    <td class="td_bg"><strong>选项：</strong><strong><a href="?">所有记录</a> ┆ <a href="?Type=OK">成功记录</a>┆ <a href="?Type=NO">失败记录</a>┆</strong>&nbsp;</td>
    </tr>
</table>
  <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  
    <tr>
      <td width="53" align="center" class="bg_tr">选中 </td>
      <td width="106" align="center" class="bg_tr">项目名称</td>
      <td width="490" align="center" class="bg_tr">文章标题</td>
      <td width="150" align="center" class="bg_tr">栏目</td>
      <td width="105" align="center" class="bg_tr">来源</td>
      <td width="140" align="center" class="bg_tr">结果</td>
      <td width="140" colspan="2" align="center" class="bg_tr">常规管理操作</td>
    </tr>
	 <%
		Dim bgColor
		If IsArray(arrinfo) Then
			For i = 0 to UBound(arrinfo, 2)
	%>
    <tr >
      <td align="center" class="td_bg" >
	  <input type="checkbox" name="ID" value="<%= arrinfo(0,i) %>">	  </td>
      <td align="center" class="td_bg" ><%Call typeclassname(arrinfo(1,i))%></td>
      <td class="td_bg" ><%= arrinfo(6,i) %></td>
      <td class="td_bg" ><%=fycms.act_L(arrinfo(3,i),2)%></td>
      <td align="center" class="td_bg" ><a href="<%= arrinfo(8,i) %>" target="_blank" title="<%= arrinfo(8,i) %>">点击访问</a></td>
      <td align="center" class="td_bg" >
	 	<%If arrinfo(9,i)=True Then
           Response.write "成功"
        ElseIf arrinfo(9,i)=False Then
           Response.Write "<font color=red>失败</font>"
        Else
           Response.Write "<font color=red>异常</font>"
        End If
      %>  </td>

 

      <td  align="center" class="td_bg">
	  <a href="?Action=del&id=<%= arrinfo(0,i) %>" onClick="return confirm('确认删除此评论吗?')">删除</a>
	 	  </td>
    </tr>
	<% 
	Next
	End If
	%>
    <tr >
      <td height="30" colspan="8" class="td_bg">
	 <label for=chk>
		<input id="chk" type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">选择全部</label>
	&nbsp;&nbsp;&nbsp;  
	

	<input type="submit" value="删除选中记录" name="allDel" class="btn btn_primary" onClick='return confirm("确定要删除所选记录吗？");'>
	<input type="submit" value="删除失败记录" name="allDel" class="btn btn_primary" onClick='return confirm("确定要删除所有失败记录吗？");'>
	<input type="submit" value="清空所有记录" name="allDel" class="btn btn_primary" onClick='return confirm("确定要清空所有记录吗？");'>
	<input type="submit" value="删除所有成功记录" name="allDel" class="btn btn_primary" onClick='return confirm("确定要清除所有成功记录吗？");'>
 	
	</td>
    </tr>
    <tr >
      <td height="25" colspan="8" align="center" class="td_bg"><%= strPageInfo%></td>
    </tr>
  </table>
</form>
<script language="javascript">
//CSS背景控制
function overColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg1"
		Obj.bgColor="";
	}
	
}
function outColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg";
		Obj.bgColor="";
	}
}
 

function CheckAll(form)  
  {  
 for (var i=0;i<form.elements.length;i++)  
    {  
    var e = Article.elements[i];  
   if (e.name != 'chkall')  
      e.checked = Article.chkall.checked;  
   }  
  }


</script>
<% CloseConn %>
</body>
</html>
