<?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;}
$dailimoney=$user['money'];
$fgg="select sum(money) from pay where  userid='$userid'   and shijian='$day'";
if ($res=mysql_query($fgg)){
list($dailimoney1)=mysql_fetch_row($res);
mysql_free_result($res);
} 
$sql = mysql_query("SELECT* FROM  pay  where  userid='$userid'   and shijian='$day'");
$cs = mysql_num_rows($sql);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>提现</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<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="divHeight"></div>
<div class="qian">
<h2><?php if($user[money] == null){ ?>￥0元<?php }else{  ?>￥<?php $xs4=round($user[money],2);echo $xs4;?> 元<?php } ?></h2>
<p>历史提款（<?php if($user[txmoney] == null){ ?>￥0元<?php }else{  ?>￥<?php $xs4=round($user[txmoney],2);echo $xs4;?> 元<?php } ?>）</p>
</div>
<div class="layui-tab-content" >
<?php if($user['money']=='0'){?>
<blockquote class="layui-elem-quote layui-text">(账户余额：<?php echo $user['money']?>) 元,暂不能提现操作&nbsp;&nbsp;</blockquote>
<?php }else{?>
<div class="layui-tab-item layui-show">
<?php if($user[skm]){?><blockquote class="layui-elem-quote layui-text" ><a class="layui-btn  open_if" id='tip'>修改收款信息</a></blockquote><?php }?>
<form class="layui-form layui-form-pane" name="FormInfo" id="FormInfo">
<input type="hidden" name="lx"  value="tx">
<blockquote class="layui-elem-quote layui-text" >单笔最小提款金额：<span style="font-size:14px;color:#ff0000"><?php echo $js?> </span>元<br>每天可提款总金额：<span style="font-size:14px;color:#ff0000"><?php echo $daymoney?> </span>元&nbsp;&nbsp;</blockquote>
<blockquote class="layui-elem-quote layui-text">今日已申请提款金额：<span style="font-size:14px;color:#ff0000"><?php if($dailimoney1 == null){ ?>￥0<?php }else{  ?>￥<?php $xs4=round($dailimoney1,2);echo $xs4;?><?php } ?></span> 元<br>每天可提现次数 <span style="font-size:14px;color:#ff0000"><?php echo $txcs?> </span>次 <br>当前已经提款 <span style="font-size:14px;color:#ff0000"><?php echo $cs?> </span>次
</blockquote>
<?php if($dailimoney1>=$daymoney){?>
<?php }else{?>
<div class="layui-form-item">
<input type="text" name="money" id="money" placeholder="请输入提现金额" autocomplete="off" class="layui-input"  lay-verify="required">
</div>
<div class="layui-form-item">
<input type="password" name="pass" id="paypassword" placeholder="请输入密码" autocomplete="off" class="layui-input" lay-verify="required">
</div>
<?php }?>
<div class="layui-form-item">
<?php if($dailimoney1>=$daymoney){?>
<input type="submit" value="今日最大提款金额已超限"  class="layui-btn" name="b"  disabled style="width:100%;">
<?php }else{?>
<?php if($user[skm]){?><button class="layui-btn" lay-submit lay-filter="FormInfo" style="width:100%;">申请提现</button><?php }else{?><a class="layui-btn  open_if"   style="width:100%;">请先设置收款信息</a> <?php }?>
<?php }?>
</div>
</div>
</div>
</form>    
<?php }?>
<script src="/layui/layui.js"></script>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'layer'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,element = layui.element
  ,laydate = layui.laydate;
<?php if($user[skm]){?>
layer.tips('亲，点这里可以修改收款信息', '#tip', {
tips: [1, '#000'],
area: ['220px', 'auto'],
time: 4000
});
<?php }?>
<?php if($dailimoney1>=$daymoney){?>
<?php }else{?>
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;
});
<?php }?>
<?php if($user[skm]==null){?>
layer.open({
type: 2,
offset: '100px',
title: '请设置收款信息',
shadeClose: true,
area: ['300px', '600px'],
content: '/mskm<?php echo $dshz?>'
});
<?php }?>
$(function() {
$('.open_if').on('click', function () {
layer.open({
type: 2,
offset: '100px',
title: '请设置收款信息',
shadeClose: true,
area: ['300px', '600px'],
content: '/mskm<?php echo $dshz?>'
});
});
});
});
</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"><i class="icon layui-icon" style="font-size: 30px;">&#xF007;</i><span class="aui-tabBar-item-text">我的</span></a>
</footer>
</body>
</html>