<?php if( !defined( 'ONGPHP')) exit( 'Error ONGSOFT');

$D = db('dblog');

$LOG = logac('zhongjianglog');

//if( isset( $YANZQX[ $NEWS[ $AC]][ $AC][ 'only']))$WHERE['adminid'] = $USER['id'];
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="<?php echo TPL;?>js/lib/html5.js"></script>
<script type="text/javascript" src="<?php echo TPL;?>js/lib/respond.min.js"></script>
<script type="text/javascript" src="<?php echo TPL;?>js/lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="<?php echo TPL;?>h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo TPL;?>h-ui/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="<?php echo TPL;?>js/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="<?php echo TPL;?>h-ui/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="<?php echo TPL;?>h-ui/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="<?php echo TPL;?>h-ui/css/style.css" />
<link rel="stylesheet" type="text/css" href="<?php echo TPL;?>js/webuploader/webuploader.css" />
<!--[if IE 6]>
<script type="text/javascript" src="<?php echo TPL;?>js/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<style>
</style>
<title><?php echo $LANG['adminac'][$_GET['action']];?></title>
</head>
<body>



<?php 
  
  $PAGE  = (int) isset( $_GET['page']) ? $_GET['page'] : 0;

	$limit = listmit( $CONN['hnum'] ,$PAGE);

   //$WHERE['zhongjiangtype >'] = 0;
   
   //dump($_GET['type']);
   if(isset( $_GET['type'])&&$_GET['type']!=''){
       
       $type = $_GET['type'];
   }
   
   $WHERE['id >'] = 0;
   
   if( isset( $_GET['type']) && $_GET['type'] != '') $WHERE['zhongjiangtype'] = $type;

   if( isset( $_GET['fenqu']) && $_GET['fenqu'] != '') $WHERE['uid'] = $_GET['fenqu'];

//    if( isset( $_GET['start']) && $_GET['start'] != '') $WHERE[ 'time >='] = $_GET['start'];

//    if( isset( $_GET['end']) && $_GET['end'] != '') $WHERE[ 'time <='] =  $_GET['end'];

  


   //dump($WHERE);exit;
   $UUID = array();
   $ZSHU = $D ->where( $WHERE ) -> total();

   $DATA = $D ->order( 'id desc' )->where( $WHERE )-> limit( $limit )-> select();

   $_SESSION[$AC] = token();

   if(! $DATA) $DATA = array();


?>

<nav class="breadcrumb"> <i class="Hui-iconfont">&#xe67f;</i> <?php echo $LANG['home']?> <span class="c-gray en">&gt;</span> <?php echo $LANG['adminac'][$_GET['action']];?> <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="<?php echo $LANG['shuaxin'];?>" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<div class="page-container">
	<div class="text-c"> 
		<form method="get">

		    <input type="hidden" value="<?php echo $AC;?>" name="action" />

            <span class="select-box" style="width:108px">
		         <select name="type" class="select"> <option value=""> <?php echo $LANG['allquan'];?></option> <?php echo ywselect($LOG, isset($_GET['type']) ?$_GET['type']:'');?> </select> 
			</span>

			用户uid：
		  
		   <input type="text" class="input-text" style="width:100px" placeholder="<?php echo $LANG['userid'];?>"  name="fenqu" value="<?php echo isset( $_GET['fenqu']) ? $_GET['fenqu'] : '';?>">

		    

           <!-- <input type="checkbox" name="filed" value="1"> <?php echo $LANG['daochu'];?> --> 



		    <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> <?php echo $LANG['sousuo'];?></button>

		   <b>押注和：</b>
			<?php if( count( $WHERE )  > 0){

			          $where =  $D -> wherezuhe( $WHERE );

					  
			
			
                   $fanhui = $D -> qurey("select sum(jine) num from `".$D->biao().'` '.$where);
				  
				   echo '<button type="button" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6c1;</i> '.(float)$fanhui['num'].'</button>';
			
			}?>
			
			<b>中奖和：</b>
			<?php if( count( $WHERE )  > 0){

			          $where =  $D -> wherezuhe( $WHERE );

					  
			
			
                   $fanhui = $D -> qurey("select sum(deqian) num from `".$D->biao().'` '.$where);
				  
				   echo '<button type="button" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6c1;</i> '.(float)$fanhui['num'].'</button>';
			
			}?>

		</form>
	</div>
	
	<div class="mt-20">
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				
				<th width="40">ID</th>
				<th width="300">昵称</th>
				<th>微信订单号</th>
				<th>猜大小单双</th>
				<th>猜几手</th>
				<th>消耗金币</th>
				<th>得到金币</th>
				

				
				<th width="130"><?php echo $LANG['shijian'];?></th>
				

			</tr>
		</thead>
		<tbody>

<?php if( $DATA){

		
	  
		foreach($DATA as $ONG){

			 if( !isset( $UUID[$ONG['uid']])){
			 
				 $zhi = uid($ONG['uid']);

				 $UUID[$ONG['uid']] = $zhi['name'].' <span style="color:Red;">('.$zhi['uid'].')</span>';
			 }
			 
			 $zhi = array(
                    '0'=>"大",
                    '1'=>"小",
                    '2'=>"单",
                    '3'=>"双",
					'10'=>"牛牛",
			        '11'=>"牛一",
			        '12'=>"牛二",
			        '13'=>"牛三",
			        '14'=>"牛四",
			        '15'=>"牛五",
			        '16'=>"牛六",
			        '17'=>"牛七",
			        '18'=>"牛八",
			        '19'=>"牛九",
			        '20'=>"无牛",
        
    );
   // echo $ONG['yatype'];
			 
?>
			<tr class="text-c">
				
				<td><?php echo $ONG['id']?></td>
				<td><?php echo $UUID[$ONG['uid']];?></td>
				<td> <span><?php echo $ONG['payment_no'];?> </span></td>
				<td> <span><?php echo $zhi[$ONG['yatype']];?> </span></td>
				<td> <span>猜<?php echo $ONG['jishou']?>手 </span></td>
				<td> <span style="color:red "><?php echo $ONG['jine'];?> </span></td>
				<td> <span style="color:green"><?php echo $ONG['deqian'];?> </span></td>
				
				<td><?php echo $ONG['time'];?></td>
				
				
			</tr>

<?php } }else {?>
     
	        <tr class="text-c">
				<td colspan="8"> 
				    <span class="label label-warning radius"><?php echo $LANG['noshuju'];?></span>
				</td>
	        </tr>

<?php }?>


		</tbody>
	</table>
	</div>
</div>

<div class="page">

<?php 
   
  
   if($ZSHU > $CONN['hnum']){

	        $_GET['guan'] = isset($_GET['guan']) ? $_GET['guan'] :'';
			$_GET['start'] = isset($_GET['start']) ? $_GET['start'] :'';
		    $_GET['end'] = isset($_GET['end']) ? $_GET['end'] :'';
			$_GET['fenqu'] = isset($_GET['fenqu']) ? $_GET['fenqu'] :'';
			$_GET['type'] = isset($_GET['type']) ? $_GET['type'] :'';
	 
         echo pagec( $LANG['PAGE'], $CONN['hnum'], $ZSHU, $CONN['hpage'], $PAGE, '?action='.$_GET['action'].'&page=','&guan='.$_GET['guan'].'&start='.$_GET['start'].'&end='.$_GET['end'].'&type='.$_GET['type'].'&fenqu='.$_GET['fenqu'] );
  } 
  
?>

</div>

<?php  include HTPL.'foot.php'; ?>
<script type="text/javascript" src="<?php echo TPL;?>js/jquery.min.js"></script> 
<script type="text/javascript" src="<?php echo TPL;?>h-ui/js/layer.js"></script> 
<script type="text/javascript" src="<?php echo TPL;?>h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="<?php echo TPL;?>h-ui/js/H-ui.admin.js"></script> 
<script type="text/javascript" src="<?php echo TPL;?>js/lib/Validform.min.js"></script>
<script type="text/javascript" src="<?php echo TPL;?>js/Switch/bootstrapSwitch.js"></script>
<script type="text/javascript" src="<?php echo TPL;?>js/webuploader/webuploader.js"></script>
<script type="text/javascript" src="<?php echo TPL;?>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

$(function(){


		
});
</script>
</body>
</html>