<!doctype html>
<html lang="en">
<head>
	<meta charset="<?php echo ODZ_CHARSET;?>">
	<title>邀请排行</title>
	<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
	<meta content="telephone=no" name="format-detection" />
	<link rel="stylesheet" href="assets/invite/css/invite_style.css">
	<script type="text/javascript" src="assets/invite/js/jquery-1.8.3.min.js"></script>	
    <script type="text/javascript" src="assets/js/fastclick.js"></script>
</head>

<body>
	<ul class="haoyou_rank">
    
        <?php if(!empty($rank)):?>
            <?php foreach($rank as $key => $val):?>
                <li onclick="lbsPerson(<?php echo $val['uid'];?>)">

                    <p class="rank_num"> 
                        <?php if($page == 1 && $val['rank'] == 1):?>
                            <img src="assets/invite/images/no1.png" alt="">
                        <?php elseif($page == 1 && $val['rank'] == 2):?>
                            <img src="assets/invite/images/no2.png" alt="">
                        <?php elseif($page == 1 && $val['rank'] == 3):?>
                            <img src="assets/invite/images/no3.png" alt="">
                        <?php else:?>
                            <span><?php echo $val['rank'];?></span>
                        <?php endif;?>
                    </p>
                    <div class="rank_btmx">
                        <a href="javascript:void(0);"  class="user-hd">
                            <?php echo avatar($val['uid']);?>                           
                        </a>
                        <div class="user-txt">
                        <a href="javascript:void(0);"  class="user-txt-name namecolor"><?php echo $val['username'];?></a>
                        <?php echo usergruop_level($val['uid'], 1);?>
                                <p class="user-txt_p">邀请&nbsp;<?php echo $val['invite_num'];?>&nbsp;人</p>
                        </div>
                    </div>
                
                </li>
            <?php endforeach;?>
        <?php endif;?>

	</ul>
	<div class="my_rank" onclick="lbsPerson(<?php echo $my_rank['uid'];?>)">
			<p class="rank_num"> <span><?php echo $my_rank['rank'];?></span></p>
			<div class="rank_btmx">
				<a href="javascript:void(0);"  class="user-hd">
                   <?php echo avatar($my_rank['uid']);?>                  
                </a>
                <div class="user-txt">
                <a href="javascript:void(0);"  class="user-txt-name namecolor"><?php echo $my_rank['username'];?></a>
                <?php echo usergruop_level($my_rank['uid'], 1);?>
                    <p class="user-txt_p">邀请&nbsp;<?php echo $my_rank['invite_num'];?>&nbsp;人</p>
                </div>
			</div>
	</div>
</body>

<script>
    $(function(){
        new FastClick(document.body);
    })
    $(window).scroll(function () {
        var scrollTop = $(this).scrollTop();
        var scrollHeight = $(document).height();
        var windowHeight = $(this).height();
        var page = "<?php echo $page+1;?>";
        var url = "<?php echo $_G['baseurl'].$_G['mocuz_config']['mocuz_type']."/index.php?mod=invite&end_rank=$end_rank&action=rank&page="?>";
        var url = url +page;
        
        var total_page = "<?php echo $total_page;?>";

        if (scrollTop + windowHeight == scrollHeight) {  
            // return false;  
            if(parseInt(page) > parseInt(total_page)){
                return false;
            }
            window.location.href = url;

        }
    });
        // 浏览器类型检测代码
    var MocuzMobile = {
        Android: function() {
            return /Android/i.test(navigator.userAgent);
        },
        BlackBerry: function() {
            return /BlackBerry/i.test(navigator.userAgent);
        },
        iOS: function() {
            return /iPhone|iPad|iPod/i.test(navigator.userAgent);
        },
        Windows: function() {
            return /IEMobile/i.test(navigator.userAgent);
        },
        any: function() {
            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
        }
    };
        //跳转个人中心
    function lbsPerson(user_id){
        var user_id = '{"user_id":' + user_id + '}';
        if(MocuzMobile.Android()) {
            window.myjs.lbsPerson(user_id);//android
            return;
        }
        if(MocuzMobile.iOS()) {
            var cmd = "lbsPerson";
            window.location.href="objc://"+cmd+":/"+user_id;
            return;
        }
    }
</script>
</html>