<?php

/*

'**************************************************************************************************

' 软件名称: 黑色幻想舞曲管理系统CMS2.0

' 版本编号: hshxsdj 2.0

' 官方网站: http://www.hshxs.com

' 官方论坛：http://bbs.hshxs.com

' 版权所有: 黑色幻想开发团队    噬己翼(QQ:532917920)

' 郑重声明:

'    1、任何个人或组织不得在未经授权的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；

'    2、黑色幻想网络事业部保留此软件的法律追究权利

'**************************************************************************************************

*/

include "../../../include/conn.php";

include "../../../include/function.php";

require_once('json.php');

include "../../admin_version.php";

include "../../admin_loginstate.php";

$jsoncls = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);

@set_time_limit(0);

session_register("S_Name");

session_register("S_Url");

session_register("S_Source");

session_register("S_Code");

session_register("S_Class");

session_register("S_Page");

session_register("S_UrlStr");

session_register("S_PageGo");

session_register("S_PageEnd");

session_register("S_Order");

session_register("S_AutoSave");

session_register("S_SavePic");

session_register("S_Safe");

session_register("S_ListGo");

session_register("S_ListEnd");

session_register("S_LinkGo");

session_register("S_LinkEnd");					

session_register("S_VideoNameGo");	

session_register("S_VideoNameEnd");	

session_register("S_RemarkGo");	

session_register("S_RemarkEnd");

session_register("S_ClassMode");

session_register("S_ClassID");

session_register("S_ClassGo");

session_register("S_ClassEnd");

session_register("S_DirectGo");

session_register("S_DirectEnd");

session_register("S_AreaMode");

session_register("S_AreaName");

session_register("S_AreaGo");

session_register("S_AreaEnd");

session_register("S_AuthorGo");

session_register("S_AuthorEnd");

session_register("S_LanguageMode");

session_register("S_LanguageName");

session_register("S_LanguageGo");

session_register("S_LanguageEnd");

session_register("S_YearGo");

session_register("S_YearEnd");

session_register("S_PicGo");

session_register("S_PicEnd");			

session_register("S_ContentGo");

session_register("S_ContentEnd");

session_register("S_PlayUrlMode");

session_register("S_PlayUrlGo");

session_register("S_PlayUrlEnd");

session_register("S_AddMode");

session_register("S_AddGo");

session_register("S_AddEnd");

session_register("S_AddOldStr");

session_register("S_AddNewStr");

session_register("S_Replace");

session_register("S_AddPath");

session_register("S_PicMode");

?>

<!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" />

<link type="text/css" href="../../images/alerts.css" rel="stylesheet" media="screen">

<title>自定义采集</title>

<script type="text/javascript" language="javascript">var tentpath='<?php echo S_SitePath?>';</script>

<script src="../../js/jquery.js"></script>

<script language="javascript" src="../../js/alerts.js"></script>

<script type="text/javascript">

$(document).ready(function(){

	$("#step1").click(function(){

		 var listgo = $("#S_ListGo").attr("value");

		 var listend = $("#S_ListGo").attr("value");

		 var linkgo = $("#s_linkgo").attr("value");

		 var linkend = $("#s_linkgo").attr("value");				   

		if($("#S_Name").val()==""){

			jAlert("请输入采集规则名称!","操作提示");

			return false;

			}

		else if($("#S_Url").val()==""){

			jAlert("请输入采集站点网址!","操作提示");

			return false;				

			}

		else if(listgo==''){

			jAlert("出错了，列表开始代码不能为空!","错误提示");

			return false;

		 }else if (listend==''){

			jAlert("出错了，列表结束代码不能为空!","错误提示");

			return false;

		 }else if(linkgo==''){

			jAlert("出错了，链接开始代码不能为空!","错误提示");

			return false;

		 }else if(linkend==''){

			jAlert("出错了，链接开始代码不能为空!","错误提示");

			return false;

		 }

		 else{

			document.form1.submit();

			 }

		

		})

})



function SelectTemplets(fname){

   if(document.all){

     var posLeft = window.event.clientY-100;

     var posTop = window.event.clientX-400;

   }

   else{

     var posLeft = 100;

     var posTop = 100;

   }

   window.open("../../admin_templets.php?f="+fname, "popmoldWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left="+posLeft+", top="+posTop);

}

function showpage(id){

		$.get("ajax.php?id="+id+"&str=<?php echo $_SESSION['S_UrlStr'];?>&ps=<?php echo $_SESSION['S_PageGo'];?>&pe=<?php echo $_SESSION['S_PageEnd'];?>",function(R){

				$("#pagevalue").html(R);						 

				})

		

		}

function getcheck(){

	url=$("#S_UrlStr").val();

		$("#getinfo").html("测试中...");

		$.get("ajax.php?action=getcheck&url="+url,function(R){

			$("#getinfo").html(R);			

			   })

	}	

function trshow(trname,id){

	if(id==0){

		$("#"+trname+"0").css("display","");

		$("#"+trname+"1").css("display","none");

		$("#"+trname+"2").css("display","none");

	}else{

		$("#"+trname+"0").css("display","none");

		$("#"+trname+"1").css("display","");

		$("#"+trname+"2").css("display","");

	}

}	

function playurlshow(id){

	if (id==0){

		$("#s_playurlgo").html("地址列表开始代码：&nbsp;")

		$("#s_playurlend").html("地址列表结束代码：&nbsp;")

	}else if(id==1){

		$("#s_playurlgo").html("播放链接开始代码：&nbsp;")

		$("#s_playurlend").html("播放链接结束代码：&nbsp;")

	}

}

</script>

</head>



<body>

<?php

SystemPer(5);

class ui_collect{



	function main(){

		global $db;

		$playadd=playadd(4);

		$sql="select S_ID,S_Name,S_Url,S_Source,S_AddTime from s_custom";

		$Arr=getpagerow($sql,20);//sql,每页显示条数

		$result=$db->query($Arr[2]);

		$adminnum=$db->num_rows($result);

?>

<div class="r_main">

	<div class="r_content">

		<div class="r_content_1">

				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"  class="tb_style" >

				<form method="post" name="formb" action="../action=add" >

					<tr>

					  <td height="30" colspan="9" bgcolor="#FFFFFF" class="td_title">&nbsp;采集规则列表</td>

				  </tr>

					<tr>

					  <td height="30" bgcolor="#FFFFFF" class="td_border">&nbsp; 编号</td>

						<td width="105" bgcolor="#FFFFFF" class="td_border">&nbsp;采集规则名</td>

						<td width="191"  bgcolor="#FFFFFF" class="td_border">&nbsp;采集站点链接</td>

						<td width="93" align="center" bgcolor="#FFFFFF" class="td_border">播放类型</td>

						<td width="175" align="center" bgcolor="#FFFFFF" class="td_border">最后采集时间</td>

						<td colspan="4" align="center" bgcolor="#FFFFFF" class="td_border">操 作</td>

					</tr>

                       <?php

					   if($adminnum==0) echo "

							<tr>

                            	<td colspan=\"8\" class=\"td_border\" height=\"30\" align=center><b>暂无规则列表,请添加<b/>！</td>

                            </tr>";						   

                       if($result){

						   while ($row = $db ->fetch_array($result)){



					   ?>   

						<tr>

							<td height="30" class="td_border" width="52">&nbsp; <?php echo $row['S_ID'];?></td>

							<td width="105" align="centent" class="td_border">&nbsp;<a href="?action=add&amp;S_ID=<?php echo $row['S_ID'];?>"><?php echo $row['S_Name'];?></a></td>

							<td width="191" class="td_border">&nbsp;<?php echo $row['S_Url'];?></td>

							<td width="93" align="center" class="td_border"><?php echo playaddshow($playadd,$row['S_Source'])?></td>

							<td width="175" align="center" class="td_border"><?php echo $row['S_AddTime'];?></td>

							<td width="36" align="center"  class="td_border"><A href="admin_collecting.php?S_ID=<?php echo $row['S_ID'];?>">采集</a></td>

							<td width="31" align="center"  class="td_border"><A href="admin_export.php?s_id=<?php echo $row['S_ID'];?>" >导出</a></td>

							<td width="28" align="center"  class="td_border"><A href="admin_collect_edit.php?action=step1&amp;S_ID=<?php echo $row['S_ID'];?>">编辑</a></td>

							<td width="32" align="center"  class="td_border"><a href="?action=del&amp;S_ID=<?php echo $row['S_ID'];?>" onClick="" >删除</a></td>

						</tr>

                         <?php

                         							   

							   }

					   }

?> 

				  </form>

			  	  <tr>

                  	<td height="30"  colspan="2" class="td_border"> &nbsp;

                  	  &nbsp; <input name="export" type="button" class="rb1" id="export" onClick="window.location='admin_export.php?action=imp'" value="导入采集规则"/></td>

				    <td height="30" colspan="12" align="right" class="td_border"><?php echo $Arr[0];?>&nbsp;</td>

			      </tr>

			  </table>

				</div>

		</div>

</div>

<?php		

		

		}

		





	function step1(){

		global $db;

		$playadd=playadd(4);

?>

<div class="r_main">

	<div class="r_content">

		<div class="r_content_1">

<form action="?action=step2" name="form1" method="post">        

				<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;添加采集规则&nbsp;<font color="red">１. 设置基本参数及列表连接设置</font>  2. 采集内容与歌曲地址设置  3. 完成并采集测试</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"><input name="S_Name" type="text"  size="50" value="<?php echo $_SESSION['S_Name']?>" id="S_Name"/>

						<font color="#FF0000">＊</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"><input name="S_Url" type="text"   value="<?php echo $_SESSION['S_Url']?>" size="50" id="S_Url"/>

						<font color="#FF0000"> ＊</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"><select name="S_Code" id="S_Code">

										<option value="GB2312" <?php if($_SESSION['S_Code']=='GB2312'){echo "selected";}?>>GB2312</option>

										<option value="UTF-8"  <?php if($_SESSION['S_Code']=='UTF-8'){echo "selected";}?>>UTF-8</option>

										<option value="BIG-5"  <?php if($_SESSION['S_Code']=='BIG-5'){echo "selected";}?>>BIG-5</option>

								   </select> <font color=#FF0000>＊</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">

                        <select name="S_Source" id="S_Source">

                              <?php echo playselect($playadd,$_SESSION['S_Source']);?>

                         </select>&nbsp;

                           <select name="S_Server" id="S_Server">

                                <option value="">服务器组</option>

                                <?php echo getAddPath($_SESSION['S_AddPath']);?>

                            </select>

                            &nbsp;播放页模版：<input id="S_RemarkGo" name="S_RemarkGo" size="10" value="play.html"> &nbsp;<input type="button" value="浏览..." style="width:60px"  onClick="SelectTemplets('form1.S_RemarkGo');" class="rb1" />

                         </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"><input type="radio" name="S_Page"  checked class="radio" value="1" onclick="showpage(1);" <?php if($_SESSION['S_Page']=='1'){echo "checked";}?>/>

						  指定分类页

						  &nbsp;

						  <input type="radio" name="S_Page"  class="radio"  value="2" onclick="showpage(2);"  <?php if($_SESSION['S_Page']=='2'){echo "checked";}?>/>

						  自动分类页

						  &nbsp;

						  <input type="radio" name="S_Page"  class="radio"  value="3" onclick="showpage(3);"  <?php if($_SESSION['S_Page']=='3'){echo "checked";}?>/>

						  批量分类页&nbsp;

						  <input type="radio" name="S_Page"   class="radio"  value="4" onclick="showpage(4);"  <?php if($_SESSION['S_Page']=='4'){echo "checked";}?>/>						  

					    采集内容页</td>                   

                   </tr> 

					<tr>

					  	<td width="146" height="35" align="right" bgcolor="#FFFFFF" class="td_border" id="pagetitle">采集页面网址：&nbsp;</td>

					  <td width="793"  align="left" bgcolor="#FFFFFF" class="td_border" id="pagevalue">

                      &nbsp;载入中......

					  <script type="text/javascript">

					  $.get("ajax.php?id=<?php echo $_SESSION['S_Page'];?>&str=<?php echo $_SESSION['S_UrlStr'];?>&ps=<?php echo $_SESSION['S_PageGo'];?>&pe=<?php echo $_SESSION['S_PageEnd'];?>",function(R){

						$("#pagevalue").html(R);						 

							})

                	</script>

                      </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"><input type="checkbox" name="S_Order" value="desc"  class="checkbox" <?php if($_SESSION['S_Order']=='desc'){echo "checked";}?>/>

						是否倒序采集&nbsp;&nbsp;&nbsp;

						<input type="checkbox" value="1" name="S_AutoSave" class="checkbox"  <?php if($_SESSION['S_AutoSave']=='1'){echo "checked";}?>/>

						  采集完毕自动入库&nbsp;&nbsp;

						  <input type="checkbox" name="S_SavePic" value="1"   class="checkbox" <?php if($_SESSION['S_SavePic']=='1'){echo "checked";}?>/>

						  入库完毕自动下载图片

				      </td>

					</tr> 

					<tr>

					  	<td width="146" height="35" align="right" bgcolor="#FFFFFF" class="td_border">采集过滤选项：&nbsp;</td>

					  <td width="793"  align="left" valign="middle" bgcolor="#FFFFFF" class="td_border"  style="padding-top:10px;">		                      <input type="checkbox" name="S_Safe[]" value="iframe"  class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"iframe")=='1'){echo "checked";}?>/>Iframe&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="object"  class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"object")=='1'){echo "checked";}?>/>Object&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="script"  class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"script")=='1'){echo "checked";}?>/>Script&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="div"     class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"div")=='1'){echo "checked";}?>/>Div&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="class"   class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"class")=='1'){echo "checked";}?>/>Class&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="table"   class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"table")=='1'){echo "checked";}?>/>Table<br /><br />

					  <input type="checkbox" name="S_Safe[]" value="span"    class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"span")=='1'){echo "checked";}?>/>Span&nbsp;&nbsp;&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="img"     class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"img")=='1'){echo "checked";}?>/>Img&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="font"  class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"font")=='1'){echo "checked";}?>/>Font&nbsp;&nbsp;&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="a"     class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"a")=='1'){echo "checked";}?>/>A &nbsp;&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="html"  class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"html")=='1'){echo "checked";}?>/>Html&nbsp;&nbsp;

                      <input type="checkbox" name="S_Safe[]" value="td"  class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"td")=='1'){echo "checked";}?>/>Td&nbsp;&nbsp; 

                      <input type="checkbox" name="S_Safe[]" value="tr"  class="checkbox" <?php if(safesplit($_SESSION['S_Safe'],"tr")=='1'){echo "checked";}?>/>Tr<br />

						  <br /></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"><input type="radio" name="S_PicMode"  checked class="radio" value="0" <?php if($_SESSION['S_PicMode']=='0'){echo "checked";}?>/>

						  栏目页采集

						  &nbsp;

						  <input type="radio" name="S_PicMode"  class="radio"  value="1" <?php if($_SESSION['S_PicMode']=='1'){echo "checked";}?>/>

						  播放页采集</td>                   

                   </tr> 

					<tr>

					  	<td width="155" height="30" align="right" bgcolor="#FFFFFF" class="td_border">&nbsp;舞曲列表开始代码：&nbsp;</td>

						<td width="728"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;<textarea name="S_ListGo" id="S_ListGo" cols="70" rows="5"><?php echo $_SESSION['S_ListGo']?></textarea></td>

					</tr>

					<tr>

					  	<td width="155" height="30" align="right" bgcolor="#FFFFFF" class="td_border">&nbsp;舞曲列表结束代码：&nbsp;</td>

						<td width="728"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;<textarea name="S_ListEnd" id="s_listend" cols="70" rows="5"><?php echo   $_SESSION['S_ListEnd'] ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="155" height="30" align="right" bgcolor="#FFFFFF" class="td_border">&nbsp;舞曲链接开始代码：&nbsp;</td>

						<td width="728"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;<textarea name="S_LinkGo" id="s_linkgo" cols="70" rows="5"><?php echo   $_SESSION['S_LinkGo'] ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="155" height="30" align="right" bgcolor="#FFFFFF" class="td_border">&nbsp;舞曲链接开始代码：&nbsp;</td>

						<td width="728"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;<textarea name="S_LinkEnd" id="s_linkend" cols="70" rows="5"><?php echo   $_SESSION['S_LinkEnd'] ?></textarea></td>

					</tr>    

			<tr>

					  	<td width="155" height="30" align="right" bgcolor="#FFFFFF" class="td_border">&nbsp;舞曲图片开始代码：&nbsp;</td>

						<td width="728"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;<textarea name="S_PicGo" id="S_PicGo" cols="70" rows="5"><?php echo $_SESSION['S_PicGo']?></textarea></td>

					</tr>

			<tr>

					  	<td width="155" height="30" align="right" bgcolor="#FFFFFF" class="td_border">&nbsp;舞曲图片结束代码：&nbsp;</td>

						<td width="728"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;<textarea name="S_PicEnd" id="S_PicEnd" cols="70" rows="5"><?php echo $_SESSION['S_PicEnd']?></textarea></td>

					</tr>                

					<tr>

				  	  <td height="40" bgcolor="#FFFFFF" class="td_border">&nbsp;</td>

					  <td height="30" bgcolor="#FFFFFF" class="td_border"><input name="step1" type="button" class="rb1" id="step1"   value="继续下一步"/></td>

					</tr>                                                                                                                     

				</table>    

                </form>    

        </div>

    </div>

</div> 

<?php 

	}

function step2(){

	global $db;

		$clsstr='';

		$sql="select S_ID,S_Name from s_class where S_SystemID=1";

		$result=$db->query($sql);

		if($result){

			while($row=$db->fetch_array($result)){

				if($_SESSION['S_ClassID']==$row['S_ID']){

					$clsstr.="<option value=\"".$row['S_ID']."\" selected>".$row['S_Name']."</option>\r\n";

					}

				else{

					$clsstr.="<option value=\"".$row['S_ID']."\">".$row['S_Name']."</option>\r\n";

					}	

				}

			}	

			

?>

<div class="r_main">

	<div class="r_content">

		<div class="r_content_1">

        <form name="form2" action="?action=step3" method="post">

            	<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;添加采集规则&nbsp;１. 设置基本参数及列表连接设置  <font color="red">2. 采集内容与歌曲地址设置</font>  3. 完成并采集测试</td>

					</tr>

					<tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲名称开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_VideoNameGo" cols="70" rows="5"><?php echo $_SESSION['S_VideoNameGo']; ?></textarea></td>

					</tr>

					<tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲名称结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_VideoNameEnd" cols="70" rows="5"><?php echo $_SESSION['S_VideoNameEnd']; ?></textarea></td>

					</tr>

					

					<tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲分类采集设置：&nbsp;</td>

					    <td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

				      <input type="radio" name="S_ClassMode" id="S_ClassMode" value="0"  class="radio" checked onClick="trshow('s_classid',0)"/>固定分类&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="S_ClassMode" id="S_ClassMode" value="1"  class="radio" <?php if($_SESSION['S_ClassMode']=='1'){echo "checked"; }?> onClick="trshow('s_classid',1)"/>					    自动转换</td>

					</tr>

                    <tr id="s_classid0" <?php if($_SESSION['S_ClassMode']!='0'){ echo "style=\"display:none;\"";} ?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">固定舞曲分类选择：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

                        	<select name="S_ClassID">

 							<?php echo $clsstr; ?>

                      </select></td>

					</tr>

					<tr id="s_classid1" <?php if($_SESSION['S_ClassMode']!=1){ echo "style=\"display:none;\"";} ?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲分类开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_ClassGo" cols="70" rows="5"><?php echo $_SESSION['S_ClassGo']; ?></textarea></td>

					</tr>

                    <tr id="s_classid2" <?php if($_SESSION['S_ClassMode']!=1){ echo "style=\"display:none;\"";} ?> >

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲分类结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_ClassEnd" cols="70" rows="5"><?php echo $_SESSION['S_ClassEnd']; ?></textarea></td>

					</tr>

					                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲地区采集设置：&nbsp;</td>

					    <td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					      <input type="radio" name="S_AreaMode" id="S_AreaMode" value="0"  class="radio" checked onClick="trshow('s_areamode',0)"/>固定地区&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="S_AreaMode" id="S_AreaMode" value="1" class="radio" <?php if($_SESSION['S_AreaMode']=='1') { echo "checked";} ?> onClick="trshow('s_areamode',1)" /> 

				      采集地区					    </td>

					</tr>

					<tr id="s_areamode0" <?php if($_SESSION['S_AreaMode']!='0'){ echo "style=\"display:none;\"";}?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">固定舞曲地区选择：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

                        	<select name="S_AreaName">

                            <?php

                            $sqlarea="select S_AreaName from s_area";

							$arearesult=$db->query($sqlarea);

							if($arearesult){

								while($area=$db->fetch_array($arearesult)){

									if($_SESSION['S_AreaName']==$area['S_AreaName']){

										echo "<option value=\"".$area['S_AreaName']."\" selected>".$area['S_AreaName']."</option>\r\n";

										}

									else{

										echo "<option value=\"".$area['S_AreaName']."\">".$area['S_AreaName']."</option>\r\n";

										}	

									

									}

								}

							?>

                      </select></td>

					</tr>

                    <tr id="s_areamode1"<?php if($_SESSION['S_AreaMode']!='1'){echo "style=\"display:none;\"";}?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲地区开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_AreaGo" cols="70" rows="5"><?php echo $_SESSION['S_AreaGo']; ?></textarea></td>

					</tr>

                    <tr id="s_areamode2" <?php if($_SESSION['S_AreaMode']!='1'){echo "style=\"display:none;\"";}?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲地区结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_AreaEnd" cols="70" rows="5"><?php echo $_SESSION['S_AreaEnd']; ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲歌手开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_AuthorGo" cols="70" rows="5"><?php echo $_SESSION['S_AuthorGo']; ?></textarea></td>

					</tr>

					<tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲歌手结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_AuthorEnd" cols="70" rows="5"><?php echo $_SESSION['S_AuthorEnd']; ?></textarea></td>

					</tr>

					

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲语言要集设置：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

						  <input type="radio" name="S_LanguageMode" id="S_LanguageMode" value="0"  class="radio" checked onClick="trshow('s_language',0)"/>固定语言&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="S_LanguageMode" id="S_LanguageMode" value="1" class="radio" <?php if($_SESSION['S_LanguageMode']==1){echo "checked";} ?> onClick="trshow('s_language',1)"/>

					  采集语言</td>

					</tr>

					<tr id="s_language0" <?php if($_SESSION['S_LanguageMode']!='0'){ echo "style=\"display:none;\"";}?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">固定舞曲语言选择：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

                        	<select name="S_LanguageName">

                           <?php

                            $sqllan="select S_Language from s_area";

							$lanresult=$db->query($sqllan);

							if($lanresult){

								while($lan=$db->fetch_array($lanresult)){

									if($_SESSION['S_LanguageName']==$lan['S_Language']){

										echo "<option value=\"".$lan['S_Language']."\" selected>".$lan['S_Language']."</option>\r\n";

										}

									else{

										echo "<option value=\"".$lan['S_Language']."\">".$lan['S_Language']."</option>\r\n";

										}	

									

									}

								}

							?>

                      </select></td>

					</tr>

                    

					<tr id="s_language1" <?php if($_SESSION['S_LanguageMode']!=1){ echo "style=\"display:none;\"";}?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲语言开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_LanguageGo" cols="70" rows="5"><?php echo $_SESSION['S_LanguageGo']; ?></textarea></td>

					</tr>

                    <tr id="s_language2" <?php if($_SESSION['S_LanguageMode']!=1) { echo "style=\"display:none;\"";}?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲语言结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_LanguageEnd" cols="70" rows="5"><?php echo $_SESSION['S_LanguageEnd']; ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">发行年份开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_YearGo" cols="70" rows="5"><?php echo $_SESSION['S_YearGo']; ?></textarea></td>

					</tr>

					<tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">发行年份结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_YearEnd" cols="70" rows="5"><?php echo $_SESSION['S_YearEnd']; ?></textarea></td>

					</tr>

<?php 

if($_SESSION['S_PicMode']==1) { 

?>

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲图片开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_PicGo" cols="70" rows="5"><?php echo $_SESSION['S_PicGo']; ?></textarea></td>

					</tr>

					<tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲图片结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_PicEnd" cols="70" rows="5"><?php echo $_SESSION['S_PicEnd']; ?></textarea></td>

					</tr>

<?php

}

?>

					<tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲介绍开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_ContentGo" cols="70" rows="5"><?php echo $_SESSION['S_ContentGo']; ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲介绍结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_ContentEnd" cols="70" rows="5"><?php echo $_SESSION['S_ContentEnd']; ?></textarea></td>

					</tr>



                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲地址采集模式：&nbsp;</td>

				      <td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

				        <input type="radio" name="S_PlayUrlMode" id="S_PlayUrlMode" value="0"  class="radio" checked onClick="playurlshow(0)"/>					      

				        内容页采集舞曲地址&nbsp;&nbsp;&nbsp;&nbsp;

					      <input type="radio" name="S_PlayUrlMode" id="S_PlayUrlMode" value="1"  class="radio" <?php if($_SESSION['S_PlayUrlMode']=='1'){echo "checked";} ?> onClick="playurlshow(1)"/>  					    

					      播放页采集舞曲地址</td>

					</tr>

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border" id="s_playurlgo"><?php if($_SESSION['S_PlayUrlMode']=='0'){ echo "地址列表开始代码";}else{echo "播放链接开始代码";}?>：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_PlayUrlGo" cols="70" rows="5"><?php echo $_SESSION['S_PlayUrlGo']; ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border" id="s_playurlend"><?php if($_SESSION['S_PlayUrlMode']=='0'){ echo "地址列表结束代码";} else{echo "播放链接结束代码";}?>：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_PlayUrlEnd" cols="70" rows="5"><?php echo $_SESSION['S_PlayUrlEnd']; ?></textarea></td>

					</tr>

                    

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">特殊播放链接处理：&nbsp;</td>

					  <td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <input type="radio" name="S_AddMode" id="S_AddMode" value="0" class="radio" checked  onclick="trshow('s_add',0)"/>不作设置&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="S_AddMode" id="S_AddMode" value="1" class="radio" <?php if($_SESSION['S_AddMode']=='1'){echo "checked";}?> onClick="trshow('s_add',1)"/>替换地址<br /></td>

					</tr>

                    <tr><td  id="s_add0" colspan="2" height="0" class=""></td></tr>

                    <tr id="s_add1" <?php if($_SESSION['S_AddMode']!='1'){echo "style=\"display:none;\"" ;}?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">要替换的地址内容：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;<font color="red">&nbsp;对于使用了Javascript:openwindow形式的连接请使用以下格式处理:<br />

&nbsp;&nbsp;脚本连接:内容[变量] 内容 如:javaScript:openwnd([变量])<br />

&nbsp;&nbsp;实际连接:内容[变量] 内容 如:play.php?id=[变量]</font><br />  

				          &nbsp; <textarea name="S_AddOldStr" cols="70" rows="5"><?php echo $_SESSION['S_AddOldStr']; ?></textarea></td>

					</tr>

                    <tr id="s_add2" <?php if($_SESSION['S_AddMode']!='1'){ echo "style=\"display:none;\"";}?>>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">替换为的地址内容：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_AddNewStr" cols="70" rows="5"><?php echo $_SESSION['S_AddNewStr']; ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲地址开始代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_AddGo" cols="70" rows="5"><?php echo $_SESSION['S_AddGo']; ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="126" height="30" align="right" bgcolor="#FFFFFF" class="td_border">舞曲地址结束代码：&nbsp;</td>

						<td width="617"  align="left" bgcolor="#FFFFFF" class="td_border">&nbsp;

					  <textarea name="S_AddEnd" cols="70" rows="5"><?php echo $_SESSION['S_AddEnd']; ?></textarea></td>

					</tr>

                    <tr>

					  	<td width="126" height="35" align="right" bgcolor="#FFFFFF" class="td_border">&nbsp;舞曲采集简介/地址替换：&nbsp;</td>

				      <td width="617"  align="left" bgcolor="#FFFFFF" class="td_border"> &nbsp;

					      <textarea name="S_Replace" id="S_Replace" cols="70" rows="5"><?php echo $_SESSION['S_Replace']; ?></textarea><br />

					  <span style="color:red">&nbsp; 格式：被替换的内容@@替换为的内容，每行为一个多个替换请以回车键换行，可使用&nbsp;&nbsp;[变量]&nbsp;&nbsp;标签&nbsp;<br>

					  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td>

					</tr>

					<tr>

					  	<td height="30" bgcolor="#FFFFFF" class="td_border" align="center">&nbsp;</td>

					    <td height="30" bgcolor="#FFFFFF" class="td_border" ><input name="botton4" type="button" class="rb1"  onclick="history.go(-1);" value="返回上一步"/>

					  	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="submit1" type="submit" class="rb1" value="保存采集规则"  /></td>

					</tr>

					<tr>

					  	<td height="30" bgcolor="#FFFFFF" class="td_border" colspan="2">&nbsp;</td>

					</tr>

			  </table>

              </form>

        </div>

    </div>

</div> 

<?php	

	}

function step3(){

?>

<div class="r_main">

	<div class="r_content">

		<div class="r_content_1">

        <input name="botton2" type="button" class="rb1"  onclick="history.go(-1);" value="返回上一步"/>

        </div>

    </div>

</div> 

<?php 

	}

}//end class

	$ui=new ui_collect;

	$action=SafeRequest("action","get");

	switch($action){

		case 'ruleadd':

			session_destroy(); 

			$ui->step1();

			break;

		case 'step1':

			$ui->step1();

			break;

		case 'del':

			del();

			break;

		case 'main':

			$ui->main();

			break;

		case 'step2':

			$_SESSION['S_Name']=SafeRequest("S_Name","post");

			$_SESSION['S_Url']=SafeRequest("S_Url","post");

			$_SESSION['S_Source']=SafeRequest("S_Source","post");

			$_SESSION['S_Code']=SafeRequest("S_Code","post");

			$_SESSION['S_Class']=SafeRequest("S_Class","post");

			$_SESSION['S_Page']=SafeRequest("S_Page","post");

			$_SESSION['S_UrlStr']=SafeRequest("S_UrlStr","post");

			$_SESSION['S_PageGo']=SafeRequest("S_PageGo","post");

			$_SESSION['S_PageEnd']=SafeRequest("S_PageEnd","post");

			$_SESSION['S_Order']=SafeRequest("S_Order","post");

			$_SESSION['S_AutoSave']=SafeRequest("S_AutoSave","post");

			$_SESSION['S_SavePic']=SafeRequest("S_SavePic","post");

			$_SESSION['S_Safe']=RequestBox("S_Safe");

			$_SESSION['S_ListGo']=SafeRequest("S_ListGo","post");

			$_SESSION['S_ListEnd']=SafeRequest("S_ListEnd","post");

			$_SESSION['S_LinkGo']=SafeRequest("S_LinkGo","post");

			$_SESSION['S_LinkEnd']=SafeRequest("S_LinkEnd","post");	

			$_SESSION['S_AddPath']=SafeRequest("S_Server","post");	

			$_SESSION['S_RemarkGo']=SafeRequest("S_RemarkGo","post");

			$_SESSION['S_PicMode']=SafeRequest("S_PicMode","post");

			$_SESSION['S_PicGo']=SafeRequest("S_PicGo","post");

			$_SESSION['S_PicEnd']=SafeRequest("S_PicEnd","post");

			

			$ui->step2();

			break;

		case 'step3':

			$_SESSION['S_VideoNameGo']=SafeRequest("S_VideoNameGo","post");	

			$_SESSION['S_VideoNameEnd']=SafeRequest("S_VideoNameEnd","post");		

			$_SESSION['S_ClassMode']=SafeRequest("S_ClassMode","post");

			$_SESSION['S_ClassID']=SafeRequest("S_ClassID","post");

			$_SESSION['S_ClassGo']=SafeRequest("S_ClassGo","post");

			$_SESSION['S_ClassEnd']=SafeRequest("S_ClassEnd","post");

			$_SESSION['S_DirectGo']=SafeRequest("S_DirectGo","post");

			$_SESSION['S_DirectEnd']=SafeRequest("S_DirectEnd","post");

			$_SESSION['S_AreaMode']=SafeRequest("S_AreaMode","post");

			$_SESSION['S_AreaName']=SafeRequest("S_AreaName","post");

			$_SESSION['S_AreaGo']=SafeRequest("S_AreaGo","post");

			$_SESSION['S_AreaEnd']=SafeRequest("S_AreaEnd","post");

			$_SESSION['S_AuthorGo']=SafeRequest("S_AuthorGo","post");

			$_SESSION['S_AuthorEnd']=SafeRequest("S_AuthorEnd","post");

			$_SESSION['S_LanguageMode']=SafeRequest("S_LanguageMode","post");

			$_SESSION['S_LanguageName']=SafeRequest("S_LanguageName","post");

			$_SESSION['S_LanguageGo']=SafeRequest("S_LanguageGo","post");

			$_SESSION['S_LanguageEnd']=SafeRequest("S_LanguageEnd","post");

			$_SESSION['S_YearGo']=SafeRequest("S_YearGo","post");

			$_SESSION['S_YearEnd']=SafeRequest("S_YearEnd","post");

if($_SESSION['S_PicMode']==1) { 

			$_SESSION['S_PicGo']=SafeRequest("S_PicGo","post");

			$_SESSION['S_PicEnd']=SafeRequest("S_PicEnd","post");	

}		

			$_SESSION['S_ContentGo']=SafeRequest("S_ContentGo","post");

			$_SESSION['S_ContentEnd']=SafeRequest("S_ContentEnd","post");

			$_SESSION['S_PlayUrlMode']=SafeRequest("S_PlayUrlMode","post");

			$_SESSION['S_PlayUrlGo']=SafeRequest("S_PlayUrlGo","post");

			$_SESSION['S_PlayUrlEnd']=SafeRequest("S_PlayUrlEnd","post");

			$_SESSION['S_AddMode']=SafeRequest("S_AddMode","post");

			$_SESSION['S_AddGo']=SafeRequest("S_AddGo","post");

			$_SESSION['S_AddEnd']=SafeRequest("S_AddEnd","post");

			$_SESSION['S_AddOldStr']=SafeRequest("S_AddOldStr","post");

			$_SESSION['S_AddNewStr']=SafeRequest("S_AddNewStr","post");

			$_SESSION['S_Replace']=SafeRequest("S_Replace","post");

			saveRules();

			break;

		default:

			$ui->main();

			break;

		}



function del(){

		global $db;

		$S_ID=SafeRequest("S_ID","get");

		$sql="delete from s_custom where S_ID='".$S_ID."'";

		if($db->query($sql)){

			echo "<script>window.location='admin_collect.php';</script>";

			}

		}



function safesplit($str,$value){

		$strArr=explode(',',$str);

		for($i=0;$i<count($strArr);$i++){

			if($strArr[$i]==$value){

				return "1";

				break;

				}

			}		

	}



function saveRules(){

 global $db;	

  $S_Name=$_SESSION['S_Name'];

  $S_Url=$_SESSION['S_Url'];

  $S_Code=$_SESSION['S_Code'];

  $S_Source=$_SESSION['S_Source'];

  $S_Page=$_SESSION['S_Page'];

  $S_UrlStr=$_SESSION['S_UrlStr'];

  $S_PageGo=$_SESSION['S_PageGo'];

  $S_PageEnd=$_SESSION['S_PageEnd'];

  $S_Order=$_SESSION['S_Order'];

  $S_AutoSave=$_SESSION['S_AutoSave'];

  $S_SavePic=$_SESSION['S_SavePic'];

  $S_Safe=$_SESSION['S_Safe'];

  $S_ListGo=$_SESSION['S_ListGo'];

  $S_ListEnd=$_SESSION['S_ListEnd'];

  $S_LinkGo=$_SESSION['S_LinkGo'];

  $S_LinkEnd=$_SESSION['S_LinkEnd'];

  $S_VideoNameGo=$_SESSION['S_VideoNameGo'];

  $S_VideoNameEnd=$_SESSION['S_VideoNameEnd']; 

  $S_RemarkGo=$_SESSION['S_RemarkGo'];

  $S_RemarkEnd=$_SESSION['S_RemarkEnd'];

  $S_DirectGo=$_SESSION['S_DirectGo'];

  $S_DirectEnd=$_SESSION['S_DirectEnd'];

  $S_YearGo=$_SESSION['S_YearGo'];

  $S_YearEnd=$_SESSION['S_YearEnd'];

  $S_AuthorGo=$_SESSION['S_AuthorGo'];

  $S_AuthorEnd=$_SESSION['S_AuthorEnd'];

  $S_AreaMode=$_SESSION['S_AreaMode'];

  $S_AreaName=$_SESSION['S_AreaName'];

  $S_AreaGo=$_SESSION['S_AreaGo'];

  $S_AreaEnd=$_SESSION['S_AreaEnd'];

  $S_PicMode=$_SESSION['S_PicMode'];

  $S_PicGo=$_SESSION['S_PicGo'];

  $S_PicEnd=$_SESSION['S_PicEnd'];

  $S_LanguageMode=$_SESSION['S_LanguageMode'];

  $S_LanguageName=$_SESSION['S_LanguageName'];

  $S_LanguageGo=$_SESSION['S_LanguageGo'];

  $S_LanguageEnd=$_SESSION['S_LanguageEnd'];

  $S_ClassMode=$_SESSION['S_ClassMode'];

  $S_ClassID=$_SESSION['S_ClassID'];

  $S_ClassGo=$_SESSION['S_ClassGo'];

  $S_ClassEnd=$_SESSION['S_ClassEnd'];

  $S_ContentGo=$_SESSION['S_ContentGo'];

  $S_ContentEnd=$_SESSION['S_ContentEnd'];

  $S_PlayUrlGo=$_SESSION['S_PlayUrlGo'];

  $S_PlayUrlEnd=$_SESSION['S_PlayUrlEnd'];

  $S_AddGo=$_SESSION['S_AddGo'];

  $S_AddEnd=$_SESSION['S_AddEnd'];

  $S_AddMode=$_SESSION['S_AddMode'];

  $S_AddOldStr=$_SESSION['S_AddOldStr'];

  $S_AddNewStr=$_SESSION['S_AddNewStr'];

  $S_AddTime=$_SESSION['S_AddTime'];

  $S_Replace=$_SESSION['S_Replace'];

  $S_PlayUrlMode=$_SESSION['S_PlayUrlMode'];

  $S_AddPath=$_SESSION['S_AddPath'];

  $S_AddTime=date("Y-m-d H:i:s");

  if(!IsNum($S_PageGo)) $S_PageGo=1;

  if(!IsNum($S_PageEnd)) $S_PageEnd=1;

  if(!IsNum($S_AutoSave)) $S_AutoSave=0;

  if(!IsNum($S_SavePic)) $S_SavePic=0;

  $sql="insert s_custom (S_Name,S_Url,S_Code,S_Source,S_Page,S_UrlStr,S_PageGo,S_PageEnd,S_Order,S_AutoSave,S_SavePic,S_Safe,S_ListGo,S_ListEnd,S_LinkGo,S_LinkEnd,S_VideoNameGo,S_VideoNameEnd,S_RemarkGo,S_RemarkEnd,S_DirectGo,S_DirectEnd,S_YearGo,S_YearEnd,S_AuthorGo,S_AuthorEnd,S_AreaMode,S_AreaName,S_AreaGo,S_AreaEnd,S_PicMode,S_PicGo,S_PicEnd,S_LanguageMode,S_LanguageName,S_LanguageGo,S_LanguageEnd,S_ClassMode,S_ClassID,S_ClassGo,S_ClassEnd,S_ContentGo,S_ContentEnd,S_PlayUrlGo,S_PlayUrlEnd,S_AddGo,S_AddEnd,S_AddMode,S_AddOldStr,S_AddNewStr,S_AddTime,S_Replace,S_PlayUrlMode,S_AddPath) values ('$S_Name','$S_Url','$S_Code','$S_Source','$S_Page','$S_UrlStr','$S_PageGo','$S_PageEnd','$S_Order','$S_AutoSave','$S_SavePic','$S_Safe','$S_ListGo','$S_ListEnd','$S_LinkGo','$S_LinkEnd','$S_VideoNameGo','$S_VideoNameEnd' ,'$S_RemarkGo','$S_RemarkEnd','$S_DirectGo','$S_DirectEnd','$S_YearGo','$S_YearEnd','$S_AuthorGo','$S_AuthorEnd','$S_AreaMode','$S_AreaName','$S_AreaGo','$S_AreaEnd','$S_PicMode','$S_PicGo','$S_PicEnd','$S_LanguageMode','$S_LanguageName','$S_LanguageGo','$S_LanguageEnd','$S_ClassMode','$S_ClassID','$S_ClassGo','$S_ClassEnd','$S_ContentGo','$S_ContentEnd','$S_PlayUrlGo','$S_PlayUrlEnd','$S_AddGo','$S_AddEnd','$S_AddMode','$S_AddOldStr','$S_AddNewStr','$S_AddTime','$S_Replace','$S_PlayUrlMode','$S_AddPath')";

  //die($sql);

  if($db->query($sql)){

	  die("规则添加成功!&nbsp;");

	  }

 else{

	 die("未知错误规则添加失败!");

	 }		  

	}

	

function getAddPath($path){

	global $db;

	$serverstr="";

	$sqlserver="select S_ID,S_Name from `s_pathip`";

	$resultserver=$db->query($sqlserver);

	  if($resultserver){

		  while($rowserver=$db->fetch_array($resultserver)){

			  if($path==$rowserver['S_ID']){

			  $serverstr.="<option value='".$rowserver['S_ID']."' selected='selected'>".$rowserver['S_Name']."</option>";

			  }

			  else{

			  $serverstr.="<option value='".$rowserver['S_ID']."'>".$rowserver['S_Name']."</option>";	

				  }	

			  }

		  }

	return $serverstr;	  

	}	

?> 

<?php require_once("../../admin_bottom.php");?>      

</body>

</html>