<?php
error_reporting(0); 
include("../../config/wap.php");
session_start();
if(!isset($_SESSION['username'])){echo "<script>alert('请重新登录!')</script><script>top.location.href='/m$dshz'</script>";exit;}
$username=$_SESSION['username'];
$type="where name='$username'";
$user=queryall(user,$type);
$userid=$user['userid'];
if(!$user){echo "<script>alert('请重新登录!')</script><script>top.location.href='/m$dshz'</script>";exit;}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<title>代理资料</title>
<link href="/2019newui/m/css/common.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/2019newui/js/jquery.min.js"></script>
<link href="/layui/css/m.css" rel="stylesheet"/>
</head>
<body>
<header class="aui-navBar aui-navBar-fixed">
<a href="javascript:;"  onclick="window.history.back(-1);" class="aui-navBar-item"><i class="icon layui-icon" style="font-size: 20px;">&#xF060;</i></a>
<div class="aui-center"><span class="aui-center-title">代理资料</span></div>
</header>
<div class="layui-tab-content" >
<div class="layui-tab-item layui-show">
<form class="layui-form layui-form-pane" action="" method="post" name="FormInfo" id="FormInfo">
<input type="hidden" name="lx"  value="user" />
<div class="layui-form-item">
<input type="text" name="n"  value="<?php echo $user['name']?>" class="layui-input" readonly="readonly" >
</div>
<div class="layui-form-item">
<input type="text" name="nikname" required lay-verify="required"  value="<?php echo $user['nikname']?>" class="layui-input"  placeholder="请输入昵称" >
</div>
<div class="layui-form-item">
<input type="text" name="pass" required lay-verify="required"  value="" class="layui-input"  placeholder="请输入原密码" >
</div>
<div class="layui-form-item">
<input type="text" name="newpass" required lay-verify="required"  value="" class="layui-input"  placeholder="请输入新密码" >
</div>
<div class="layui-form-item">
<input type="text" name="qq" required lay-verify="required"  value="<?php echo $user['qq']?>" class="layui-input"  placeholder="请输入QQ" >
</div>
<div class="layui-form-item">
<input type="text" name="weixin" required lay-verify="required"  value="<?php echo $user['weixin']?>" class="layui-input" placeholder="请输入微信" >
</div>
<div class="layui-form-item"><button class="layui-btn" lay-submit="" lay-filter="FormInfo" style="width:100%;">修改资料</button></div>
</form>
<div style="height:100px;"></div>
</div>
<script src="/layui/layui.js"></script>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'upload', 'layer'], function(){
  var form = layui.form
  ,layer   = layui.layer
  ,layedit = layui.layedit
  ,element = layui.element
,upload  = layui.upload
  ,$       = layui.jquery
  ,laydate = layui.laydate;
form.on('submit(FormInfo)', function (data) {var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type:'POST',
url : "/mpost<?php echo $dshz?>",
data:$("#FormInfo").serialize(),
dataType:'json',
success:function(result){
if(result.status == 'true'){
layer.closeAll('loading');
layer.open({
type: 1
,offset: 'auto'
,id: 'layerMsg'
,content: '<div style="padding: 20px 100px;">修改成功</div>'
,btn: '确定'
,btnAlign: 'c'
,shade: 0
,closeBtn: 0
,yes: function(index){
location.reload();
}
});
}else{
layer.closeAll('loading');
layer.msg(result.msg);
}
}	
});
return false;
});
});
</script>
<footer class="aui-footer aui-footer-fixed">
<a href="/mmain<?php echo $dshz?>" class="aui-tabBar-item"><i class="icon layui-icon" style="font-size: 30px;">&#xF015;</i><span class="aui-tabBar-item-text">首页</span></a>
<a href="/mdingdan<?php echo $dshz?>" class="aui-tabBar-item"><i class="icon layui-icon" style="font-size: 30px; ">&#xF123;</i><span class="aui-tabBar-item-text">订单</span></a>
<a href="/muser<?php echo $dshz?>" class="aui-tabBar-item aui-tabBar-item-active"><i class="icon layui-icon" style="font-size: 30px;color: #1E9FFF;">&#xF007;</i><span class="aui-tabBar-item-text">我的</span></a>
</footer>
</body>
</html>