<!--#include file="../../fy.Function.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="inc/function.asp"-->
<%
'采集程序源码来自互联网,部分做了修改
Dim SqlItem,RsItem,Rs,Sql
Dim Action,FoundErr,ErrMsg
Dim ItemID,ItemName,WebName,ClassID,SpecialID,ListStr,ListPaingType,ListPaingStr2,ListPaingID1,ListPaingID2,ListPaingStr3,Flag,ItemCollecDate
Dim ListUrl
Dim CurrentPage,AllPage,iItem,ItemNum
Const MaxPerPage=20
Call Main()
'关闭数据库链接
If fycms.s("Action")="Del" Then  Call Del()
Call CloseConn()
Call CloseConnItem()

Sub Main%>
<!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>
<!--#include file="top.asp"-->
<form name="myform" method="POST" action="collectstart.asp">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <thead>
      <tr>
      <th>选择</th>
	  <th>项目名称</th>
	  <th>采集地址</th>
	  <th>所属栏目</th>
	  <th>状态</th>
	  <th>上次采集</th>
	  <th>操作</th>
	  </tr>
    </thead>



 <%            
If Request("page")<>"" then
    CurrentPage=Cint(Request("Page"))
Else
    CurrentPage=1
End if 

Set RsItem=server.createobject("adodb.recordset")         
SqlItem="select ItemID,ItemName,WebName,ListStr,ListPaingType,ListPaingStr2,ListPaingID1,ListPaingID2,ListPaingStr3,ClassID,SpecialID,Flag from Item order by ItemID DESC"   
 RsItem.open SqlItem,ConnItem,1,1

if Not RsItem.Eof then
   RsItem.PageSize=MaxPerPage
   Allpage=RsItem.PageCount
   If Currentpage>Allpage Then Currentpage=1
   ItemNum=RsItem.RecordCount
   RsItem.MoveFirst
   RsItem.AbsolutePage=CurrentPage
   iItem=0
   Do While Not RsItem.Eof
      ItemID=RsItem("ItemID")
      ItemName=RsItem("ItemName")
      WebName=RsItem("WebName")
      ClassID=RsItem("ClassID")      
      SpecialID=RsItem("SpecialID")
      ListStr=RsItem("ListStr")
      ListPaingType=RsItem("ListPaingType")
      ListPaingStr2=RsItem("ListPaingStr2")
      ListPaingID1=RsItem("ListPaingID1")
      ListPaingID2=RsItem("ListPaingID2")
      ListPaingStr3=RsItem("ListPaingStr3")
      Flag=RsItem("Flag")
      If  ListPaingType=0  Or ListPaingType=1  Then
            ListUrl=ListStr
      ElseIf  ListPaingType=2  Then
            ListUrl=Replace(ListPaingStr2,"{$ID}",CStr(ListPaingID1))
      ElseIf  ListPaingType=3  Then
            If  Instr(ListPaingStr3,"|")>0  Then
            ListUrl=Left(ListPaingStr3,Instr(ListPaingStr3,"|")-1)
         Else
               ListUrl=ListPaingStr3
         End  If
      End  If

%>
        <tr >         
		<td align="center">
		
 


		<input name="ItemID" type="checkbox"  value="<%=ItemID%>"></td>
          <td align="center"><%=ItemName%></td>
          <td align="center"><a href="<%=ListUrl%>" target="_bank"><%=WebName%></a></td>
          <td align="center"><%=fycms.act_L(ClassID,2)%></td>
          <td align="center"><b>
            <%If Flag=True then
                    Response.write "√"
          Else
                 Response.write "<font color=red>×</font>"
          End If
        %>
          </b> </td>
          <td align="center"><%
       Set Rs=connItem.execute("select Top 1 CollecDate From Histroly Where ItemID=" & ItemID & " Order by HistrolyID desc")
       If Not Rs.Eof Then
          ItemCollecDate=rs("CollecDate")
       Else
          ItemCollecDate=""
       End if
       Set Rs=Nothing
       if ItemCollecDate<>"" then
          Response.Write ItemCollecDate
       Else
          Response.Write "尚无记录"
       End If
       %>          </td>
          <td align="center"><a href="collectstart.asp?ItemID=<%=ItemID%>
">采集</a> <a href=copy.asp?Action=Copy&ItemID=<%=ItemID%>>复制</a> <a href=setup.asp?ItemID=<%=ItemID%>>修改</a> <a href=setup5.asp?ItemID=<%=ItemID%>>测试</a> 

<a href=set.asp?ItemID=<%=ItemID%>>属性</a>
 
<a href=?Action=Del&ItemID=<%=ItemID%> onClick='return confirm("确定要删除此项目吗？");'>删除</a>



  <a href='Histroly.asp?allDel=Del&ItemID=<%=ItemID%>' title='清空采集历史记录!' onClick="return(confirm('清空采集历史记录可能导致,重复采集!确定删除吗?'))">清空采集记录</a></td>
        </TR>
<%    iItem=iItem+1
      If iItem>=MaxPerPage Then Exit Do
      RsItem.MoveNext
   Loop 
%>
    <tr> 
      <td height="30" colspan="9" bgcolor="#F7F7F7" class="tl">  
<label for="chkAll">
<input name="ChkAll" type="checkbox" id="ChkAll" onClick="CheckAll(this.form)" value="checkbox">
&nbsp;选中所有</label>		
		<input type="submit" class="btn btn_primary" value="开始采集" name="submit">
&nbsp;&nbsp; </td>
    </tr>
    
<%Else%>
<tr>
        <td colspan='9' align="center"><br>系统中暂无可用采集项目！</td>
</tr>
<%End If
 RsItem.Close
Set RsItem=Nothing
%>
 
</TABLE></form> 
<script type="text/javascript">
<!--
	function CheckAll(form)
		  {  
		 for (var i=0;i<form.elements.length;i++)  
			{  
			   var e = myform.elements[i];  
			   if (e.name != 'ChkAll'&&e.type=="checkbox")  
			   e.checked = myform.ChkAll.checked;  
		   }  
	  }
//-->
</script>
</div>
</body>
</html>
<%end sub%>
<%Sub Del
ItemID=ChkNumeric(Request("ItemID"))
 
    
      ItemID=Replace(ItemID," ","")   
      ConnItem.Execute("Delete From [Item] Where ItemID In(" & ItemID & ")")
      ConnItem.Execute("Delete From [Filters] Where ItemID In(" & ItemID & ")")
      ConnItem.Execute("Delete From [Histroly] Where ItemID In(" & ItemID & ")")
  
 Call fycms.ActErr("删除成功","Sys_fy/collection/index.asp","")
End Sub
%>