<?php
include("../includes/common.php");
$title='系统基本设置';
include './head.php';
if($islogin==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
?>
        <div class="lime-container">
            <div class="lime-body">
                <div class="container">
                	<div class="row">
                        <div class="col-xl">
                            <div class="card">
                                <div class="card-body">
                                	<h5 class="card-title">基本信息设置</h5><hr>
                                    <div class="form-row">
                                        <div class="form-group col-md-4">
                                            <label for="inputEmail4">网站标题</label>
                                            <input type="text" class="form-control" name="title" id="title" value="<?php echo $conf['title'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">站长ＱＱ</label>
                                            <input type="text" class="form-control" name="kfqq" id="kfqq" value="<?php echo $conf['kfqq'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">底部版权</label>
                                            <input type="text" class="form-control" name="foot" id="foot" value="<?php echo $conf['foot'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">是否开启换钱功能</label>
                                            <select name="on" id="on" class="form-control custom-select" default="<?php echo $conf['on'] ?>">
                                                <option value="1">开启功能</option>
                                                <option value="0">关闭功能</option>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">官方Q群</label>
                                            <input type="text" class="form-control" name="qun" id="qun" value="<?php echo $conf['qun'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">加群链接</label>
                                            <input type="text" class="form-control" name="url" id="url" value="<?php echo $conf['url'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">首页换钱记录是否显示</label>
                                            <select name="jl" id="jl" class="form-control custom-select" default="<?php echo $conf['jl'] ?>">
                                                <option value="1">显示</option>
                                                <option value="2">不显示</option>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">换钱手续费百分比（列：设置3%，实际100元付款103元）</label>
                                            <input type="text" class="form-control" name="jy_sxf" id="jy_sxf" value="<?php echo $conf['jy_sxf'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">最低交换金额</label>
                                            <input type="text" class="form-control" name="money" id="money" value="<?php echo $conf['money'] ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="card">
                                <div class="card-body">
                                	<h5 class="card-title">哆咪付（汇款）接口配置&nbsp;&nbsp;（<code>请在<a href="http://www.dmf.cn" target="_blank">哆咪付|DMF.CN</a>官方获取代付接口信息</code>）</h5><hr>
                                    <div class="form-row">
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">哆咪付商户ID</label>
                                            <input type="text" class="form-control" name="ds_id" id="ds_id" value="<?php echo $conf['ds_id'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">哆咪付商户KEY</label>
                                            <input type="password" class="form-control" name="ds_key" id="ds_key" value="<?php echo $conf['ds_key'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">哆咪付支付安全码</label>
                                            <input type="password" class="form-control" name="ds_pass" id="ds_pass" value="<?php echo $conf['ds_pass'] ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="card">
                                <div class="card-body">
                                	<h5 class="card-title">易支付收款接口配置</h5><hr>
                                    <div class="form-row">
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">易支付接口</label>
                                            <input type="text" class="form-control" name="yzf_url" id="yzf_url" value="<?php echo $conf['yzf_url'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">易支付商户ID</label>
                                            <input type="text" class="form-control" name="yzf_id" id="yzf_id" value="<?php echo $conf['yzf_id'] ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputPassword4">易支付商户秘钥</label>
                                            <input type="password" class="form-control" name="yzf_key" id="yzf_key" value="<?php echo $conf['yzf_key'] ?>">
                                        </div>
                                    </div>
                                    <button type="sumbit" class="btn btn-primary btn-block" onclick="set();">确定修改</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="lime-footer">
                <div class="container">
                    <div class="row">
                        <div class="col-md-12">
                            <span class="footer-text"><?php echo $conf['foot'] ?></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Javascripts -->
        <script src="../../assets/plugins/jquery/jquery-3.1.0.min.js"></script>
        <script src="../../assets/plugins/bootstrap/popper.min.js"></script>
        <script src="../../assets/plugins/bootstrap/js/bootstrap.min.js"></script>
        <script src="../../assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
        <script src="../../assets/plugins/chartjs/chart.min.js"></script>
        <script src="../../assets/plugins/apexcharts/dist/apexcharts.min.js"></script>
        <script src="../../assets/js/lime.min.js"></script>
        <script src="../../assets/js/pages/dashboard.js"></script>
        <script src="//lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
        <script src="//lib.baomitu.com/layer/3.1.1/layer.js"></script>
        <script src="//lib.baomitu.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>
function set(){
	var title= $("#title").val();
	var kfqq= $("#kfqq").val();
	var ds_id= $("#ds_id").val();
	var ds_key= $("#ds_key").val();
	var ds_pass= $("#ds_pass").val();
	var jy_sxf= $("#jy_sxf").val();
	var qun= $("#qun").val();
	var url= $("#url").val();
	var foot= $("#foot").val();
	var money= $("#money").val();
	var yzf_url= $("#yzf_url").val();
	var yzf_id= $("#yzf_id").val();
	var yzf_key= $("#yzf_key").val();
	var on= $("#on").val();
	var jl= $("#jl").val();
		  	var ii = layer.load(3, {shade:[0.1,'#fff']});
		  	$.ajax({
				type : "POST",
				url : "./Ajax.php?act=Set",
				data : {title:title,kfqq:kfqq,ds_id:ds_id,ds_key:ds_key,ds_pass:ds_pass,jy_sxf:jy_sxf,qun:qun,url:url,foot:foot,money:money,jl:jl,yzf_url:yzf_url,yzf_id:yzf_id,yzf_key:yzf_key,on:on},
				dataType : 'json',
				timeout:10000,
				success : function(data) {					  
					  layer.close(ii);
					  layer.msg(data.msg);
					  if(data.code==1){
						setTimeout(function () {
							location.href="./set.php";
						}, 1000); //延时1秒跳转
					  }
				},
				error:function(data){
					layer.close(ii);
					layer.msg('服务器错误');
					}
			});
}
</script>
<script>
var items = $("select[default]");
for (i = 0; i < items.length; i++) {
$(items[i]).val($(items[i]).attr("default")||0);
}
</script>
    </body>
</html>