<?php
include("../includes/common.php");
$title="后台首页";
include "./head.php";
if($islogin==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
?>
<?php
$sites=$DB->count("SELECT count(*) from ds_pay WHERE status='1'");
$blocks=$DB->count("SELECT count(*) from ds_pay WHERE 1");
?>
  <link rel="stylesheet" href="/assets/js/datatables.min.css">

        <div class="lime-container">
            <div class="lime-body">
                <div class="container">
                    <div class="row">
                        <div class="col-xl">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">历史换钱列表</h5>
                                    <table class="table" id="table-1" >
                                        <thead class="thead-dark">
                                            <tr>
                                                <th scope="col">订单号</th>
                                                <th scope="col">换钱账号</th>
                                                <th scope="col">换钱人名称</th>
                                                <th scope="col">换钱方式</th>
                                                <th scope="col">换钱金额</th>
                                                <th scope="col">提交时间</th>
                                                <th scope="col">交换状态</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                        	$rs=$DB->query("SELECT * FROM ds_pay WHERE 1 ORDER BY addtime desc ");
                                        	foreach($rs as $res){
                                        	$types = $res['type'];
                                        	if ($types == 'alipay') {
                                        		$types = '支付宝';
                                        		} else if($types == 'wxpay'){
                                        			$types = '微信';
                                        			}else if($types == 'qqpay'){
                                        				$types = 'QQ钱包';
                                        				}
                                        		echo '<tr>
                                        		<td>'.$res['trade_no'].'</td>
                                        		<td>'.$res['accounts'].'</td>
                                        		<td>'.$res['names'].'</td>
                                        		<td>'.$types.'</td>
                                        		<td>'.$res['moneys'].'</td>
                                        		<td>'.$res['addtime'].'</td>
                                        		<td>'.($res['status']== '1'?'<span class="badge badge-success">交换成功</span>':'<span class="badge badge-danger">未付款</span>').'</td>
                                        		</tr>';
                                        		}?>
                                        </tbody>
                                    </table>       
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="lime-footer">
                <div class="container">
                    <div class="row">
                        <div class="col-md-12">
                            <span class="footer-text"><?php echo $conf['foot'] ?></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Javascripts -->
        <script src="../../assets/plugins/jquery/jquery-3.1.0.min.js"></script>
        <script src="../../assets/plugins/bootstrap/popper.min.js"></script>
        <script src="../../assets/plugins/bootstrap/js/bootstrap.min.js"></script>
        <script src="../../assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
        <script src="../../assets/plugins/chartjs/chart.min.js"></script>
        <script src="../../assets/plugins/apexcharts/dist/apexcharts.min.js"></script>
        <script src="../../assets/js/lime.min.js"></script>
        <script src="../../assets/js/pages/dashboard.js"></script>
        
        
  <script src="/assets/js/app.min.js"></script>
  <script src="/assets/js/datatables.min.js"></script>
  <script src="/assets/js/datatables.js"></script>
    </body>
</html>