<!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=utf-8">
<title>duomicms智能采集工具</title>
<link href="skin/css/admin.css" rel="stylesheet" type="text/css" />
<script src="skin/js/common.js" type="text/javascript"></script>
<script src="skin/js/main.js" type="text/javascript"></script>
<style type="text/css">
input {
	height:12px;
}
.txt {
	width:250px;
}
.tb2 td {
	padding:2px 5px 2px 5px;
	height:25px
}
.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;
}
.btn {
	height:22px
}
.red {
	color:red
}
.blue {
	color:blue
}
.gray {
	color:gray
}
</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";
	}
}

function checkForm(){
	if($('name').value=='')
	{
		alert("请填写过滤器名称！");
		$('name').focus();
		return false;
	}
}
</script>
</head>
<body>
<div class="container" id="cpcontainer">
  <table class="tb">
    <tr class="thead">
      <th colspan="2">过滤字典: <a href="?action=filters">字典列表</a> | <a href="?action=filtersadd">添加过滤</a></th>
    </tr>
    <form action="?action=filterssave" method="post" name="form1">
      <input type="hidden" name="id" value="<?php echo $id; ?>" />
      <?php 
    	$sql = "select * from duomi_co_filters where ID=".$id;
		$row = $dsql->GetOne($sql);
    ?>
      <tr>
        <td class="label">过滤器名称</td>
        <td><input type="text" class="txt" id="name" name="name" value="<?php echo $row['Name']; ?>" /></td>
      </tr>
      <tr>
        <td class="label">过滤字段</td>
        <td><select name="rColumn">
            <option value="0" <?php if($row['rColumn']==0) echo 'selected'; ?>>数据名称</option>
            <option value="1" <?php if($row['rColumn']==1) echo 'selected'; ?>>数据简介</option>
          </select></td>
      </tr>
      <tr>
        <td class="label">过滤模式</td>
        <td><input type="radio" class="radio" name="uesMode" value="0" onclick="hide('sStartBody','sEndBody');show('sFindBody');" <?php if($row['uesMode']==0) echo 'checked'; ?> />
          简单替换
          <input type="radio" class="radio" name="uesMode" value="1" onclick="hide('sFindBody');show('sStartBody','sEndBody');" <?php if($row['uesMode']==1) echo 'checked'; ?> />
          高级替换</td>
      </tr>
      <tr id="sFindBody" style="<?php if($row['uesMode']==0) echo ''; else echo 'display:none'; ?>">
        <td class="label">查找</td>
        <td><textarea name="sFind" rows="4" cols="80"><?php echo $row['sFind']; ?></textarea></td>
      </tr>
      <tr id="sStartBody" style="<?php if($row['uesMode']==0) echo 'display:none'; else echo ''; ?>">
        <td class="label">开始标记</td>
        <td><textarea name="sStart" rows="4" cols="80"><?php echo $row['sStart']; ?></textarea></td>
      </tr>
      <tr id="sEndBody" style="<?php if($row['uesMode']==0) echo 'display:none'; else echo ''; ?>">
        <td class="label">结束标记</td>
        <td><textarea name="sEnd" rows="4" cols="80"><?php echo $row['sEnd']; ?></textarea></td>
      </tr>
      <tr>
        <td class="label">替换</td>
        <td><textarea name="sReplace" rows="4" cols="80"><?php echo $row['sReplace']; ?></textarea></td>
      </tr>
      <tr>
        <td class="label">启用</td>
        <td><input type="radio" class="radio" name="Flag" value="1" <?php if($row['Flag']==1) echo 'checked'; ?>/>
          启用
          <input type="radio" class="radio" name="Flag" value="0" <?php if($row['Flag']==0) echo 'checked'; ?>/>
          禁用</td>
      </tr>
      <tr>
        <td colspan=2><input  type="submit" class="btn" onclick="return checkForm();" name="Submit" value="确&nbsp;&nbsp;定" >
          &nbsp;&nbsp;&nbsp;&nbsp;
          <input name="Cancel" class="btn" type="button" id="Cancel" value="取&nbsp;&nbsp;消" onClick="window.location.href='?action=filters'"></td>
      </tr>
    </form>
  </table>
</div>
<?php 
viewFoot();
?>
</body>
<iframe frameborder="0" scrolling="no" height="0" width="0" name="hiddensubmit" id="hiddensubmit" src="about:blank"></iframe>
</html>
