<?php
if(!isset($_SESSION['admin_name'])){
   exit; 
}
?>
<div style="text-align: center;">
<br>
<p style="padding-bottom:9px;font-size: 20px;font-weight: bold;color:#6A6A6A;">
用户提现
</p>
<div class="guanli">
<form action="tixian/del_tixian.php" method="get" id="form1">
<table style="width:1020px;margin:0 auto;" cellspacing="0">
<tr style="background: #009999;height: 30px;">
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 1px;color: #fff;">全选</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px; color: #fff;">ID</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px; color: #fff;">用户名称</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">用户总额</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">提现金额</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">账户余额</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">审核状态</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">支付状态</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">用户状态</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">提交时间</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">审核通过</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">是否支付</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">修改</td>
<td style="font-weight: bold;border: 1px solid #BCBCBC;border-width:0px 1px 1px 0px;color: #fff;">删除</td>
</tr>
<?php
$length=10;
$totsql="select count(*) from tixian_shenhe";
$totrst=mysql_query($totsql);
$totarr=mysql_fetch_row($totrst);
//总页数
$totpage=ceil($totarr[0]/$length);
//当前页
$pagenum=@$_GET['page']?@$_GET['page']:1;
//限制最大页数
if($pagenum>=$totpage){$pagenum=$totpage;}
//offset算法
$offset=($pagenum-1)*$length;
$zhuan_sql="select tixian_shenhe.*,user.username,user.zanting from tixian_shenhe,user where tixian_shenhe.uid=user.id  order by tixian_shenhe.id desc limit {$offset},{$length}";
$zhuan_rst=mysql_query($zhuan_sql);
$biaoti=10;

while($zhuan_row=@mysql_fetch_assoc($zhuan_rst)){
    echo "<tr align='center' style='height:50px;background:#FAFFFF;'>"; 
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 1px;'><input type='checkbox' name='checkbox[]' class='checkall' value='{$zhuan_row['id']}'/></td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'>{$zhuan_row['id']}</td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'>{$zhuan_row['username']}</td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'><span style='color:red;'>{$zhuan_row['zonger']}</span>元</td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'><span style='color:red;'>{$zhuan_row['tixianjiner']}</span>元</td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'><span style='color:red;'>{$zhuan_row['tixian_yuer']}</span>元</td>";
    
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;' class='shenhe_color'>";
    if($zhuan_row['shifoutongguo']==0){
        echo "<span style='color:#000;'>审核当中</span>";
    }elseif($zhuan_row['shifoutongguo']==1){
        echo "<span style='color:green;'>审核通过</span>";
    }elseif($zhuan_row['shifoutongguo']==2){
        echo "<span style='color:red;'>审核未过</span>";
    }
    echo "</td>";
    
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;' class='shenhe_color'>";
    if($zhuan_row['shifouzhifu']==0){
        echo "<span style='color:red;'>未支付</span>";
    }else{
        echo "<span style='color:green;'>已支付</span>";
    }
    echo "</td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'>";
            if($zhuan_row['zanting']==0){
                echo "<span style='color:green;'>正常</span>";
            }else{
               echo "<span style='color:red;'>停用</span>";
           }
    echo "</td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'>".date("Y/m/d H:i:s",$zhuan_row['time'])."</td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'><button class='shenhetongguo' shenhetongguoid='{$zhuan_row['id']}' style='color:green;'>是</button><button class='shenheweiguo' shenheweiguoid='{$zhuan_row['id']}' style='color:red;'>否</button></td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'><button class='yizhifu' yizhifuid='{$zhuan_row['id']}' style='color:green;'>是</button><button class='weizhifu' weizhifuid='{$zhuan_row['id']}' style='color:red;'>否</button></td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'><a class='xg_tixian_class' xg_tixian_data='{$zhuan_row['id']}' href='javascript:;'><img style='border:0px;' src='image/gai.png'></a></td>";
    echo "<td style='border: 1px solid #C6D4E2;border-width:0px 1px 1px 0px;'><a href='tixian/del_tixian.php?id={$zhuan_row['id']}&hid=1' onclick=\"c=confirm('确定删除吗？');if(!c){return false;}\"><img style='border:0px;' src='image/shan.png'></a></td>";
    echo "</tr>";
    
}

$prevpage=$pagenum-1;
$nextpage=$pagenum+1;

?> 
</table>
<input type="hidden" name="hid" value="2"/>

<p><input style="margin:20px 0px 0px 0px;" type="checkbox" name="all" onclick="check_all(this,'checkbox[]')" />
<span >全选</span>&nbsp;<input onclick="var b=confirm('确定要删除吗？');if(!b){return false;}" type="submit" value="全部删除"/></p>
</form>
<br/>
<?php
echo "<p>";
echo "<a href='index.php?ye=yonghutixian&page=1'>首页</a>&nbsp;<a href='index.php?ye=yonghutixian&page={$prevpage}'>&lt;上一页</a>";
echo "&nbsp;<a style='color:#009999;' href='index.php?ye=yonghutixian&page={$pagenum}'>{$pagenum}</a>&nbsp;/&nbsp;<span>{$totpage}</span>";
echo "<a href='index.php?ye=yonghutixian&page={$nextpage}'>&nbsp;下一页&gt;</a>&nbsp;<a href='index.php?ye=yonghutixian&page={$totpage}'>尾页</a>";
echo "</p>";
@mysql_free_result($zhuan_rst);
mysql_free_result($totrst);
mysql_close($con);
?>

</div>
</div>
<script>

$(".shenhetongguo").click(function(){
    var uid=$(this).attr("shenhetongguoid");
    var shenhethis=$(this);
    $.post("tixian/tixian_shenhe.php",{"suid":uid},function(data){
        if(data=="yes"){
            alert("审核成功请刷新页面!");
            
            }else{alert("已经审核");}
        
    })
    return false;
})


$(".shenheweiguo").click(function(){
    var wuid2=$(this).attr("shenheweiguoid");

    $.post("tixian/tixian_shenhe_weiguo.php",{"wuid":wuid2},function(data){
        if(data=="yes"){alert("审核成功请刷新页面");}else{alert("审核失败");}
        
    })
    return false;
})

$(".yizhifu").click(function(){
    var zhifuid2=$(this).attr("yizhifuid");
    $.post("tixian/tixian_shenhe_zhifu.php",{"zhifuid":zhifuid2,"num":1},function(data){

        if(data=="yes"){alert("已支付请刷新页面");}else{alert("支付失败");}
        
    })
 return false;
})


$(".weizhifu").click(function(){
    var zhifuid2=$(this).attr("weizhifuid");
    $.post("tixian/tixian_shenhe_weizhifu.php",{"zhifuid":zhifuid2,"num":0},function(data){

        if(data=="yes"){alert("未支付请刷新页面");}else{alert("支付失败");}
        
    })
 return false;
})


function check_all(obj,cName) 
{ 
    var checkboxs = document.getElementsByName(cName); 
    for(var i=0;i<checkboxs.length;i++){checkboxs[i].checked = obj.checked;} 
}
</script> 