<?
include "cnn.php";
?>
<script>
function AbreMenu(nome_div)
{
var div = "";
var menus = 3;
	for (var i=1; i < menus; i++)
	{
	div = "div"+i;
	document.getElementById(div).style.display = "none"; 
		if (div == nome_div)
		{
		document.getElementById(nome_div).style.display = "block"; 
		}
	}
}
</script>
<style type="text/css">
<!--
.style1 {	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>

<h1>Ranking Resets</h1>
<p class='post-footer'>
<a href="javascript:AbreMenu('div1')">Ranking de Personagens</a>&nbsp;|
<a href="javascript:AbreMenu('div2')">Ranking de Guilds</a></p>

<p class=''><form action='index.php?go=csearch' method='post'>
Char:
<input type="text" id="char" size="14" name="char" value="nome do char" maxlength="20" onFocus="clearText(this)">
<input type="submit"  name="submit" value="pesquisar">
</form>  &nbsp;</p>
<div class='post-footer' id='div1' style='display:none'>
<a href='?go=ranres&top=10'>Resets</a>&nbsp;|
<a href='?go=ranlev&top=10'>Level</a>&nbsp;|
<a href='?go=ranpk&top=10'>PK (Mortes)</a>&nbsp;|
<a href='?go=ranmr&top=10'>Master Reset</a>&nbsp;|
<a href='?go=rankmed'>Medalhas</a></div>
<div class='post-footer' id='div2' style='display:none'>
<a href='?go=rangui&top=10'>Pontos (Wars Ganhos)</a>
</div>
<div class="quadros">
<input name="button" type='button' class='submit' onClick="location='?go=ranres&top=10'" value='Top 10'>
<input name="button" type='button' class='submit' onClick="location='?go=ranres&top=30'" value='Top 30'>
<input name="button" type='button' class='submit' onClick="location='?go=ranres&top=50'" value='Top 50'>
<input name="button" type='button' class='submit' onClick="location='?go=ranres&top=100'" value='Top 100'>
<input name="button" type='button' class='submit' onClick="location='?go=ranres&top=300'" value='Top 300'>
<input name="button" type='button' class='submit' onClick="location='?go=ranres&top=500'" value='Top 500'>
<table border='0' width='100%'>
<tr>
<td bgcolor='#cccccc' align='center'><strong>#</strong></td>
<td bgcolor='#cccccc' align='center'><strong>Char</strong></td>
<td bgcolor='#cccccc' align='center'><strong>Level</strong></td>
<td bgcolor='#cccccc' align='center'><strong>Mortes</strong></td>
<td bgcolor='#cccccc' align='center'><strong>Classe</strong></td>
<td bgcolor='#B4B4B4' align='center'><strong>Resets</strong></td>
<td bgcolor='#cccccc' align='center'><strong>Status Conta</strong></td>
</tr>
<?
  $Query = mssql_query ("select top $top PkCount,name,clevel,resets,class,AccountID from character where ctlcode=0 or ctlcode=null order by Resets desc");
  for($i=0;$i<mssql_num_rows($Query);$i++) {
  $rank = $i+1;
  $Array = mssql_fetch_row($Query);
$query_check_condi = mssql_query("SELECT vip FROM MEMB_INFO WHERE memb___id='$Array[5]'");
$check_condi = mssql_fetch_row($query_check_condi);

if ($check_condi[0] == 0) { $condi = "<strong>Free</strong>"; }
if ($check_condi[0] == 1) { $condi = "<strong>Vip Silver</strong>"; }
if ($check_condi[0] == 2) { $condi = "<strong>Vip Gold</strong>"; }
  switch($Array[4]) {
case 0: $classefinal = "Dark Wizard"; break;
case 1: $classefinal = "Soul Master"; break;
case 16: $classefinal = "Dark Knight"; break;
case 17: $classefinal = "Blade Knight"; break;
case 32: $classefinal = "Elf"; break;
case 33: $classefinal = "Muse Elf"; break;
case 48: $classefinal = "Magic Gladiator"; break;
case 64: $classefinal = "Dark Lord"; break;
case 65: $classefinal = "Lord Emperor"; break;
case 2: $classefinal = "Grand Master"; break;
case 18: $classefinal = "Blade Master"; break;
case 49: $classefinal = "Duel Master"; break;
case 34: $classefinal = "High Elf"; break;
case 80: $classefinal = "Summoner"; break;
case 81: $classefinal = "Blood Summoner"; break;
case 82: $classefinal = "Dimension Master"; break;

}
?>
<tr>
<td align="center" bgcolor="#E5E5E5"><?=$rank?></td>
<td align="center"><a href="index.php?go=cbusca&char=<?=$Array[1]?>"><strong><?=$Array[1]?></strong></td>
<td align="center"><?=$Array[2]?></td>
<td align="center"><?=$Array[0]?></td>
<td align="center"><?=$classefinal?></td>
<td align="center"><strong><?=$Array[3]?></strong></td>
<td align="center"><?=$condi?></td>
</tr>
<? } ?>
</table>
</div>
