<div class="primary-block">
<?php include('templates/rank/rankrs_top.tpl'); ?>
	<div class="main-content">
		<h1 class="title-content">Xếp hạng Tiêu Phí</h1>
        <div class="intro-content">
            <div class="in-20">
                <span class="color-violet">Xếp hạng Theo Số tiền tiêu trên Web theo thứ tự (Gcoin > Vpoint > Gcoin_KM)</span><br />
            </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 <? if(!isset($_GET['type']) || $_GET['type'] == 'ALL') echo 'class="active"'; ?> ><a href="#rank&act=rank_tieuphi&type=ALL" rel="ajax">TOP ALL</a></li>
			<li <? if(!isset($_GET['type']) || $_GET['type'] == 'NOW') echo 'class="active"'; ?> ><a href="#rank&act=rank_tieuphi&type=NOW" rel="ajax">TOP Ngày <? echo $date_now; ?></a></li>
			<li <? if(!isset($_GET['type']) || $_GET['type'] == 'YESTERDAY') echo 'class="active"'; ?> ><a href="#rank&act=rank_tieuphi&type=YESTERDAY" rel="ajax">TOP Ngày <? echo $date_yesterday; ?></a></li>
		</ul>
	</div>
</div>
	<div class="in-20 font-14 text-semibold">
		<p class="update-time"><span class="color-red">Cập nhập lúc:</span> <span class="color-brown"><? echo date('H:i d/m/Y', $time_host); ?><span class="color-red"> <span class="color-red">( 5 phút cập nhập 1 lần )</span></p>
        
        <? if(!isset($_GET['type']) || $_GET['type'] == 'ALL') { ?>
		<p class="update-time in-10">
			<center><b><font color="red">TOP Tiêu Phí ALL</font></b></center><br>
		</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>Tiêu Phí (Tổng)</th>
                    <th>Relife / Reset</th>
                    <th>Lớp nhân vật</th>
				</tr>
			</thead>
			<tbody>
			<? for($i=0;$i<$slg_TopTieuPhi_ALL;$i++) { 
				$top = $i+1;
				if($top==1){$top='<img src="images/icons/top/1.png" width="80px"/>';}
				if($top==2){$top='<img src="images/icons/top/2.png" width="60px"/>';}
				if($top==3){$top='<img src="images/icons/top/3.png" width="55px"/>';}
			?>
			<tr>
				<td align="center"><? echo $top; ?></td>
				<td align="center"><? echo $TopTieuPhi['ALL'][$i]['Name']; ?></td>
				<td align="center"><? echo $TopTieuPhi['ALL'][$i]['Gcoin']+$TopTieuPhi['ALL'][$i]['Vpoint']+$TopTieuPhi['ALL'][$i]['Gcoin_KM']; ?></td>
				<td align="center"><? echo $TopTieuPhi['ALL'][$i]['Relife']; ?>/<? echo $TopTieuPhi['ALL'][$i]['Reset']; ?></td>
				<td align="center"><? echo $TopTieuPhi['ALL'][$i]['Class']; ?></td>
			</tr>
			<? } ?>
			</tbody>
		</table>
        
        <? } elseif(!isset($_GET['type']) || $_GET['type'] == 'NOW') { ?>
		<p class="update-time in-10">
			<center><b><font color="red">TOP Tiêu Phí Ngày <? echo $date_now; ?></font></b></center><br>
		</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>Tiêu Phí (Tổng)</th>
                    <th>Relife / Reset</th>
                    <th>Lớp nhân vật</th>
				</tr>
			</thead>
			<tbody>
			<? for($i=0;$i<$slg_TopTieuPhi_Daily_NOW;$i++) { 
				$top = $i+1;
				if($top==1){$top='<img src="images/icons/top/1.png" width="80px"/>';}
				if($top==2){$top='<img src="images/icons/top/2.png" width="60px"/>';}
				if($top==3){$top='<img src="images/icons/top/3.png" width="55px"/>';}
			?>
			<tr>
				<td align="center"><? echo $top; ?></td>
				<td align="center"><? echo $TopTieuPhi['NOW'][$i]['Name']; ?></td>
				<td align="center"><? echo $TopTieuPhi['NOW'][$i]['Gcoin']+$TopTieuPhi['NOW'][$i]['Vpoint']+$TopTieuPhi['NOW'][$i]['Gcoin_KM']; ?></td>
				<td align="center"><? echo $TopTieuPhi['NOW'][$i]['Relife']; ?>/<? echo $TopTieuPhi['NOW'][$i]['Reset']; ?></td>
				<td align="center"><? echo $TopTieuPhi['NOW'][$i]['Class']; ?></td>
			</tr>
			<? } ?>
			</tbody>
		</table>
        
        <? } elseif(!isset($_GET['type']) || $_GET['type'] == 'YESTERDAY') { ?>
		<p class="update-time in-10">
			<center><b><font color="red">TOP Tiêu Phí Ngày <? echo $date_yesterday; ?></font></b></center><br>
		</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>Tiêu Phí (Tổng)</th>
                    <th>Relife / Reset</th>
                    <th>Lớp nhân vật</th>
				</tr>
			</thead>
			<tbody>
			<? for($i=0;$i<$slg_TopTieuPhi_Daily_YESTERDAY;$i++) { 
				$top = $i+1;
				if($top==1){$top='<img src="images/icons/top/1.png" width="80px"/>';}
				if($top==2){$top='<img src="images/icons/top/2.png" width="60px"/>';}
				if($top==3){$top='<img src="images/icons/top/3.png" width="55px"/>';}
			?>
			<tr>
				<td align="center"><? echo $top; ?></td>
				<td align="center"><? echo $TopTieuPhi['YESTERDAY'][$i]['Name']; ?></td>
				<td align="center"><? echo $TopTieuPhi['YESTERDAY'][$i]['Gcoin']+$TopTieuPhi['YESTERDAY'][$i]['Vpoint']+$TopTieuPhi['YESTERDAY'][$i]['Gcoin_KM']; ?></td>
				<td align="center"><? echo $TopTieuPhi['YESTERDAY'][$i]['Relife']; ?>/<? echo $TopTieuPhi['YESTERDAY'][$i]['Reset']; ?></td>
				<td align="center"><? echo $TopTieuPhi['YESTERDAY'][$i]['Class']; ?></td>
			</tr>
			<? } ?>
			</tbody>
		</table>
        
        <? } ?>
	</div>

</div>