<div class="primary-block">
    <div class="main-content">
        <h1 class="title-content">Xếp hạng Phúc Lợi</h1>
        <div class="intro-content">
            <div class="in-20">
<?
if(!isset($_GET['action'])) $_GET['action'] = 'daily';
if ($thehe_choise)
{
    echo "<table> <tr>";
    for($i=count($thehe_choise)-1;$i>0;$i--)
    {
        if(strlen($thehe_choise[$i]) > 0) {
            echo "<span class='tag tag-red'>";
            if($_SESSION['thehe'] == $i );
                else echo '<a href="#rank&act=rank_phucloi&action='. $action .'&thehe='.$i.'" rel="ajax">';
            echo $thehe_choise[$i];
            if($_SESSION['thehe'] == $i );
                else echo "</a>";
            echo "</span>";
        }
    }
    echo "</tr> </table>";
}
?>
            </div>
        </div>
    </div>
</div>



<div class="primary-block out-top-20">
<div class="primary-block out-top-20">
    <div class="main-content">
        <ul class="tabs-content">
            <li class="active">
                <a href="#rank&act=rank_phucloi" rel="ajax">Phúc Lợi</a><p></p>
				<div class="submenu">
				
				<p <? if($_GET['action']=='daily') echo 'class="active"'; ?>><a href="#rank&act=rank_phucloi&action=daily" rel="ajax">Ngày</a></p>
				<p <? if($_GET['action']=='week') echo 'class="active"'; ?>><a href="#rank&act=rank_phucloi&action=week" rel="ajax">Tuần</a></p>
				<p <? if($_GET['action']=='month') echo 'class="active"'; ?>><a href="#rank&act=rank_phucloi&action=month" rel="ajax">Tháng</a></p>
				</div>
            </li>
        </ul>
    </div>

<div>
    </div>

</div>
<div class="in-20 font-14 text-semibold">

<? if(isset($err)) echo "<center><font color='red'><b>$err</b></font></center>"; ?>
<p class="update-time"><span class="color-red">Cập nhập lúc:</span> <span class="color-brown"><? echo $time_top; ?><span class="color-red"> <span class="color-red">( 5 phút cập nhập 1 lần )</span></span></span></p>

    <? 
        foreach($rank as $key => $val) {
    ?>
	<div class="out-top-20">
				<p class="in-10">
                <span class="color-blue"><? echo $title_top[$key]; ?></span>
            </p>
        <table class="table table-blue-white table-border-2 table-text-center table-sort">
		  <thead>
		  <tr>
		    <th>#</th>
		    <th>Nhân vật</th>
		    <th>Điểm Phúc Lợi</th>
		  </tr>
		  </thead>
<? foreach($val as $key2 => $val2) { ?>
		<tbody>
		  <tr>
		    <td align="center"><? echo $key2+1; ?></td>
		    <td align="center"><? echo $val2['name']; ?></td>
		    <td align="center"><? echo $val2['plpoint']; ?></td>
		  </tr>
		</tbody>
<? } ?>
		</table>
		</div>
    <? 
        }
    ?>
</div>
</div>
<!-- End Content -->