<?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">
<title>收款信息</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="stylesheet" href="/layui/css/houtai.css">
<script src="/layui/jquery.min.js"></script>
<script src="/layui/layui.js"></script>
</head>
<body style="padding:5px;overflow-x: hidden;">
<div class="layui-tab-item layui-show">
<form class="layui-form" name="FormInfo" id="FormInfo">
<input type="hidden" name="lx"  value="addskm">
<input type="hidden" name="pd"  id="pd"  value="<?php if($user[skm]){?><?php echo $user[skm]?><?php }?>"  >
<div class="layui-form-item">
<input type="text" name="txname"  autocomplete="off" class="layui-input" value="<?php echo $user['txname']?>"  required lay-verify="required" placeholder="请输入收款人" >
</div>
<div class="layui-form-item">
<input type="text" name="tixian"  required lay-verify="required"  placeholder="请输入收款账号" autocomplete="off" class="layui-input" value="<?php echo $user['tixian']?>" >
</div>
<div class="layui-form-item">
<button type="button" class="layui-btn layui-btn-danger" id="userAvatar"  style="width:100%;">上传收款二维码</button>
</div>
<div class="layui-form-item">
<button class="layui-btn " lay-submit lay-filter="FormInfo" style="width: 100%;">立即提交</button>
</div>
<div class="layui-form-item"><center><img src="<?php if($user[skm]){?><?php echo $user[skm]?><?php }?>"    style="width:100%;<?php if($user[skm]){?><?php }else{?>display: none;<?php }?>" id="pic" ></center></div>
</form>
</div><script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'upload', 'layer'], function(){
var form = layui.form
,layer   = layui.layer
,layedit = layui.layedit
,element = layui.element
,$= layui.jquery
,upload  = layui.upload
,laydate = layui.laydate;
upload.render({
elem: '#userAvatar'
,url: '/shoukuan.html'
,size: 500
,done: function(res){
if(res.status=='true'){
layer.msg("上传成功");
$("#pic").attr("src",res.img);
$("#pic").show();
$("#pd").val(res.img);
}else{
layer.msg(res.msg);
}
}
});
form.on('submit(FormInfo)', function (data) {
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type:'POST',
url : "/post<?php echo $dshz?>",
data:$("#FormInfo").serialize(),
dataType:'json',
success:function(result){
if(result.status == 'true'){
layer.closeAll('loading');
layer.msg('设置成功');
parent.location.href='/mtx<?php echo $dshz?>';
}else{
layer.closeAll('loading');
layer.msg(result.msg);
}
}	
});
return false;
});
});
</script>
</body>
</html>