<?php

/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0);
include '../../../include/cctvai.conn.php';
include "../../function_common.php";
include "config.php";
admincheck(6);
/*if(Smallfivesolution() == $_SERVER['SERVER_NAME']) {
} else {
    echo Smallfivesq();
    exit();
}*/

$action=SafeRequest("action", "get");
$ac=SafeRequest("ac", "get");
if($action=="config") {
	$str=file_get_contents("../../../include/cctvai.config.php");
	$cd_xalipay=SafeRequest("cd_xalipay", "post");
	$cd_xalipaya=SafeRequest("cd_xalipaya", "post");
	$cd_xalipaypid=SafeRequest("cd_xalipaypid", "post");
	$cd_xalipaykey=SafeRequest("cd_xalipaykey", "post");
	$cd_xalipayuser=SafeRequest("cd_xalipayuser", "post");
	$str=preg_replace('/"cd_xalipay","(.*?)"/', '"cd_xalipay","' . $cd_xalipay . '"', $str);
	$str=preg_replace('/"cd_xalipaya","(.*?)"/', '"cd_xalipaya","' . $cd_xalipaya . '"', $str);
	$str=preg_replace('/"cd_xalipaypid","(.*?)"/', '"cd_xalipaypid","' . $cd_xalipaypid . '"', $str);
	$str=preg_replace('/"cd_xalipaykey","(.*?)"/', '"cd_xalipaykey","' . $cd_xalipaykey . '"', $str);
	$str=preg_replace('/"cd_xalipayuser","(.*?)"/', '"cd_xalipayuser","' . $cd_xalipayuser . '"', $str);
	if(!$fp=fopen('../../../include/cctvai.config.php', 'w')) {
		showmessage("出错了，文件 ../../../include/cctvai.config.php 没有写入权限！", "skin.php", 1);
	}
	$ifile=new iFile('../../../include/cctvai.config.php', 'w');
	$ifile->WriteFile($str, 3);
	showmessage("恭喜您，保存设置成功！", $_SERVER['HTTP_REFERER'], 0);
}
?>
<!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" /> 
  <meta name="renderer" content="webkit" /> 
  <title>管理后台</title> 
  <link rel="stylesheet" href="../../css/add.css" type="text/css" media="screen" /> 
<style type="text/css">
.table2{width: 100%;max-width: 100%;border-collapse: collapse;border-spacing: 0;}
.table2 td{font-size: 12px;border-top: 1px solid #ddd;padding: 8px;vertical-align: top;}
.table2 tr:hover{text-decoration: none;background-color: #e6f2fb;}
.table2 th{border-bottom: 2px solid #ddd;vertical-align: bottom;padding: 2px;text-align: left;}
.table3{width: 100%;max-width: 100%;border-collapse: collapse;border-spacing: 0;}
.table3 tr:hover{text-decoration: none;background-color: #e6f2fb;}
.table3 td{font-size: 12px;line-height:25px;border-top: 1px solid #ddd;padding: 5px;vertical-align: top;border-right: solid 1px #ddd;}
.table3 th{border-bottom: 2px solid #ddd;vertical-align: bottom;padding: 2px;text-align: left;}
</style>
 </head> 
 <body> 
  <div class="contents"> 
   <div class="panel"> 
    <div class="panel-head">
     <strong><?php echo $plug_name?>插件设置</strong>
    </div> 
    <form action="?action=config" method="post" name="form2" >
    <table class="table3" id="dellist"> 
     <tbody>
	 <tr>
       <td width="110" align="left">版本信息</td>
       <td align="left"><?php echo $plug_version;?>　</td>
      </tr>
	 <tr>
       <td width="120" align="left">是否启用</td>
       <td align="left">
<label class="mr20"><input name="cd_xalipay" type="radio" value="1" <?php if(cd_xalipay=="1"){echo "checked";} ?>>&nbsp;启用&nbsp;</label>
<label class="mr20"><input type="radio" name="cd_xalipay" value="0" <?php if(cd_xalipay=="0"){echo "checked";} ?>>&nbsp;关闭&nbsp;</label>
	   </td>
      </tr>
	 <tr>
       <td width="120" align="left">支付接口</td>
       <td align="left">
<label class="mr20"><input name="cd_xalipaya" type="radio" value="1" <?php if(cd_xalipaya=="1"){echo "checked";} ?>>&nbsp;纯担保交易&nbsp;</label>
<label class="mr20"><input type="radio" name="cd_xalipaya" value="2" <?php if(cd_xalipaya=="2"){echo "checked";} ?>>&nbsp;即时到账&nbsp;</label>
<label class="mr20"><input type="radio" name="cd_xalipaya" value="4" <?php if(cd_xalipaya=="4"){echo "checked";} ?>>&nbsp;双向(担保&即时)&nbsp;</label>
	   </td>
      </tr>
	 <tr>
       <td width="120" align="left">合作者身份(PID)</td>
       <td align="left">
<input id="cd_xalipaypid" name="cd_xalipaypid" value="<?php echo cd_xalipaypid?>" type="text" class="input input_hd length_4">
	   </td>
      </tr>
	 <tr>
       <td width="120" align="left">安全校验码(Key)</td>
       <td align="left">
<input id="cd_xalipaykey" name="cd_xalipaykey" value="<?php echo cd_xalipaykey?>" type="text" class="input input_hd length_4">
	   </td>
      </tr>
	 <tr>
       <td width="120" align="left">支付宝收款帐号</td>
       <td align="left">
<input id="cd_xalipayuser" name="cd_xalipayuser" value="<?php echo cd_xalipayuser?>" type="text" class="input input_hd length_4">
	   </td>
      </tr>
      <tr>
       <td height="35" colspan="2" align="left" bgcolor="#FAFBF7" class="td_border"><button type="submit" id="adddance" class="btn btn_submit J_ajax_submit_btn" style="margin-left: 80px;">保存设置</button></td>
      </tr>
     </tbody>
    </table> 
   </div> 
  </div>  
  <div class="contents"> 
   <div class="panel"> 
    <div class="panel-head">
     <strong><?php echo $plug_name?>使用说明</strong>
    </div> 
	<div style="padding: 5px;line-height: 22px;color: #575757;">支付宝交易过程中产生的费率与本插件以及程序无关，相关费率请咨询支付宝商家客服！<br>因缺少即时到账接口的测试帐号，请先使用其他接口，待后期更新补上。</div>
   </div> 
  </div>  
 </body>
</html>