<!--{template 'head'}-->
<!--{template 'collect/head'}-->
<script type="text/javascript">
function collectSingle(rules, id){
	qmeCms.dialogView.get("采集中");
	Ajax.get("system.php?sys=collect&work=content&rules="+rules+"&channelid="+config.channelid+"&id="+id, function(resp){
		var json = evaljson(resp);
		var msg = '';
		switch(json['status']){
			case 0:
				msg = '错误的请求';
			break;

			case 1:
				msg = '数据源错误';
			break;

			case 2:
				msg = '没有采集到文章内容';
			break;

			case 3:
				msg = '已存在相同标题的数据';
				$('item-parent').deleteRow($('item-'+id).rowIndex);
			break;

			case 4:
				msg = '采集成功';
				$('item-parent').deleteRow($('item-'+id).rowIndex);
			break;
		}
		qmeCms.dialogView.setMessage("<p class='padding'>"+msg+"</p>");
	});
}
</script>
<form name="tablesForm" method="get" action="system.php">
<table cellpadding="0" cellspacing="1" border="0" align=center width=100% class="tableborder" id="item-parent">	
	<tr>
		<td class="tablerowl" colspan=3><!--{eval new pager($num,$pagenum);}--></td>
		<td class="tablerowl" colspan=2 align=right>
			<input type="hidden" value="link_show" name="work">
			<input type="hidden" value="collect" name="sys">
			<input type="hidden" value="{$channelid}" name="channelid">
			<select  onchange="this.form.submit();" name="rules">
			<option value="">显示全部</option>
			<!--{loop $classs $val}-->
				<option value="{$val[id]}" {$val[selected]}>{$val[name]}</option>
			<!--{/loop}--> 
			</select>
		</td>
	</tr>
	<tr align="center" >
		<td width="60" bgcolor="#8482A5" height="30"><font color="#FFFFFF">ID</font></td>
		<td bgcolor="#8482A5" height="30"><font color="#FFFFFF">标题</font></td>
		<td width="80" bgcolor="#8482A5" height="30"><font color="#FFFFFF">采集器ID</font></td>
		<td width="150" bgcolor="#8482A5" height="30"><font color="#FFFFFF">采集时间</font></td>
		<td width="100" bgcolor="#8482A5" height="30"><font color="#FFFFFF">操作</font></td>
	</tr>
	<!--{if $lists}-->
	<!--{loop $lists $val}-->
	<tr height=20 onmouseout="this.style.backgroundColor='#F1F3F5'" onmouseover="this.style.backgroundColor='#BFDFFF'" bgColor='#F1F3F5' id="item-{$val['id']}">
		<td bgcolor="#C0C0C0" align="center">{$val[id]}</td>
		<td style="padding-left:10px"><a target="_blank" href="{$val[url]}">{$val[title]}</a></td>
		<td align="center">{$val[rules]}</td>
		<td align="center">{$val[date]}</td>
		<td align="center"><a href="###" onclick="collectSingle({$val[rules]}, {$val['id']});">点击采集</a></td>
	</tr>
	<!--{/loop}-->
	<!--{else}-->
	<tr height=24 bgColor='#F1F3F5'>
		<td align="center" colspan="5"><p style="padding:30px">没有相关数据</p></td>
	</tr>
	<!--{/if}-->
</table>
</form>
<!--{template 'foot'}-->