<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/function.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p09")
'''''''''''''''''''''''''''''''''''''''''''''''
BeginTime=Timer
dim taskid
if not isempty(request("taskid")) then 
	taskid=Cint(request("taskid"))
else
	taskid=0
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: #D4D0C8;
}
input{ font-size:12px;}
form{margin:0;}
-->
</style>
<link href="style/global.css" rel="stylesheet" type="text/css">
<style type="text/css">
body{font-size:12px;}
<!--
.style1 {color: #FF0000}
.style2 {color: #CCCCCC}
.style3 {color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</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>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#FF9900">
    <td width="100%" height="22"><div align="center"><span class="style3">◆ 信息采集 ◆</span></div></td>
  </tr>
</table>
<fieldset style="margin:5px 50px 5px 50px; border-top:1px solid #ffffff; border-right:1px solid #000000;border-bottom:1px solid #000000;border-left:1px solid #ffffff;">
<%
if(taskid>=1) then
	set rs=server.CreateObject("adodb.recordset") 
	rs.open "select top 1 * from collect where id="&taskid,conn,3,3
	if not rs.eof then
	catalogid=rs("catalogid")
	catalogName=getCatalogName(catalogid)
%>
	<form name="form1" method="post" action="collect2.asp">
	  <legend>第一步建立新任务</legend>
	<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="34%"><div align="right">任务名称：</div></td>
    <td width="66%"><div align="left">
      
        <input name="taskname" type="text" id="taskname" value="<%=rs("TaskName")%>">
      
    </div></td>
    </tr>
  <tr>
    <td><div align="right">任务描述：</div></td>
    <td><div align="left">
      <input name="taskdes" type="text" id="taskdes" size="30" value="<%=rs("Taskdes")%>">
    </div></td>
  </tr>
  <tr>
    <td><div align="right">采集地址：</div></td>
    <td><div align="left">
      <input name="collecturl" type="text" id="collecturl" value="<%=rs("CollectUrl")%>">
    例：http://www.tot.name</div></td>
  </tr>
  <tr>
    <td><div align="right">设置编码：</div></td>
    <td><div align="left">
      <input name="encode" type="text" id="encode" size="20" value="<%=rs("Encode")%>">
    (常见的有：UTF-8,ISO-8859-1,GBK,GB2312)</div></td>
  </tr>
  <tr>
    <td><div align="right">是否需要登录：</div></td>
    <td><input name="IfLogin" type="radio" onClick="LoginAbs.style.display='none'" value="0" <%if(rs("IfLogin")=0) then response.Write("checked")%>> 
      否
        <input name="IfLogin" type="radio" onClick="LoginAbs.style.display='block'" value="1" <%if(rs("IfLogin")=1) then response.Write("checked")%>> 
        是<br>
	<div id="LoginAbs" <%if(rs("IfLogin")=0) then response.Write("style=""display:none; """)%>>设置登录需要的参数：<br>
      登录地址：
        <input name="LoginUrl" type="text" id="LoginUrl" value="<%=rs("LoginUrl")%>" size="30">
        <br>
        登录提交地址：
        <input name="LoginActUrl" type="text" id="LoginActUrl" value="<%=rs("LoginActUrl")%>" size="30">
	    <br>
	    发送的数据：
	    <input name="PostData" type="text" id="PostData" value="<%=rs("PostData")%>" size="30">
		<br>
	    登录失败信息：
	    <input name="LoginFailMsg" type="text" id="LoginFailMsg" value="<%=rs("LoginFailMsg")%>" size="30">
		</div></td>
  </tr>
  <tr>
    <td><div align="right">采集到(哪个栏目)：</div></td>
    <td><div align="left">
	  <select name="catalogid" >
  <option value="<%=catalogid%>"><%=catalogname%></option>
  </select>
	&nbsp;&nbsp;<a href="#" onClick="addParentOption();">＋</a> 
    </div></td>
  </tr>
  <tr>
    <td><div align="right"></div></td>
    <td height="50"><div align="left">
	<input type="hidden" name="taskid" value="<%=taskid%>">
      <input type="submit" name="Submit" value="下一步">
      <br>
    </div></td>
  </tr>
  <tr>
    <td height="50" colspan="2"><div align="center"><a href="config.asp">(注：采集文章生成静态时所绑定的文章模板请在inc/config.asp中修改GatherInfo(0)值)</a></div></td>
    </tr>
</table>
</form>
<%
	end if
	rs.close
	set rs=nothing
else
%>
	<form name="form1" method="post" action="collect2.asp">
	  <legend>第一步建立新任务</legend>
	<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="34%"><div align="right">任务名称：</div></td>
    <td width="66%"><div align="left">
      
        <input name="taskname" type="text" id="taskname">
      
    </div></td>
    </tr>
  <tr>
    <td><div align="right">任务描述：</div></td>
    <td><div align="left">
      <input name="taskdes" type="text" id="taskdes" size="30">
    </div></td>
  </tr>
  <tr>
    <td><div align="right">采集地址：</div></td>
    <td><div align="left">
      <input name="collecturl" type="text" id="collecturl">
    例：http://www.tot.name</div></td>
  </tr>
  <tr>
    <td><div align="right">设置编码：</div></td>
    <td><div align="left">
      <input name="encode" type="text" id="encode" value="GB2312" size="20">
    (常见的有：UTF-8,ISO-8859-1,GBK,GB2312)</div></td>
  </tr>
  <tr>
    <td><div align="right">是否需要登录：</div></td>
    <td><input name="IfLogin" type="radio" onClick="LoginAbs.style.display='none'" value="0" checked> 
      否
        <input name="IfLogin" type="radio" onClick="LoginAbs.style.display='block'" value="1"> 
        是<br>
	<div id="LoginAbs" style="display:none; ">设置登录需要的参数：<br>
      登录地址：
        <input name="LoginUrl" type="text" id="LoginUrl"  size="30">
        <br>
        登录提交地址：
        <input name="LoginActUrl" type="text" id="LoginActUrl" size="30">
	    <br>
	    发送的数据：
	    <input name="PostData" type="text" id="PostData"  size="30">例：username=test&password=test
		<br>
	    登录失败信息：
	    <input name="LoginFailMsg" type="text" id="LoginFailMsg" size="30">
		</div></td>
  </tr>
  <tr>
    <td><div align="right">采集到(哪个栏目)：</div></td>
    <td><div align="left">
      <select name="catalogid" >
  <option>点击右边＋号选择栏目</option>
  </select>
	&nbsp;&nbsp;<a href="#" onClick="addParentOption();">＋</a> 
    </div></td>
  </tr>
  <tr>
    <td><div align="right"></div></td>
    <td height="50"><div align="left">
      <input type="submit" name="Submit" value="下一步">
      <br>
    </div></td>
  </tr>
  <tr>
    <td height="50" colspan="2"><div align="center"><a href="config.asp">(注：采集文章生成静态时所绑定的文章模板请在inc/config.asp中修改GatherInfo(0)值)</a></div></td>
    </tr>
</table>
</form>
<%end if%>
</fieldset>
<!--开始采集规则-->
<!--开如数据设置规则-->
<p align="center"><%=CStr(FormatNumber((Timer-BeginTime)*1000,2))& "毫秒"%></p>
<script>
function addParentOption()
{
	var arr = showModalDialog("tree_container.asp", "", "dialogWidth:410px; dialogHeight:420px; status:0");
  	if (arr != null){  
   		document.form1.catalogid.options[0]=new Option(arr[1],arr[0]);
  	}
	
}
</script>
</body>
</html>
<%
call connclose()
%>
