<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p09")
'''''''''''''''''''''''''''''''''''''''''''''''
dim BeginTime,currentpage,allrec,totalpage,n,p
BeginTime=Timer
const recpage=20
dim i
if not isempty(request("page")) then 
currentpage=request("page")
else currentpage=1
end if
%>
<html>
<head>
<title>采集历史记录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
}
form{margin:0;}
input{font-size:12px;}
-->
</style>
<link href="style/global.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #CCCCCC}
.style3 {color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
<script language="javascript">
function goto(frm)
{
	var gourl ="?";
	gourl += "page=" + (frm.page.value);
     var hid=parseInt(frm.hid.value);
	 if(parseInt(frm.page.value)>hid||frm.page.value<=0){
	 alert("错误！请确定你输入的数字在1-"+hid+"之间");
	 return false;
	 }
	window.location.href(gourl);
}</script>
<script language="JavaScript" type="text/JavaScript">

function ConfirmDel()
{
   if(confirm("确认删除？，并且不能恢复！确定要删除此信息吗？"))
     return true;
   else
     return false;
	 
}
</script>
</head>

<body>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<form action="collect_do.asp" enctype="application/x-www-form-urlencoded" name="form1" id="form1" method="post">
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#FF9900">
    <td height="22" colspan="6"><div align="center"><span class="style3">◆ 采集历史记录 ◆</span></div></td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td width="8%" height="22"><div align="center">id</div></td>
    <td width="46%"><div align="center">链接地址</div></td>
    <td width="13%"><div align="center">采集状态</div></td>
    <td width="7%"><div align="center">任务ID</div></td>
    <td width="14%"><div align="center">添加时间</div></td>
    <td width="12%"><div align="center">删除</div></td>
  </tr>
  <!-- 开始按行循环----------------------->
  <%
  		set rs=server.createobject("adodb.recordset")
  		rs.open "select count(*) AS co from collect_his",conn,3,1
		allrec=rs("co")
		totalpage=int((allrec+recpage-1)/recpage)
		rs.close
		set rs=nothing
		set rs=server.createobject("adodb.recordset")
		if(currentpage=1) then
			sql="select top "&recpage&" * from collect_his order by id desc"
		else
			sql="select top "&recpage&" * from collect_his where id <(select min(id) from (select top "&(recpage*(currentpage-1))&" id from collect_his order by id desc) as t) order by id desc "
		end if
		rs.open sql,conn,3,1		
		do while not rs.eof		
	%>
  <tr>
    <td height="20" bgcolor="#FFFFFF">	<div align="center">
      <%=rs("id")%><input type="checkbox" name="hisid" value=<%=rs("id")%>>
     </div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%=rs("linkurl")%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%if(rs("iscollected")=0) then response.Write("未采集") else response.Write("<span style=""color:red;"">已采集</span>") end if%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%=rs("taskid")%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%=rs("Moditime")%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><a href="dele.asp?id=<%=rs("id")%>&table=collect_his" onClick="return ConfirmDel()">删除</a></div></td>
  </tr>
  
  <%
    rs.movenext
	  i=i+1
	   if i>=recpage then 
		exit do
	   end if
	  loop
	 ' end sub
	  rs.close
	  set rs=nothing
  %>  
  <!--按行循环结束------------------------>
  <tr bgcolor="#FFFFFF">
  	<td height="30" colspan="6">  		<div align="center">
   	    <input class=Button type="button" name="chkall" style="background-color:#FFFFFF; border:1px solid #999999; " value=" 全 选 " onClick="CheckAll(this.form)">&nbsp;
   	    <input class=Button type="button" name="chksel" style="background-color:#FFFFFF; border:1px solid #999999; " value=" 反 选 " onClick="ContraSel(this.form)">&nbsp;
   	    <select name="act">
        <option value="del">删除</option>
        <option value="gathered">设置为已采集</option>
		    <option value="notgather">设置为未采集</option>
 	      </select>
        <input class=Button type="submit" name="Submit2" style="background-color:#006699; border:1px solid #999999; color:#FFFFFF; " value="执行操作->" onClick="return confirm('您确定执行该操作吗?')">
	      <a href="collect_do.asp?act=remove" onClick="return confirm('确定删除所有栏目吗？')">清空记录</a></div></td>
  </tr>
</table>
</form>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="40">
	<div align="center">
	<form name="form1" method="post" action="" style="margin:0 0 0 0">
<%
n=currentpage+1
p=currentpage-1
if p>0then
response.write("["&"<a href='?page="&cstr(p)&"'>上一页</a>]&nbsp;&nbsp;&nbsp;")
else response.write("上一页&nbsp;&nbsp;&nbsp;")
end if 
if (n-1)*recpage>=allrec then 
response.write("下一页" )
else
response.Write("["&"<a href='?page="&cstr(n)&"'>下一页</a>]")
end if
response.write("&nbsp;共"&allrec&"条&nbsp;")
response.Write("&nbsp;共"&totalpage&"页&nbsp;")
response.Write("&nbsp;第"&currentpage&"页&nbsp;")
%>
          <input type="hidden" name="hid" value="<%=totalpage%>">
&nbsp;&nbsp;跳至
          <input name="page" type="text" size="5" onChange="goto(this.form)" style="border:1px solid #000000;height:18px ">
          页
          <input type="button" name="Button22" value="Go->" style="font-size:12px ;border:1px solid #000000;height:18px ">
        </form>
	  </div>
	</td>
  </tr>
</table>
<script language="javascript">
function CheckAll(form) {  
	for (var i=0;i<form.elements.length;i++)  {  
		var e = form.elements[i];  
		if (e.name != 'chkall')  
		e.checked = true // form.chkall.checked;  
	}  
} 
 
function ContraSel(form) {
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked=!e.checked;
	}
}
</script>
</body>
</html>
<%
call connclose()
%>
<%=CStr(FormatNumber((Timer-BeginTime)*1000,2))& "毫秒"%>