<?php
/*
'**************************************************************************************************
' 软件名称: 搜一次 Content Management System
' 版本编号: Version 1.X
' 官方网站: http://www.yixiu.cc
' 官方论坛：http://bbs.yixiu.cc
' 版权所有: 搜一次运营团队
' 郑重声明:
'    1、任何个人或组织不得在未经授权的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；
'    2、搜一次网络事业部保留此软件的法律追究权利
' @author YGH 2012-12-13
'**************************************************************************************************
*/
include "../../admin_loginstate.php";
include "../../../include/conn.php";
include "../../../include/function.php";
include "../../admin_version.php";

$data = array (
  'id' => 0,'name' => '','targeturl' => '','charset' => 1,'player' => 'qvod','collecturl' => '','collecttype' => 2,'type' => 0,'bintype'=>0,'pictype' => 0,'list' => '','listhref' => '','title' => '','state' => '','class' => '','direct' => '','author' => '','area' => '','language' => '','year' => '','pic' => '','content' => '','playmode' => '','playrange' => '','webplayurl' => '','urlmode' => '','playurl' => '','urlreplace' => '','contentreplace' => '','finish' => '','collecttime' => '',
);

if (isset($_GET['edit'])) {
	$id = intval($_GET['edit']);
	$data = $db->getAll('select * from s_vodrule where id='.$id);
	if ($data) {
		$data = $data[0];
		$data['bintype'] = str_split(strrev(str_pad(decbin($data['type']),3,0,STR_PAD_LEFT)));
	}	
}

$collectName = '';
$ispage = 0;
switch($data['collecttype']){
	case 1: $collectName = '指定分类页'; break;
	case 2: $collectName = '自动分类页'; $ispage=1; break;
	case 3: $collectName = '批量分类页'; break;
	case 4: $collectName = '直接采集内容页'; $ispage=1; break;
}

$playxml = playadd();array_pop($playxml);
$playxml = playselect($playxml,$data['player']);

?><!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 http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link  href="../../images/style.css" rel="stylesheet" type="text/css" />
<title>自定义采集</title>
<script type="text/javascript" src="../../js/base.js"></script>
<script type="text/javascript" src="../../js/jquery.js"></script>

</head>
<body>
<div class="r_main">
	<div class="r_content">
		<div class="r_content_1">
			<form action="rulesave.php?action=collect" name="form1" method="post">
				<input type="hidden" name="id" value="<?php echo $data['id'];?>" />
				
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"  class="tb_style" >
					<tr>
						<td height="30" colspan="2" bgcolor="#FFFFFF" class="td_title">&nbsp;<font color="red">设置本次采集基本参数</font></td>
					</tr>
					<tr>
						<td width="146" height="35" align="right" bgcolor="#FFFFFF" class="td_border">采集规则名称：&nbsp;</td>
						<td width="793"  align="left" bgcolor="#FFFFFF" class="td_border"><?php echo $data['name'];?></td>
					</tr>
					<tr>
						<td width="146" height="35" align="right" bgcolor="#FFFFFF" class="td_border">采集目标网址：&nbsp;</td>
						<td width="793"  align="left" bgcolor="#FFFFFF" class="td_border"><?php echo $data['targeturl'];?></td>
					</tr>
					<tr>
						<td height="35" align="right" bgcolor="#FFFFFF" class="td_border">采集类型：&nbsp;</td>
						<td align="left" bgcolor="#FFFFFF" class="td_border"><?php echo $collectName;?></td>
					</tr>
					<?php if($ispage==1):?>
					<tr>
						<td height="35" align="right" bgcolor="#FFFFFF" class="td_border">采集分页设置：&nbsp;</td>
						<td align="left" bgcolor="#FFFFFF" class="td_border">
							<input type="text" name="pagebegin" value="" size="6" />
							-
							<input type="text" name="pageend" value="" size="6" />
							请输入开始页和结束页
						</td>
					</tr><?php endif;?>
					<tr>
						<td height="35" align="right" bgcolor="#FFFFFF" class="td_border">采集注意事项：&nbsp;</td>
						<td align="left" bgcolor="#FFFFFF" class="td_border">
							1、在采集前请确认规则已经填写完毕并正确<br />
							2、对于直接入库的数据，在没有百分百把握下，采集前请注意备份<br />
							3、采集时请不要人为去清空网站缓存，会导致采集不可预知的错误
						</td>
					</tr>
					<tr>
						<td height="40" bgcolor="#FFFFFF" class="td_border">&nbsp;</td>
						<td height="30" bgcolor="#FFFFFF" class="td_border"><input type="submit" class="rb1" id="step1"   value="继续下一步"/></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</div>
<?php require_once("../../admin_bottom.php");?>      
</body>
</html>