<?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>
<script src="/2019newui/js/bootstrap.min.js"></script>
<script src="/layui/layui.js"></script>
<link href="/layui/css/m.css" rel="stylesheet"/>
<link href="/2019newui/page.css" rel="stylesheet" type="text/css"/>
</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>
<ul class="contact">
<li><a href="/mtx<?php echo $dshz?>" style="height:40px;font-size:16px;text-align:center;line-height:40px;border-radius:6px;display:block;background:#29a7e2;color:#fff;"><span >申请提现</span></a></li>
<div class="layui-form-item">收款二维码<img src="<?php if($user[skm]){?><?php echo $user[skm]?><?php }?>"  style="width:60%;<?php if($user[skm]){?><?php }else{?>display: none;<?php }?>" id="pic" ></div>
</ul>
<div style="height: .5rem;"></div>
</div>
<table class="layui-table" >
<thead>
<tr>
<th  style="text-align:center;" >提现金额</th>
<th  style="text-align:center;" >提现时间</th>
<th  style="text-align:center;" >提现状态</th>
</tr>
</thead>
<tbody>
<?php 
$page_size=10; 
$sql = "WHERE 1=1";
$sql .=" and userid='$userid' ";
$resul = mysql_query("select id from  pay    ".$sql."");
$count = mysql_num_rows($resul);
if($count == 0){echo '<tr><td style="text-align:center;" colspan=3>暂无记录</td></tr>';}
$page_count = ceil($count/$page_size); 
$init=1; 
$page_len=7; 
$max_p=$page_count; 
$pages=$page_count; 
if(empty($_GET['page'])||$_GET['page']<0){ 
$page=1; 
}else { 
$page=$_GET['page']; 
} 
$offset=$page_size*($page-1); 
$query = mysql_query("select * from  pay  ".$sql."  order by id desc     limit $offset, $page_size");
while ($zgg=mysql_fetch_array($query)) { 
?> 	
<tr>
<td  style="text-align:center;"><?php echo $zgg[money]?> 元</td>
<td style="text-align:center;"><?php echo  $zgg[shijian]?></td>
<td  style="text-align:center;"><?php echo $zgg[zt]?></td>
</tr>
<?php 
} 
$page_len = ($page_len%2)?$page_len:$pagelen+1;//页码个数 
$pageoffset = ($page_len-1)/2;//页码个数左右偏移量 
if($page!=1){ 
$keyt.="<li><a href=\""."/mtxpage/1/\">首页</a></li>"; //首页 
$keyt.="<li><a href=\""."/mtxpage/".($page-1)."/\">上页 </a></li>"; //上一页 
}else { 
$keyt.="<li>首页</li>"; //首页 
$keyt.="<li>上页</li>"; //上一页  
} 
if($pages>$page_len){ 
//如果当前页小于等于左偏移 
if($page<=$pageoffset){ 
$init=1; 
$max_p = $page_len; 
}else{//如果当前页大于左偏移 
//如果当前页码右偏移超出最大分页数 
if($page+$pageoffset>=$pages+1){ 
$init = $pages-$page_len+1; 
}else{ 
//左右偏移都存在时的计算 
$init = $page-$pageoffset; 
$max_p = $page+$pageoffset; 
} 
} 
} 
for($i=$init;$i<=$max_p;$i++){ 
if($i==$page){ 
$keyt.='<li class="active">'.$i.'</li>'; 
} else { 
$keyt.="<li><a href=\""."/mtxpage/".$i."/\">".$i."</a></li>"; 
} 
} 
if($page!=$pages){ 
$keyt.="<li><a href=\""."/mtxpage/".($page+1)."/\">下页 </a></li>";//下一页 
$keyt.="<li><a href=\""."/mtxpage/{$pages}/\">尾页</a></li>"; //最后一页 
}else { 
$keyt.="<li>下页</li>";//下一页 
$keyt.="<li>尾页</li>"; //最后一页 
} 
$keyt.='<li class="totalPage">跳转<input type="text" onkeyup="cq(this.value)" value="'.$page.'" ><span>页</span></li><br>';
$keyt.="<li class='totalPage'>当前第 <b>$page</b> 页/共 <b>$pages</b> 页</li>"; 
$keyt.="<li class='totalPage'>每页<b>$page_size</b>条数据</li>"; 
$keyt.="<li class='totalPage'>总共<b>$count</b>条数据 "; 
?> 
</tbody>
</table>
<?php if($count=="0"){?>
<?php }else{?>
<div style="height:10px;"></div>
</div>
<div id="pagination" class="pagination">
<ul>
<?php if($count =="0"){?><?php }else{?><?php echo $keyt?><?php }?>
</ul>
</div>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'layer'], function(){
var form = layui.form
,layer   = layui.layer
,layedit = layui.layedit
,element = layui.element
,$= layui.jquery
,laydate = layui.laydate;
});
</script>
<script type="text/javascript">
function cq(page) {
if(page><?php echo $count?>){
layer.msg('当前共<?php echo $count?>页<br>请正确输入页码');
}else{
window.location.href='/mtxpage/'+page+'/';
} 
}
</script>
<?php }?>
<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>