<?php
include_once("htui_header.php");

$scuser_id=$_SESSION["a_uid"];

$page=intval($_GET["page"]);
if ($page==0) $page=1;
  
$where = "";
if ($_POST["trade_no"]!=""){
   $trade_no=flc_request(trim($_POST["trade_no"]));
   $where = " AND trade_no = '".$trade_no."'";
}elseif ($_GET["trade_no"]!=""){
   $trade_no=flc_request(trim($_GET["trade_no"]));
   $where = " AND trade_no = '".$trade_no."'";
}

$sql = "select d.* from {$tablepre}trade d WHERE 1=1 ".$where." order by d.id desc"; 

$p       = new htui_page;
$myrow   = $db->get_all($sql);
$numrows = count($myrow);

$p->setvar(array("kw" => $kw)); 
$p->set($site_admin_num,$numrows,$psize); 
$ListArray = $db -> get_all($sql." limit ".$p->limit());


if(!empty($ListArray) && is_array($ListArray)){
     foreach($ListArray as $k => $v){
		$sql = "select * from {$tablepre}scuser where ID='".$v['scuser_id']."'";
        $row = $db->get_row($sql);
		$ListArray[$k]['UserName'] = $row['UserName'];
     }
}
?>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta id="scale" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>在线支付日志列表 - 飞天素材网</title>
<meta name="author" content="ftsucai.com">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/htstyle.css" rel="stylesheet">
<link href="../css/jquery-confirm.min.css" rel="stylesheet">
</head>
  
<body>
    <!--页面主要内容-->
    <main class="ftdms-layout-content">
      
      <div class="container-fluid" style="margin-bottom:90px;">
        
        <div class="row" style="margin-top:15px;">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-toolbar clearfix">
                <form class="pull-right search-bar" method="post" action="" role="form" id="search">
                  <div class="input-group">
				     <div class="input-group-btn">
                      <input type="hidden" name="search_field" id="search-field" value="trade_no">
                      <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
                      交易号 <span class="caret"></span>
                      </button>
                      <ul class="dropdown-menu">
                        <li> <a tabindex="-1" href="javascript:void(0)" data-field="trade_no">交易号</a> </li>
                      </ul>
                      </div>
                    <input type="text" class="form-control" value="" name="trade_no" placeholder="<?php echo $trade_no;?>">
                    </div>
                </form>
                <div class="toolbar-btn-action">
				  <a class="btn btn-default submenuitem"> 交易列表</a>
                </div>
              </div>
              <div class="card-body">
                
                <div class="table-responsive">
                  <table class="table table-bordered">
                    <thead>
                      <tr>
                        <th width="3%">
                          <label class="ftdms-checkbox checkbox-success">
                            <input type="checkbox" id="check-all"><span></span>
                          </label>
                        </th>
						<th>用户帐号</th>
                        <th>交易号</th>
                        <th>交易金额</th>
						<th>交易标题</th>
						<th>交易描述</th>
						<th>交易日期</th>
                      </tr>
                    </thead>
                    <tbody>
					  <?php
					  foreach ($ListArray as $k=>$v){
					  ?>
                      <tr>
                        <td>
                          <label class="ftdms-checkbox checkbox-success">
                            <input type="checkbox" name="ids" value="<?php echo $v['id']?>" data_id="<?php echo $v['id']?>"><span></span>
                          </label>
                        </td>
                        <td><?php echo $v['UserName']?></td>
                        <td><?php echo $v['trade_no']?></td>
                        <td><?php echo $v['payment']?></td>
						<td><?php echo $v['goods']?></td>
						<td><?php echo $v['goods_desc']?></td>
                        <td><?php echo $v['trade_time']?></td>
                      </tr>
					  <?php
					  }
					  ?>
                    </tbody>
                  </table>
				  <nav>
                    <ul class="pagination no-border">
                     <?php echo $pager=$p->output(1);?>
                    </ul>
                  </nav>
                </div>	
       
              </div>
            </div>
          </div>
          
        </div>
        
      </div>
      
    </main>
    <!--End 页面主要内容-->

<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.js"></script>
<script type="text/javascript" src="../js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="../js/main.min.js"></script>
<script type="text/javascript" src="../js/jquery-confirm.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="../js/tips.js"></script>

</body>
</html>