<?php
require_once("../check.php");
?>
<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="../js/jquery-1.11.1.min.js"></script>
<script src="../jquerymoblie/jquery.mobile-1.4.1.min.js"></script>
<link rel="stylesheet" href="../jquerymoblie/jquery.mobile-1.4.1.min.css"/>
<style>

#alert{
    display:none;
    margin-top:100px;
    color:#FFFF00;
    z-index:100;
    position: absolute;
    width:100%;
    font-size:14px;
    height:60px;
    line-height:60px;
    background-color: #FF671E;
    border-radius:10px;
    text-align:center;
}
table {
border:0;
border-collapse:collapse; border-spacing:0;
}
table tr{
border-width:0px 0px 0px 0px;
}
table tr td{
    border-width:0px 0px 0px 0px;
    border-bottom:1px solid #D5D5D5;
    font-size:14px;
    color: #8F8F8F;
    line-height:35px;
}
table tr th{
    color: #7B7B7B;
}
#pageye{
    width:95%;
    margin-left:auto;
    margin-right:auto;
    height:40px;
    line-height:40px;
}
#pageye .left{
    float:left;
    width:50%;
    text-align:center;
}
#pageye a{
    text-decoration:none;
    font-size:16px;
    
}
</style>

<div data-role="page" id="pageone">
  <div data-role="header">
    <h1>我的收入明细</h1>
</div>
<div data-role="content" style="text-align: center;">
<?php
ini_set("date.timezone","PRC");
$m="10";//每页显示的记录数
isset($_GET['page'])?$page=$_GET['page']:$page="1";//当前页数
$numsql = "select count(id) as num from dunling_share where uid='$uid' and youxiao='1'";
$numery = mysql_query($numsql,$config);
$numery = mysql_fetch_array($numery);
$zongjilushu = $numery['num'];//总记录数
$zy = (int)(($zongjilushu-1)/$m)+1;//总页数
$one = (int)($page-1)*$m;//当前页的首条记录
$paysql = "select * from dunling_share where uid='$uid' and youxiao='1'  order by id desc limit $one,$m";
$payery = mysql_query($paysql,$config);
$paynum = mysql_num_rows($payery);
if($paynum=="0"){
        echo '您当前无任何收入明细记录!';
}else{
echo '<table width="100%" border="0"><tr><th>日期</th><th>来源</th><th>收益</th></tr>';
while($pay = mysql_fetch_array($payery)){
$title = $pay['title'];
$title = mb_substr($title,0,10,'utf-8');

    echo '<tr>';
    echo '<td>';
    echo date("m/d H:i",$pay['time']);
    echo '</td>';
    echo '<td>';
    echo $title;
    echo '</td>';
    echo '<td>';
    echo $pay['danjia'];
    echo '</td>';
    echo '</tr>';
}
echo '</table>';
}
?>

</table>
</div>






<div id="pageye">
<?php
$xiayiye = $page+1;
$shangyiye = $page-1;
if($page>"1"){
  echo '<div class="left"><a href="?page='.$shangyiye.'">上一页</a></div>';  
}
if($page<$zy){
  echo '<div class="left"><a href="?page='.$xiayiye.'">下一页</a></div>';  
}
?>
</div>
</div>