<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta name="robots" content="noindex,nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="img/style.css" rel="stylesheet" type="text/css" />
<title>添加采集项目</title>
<script src="js/common.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<style type="text/css">

.txt {
	width:250px;
}
.tb2 td {
	padding:2px 5px 2px 5px;
	height:25px;
	text-align:left;
}
.tb2 .thc {
	text-align:center;
	line-height:30px;
	background-color: #F5F7F8;
	font-size:18px;
	font-weight:bold;
	color:#000
}
.tb2 .thr {
	text-align:center;
	height:20px
}
.label {
	padding:0;
	width:150px;
	text-align:right;
	border-right:1px solid #DEEFFA;
}

.red {
	color:red
}
.blue {
	color:blue
}
form, fieldset {
	margin:0;
	padding:0
}
.tb td {
	text-align:left;
}
</style>
<script type="text/javascript">
function show(){
	var arg=arguments;
	for(var i=0;i<arg.length;i++){
		$(arg[i]).style.display="";
	}
}

function hide(){
	var arg=arguments;
	for(var i=0;i<arg.length;i++){
		$(arg[i]).style.display="none";
	}
}
</script>
</head>
<!--当前导航-->
<body bgcolor="#F7FBFF">
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='后台首页&nbsp;&raquo;&nbsp;采集&nbsp;&raquo;&nbsp;自定义采集 ';</script>
<div class="r_main">
  <div class="r_content">
    <div class="r_content_1" align=center>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tb">
        <thead>
          <tr class="thead">
            <th>&nbsp;<font color="#000000">操作选项： </font><a href="admin_collect.php">管理采集规则</a> | <a href="?action=add">添加采集规则</a></th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1. 通过本向导将传统的采集规则转换成采集规则</td>
          </tr>
        </tbody>
      </table>
      <table class="tb2">
        <thead>
          <tr>
            <th colspan="2" class="thc">使用采集规则向导生成采集规则</th>
          </tr>
          <tr>
            <th colspan="2" class="thr"><font id="stephit1" color="red">１. 设置基本参数</font>&nbsp;&nbsp;<font id="stephit2">２. 采集列表连接设置</font>&nbsp;&nbsp;<font id="stephit3">３. 采集内容与影片地址设置</font>&nbsp;&nbsp;<font id="stephit4">４. 在线模拟预览结果</font>&nbsp;&nbsp;<font id="stephit5">５. 完成向导并真实演示</font></th>
          </tr>
        </thead>
      </table>
      <form name="addruleform" id="addruleform" method="post" action="?action=editrulesingle">
        <input type='hidden' name='step' value='2' />
        <input type="hidden" name="id" value="<?php echo $id;?>" />
        <table class="tb2">
          <tbody>
            <tr>
              <td class="label">项目名称：</td>
              <td><input type="text" class="txt" name="itemname" value="<?php echo $row[tname];?>" /></td>
            </tr>
            <tr>
            <tr>
              <td class="label">入库方式：</td>
              <td><input type="radio" class="radio" name="intodatabase" value="0"<?php if($atd["intodatabase"]==0) echo " checked";?> />
                入临时库
                <input type="radio" class="radio" name="intodatabase" value="1"<?php if($atd["intodatabase"]==1) echo " checked";?>/>
                直接入库</td>
            </tr>
            <?php if($cofrom!=1) {?>
            <tr>
              <td class="label">只采集最近：</td>
              <td><select name="getherday">
                  <option value="0">不限</option>
                  <?php for($i=1;$i<=31;$i++){if($row[getherday]==$i){echo "<option value=\"".$i."\" selected>".$i."</option>";}else{echo "<option value=\"".$i."\">".$i."</option>";}}?>
                </select>
                天 * 选择天数还要填写第3步的 <span class="red">影片日期 开始代码 和 结束代码</span>才有效</td>
            </tr>
            <?php }?>
            <tr>
              <td class="label">目标站点URL：</td>
              <td><input type="text" class="txt" name="siteurl" value="<?php echo $atd["siteurl"];?>" /></td>
            </tr>
            <tr>
              <td class="label">网页编码：</td>
              <td><select name="coding" size="1">
                  <option value="gb2312"<?php if($row[coding]=='gb2312') echo " selected"?>>GB2312</option>
                  <option value="utf-8"<?php if($row[coding]=='utf-8') echo " selected"?>>UTF-8</option>
                  <option value="big5"<?php if($row[coding]=='big5') echo " selected"?>>BIG5</option>
                </select></td>
            </tr>
            <tr>
              <td class="label">使用SOCK获取：</td>
              <td><label for="sock">
                  <input name="sock" type="checkbox" id="sock" value="1" class="checkbox"<?php if($row[sock]==1) echo " checked"?>>
                  是的，使用SOCK</label>
                <span class="red">使用SOCK可以有效的突破各种防盗链</span></td>
            </tr>
            <tr <?php if($cofrom==1){echo 'style=display:none;';} ?>>
              <td class="label">播放来源：</td>
              <?php if($cofrom==1) {?>
              <td><input name='playfrom' value="<?php echo $row[playfrom]?>"/></td>
              <?php }else{?>
              <td><select name='playfrom'>
                  <option value=''>暂没有数据</option>
                  <?php echo makePlayerSelect($row[playfrom]);?>
                </select></td>
              <?php }?>
            </tr>
            <tr <?php if($cofrom==1){echo 'style=display:none;';} ?>>
              <td class="label">下载来源：</td>
              <td><select name='downfrom'>
                  <option value=''>暂没有数据</option>
                  <?php echo makedownSelect($atd[downfrom]);?>
                </select></td>
            </tr>
            <tr>
              <td>分类设置：</td>
              <td><input type="radio" class="radio" name="autocls" value="0" onclick="show('selcls');"<?php if($row[autocls]==0) echo " checked"?>/>
                固定分类
                <input type="radio" class="radio" name="autocls" value="1" onclick="hide('selcls');"<?php if($row[autocls]==1) echo " checked"?>/>
                智能归类(若归类失败，影片将自动加到临时库)</td>
            </tr>
            <tr id="selcls" style="<?php if($row[autocls]==1) echo "display:none"?>">
              <td class="label">所属分类：</td>
              <?php if($cofrom==1) {?>
              <td><select name="classid">
                  <option value="0">请选择数据分类</option>
                  <?php makeTypeOptionSelected(0,"&nbsp;|&nbsp;","",$row[classid],1); ?>
                </select></td>
              <?php }else{?>
              <td><select name="classid">
                  <option value="0">请选择数据分类</option>
                  <?php makeTypeOptionSelected(0,"&nbsp;|&nbsp;","",$row[classid]); ?>
                </select></td>
              <?php }?>
            </tr>
           <tr style="display:none;">
              <td class="label">初始点击数：</td>
              <td><input type="text" name="inithit" value="<?php echo $atd["inithit"];?>" />
                &nbsp;<font color="red">-1为随机点击数</font></td>
            </tr>
            <tr>
              <td class="label">分页设置：</td>
              <td><input type="radio" class="radio" name="pageset" value="0" onclick="hide('page_0','page_1','page_2');show('page_0');"<?php if($atd["pageset"]==0) echo " checked"?>/>
                不分页
                <input type="radio" class="radio" name="pageset" value="1" onclick="hide('page_0','page_1','page_2');show('page_1');"<?php if($atd["pageset"]==1) echo " checked"?>/>
                批量分页
                <input type="radio" class="radio" name="pageset" value="2" onclick="hide('page_0','page_1','page_2');show('page_2');"<?php if($atd["pageset"]==2) echo " checked"?>/>
                手动分页 </td>
            </tr>
            <tr id="page_0" style="<?php if($atd["pageset"]!=0) echo "display:none"?>">
              <td class="label">采集网址：</td>
              <td><input type="text" class="txt" name="pageurl0" value="<?php echo $atd["pageurl0"];?>" /></td>
            </tr>
          </tbody>
          <tbody id="page_1" style="<?php if($atd["pageset"]!=1) echo "display:none"?>">
            <tr>
              <td class="label">远程列表分页URL：</td>
              <td><input type="text" class="txt" name="pageurl1" value="<?php echo $atd["pageurl1"];?>" />
                &nbsp;ID变量<font color="red">(*)</font></td>
            </tr>
            <tr>
              <td class="label">远程列表起始页：</td>
              <td>标准格式：Http://www.damin.com/list/list_(*).html<br />
                开始页：
                <input type="text" name="istart" value="<?php echo $atd["istart"];?>" style="width: 60px"/>
                - 结束页：
                <input type="text" name="iend" value="<?php echo $atd["iend"];?>" style="width: 60px" />
                &nbsp;例如：1 - 10 或者 10 - 1</td>
            </tr>
          </tbody>
          <tbody id="page_2" style="<?php if($atd["pageset"]!=2) echo "display:none"?>">
            <tr>
              <td class="label">手动分页：</td>
              <td><textarea name="pageurl2" rows="6" cols="80" wrap="off"><?php echo $atd['pageurl2'];?></textarea></td>
</td>
            </tr>
          </tbody>
          <tbody>
            <tr>
              <td class="label">采集方式：</td>
              <td><input type="checkbox" class="checkbox" name="reverse" value="1"<?php if($atd["reverse"]==1) echo " checked"?>/>
                倒序采集</td>
            </tr>
          </tbody> 
          <tbody>
          	<tr <?php if($cofrom==1) echo 'style="display:none;"';?>>
			<td class="label">内容过滤设置：</td>
			<td>
			<?php 
				$filter = explode("|","IFRAME|OBJECT|BUTTON|CLASS|HTML|SPAN|DIV|P|SCRIPT|APPLET|STRONG|STYLE|TABLE|FONT|IMG|A");
                $filterin = $atd["removecode"];
				for($i=0;$i<count($filter);$i++)
				{
                	echo "<input type=\"checkbox\" class=\"checkbox\" name=\"removecode[]\" value=\"$filter[$i]\" ".(strpos(' '.$filterin,$filter[$i])>0?'checked':'')." />$filter[$i]";
					if($filter[$i]=="P")echo "<br>";
				}
			?>
			</td>
		</tr>
          </tbody>
            </tbody>
          
        </table>
        <table class="tb2">
          <tbody>
            <tr>
              <td class="label"></td>
              <td><input type="button" class="rb1" name="back" value="返回上一步" onclick="javascript:history.back(-1)" />
                &nbsp;&nbsp;
                <input type="submit" name="Submit" class="rb1" value="保存信息并进入下一步设置" onClick="if($('itemname').value.length==0){alert('没有填写项目名称');return false;};"/>&nbsp;&nbsp;
                <input id="showcode" class="checkbox" type="checkbox" value="1" name="showcode">
下一步显示源码</td>
            </tr>
          </tbody>
        </table>
      </form>
    </div>
  </div>
</div>
<div class="bottom">
  <table width="100%" cellspacing="5">
    <tr>
      <td align="center"><?php echo $cfg_powerby?></td>
    </tr>
  </table>
</div>
</body>
</html>
