<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
        <meta name="apple-mobile-web-app-capable" content="yes" /><!-- 删除苹果默认的工具栏和菜单栏 -->
        <meta name="apple-mobile-web-app-status-bar-style" content="black" /><!-- 设置苹果工具栏颜色 -->
        <meta name="format-detection" content="telephone=no, email=no" /><!-- 忽略页面中的数字识别为电话，忽略email识别 -->
        <!-- 启用360浏览器的极速模式(webkit) -->
        <meta name="renderer" content="webkit">
        <!-- 避免IE使用兼容模式 -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
        <meta name="HandheldFriendly" content="true">
        <!-- 微软的老式浏览器 -->
        <meta name="MobileOptimized" content="320">
        <!-- uc强制竖屏 -->
        <meta name="screen-orientation" content="portrait">
        <!-- QQ强制竖屏 -->
        <meta name="x5-orientation" content="portrait">
        <!-- UC强制全屏 -->
        <meta name="full-screen" content="yes">
        <!-- QQ强制全屏 -->
        <meta name="x5-fullscreen" content="true">
        <!-- UC应用模式 -->
        <meta name="browsermode" content="application">
        <!-- QQ应用模式 -->
        <meta name="x5-page-mode" content="app">
        <!-- windows phone 点击无高光 -->
        <meta name="msapplication-tap-highlight" content="no">
        <!-- 适应移动端end -->   
        <title>排行榜</title>
        <link rel="stylesheet" type="text/css" href="/vns/ph/global.css">
        <link rel="stylesheet" type="text/css" href="/vns/ph/ranking.css">
        <script type="text/javascript" src="/vns/ph/jquery-1.11.1.min.js"></script>
</head>
<body>
   <div class="wrap">
       <div class="top_tit">
           <div class="cxd" id = "yqdr" style="width:100%;"><a href="?action=paihangy">邀请达人</a></div>
           
       </div><!--
       <div class="xiao_top">
           <div class=" zrb" onclick="show(1);">昨日榜</div>
           <div class="plo zsd" onclick="show(2);" >今日榜</div>
       </div>
        邀请达人 -->
       <div class="big_box big_box1">
       
       <?php 
        
      $tiaojian = array(
	  'type'=>1,
	  );
       $huobi = $D -> setbiao('huobilog')->where($tiaojian) -> select();
       
       if($huobi){
           
           foreach ($huobi as $key=>$value){
               
               $huobiuid[$value['uid']][] = $value['jine'];
               
           }
       }
       
	   if($huobiuid){
		   
       foreach ($huobiuid as $key=>$value){
           
           $zhi[$key] = array_sum($value);
           
       }
       }else{
		   $zhi = array();
		   
	   }
       arsort($zhi);
       $order = '  ';
       
       

       $i = 1;
        if (is_array($zhi )) {
            foreach($zhi  as  $k => $v){
                
                if($i>10){
                    break;
                }
                
                $tiaojian = array(
                    'uid'=>$k,
                );
                $user = $D -> setbiao('user') ->where($tiaojian)->find();
        
		$v = sprintf("%.2f",$v);
        
?>
    
    
    <div class="zu_row">
               <div class="zu_left">
                   <div class="img_bo"><img src="<?php echo $user['touxiang'] ?>"></div>
                   <p class="name_bo">第<?php echo $i ?>名 </p>
               </div>
               <div class="zu_right">
                   <p>
                     uid:<?php echo $user['uid'] ?>                                       </p>
                   <p class="yaoq">佣金：<em><?php echo $v?></em></p>
               </div>
           </div>
    
    
       <?php 
        $i = $i+1;
        }
    }
    ?>
       
         

       <!-- 邀请达人 -->
       <div class="big_box big_box1" >
                </div>

       <!-- 邀请达人 -->
       <!-- 竞猜达人 -->
       <div class="big_box big_box2" >
                </div>
   </div>
    <!-- 返回按钮 -->
    <div class="back_box"><a href="?action=index">返回</a></div>
</body>
</html>
<script type="text/javascript">
    $(function(){
      //if((window.location.href)=='http://cffalse.local.com/User/rankList.html?type=1'){
          //$('.zrb').addClass('zsd')
          //$('.plo').removeClass('zsd')
      //}
	  if(2 == 1){
		  $('#jcdr').addClass('cxd');
          $('#yqdr').removeClass('cxd');
	  }else{
		  $('#jcdr').removeClass('cxd');
          $('#yqdr').addClass('cxd');
	  }

      //if((window.location.href)=='http://cffalse.local.com/User/rankList.html?type=2'){
          //$('.zrb').removeClass('zsd')
          //$('.plo').addClass('zsd')
      //}
        $('.top_tit>div').click(function(event) {
             $(this).addClass('cxd').siblings().removeClass('cxd');
             var my_index=$(this).index();
             $('.big_box').eq(my_index).show().siblings('.big_box').hide();
        });
        $('.xiao_top>div').click(function(event) {
                $(this).addClass('zsd').siblings().removeClass('zsd');
        });
    })

	function show(num){
		if(num == 1){
			$('.big_box2').show();
			$('.big_box1').hide();
            $('.zrb').addClass('zsd');
            $('.plo').removeClass('zsd');
		}else{
			$('.big_box1').show();
			$('.big_box2').hide();
            $('.zrb').removeClass('zsd');
            $('.plo').addClass('zsd');
		}
	}
</script>