<?php
# Name: PHP版程氏音乐CMS管理系统 v3.0
# Author: 程氏<web@chshcms.com> [QQ:848769359]
# Homepage:http://www.chshcms.cn/
include_once("../../lib/cs_conn.php");
include_once("../../lib/cs_common.php");
include_once("../loginstate.php");
SystemPer('1_2');
$mailpass=substr(CS_Mailpass,0,1)."********".substr(CS_Mailpass,-1);
?>
<!doctype html>
<html>
<head>
<meta charset="gbk">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>csdjcms management</title>
<link href="../res/css/admin_style.css" rel="stylesheet" />
<script type="text/javascript" src="../res/js/ajax.js"></script>
<script language="javascript" src="../res/js/jquery.js"></script>
<script>
//导航转换
function menu(n) {
   for(var i=1;i<=4;i++){
        var curC=document.getElementById('config_0'+i);
        var curB=document.getElementById('top'+i);
        if(n==i){
             curC.style.height="90px";
          if(n==2){
             document.getElementById('config_05').style.height="210px";
          }
          if(n==3){
             document.getElementById('config_05').style.height="220px";
          }
          if(n==4){
             document.getElementById('config_05').style.height="290px";
          }
          curB.className="current";
        }else{
          if(i!=1){
             curC.style.height="0px";
          }else{
             curC.style.height="70px";
          }
          curB.className=""
        }
   } 
}

function djadd(n) {
     if(n==1){
            document.getElementById('opss1').style.display='';
            document.getElementById('opss2').style.display='none';
            document.getElementById('opss4').style.display='none';
     }else if(n==2){
            document.getElementById('opss1').style.display='none';
            document.getElementById('opss2').style.display='';
            document.getElementById('opss4').style.display='none';
     }else if(n==4){
            document.getElementById('opss1').style.display='none';
            document.getElementById('opss2').style.display='none';
            document.getElementById('opss4').style.display='';
     }else{
            document.getElementById('opss1').style.display='none';
            document.getElementById('opss2').style.display='none';
            document.getElementById('opss4').style.display='none';
     }
}
</script>
</head>
<body>
<div class="wrap">
<!-- start -->
<div class="top_wrap">
	<div class="top_wrap_pd">
	<div class="nav">
		<ul class="cc">
			<li id="top1" class="current"><a href="#config_01" onclick="menu(1);">会员基本</a></li>
			<li id="top2"><a href="#config_02" onclick="menu(2);">点数奖罚策略</a></li>
			<li id="top3"><a href="#config_03" onclick="menu(3);">注册邮件设置</a></li>
			<li id="top4"><a href="#config_04" onclick="menu(4);">在线支付设置</a></li>
		</ul>
	</div>
	</div>
</div>
<a name="config_01"></a><div id="config_01" style="height:70px;"></div>
<form method="post" class="J_ajaxForm" action="?a=edit">
<div class="h_a">会员基本配置</div>
<div class="table_full">
	<table width="100%">
		<col class="th" />
		<col width="400" />
		<col />
		<tr>
			<th>会员功能开关</th>
			<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_UserFun" type="radio" value="0" <?php if(CS_UserFun==0){echo("checked='checked'");}?>>完全开放</label></li>
				<li><label><input data-title="s3" name="CS_UserFun" type="radio" value="1" <?php if(CS_UserFun==1){echo("checked='checked'");}?>>完全关闭</label></li>
			</ul>
			</td>
			<td><div class="fun_tips">网站会员功能开关</div></td>
		</tr>
		<tr>
			<th>会员注册开关</th>
			<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_RegFun" type="radio" value="0" <?php if(CS_RegFun==0){echo("checked='checked'");}?>>完全开放</label></li>
				<li><label><input data-title="s3" name="CS_RegFun" type="radio" value="1" <?php if(CS_RegFun==1){echo("checked='checked'");}?>>完全关闭</label></li>
			</ul>
			</td>
			<td><div class="fun_tips">网站会员功能开关</div></td>
		</tr>
		<tr>
			<th>舞曲审核开关</th>
			<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_DjFun" type="radio" value="0" <?php if(CS_DjFun==0){echo("checked='checked'");}?>>开启审核</label></li>
				<li><label><input data-title="s3" name="CS_DjFun" type="radio" value="1" <?php if(CS_DjFun==1){echo("checked='checked'");}?>>关闭审核</label></li>
			</ul>
			</td>
			<td><div class="fun_tips">网站会员上传舞曲审核开关</div></td>
		</tr>
		<tr>
			<th>文章审核开关</th>
			<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_NewsFun" type="radio" value="0" <?php if(CS_NewsFun==0){echo("checked='checked'");}?>>开启审核</label></li>
				<li><label><input data-title="s3" name="CS_NewsFun" type="radio" value="1" <?php if(CS_NewsFun==1){echo("checked='checked'");}?>>关闭审核</label></li>
			</ul>
			</td>
			<td><div class="fun_tips">网站会员文章审核开关</div></td>
		</tr>
		<tr>
			<th>专集审核开关</th>
			<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_TopicFun" type="radio" value="0" <?php if(CS_TopicFun==0){echo("checked='checked'");}?>>开启审核</label></li>
				<li><label><input data-title="s3" name="CS_TopicFun" type="radio" value="1" <?php if(CS_TopicFun==1){echo("checked='checked'");}?>>关闭审核</label></li>
			</ul>
			</td>
			<td><div class="fun_tips">网站会员专集审核开关</div></td>
		</tr>
		<tr>
			<th>相片审核开关</th>
			<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_PicFun" type="radio" value="0" <?php if(CS_PicFun==0){echo("checked='checked'");}?>>开启审核</label></li>
				<li><label><input data-title="s3" name="CS_PicFun" type="radio" value="1" <?php if(CS_PicFun==1){echo("checked='checked'");}?>>关闭审核</label></li>
			</ul>
			</td>
			<td><div class="fun_tips">网站会员上传相片审核开关</div></td>
		</tr>
		<tr>
			<th>网站留言开关</th>
			<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_BookFun" type="radio" value="0" onClick="javascript:document.getElementById('gbook').style.display='';" <?php if(CS_BookFun==0){echo("checked='checked'");}?>>完全开放</label></li>
				<li><label><input data-title="s3" name="CS_BookFun" type="radio" value="1" onClick="javascript:document.getElementById('gbook').style.display='none';" <?php if(CS_BookFun==1){echo("checked='checked'");}?>>完全关闭</label></li>
				<li id="gbook" <?php if(CS_BookFun!=0){echo "style=\"display:none\"";} ?>><label>每页显示:<input name="CS_BookNum" type="text" class="input length_1" value="<?php echo CS_BookNum?>">&nbsp;条</label></li>
			</ul>
			</td>
			<td><div class="fun_tips">网站留言功能开关</div></td>
		</tr>
		<tr>
			<th>上传歌曲方式</th>
			<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_DjMode" type="radio" value="0" onClick="djadd(0);" <?php if(CS_DjMode==0){echo("checked='checked'");}?>>本地上传</label></li>
				<li><label><input data-title="s3" name="CS_DjMode" type="radio" value="4" onClick="djadd(4);" <?php if(CS_DjMode==4){echo("checked='checked'");}?>>官方上传</label></li>
				<li><label><input data-title="s3" name="CS_DjMode" type="radio" value="1" onClick="djadd(1);" <?php if(CS_DjMode==1){echo("checked='checked'");}?>>FTP上传</label></li>
			</ul>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_DjMode" type="radio" value="2" onClick="djadd(2);" <?php if(CS_DjMode==2){echo("checked='checked'");}?>>飞速上传</label></li>
				<li><label><input data-title="s3" name="CS_DjMode" type="radio" value="3" onClick="djadd(3);" <?php if(CS_DjMode==3){echo("checked='checked'");}?>>威客上传</label></li>
				<li><label><input data-title="s3" name="CS_DjMode" type="radio" value="5" onClick="djadd(5);" <?php if(CS_DjMode==5){echo("checked='checked'");}?>>关闭上传</label></li>
			</ul>
			</td>
			<td><div class="fun_tips">会员上传舞曲方式</div></td>
		</tr>
		<tr id="opss1" <?php if(CS_DjMode!=1){echo "style=\"display:none\"";} ?>>
			<th>上传FTP信息设置</th>
			<td>
				<div class="mb10">FTP 服务器:&nbsp;<input name="CS_FtpIp" type="text" class="input length_2" value="<?php echo CS_FtpIp?>"></div>
				<div class="mb10">FTP 用户名:&nbsp;<input name="CS_FtpName" type="text" class="input length_2" value="<?php echo CS_FtpName?>"></div>
				<div class="mb10">FTP 密&nbsp;&nbsp;&nbsp;&nbsp;码:&nbsp;<input name="CS_FtpPwd" type="text" class="input length_2" value="<?php echo CS_FtpPwd?>"></div>
				<div class="mb10">FTP 端&nbsp;&nbsp;&nbsp;&nbsp;口:&nbsp;<input name="CS_FtpDk" type="text" class="input length_2" value="<?php echo CS_FtpDk?>"></div>
				<div class="mb10">FTP 目&nbsp;&nbsp;&nbsp;&nbsp;录:&nbsp;<input name="CS_FtpDir" type="text" class="input length_2" value="<?php echo CS_FtpDir?>"></div>
			</td>
			<td><div class="fun_tips">填写上传FTP信息</div></td>
		</tr>
		<tr id="opss2" <?php if(CS_DjMode!=1){echo "style=\"display:none\"";} ?>>
			<th>飞速网盘帐号</th>
			<td>
				<input name="CS_FsName" type="text" class="input length_5" value="<?php echo CS_FsName?>">
			</td>
			<td><div class="fun_tips">飞速网盘帐号设置</div></td>
		</tr>
		<tr id="opss4" <?php if(CS_DjMode!=4){echo "style=\"display:none\"";} ?>>
			<th>音乐网盘帐号</th>
			<td>
				<input name="CS_CsName" type="text" class="input length_5" value="<?php echo CS_CsName?>">
			</td>
			<td><div class="fun_tips">官方音乐网盘帐号设置</div></td>
		</tr>
		<tr>
			<th>会员包月设置</th>
			<td>
				<div class="mb10">包一月需要点数:&nbsp;<input name="CS_VipDs1" type="text" class="input length_2" value="<?php echo CS_VipDs1?>"></div>
				<div class="mb10">包半年需要点数:&nbsp;<input name="CS_VipDs2" type="text" class="input length_2" value="<?php echo CS_VipDs2?>"></div>
				<div class="mb10">包一年需要点数:&nbsp;<input name="CS_VipDs3" type="text" class="input length_2" value="<?php echo CS_VipDs3?>"></div>
			</td>
			<td><div class="fun_tips">会员包月所需要点数设置</div></td>
		</tr>
	</table>
</div>
<a name="config_02"></a><div id="config_02" style="height:0px;"></div>
<div class="h_a">点数奖励策略</div>		
<div class="table_full">
<table width="100%">
	<col class="th" />
	<col width="400" />
	<col />
	<tr>
		<th>每天登入是否加点</th>
		<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_LogFun" type="radio" value="0" <?php if(CS_LogFun==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('logadd').style.display=''">开启</label></li>
				<li><label><input data-title="s3" name="CS_LogFun" type="radio" value="1" <?php if(CS_LogFun==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('logadd').style.display='none'">关闭</label></li>
				<li id="logadd" <?php if(CS_LogFun!=0){echo "style=\"display:none\"";} ?>><label>增加:<input name="CS_LogDs" type="text" class="input length_1" value="<?php echo CS_LogDs?>">&nbsp;点</label></li>
			</ul>
		</td>
		<td><div id="J_statuCS_tip" class="fun_tips">会员每天登入是否加点</div></td>
	</tr>
	<tr>
		<th>发布舞曲是否加点</th>
		<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_DjaddFun" type="radio" value="0" <?php if(CS_DjaddFun==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('djadd').style.display=''">开启</label></li>
				<li><label><input data-title="s3" name="CS_DjaddFun" type="radio" value="1" <?php if(CS_DjaddFun==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('djadd').style.display='none'">关闭</label></li>
				<li id="djadd" <?php if(CS_DjaddFun!=0){echo "style=\"display:none\"";} ?>><label>增加:<input name="CS_DjDs" type="text" class="input length_1" value="<?php echo CS_DjDs?>">&nbsp;点</label></li>
			</ul>
		</td>
		<td><div id="J_statuCS_tip" class="fun_tips">会员发布舞曲是否加点</div></td>
	</tr>
	<tr>
		<th>上传相片是否加点</th>
		<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_PicaddFun" type="radio" value="0" <?php if(CS_PicaddFun==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('picadd').style.display=''">开启</label></li>
				<li><label><input data-title="s3" name="CS_PicaddFun" type="radio" value="1" <?php if(CS_PicaddFun==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('picadd').style.display='none'">关闭</label></li>
				<li id="picadd" <?php if(CS_PicaddFun!=0){echo "style=\"display:none\"";} ?>><label>增加:<input name="CS_PicDs" type="text" class="input length_1" value="<?php echo CS_PicDs?>">&nbsp;点</label></li>
			</ul>
		</td>
		<td><div id="J_statuCS_tip" class="fun_tips">会员上传相片是否加点</div></td>
	</tr>
</table>
</div>
<div class="h_a">点数惩罚策略</div>		
<div class="table_full">
<table width="100%">
	<col class="th" />
	<col width="400" />
	<col />
	<tr>
		<th>舞曲被删除扣点</th>
		<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_DjdelFun" type="radio" value="0" <?php if(CS_DjdelFun==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('djdel').style.display=''">开启</label></li>
				<li><label><input data-title="s3" name="CS_DjdelFun" type="radio" value="1" <?php if(CS_DjdelFun==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('djdel').style.display='none'">关闭</label></li>
				<li id="djdel" <?php if(CS_DjdelFun!=0){echo "style=\"display:none\"";} ?>><label>减去:<input name="CS_DjdelDs" type="text" class="input length_1" value="<?php echo CS_DjdelDs?>">&nbsp;点</label></li>
			</ul>
		</td>
		<td><div id="J_statuCS_tip" class="fun_tips">会员舞曲被删除是否扣点</div></td>
	</tr>
	<tr>
		<th>相片被删除扣点</th>
		<td>
			<ul class="switch_list cc">
				<li><label><input data-title="s1" name="CS_PicdelFun" type="radio" value="0" <?php if(CS_PicdelFun==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('picdel').style.display=''">开启</label></li>
				<li><label><input data-title="s3" name="CS_PicdelFun" type="radio" value="1" <?php if(CS_PicdelFun==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('picdel').style.display='none'">关闭</label></li>
				<li id="picdel" <?php if(CS_PicdelFun!=0){echo "style=\"display:none\"";} ?>><label>减去:<input name="CS_PicdelDs" type="text" class="input length_1" value="<?php echo CS_PicdelDs?>">&nbsp;点</label></li>
			</ul>
		</td>
		<td><div id="J_statuCS_tip" class="fun_tips">会员相片被删除是否扣点</div></td>
	</tr>
</table>
</div>
<a name="config_03"></a><div id="config_03" style="height:0px;"></div>
<div class="h_a">注册邮件设置</div>		
<div class="table_full">
	<table width="100%">
		<col class="th" />
		<col width="400" />
		<col />
		<tr>
			<th>注册邮件开关</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_Mailmode" type="radio" value="0" <?php if(CS_Mailmode==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('opsss').style.display=''"><span>开启</span></label></li>
					<li><label><input name="CS_Mailmode" type="radio" value="1" <?php if(CS_Mailmode==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('opsss').style.display='none'"><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">注册邮件开关设置</div></td>
		</tr>
		<tr id="opsss" <?php if(CS_Mailmode==1){echo "style=\"display:none\"";} ?>>
			<th>邮件发送相关设置</th>
			<td>
				<div class="mb10">&nbsp;&nbsp;S&nbsp;M&nbsp;T&nbsp;P:&nbsp;<input name="CS_Mailsmtp" type="text" class="input length_5" value="<?php echo CS_Mailsmtp?>"></div>
				<div class="mb10">邮箱帐号:&nbsp;<input name="CS_Mailuser" type="text" class="input length_5" value="<?php echo CS_Mailuser?>"></div>
				<div class="mb10">邮箱密码:&nbsp;<input name="CS_Mailpass" type="text" class="input length_5" value="<?php echo $mailpass?>"></div>
				<div class="mb10">邮箱名称:&nbsp;<input name="CS_Mailname" type="text" class="input length_5" value="<?php echo CS_Mailname?>"></div>
				<div class="mb10">发送内容:&nbsp;<textarea class="length_5"  name="CS_Mailreg"><?php echo CS_Mailreg?></textarea></div>
			</td>
			<td><div class="fun_tips">邮件发送相关设置,安全考虑，密码只显示前后两位，中间显示八个 * 号。 </div></td>
		</tr>
	</table>
</div>
<a name="config_04"></a><div id="config_04" style="height:0px;"></div>
<div class="h_a">在线支付设置</div>		
<div class="table_full">
	<table width="100%">
		<col class="th" />
		<col width="400" />
		<col />
		<tr>
			<th>在线支付默认方式</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_PayFun" type="radio" value="1" <?php if(CS_PayFun==1){echo("checked='checked'");}?>><span>易宝支付</span></label></li>
					<li><label><input name="CS_PayFun" type="radio" value="2" <?php if(CS_PayFun==2){echo("checked='checked'");}?>><span>支付宝</span></label></li>
					<li><label><input name="CS_PayFun" type="radio" value="3" <?php if(CS_PayFun==3){echo("checked='checked'");}?>><span>财富通</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">在线支付开关设置</div></td>
		</tr>
		<tr>
			<th>财富通支付开关</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_TenFun" type="radio" value="0" <?php if(CS_TenFun==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('tenopen').style.display=''"><span>开启</span></label></li>
					<li><label><input name="CS_TenFun" type="radio" value="1" <?php if(CS_TenFun==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('tenopen').style.display='none'"><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">财富通支付开关设置</div></td>
		</tr>
		<tr id="tenopen" <?php if(CS_TenFun==1){echo "style=\"display:none\"";} ?>>
			<th>财富通支付设置</th>
			<td>
				<div class="mb10">商&nbsp;&nbsp;户&nbsp;&nbsp;&nbsp;号:<input name="CS_PaytenId" type="text" class="input length_5" value="<?php echo CS_PaytenId?>"></div>
				<div class="mb10">MD5私钥:&nbsp;<input name="CS_PaytenKey" type="text" class="input length_5" value="<?php echo CS_PaytenKey?>"></div>
			</td>
			<td><div class="fun_tips">财富通支付设置</div>--><a href="http://mch.tenpay.com/market/index.shtml" target="_blank">注册地址</a></td>
		</tr>
		<tr>
			<th>支付宝支付开关</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_ZfbFun" type="radio" value="0" <?php if(CS_ZfbFun==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('zfbopen').style.display=''"><span>开启</span></label></li>
					<li><label><input name="CS_ZfbFun" type="radio" value="1" <?php if(CS_ZfbFun==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('zfbopen').style.display='none'"><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">支付宝支付开关设置</div></td>
		</tr>
		<tr id="zfbopen" <?php if(CS_ZfbFun==1){echo "style=\"display:none\"";} ?>>
			<th>支付宝支付设置</th>
			<td>
				<div class="mb10">支付宝帐号:&nbsp;<input name="CS_PayzfbName" type="text" class="input length_5" value="<?php echo CS_PayzfbName?>"></div>
				<div class="mb10">合作者&nbsp;&nbsp;I&nbsp;&nbsp;D:&nbsp;<input name="CS_PayzfbId" type="text" class="input length_5" value="<?php echo CS_PayzfbId?>"></div>
				<div class="mb10">安全检验码:&nbsp;<input name="CS_PayzfbKey" type="text" class="input length_5" value="<?php echo CS_PayzfbKey?>"></div>
			</td>
			<td><div class="fun_tips">支付宝支付设置</div>--><a href="https://lab.alipay.com/user/reg/index.htm" target="_blank">注册地址</a></td>
		</tr>
		<tr>
			<th>易宝支付开关</th>
			<td>
				<ul class="switch_list cc">
					<li><label><input name="CS_YeeFun" type="radio" value="0" <?php if(CS_YeeFun==0){echo("checked='checked'");}?> onClick="javascript:document.getElementById('yeeopen').style.display=''"><span>开启</span></label></li>
					<li><label><input name="CS_YeeFun" type="radio" value="1" <?php if(CS_YeeFun==1){echo("checked='checked'");}?> onClick="javascript:document.getElementById('yeeopen').style.display='none'"><span>关闭</span></label></li>
				</ul>
			</td>
			<td><div class="fun_tips">易宝支付开关设置</div></td>
		</tr>
		<tr id="yeeopen" <?php if(CS_YeeFun==1){echo "style=\"display:none\"";} ?>>
			<th>易宝支付设置</th>
			<td>
				<div class="mb10">商&nbsp;&nbsp;户&nbsp;&nbsp;&nbsp;号:<input name="CS_PayyeeId" type="text" class="input length_5" value="<?php echo CS_PayyeeId?>"></div>
				<div class="mb10">MD5私钥:&nbsp;<input name="CS_PayyeeKey" type="text" class="input length_5" value="<?php echo CS_PayyeeKey?>"></div>
			</td>
			<td><div class="fun_tips">易宝支付设置</div>--><a href="http://www.yeepay.com/" target="_blank">注册地址</a></td>
		</tr>
	</table>
</div>
<div id="config_05" style="height:0px;">&nbsp;</div>
<div class="btn_wrap">
	<div class="btn_wrap_pd">
		<button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交保存</button>
                <div class="tips_error" id="Msg"></div>
	</div>
</div></form>
<!-- end -->
</div>
<?php
$action=CS_Request("a");
if ($action=="edit"){
	$CS_UserFun=CS_Request("CS_UserFun");
	$CS_RegFun=CS_Request("CS_RegFun");
	$CS_DjFun=CS_Request("CS_DjFun");
	$CS_NewsFun=CS_Request("CS_NewsFun");
	$CS_TopicFun=CS_Request("CS_TopicFun");
	$CS_PicFun=CS_Request("CS_PicFun");
	$CS_DjMode=CS_Request("CS_DjMode");
	$CS_FsName=CS_Request("CS_FsName");
	$CS_CsName=CS_Request("CS_CsName");
	$CS_BookFun=CS_Request("CS_BookFun");
	$CS_BookNum=CS_Request("CS_BookNum");
        if(empty($CS_BookNum)) $CS_BookNum=15;

	$CS_FtpIp=CS_Request("CS_FtpIp");
	$CS_FtpName=CS_Request("CS_FtpName");
	$CS_FtpPwd=CS_Request("CS_FtpPwd");
	$CS_FtpDk=CS_Request("CS_FtpDk");
	$CS_FtpDir=CS_Request("CS_FtpDir");
	
	$CS_VipDs1=CS_Request("CS_VipDs1");
	$CS_VipDs2=CS_Request("CS_VipDs2");
	$CS_VipDs3=CS_Request("CS_VipDs3");
        if(empty($CS_VipDs1)) $CS_VipDs1=30;
        if(empty($CS_VipDs2)) $CS_VipDs1=150;
        if(empty($CS_VipDs3)) $CS_VipDs1=260;

	$CS_LogFun=CS_Request("CS_LogFun");
	$CS_DjaddFun=CS_Request("CS_DjaddFun");
	$CS_PicaddFun=CS_Request("CS_PicaddFun");
	$CS_LogDs=CS_Request("CS_LogDs");
	$CS_DjDs=CS_Request("CS_DjDs");
	$CS_PicDs=CS_Request("CS_PicDs");
	$CS_DjdelFun=CS_Request("CS_DjdelFun");
	$CS_PicdelFun=CS_Request("CS_PicdelFun");
	$CS_DjdelDs=CS_Request("CS_DjdelDs");
	$CS_PicdelDs=CS_Request("CS_PicdelDs");
        if(empty($CS_LogDs)) $CS_LogDs=0;
        if(empty($CS_DjDs)) $CS_DjDs=0;
        if(empty($CS_PicDs)) $CS_PicDs=0;
        if(empty($CS_DjdelDs)) $CS_DjdelDs=0;
        if(empty($CS_PicdelDs)) $CS_PicdelDs=0;


	$CS_Mailmode=CS_Request("CS_Mailmode");
	$CS_Mailsmtp=CS_Request("CS_Mailsmtp");
	$CS_Mailuser=CS_Request("CS_Mailuser");
	$CS_Mailpass=CS_Request("CS_Mailpass");
	$CS_Mailname=CS_Request("CS_Mailname");
	$CS_Mailreg=CS_Request("CS_Mailreg");

	$CS_PayFun=CS_Request("CS_PayFun");

	$CS_WyFun=CS_Request("CS_WyFun");
	$CS_PaywyId=CS_Request("CS_PaywyId");
	$CS_PaywyKey=CS_Request("CS_PaywyKey");

	$CS_TenFun=CS_Request("CS_TenFun");
	$CS_PaytenId=CS_Request("CS_PaytenId");
	$CS_PaytenKey=CS_Request("CS_PaytenKey");

	$CS_ZfbFun=CS_Request("CS_ZfbFun");
	$CS_PayzfbName=CS_Request("CS_PayzfbName");
	$CS_PayzfbId=CS_Request("CS_PayzfbId");
	$CS_PayzfbKey=CS_Request("CS_PayzfbKey");

	$CS_YeeFun=CS_Request("CS_YeeFun");
	$CS_PayyeeId=CS_Request("CS_PayyeeId");
	$CS_PayyeeKey=CS_Request("CS_PayyeeKey");

        if($CS_Mailpass==$mailpass){
	     $CS_Mailpass=CS_Mailpass;
        }

	$strs="<?php"."\r\n";
	$strs=$strs."define(\"CS_UserFun\",".$CS_UserFun.");      //会员开关\r\n";
	$strs=$strs."define(\"CS_RegFun\",".$CS_RegFun.");      //会员注册开关\r\n";
	$strs=$strs."define(\"CS_DjFun\",".$CS_DjFun.");      //会员上传舞曲审核\r\n";
	$strs=$strs."define(\"CS_NewsFun\",".$CS_NewsFun.");      //会员文章审核\r\n";
	$strs=$strs."define(\"CS_TopicFun\",".$CS_TopicFun.");      //会员专集审核\r\n";
	$strs=$strs."define(\"CS_PicFun\",".$CS_PicFun.");      //会员上传相片审核\r\n";
	$strs=$strs."define(\"CS_DjMode\",".$CS_DjMode.");      //会员上传舞曲开关\r\n";
	$strs=$strs."define(\"CS_BookFun\",".$CS_BookFun.");      //网站留言开关\r\n";
	$strs=$strs."define(\"CS_BookNum\",".$CS_BookNum.");      //留言每页条数\r\n";
	$strs=$strs."define(\"CS_FsName\",\"".$CS_FsName."\");      //飞速帐号\r\n\r\n";
	$strs=$strs."define(\"CS_CsName\",\"".$CS_CsName."\");      //官方网盘帐号\r\n\r\n";

	$strs=$strs."define(\"CS_FtpIp\",\"".$CS_FtpIp."\");      //FTP服务器\r\n";
	$strs=$strs."define(\"CS_FtpName\",\"".$CS_FtpName."\");      //FTP用户名\r\n";
	$strs=$strs."define(\"CS_FtpPwd\",\"".$CS_FtpPwd."\");      //FTP密码\r\n";
	$strs=$strs."define(\"CS_FtpDk\",\"".$CS_FtpDk."\");      //FTP端口\r\n";
	$strs=$strs."define(\"CS_FtpDir\",\"".$CS_FtpDir."\");    //FTP默认目录\r\n\r\n";
	
	$strs=$strs."define(\"CS_VipDs1\",".$CS_VipDs1.");      //包一月点数\r\n";
	$strs=$strs."define(\"CS_VipDs2\",".$CS_VipDs2.");      //包半年点数\r\n";
	$strs=$strs."define(\"CS_VipDs3\",".$CS_VipDs3.");      //包一年点数\r\n\r\n";

	$strs=$strs."define(\"CS_LogFun\",".$CS_LogFun.");      //登入加点开关\r\n";
	$strs=$strs."define(\"CS_DjaddFun\",".$CS_DjaddFun.");      //舞曲加点数开关\r\n";
	$strs=$strs."define(\"CS_PicaddFun\",".$CS_PicaddFun.");      //图片加点数开关\r\n";
	$strs=$strs."define(\"CS_LogDs\",".$CS_LogDs.");      //登入加点数\r\n";
	$strs=$strs."define(\"CS_DjDs\",".$CS_DjDs.");      //舞曲加点数\r\n";
	$strs=$strs."define(\"CS_PicDs\",".$CS_PicDs.");      //图片加点数\r\n\r\n";
	$strs=$strs."define(\"CS_DjdelFun\",".$CS_DjdelFun.");      //舞曲扣点数开关\r\n";
	$strs=$strs."define(\"CS_PicdelFun\",".$CS_PicdelFun.");      //图片扣点数开关\r\n";
	$strs=$strs."define(\"CS_DjdelDs\",".$CS_DjdelDs.");      //舞曲扣点数\r\n";
	$strs=$strs."define(\"CS_PicdelDs\",".$CS_PicdelDs.");      //图片扣点数\r\n\r\n";

	$strs=$strs."define(\"CS_Mailmode\",".$CS_Mailmode.");      //邮件开关\r\n";
	$strs=$strs."define(\"CS_Mailsmtp\",\"".$CS_Mailsmtp."\");      //邮件SMTP\r\n";
	$strs=$strs."define(\"CS_Mailuser\",\"".$CS_Mailuser."\");      //邮件用户名\r\n";
	$strs=$strs."define(\"CS_Mailpass\",\"".$CS_Mailpass."\");      //邮件密码\r\n";
	$strs=$strs."define(\"CS_Mailname\",\"".$CS_Mailname."\");      //邮件名称\r\n";
	$strs=$strs."define(\"CS_Mailreg\",\"".$CS_Mailreg."\");      //邮件内容\r\n\r\n";

	$strs=$strs."define(\"CS_PayFun\",".$CS_PayFun.");      //默认支付\r\n\r\n";

	$strs=$strs."define(\"CS_TenFun\",".$CS_TenFun.");      //财富通开关\r\n";
	$strs=$strs."define(\"CS_PaytenId\",\"".$CS_PaytenId."\");      //财富通ID\r\n";
	$strs=$strs."define(\"CS_PaytenKey\",\"".$CS_PaytenKey."\");      //财富通KEY\r\n\r\n";

	$strs=$strs."define(\"CS_ZfbFun\",".$CS_ZfbFun.");      //支付宝开关\r\n";
	$strs=$strs."define(\"CS_PayzfbName\",\"".$CS_PayzfbName."\");      //支付宝邮箱\r\n";
	$strs=$strs."define(\"CS_PayzfbId\",\"".$CS_PayzfbId."\");      //支付宝ID\r\n";
	$strs=$strs."define(\"CS_PayzfbKey\",\"".$CS_PayzfbKey."\");      //支付宝KEY\r\n\r\n";

	$strs=$strs."define(\"CS_YeeFun\",".$CS_YeeFun.");      //易宝开关\r\n";
	$strs=$strs."define(\"CS_PayyeeId\",\"".$CS_PayyeeId."\");      //易宝ID\r\n";
	$strs=$strs."define(\"CS_PayyeeKey\",\"".$CS_PayyeeKey."\");      //易宝KEY";

	//写文件
	$ifile = new iFile('../../lib/cs_config_user.php','w');
	if(!$ifile->WriteFile($strs,3)) exit("<script>document.getElementById('Msg').innerHTML='../../lib/cs_config_user.php!';</script>");
         echo '<script>document.getElementById("Msg").className="tips_success";$("#Msg").text("恭喜,操作成功!").css("color","#026E12");</script>';
	 echo "<script>setTimeout(\"window.location='config_user.php'\",2000);</script>";
}
?>
</body>
</html>