<div class="primary-block out-top-20">
    <div class="main-content">
        <ul class="tabs-content">
		<? if ($rank_rs1 == 1){ ?>
			<li <? if(!$_GET['act'] || ($_GET['act']=='rankrs' && $_GET['action']=='daily' && $_GET['type']=='all')) echo 'class="active"'; ?>><a href="#rank&act=rankrs&action=daily&type=all" rel="ajax">BXH Reset 1</a></li>
		<? } if ($rank_rs2 == 1){ ?>
			<li <? if(!$_GET['act'] || ($_GET['act']=='rankrs2' && $_GET['action']=='daily' && $_GET['type']=='all')) echo 'class="active"'; ?>><a href="#rank&act=rankrs2&action=daily&type=all" rel="ajax">BXH Reset 2</a></li>
		<? } if ($rank_rs3 == 1){ ?>	
			<li <? if(!$_GET['act'] || ($_GET['act']=='rankrs3' && $_GET['action']=='daily' && $_GET['type']=='all')) echo 'class="active"'; ?>><a href="#rank&act=rankrs3&action=daily&type=all" rel="ajax">BXH Reset 3</a></li>
		<? } if ($rank_0h == 1){ ?>
			<li <? if($_GET['act']=='rank50') echo 'class="active"'; ?>><a href="#rank&act=rank50" rel="ajax">TOP 0h</a></li>
		<? } if ($rank_all == 1){ ?>
			<li <? if($_GET['act']=='ranking') echo 'class="active"'; ?>>
                <a href="#rank&act=ranking" rel="ajax">TOP tất cả</a>
                <div class="submenu">
                    <p <? if($_GET['act']=='ranking' && $_GET['type'] == 'all') echo 'class="active"'; ?>><a href="#rank&act=ranking" rel="ajax" >TOP ALL</a></p>
                    <p <? if($_GET['act']=='ranking' && $_GET['type'] == 'DW') echo 'class="active"'; ?>><a href="#rank&act=ranking&type=DW" rel="ajax" >DW</a></p>
                    <p <? if($_GET['act']=='ranking' && $_GET['type'] == 'DK') echo 'class="active"'; ?>><a href="#rank&act=ranking&type=DK" rel="ajax" >DK</a></p>
                    <p <? if($_GET['act']=='ranking' && $_GET['type'] == 'ELF') echo 'class="active"'; ?>><a href="#rank&act=ranking&type=ELF" rel="ajax" >ELF</a></p>
                    <? if(!isset($mg_use) || $mg_use == 1) { ?>
                    <p <? if($_GET['act']=='ranking' && $_GET['type'] == 'MG') echo 'class="active"'; ?>><a href="#rank&act=ranking&type=MG" rel="ajax" >MG</a></p>
                    <? } ?>
                    <? if(!isset($dl_use) || $dl_use == 1) { ?>
                    <p <? if($_GET['act']=='ranking' && $_GET['type'] == 'DL') echo 'class="active"'; ?>><a href="#rank&act=ranking&type=DL" rel="ajax" >DL</a></p>
                    <? } ?>
                    <? if(!isset($sum_use) || $sum_use == 1) { ?>
                    <p <? if($_GET['act']=='ranking' && $_GET['type'] == 'SuM') echo 'class="active"'; ?>><a href="#rank&act=ranking&type=SuM" rel="ajax" >SUM</a></p>
                    <? } ?>
                    <? if(!isset($rf_use) || $rf_use == 1) { ?>
                    <p <? if($_GET['act']=='ranking' && $_GET['type'] == 'RF') echo 'class="active"'; ?>><a href="#rank&act=ranking&type=RF" rel="ajax" >RF</a></p>
                    <? } ?>
                </div>
            </li>
		<? } if ($rank_other == 1){ ?>
            <li <? if($_GET['type']=='rank_other') echo 'class="active"'; ?>>
                <a href="#" rel="ajax">TOP khác</a>
                <div class="submenu">
				<? if ($rank_pcp == 1){ ?>
                    <p <? if($_GET['act']=='rank_pcpoint' && $_GET['type'] == 'rank_other') echo 'class="active"'; ?>><a href="#rank&act=rank_pcpoint&type=rank_other" rel="ajax" >TOP PCPoint</a></p>
				<? } if ($rank_master == 1){ ?>
					<p <? if($_GET['act']=='rank_master' && $_GET['type'] == 'rank_other') echo 'class="active"'; ?>><a href="#rank&act=rank_master&type=rank_other" rel="ajax" >TOP Master</a></p>
				<? } if ($rank_pk == 1){ ?>
					<p <? if($_GET['act']=='rank_pk' && $_GET['type'] == 'rank_other') echo 'class="active"'; ?>><a href="#rank&act=rank_pk&type=rank_other" rel="ajax" >TOP Phong Thần</a></p>
				<? } if ($rank_gp == 1){ ?>
					<p <? if($_GET['act']=='rank_gp' && $_GET['type'] == 'rank_other') echo 'class="active"'; ?>><a href="#rank&act=rank_gp&type=rank_other" rel="ajax" >TOP Guild Point</a></p>
				<? } if ($rank_tieuphi == 1){ ?>
					<p><a href="#rank&act=rank_tieuphi&type=ALL" rel="ajax" >TOP Tiêu Phí</a></p>
				<? } ?>
                </div>
            </li>
		<? } ?>
        </ul>
    </div>

<div>
    <? if(isset($err)) echo "<center><font color='red'><b>$err</b></font></center>"; ?>
</div>

</div>

<?
if(!isset($_GET['action'])) $_GET['action'] = 'daily';
if(!isset($_GET['type'])) $_GET['type'] = 'all';

$thehe_count = count($thehe_choise);
if ($thehe_choise && $thehe_count > 2)
{
    $thehe_check = 0;
    for($i=0; $i<$thehe_count; $i++) {
        if(strlen($thehe_choise[$i]) > 0) $thehe_check++;
    }
}
    
if($thehe_check > 1) {
    echo "<br /><br /><table align='center' width='90%' border='0'> <tr>";
    for($i=$thehe_count-1;$i>0;$i--)
    {
        if(strlen($thehe_choise[$i]) > 0) {
            echo "<td align='center'>";
            if($_SESSION['thehe'] == $i ) echo '<a class="btn btn-green btn-lg" href="javascript:;" disabled="disabled"><b>';
            else echo '<a class="btn btn-green btn-lg" href="#rank&act='. $_GET['act'] .'&action='. $_GET['action'] .'&type='. $_GET['type'] .'&thehe='.$i.'" rel="ajax">';
            
            echo $thehe_choise[$i];
            
            if($_SESSION['thehe'] == $i ) echo "</b></a>";
            else echo '</a>';
            
            echo "</td>";
        }
    }
        echo "</tr> </table>";
}
    
    $style_active_begin = "<b><font color='red'>";
            $style_active_end = "</font></b>";

?>