<?php if( !defined( 'ONGPHP')) exit( 'Error ONGSOFT');
$D = db('');
    $user = $D -> setbiao('user') -> where( 
        array( 
            "uid" => $_SESSION['uid'], 
        ) 
    ) -> find();


?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title><?php echo $shezhi['title'] ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.2, user-scalable=0">
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="yes" name="apple-touch-fullscreen" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta content="telephone=no,email=no" name="format-detection">
    <link rel="stylesheet" href="/wabao/reset.css"/>
    <link rel="stylesheet" href="/wabao/style.css?3223"/>
    <script type="text/javascript" src="/wabao/jquery.min.js"></script>
    <script type="text/javascript" src="/wabao/layer.js"></script>
</head>

<script type="text/javascript">
jQuery.divselect = function(divselectid) {
	$(divselectid+" cite").click(function(){
		var ul = $(divselectid+" ul");
		if(ul.css("display")=="none"){
			ul.show();
		}else{
			ul.hide();
		}
	});
	$(divselectid+" ul li a").click(function(){
		var txt = $(this).text();
		$(divselectid+" cite").html(txt);
		var value = $(this).attr("selectid");
		$(divselectid+" ul").hide();
		$.post("/site/paihang",{
			"n" : value
		},
		function(html){
			$("#home").hide();
			$("#ajax").show();
			$("#ajax").html(html);
		});
	});
};
$(function(){
	$.divselect("#divselect");
	var n=$("#ph_n").val();
	var n_text=$("#b_"+n).text();
	$("#cite").html(n_text);

});
</script>
<input type="hidden" id="ph_n" value="0" />
<header class="header-ranking">
	<div class="tab">
		<span class="active" data="1">挖包达人榜</span>


        <!-- <span data="2">邀请达人榜</span> -->
		<div class="ranking-rule"><img src="/wabao/ranking-rule.png"></div>
		<!-- <div class="select">
			<div id="divselect">
				<cite id="cite">今日榜</cite>
				<ul>
					<li selectid><a href="javascript:void(0);" id="b_0" selectid="0">今日榜</a></li>
					<li ><a href="javascript:void(0);" id="b_1" selectid="1">昨日榜</a></li>
					<li ><a href="javascript:void(0);" id="b_2" selectid="2">前日榜</a></li>
				</ul>
			</div>
		</div> -->
	</div>
	<!-- <div class="tips">数据实时更新，上榜奖励将在凌晨00:00-00:59发放至账户</div> -->
	<div class="my" id="t1">
        <div class="l">


        <?php 
            
        if ($user['touxiang']!='') {
                ?>
                   <img src="<?php echo $user['touxiang'] ?>">

                <?php
        }else{

        ?>
        <img src="/wabao/tou.png">

        <?php 
            }
        ?>


        </div>
        <div class="r">
            <p class="name"><?php echo $user['name'] ?></p>
            <!--<p class="tips" id="ts">您还没有上挖包达人榜！</p>-->
        </div>
        <div class="n"><?php echo $user['jine'] ?></div>
    </div>
    
    <div class="my" id="t2" style="display: none;">
        <div class="l">
        <?php 
            
        if ($user['touxiang']=='') {


        ?>
        <img src="/wabao/tou.png">

        <?php 
            }else{?>

              <img src="<?php echo $user['touxiang'] ?>">
            <?php

            }
        ?>

        </div>
        <div class="r">
            <p class="name"><?php echo $user['name'] ?></p>
    <!--        <p class="tips" id="ts">您还没有上邀请达人榜！</p>-->
        </div>

        <?php 
            
        /*查询下线*/
        $order = '  ';
        $tiaojian = array(
            'tuid' => $_SESSION['uid'],
            );
        $rs = $D -> setbiao('user') -> order(  )->where( $tiaojian )-> select();



        ?>

        <div class="n">0人</div>	
    </div>
</header>
<div class="ranking-list" id="l1">
<ul>

<?php 
    

    $order = '  ';
    $users = $D -> setbiao('user') -> order(  ' jine desc' )->where( 
        array(
            
        )
    )-> limit('10')-> select();


    if (is_array($users)) {



        $yy = 0;
        foreach($users as  $k => $v){
            $yy = $yy+1;

?>


	<li id="wa_59030f23618bfac72fdb3cff">
    	<em class="a1"><?php echo $yy ?></em>
    	<div class="l">
        <?php 
            
        if ($v['touxiang']) {
            ?>

             <img src="<?php echo $v['touxiang'] ?>">

            <?php
            
        }else{

        ?>
        
        <img src="/wabao/tou.png">
        
        <?php 
            }
        ?>



        </div>
        <div class="r">
            <p class="name"><?php echo $v['name'] ?></p>
            <p class="tips">奖： <?php echo $v['jinchan'] ?>金、 <?php echo $v['yinchan'] ?>银、 <?php echo $v['tongchan'] ?>铜、 <?php echo $v['tiechan'] ?>铁铲子&nbsp;</p>
		</div>
        <div class="n">
            <p class="h"><?php echo $v['jine'] ?></p>
            <p class="ts">第 <?php echo $yy ?> 名</p>
        </div>		
	</li>
	
	   
	
	<?php 
     }   
    ?>
	
	
	
	
	


    <?php 
        }
    ?>

</ul>
</div>
<div class="ranking-list" id="l2" style="display: none;">
<ul>


    <?php 
        

        if (is_array($rs)) {
            foreach($rs as  $k => $v){
    ?>

	<li id="yao_5903cfe1618bfaa82cdb4303">
    	<em class="a1">1</em>
    	<div class="l">
        <?php 

        if ($v['touxiang']=='') {
            ?>
             <img src="/wabao/tou.png">
            <?php

        }else{
            ?>

             <img src="<?php echo $v['touxiang'] ?>">
            <?php

        }

        ?>
       


        </div>
        <div class="r">
            <p class="name"><?php echo $v['name'] ?></p>
            <p class="tips">奖： <?php echo $v['jinchan'] ?> 金、 <?php echo $v['yinchan'] ?>银、 <?php echo $v['tongchan'] ?>铜、 <?php echo $v['tiechan'] ?>铁铲子&nbsp;</p>
		</div>
        <div class="n">
            <p class="h">33人</p>
            <p class="ts">第1名</p>
        </div>		
	</li>


    <?php 
        }
    }
    ?>


	
	
	
	
	
	
	
	
	
</ul>
</div>
<script type="text/javascript">
// 排行榜切换
$(".header-ranking .tab span").each(function() {
	var p = $(this);
	var data = p.attr("data");
	p.click(function() {
		$(".header-ranking .tab span.active").removeClass('active');
		p.addClass('active');
		$(".header-ranking .my").hide();
		$("#t" + data).show();
		$(".ranking-list").hide();
		$("#l" + data).show();
	});
});


</script>


    <?php

    $lan = 'paihang';
     include QTPL.'foot.php';?>