<?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-md-12">
                            <div class="page-title">
                                <h3>温馨提示</h3>
                                <p class="page-desc">为了您的资金安全，请勿随意将泄露账号或密码给他人！如泄露请第一时间进行修改！</p>
                            </div>
                        </div>
                    </div>
                	<div class="row">
                        <div class="col-xl">
                            <div class="card">
                                <div class="card-body">
                                    <div class="form-group">
                                        <label for="exampleInputEmail1">后台管理员账号</label>
                                        <input type="text" class="form-control" id="admin_user" name="admin_user" value="<?php echo $conf['admin_user'] ?>" required>
                                    </div>
                                    <div class="form-group">
                                        <label for="exampleInputPassword1">后台管理员密码</label>
                                        <input type="password" class="form-control" id="admin_pass" name="admin_pass" placeholder="******" required>
                                    </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 admin_user= $("#admin_user").val();
	var admin_pass= $("#admin_pass").val();
	if(admin_user=='' || admin_pass==''){layer.alert('请确保各项不能为空！');return false;}
	var jl= $("#jl").val();
		  	var ii = layer.load(3, {shade:[0.1,'#fff']});
		  	$.ajax({
				type : "POST",
				url : "./Ajax.php?act=user",
				data : {admin_user:admin_user,admin_pass:admin_pass},
				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>