<a class="custom_button" href="javascript: void(0);" onclick="loading('?go=dl1', 'result');">TOP [10]</a> | 

<a class="custom_button" href="javascript: void(0);" onclick="loading('?go=dl2', 'result');">TOP [30]</a> |

<a class="custom_button" href="javascript: void(0);" onclick="loading('?go=dl3', 'result');">TOP [50]</a> 
                
                
                
                <br><br><table class="ranking-table">
                            <thead>
                            <tr class="main-tr">
                                <th style="text-align:center;">Posicao</th>
                                <th style="text-align:center;">Nome</th>
                                <th style="text-align:center;">Classe</th>
                                <th style="text-align:center;">Level</th>
                               
                                    <th style="text-align:center;"><font color="#bb883b">Resetes</font></th>
                               
                                    <th style="text-align:center;">M.Resetes</th>
                              
                               
                                <th style="text-align:center;">Guild</th>
                                <th style="text-align:center;"
                                    class="end">Vitorias</th>
                                    <th style="text-align:center;"
                                    class="end">Derrotas</th>
                            </tr>
                            </thead>
                            <tbody>
						
						
						<?
						$Query = mssql_query("select top 10 name,clevel,resetcount,strength,dexterity,vitality,energy,class,masterresetcount,kills,deads AccountID from character WHERE class= 64 and resetcount < 500 order by masterresetcount desc,resetcount desc,clevel desc");
						for($i=0;$i<mssql_num_rows($Query);$i++) 
						{
							
							$rank = $i+1;
  							$Array = mssql_fetch_row($Query);
  							$Pega_Guild = mssql_query("select G_Name from GuildMember where Name='".$Array[0]."'");
							$Guild = mssql_num_rows($Pega_Guild);
  							if($Guild <= 0) { $Guild_[0]='--';}
  							elseif($Guild > 0) { $Guild_ = mssql_fetch_row($Pega_Guild);}
							
						
							switch($Array[7]) 
							{
case 0: $classefinal  = 'DARK WIZARD' ;		break;
case 1: $classefinal  = 'SOUL MASTER' ;		break;
case 2: $classefinal  = 'G.MASTER' ;		break;
case 16: $classefinal = 'DARK KNIGHT' ;		break;
case 17: $classefinal = 'BLADE KNIGHT' ;		break;
case 18: $classefinal = 'BLADE MASTER' ;		break;
case 32: $classefinal = 'ELF';		break;
case 33: $classefinal = 'MUSE ELF';		break;
case 34: $classefinal = 'HIGH ELF';	break;
case 48: $classefinal = 'M.GLADIADOR';		break;
case 50: $classefinal = 'DUEL MASTER';		break;
case 49: $classefinal = 'DUEL MASTER';		break;
case 64: $classefinal = 'DARK LORD';		break;
case 65: $classefinal = 'LORD';		break;
case 66: $classefinal = 'L.EMPEROR';	break;
case 80: $classefinal = 'SUMONER';		break;
case 81: $classefinal = 'B.SUMONER';		break;
case 96: $classefinal = 'R.FIGHTER';		break;
case 98: $classefinal = 'F.MASTER';		break;
							}
							?>
							<tr>
                <td width="9%" height="20"><div align="left">
                    <?=$rank?>
                </div></td>
                <td width="10%"><strong> <a href="javascript: void(0);" onclick="loading('?go=char&name=<?=$Array[0]?>', 'conteudo');"><?=$Array[0]?></a>
                </strong></td>
                <td width="14%"><div align="left">
                  <?=$classefinal?>
                </div></td>
                <td width="7%"><div align="left">
                    <?=$Array[1]?>
                </div></td>
                <td align="center" width="9%"><font color="#6C0"><?=$Array[2]?></font></td>
                <td align="center" width="11%"><?=$Array[8]?></td>
               
                <td align="center" width="9%"><font color="#0000FF">
                    
                    <a href="javascript: void(0);" onclick="loading('?go=guild&g_name=<?=$Guild_[0]?>','conteudo');"><?=$Guild_[0]?></a>
                    
                </font></td>
                <td align="center" width="11%"><?=$Array[9]?></td>
                <td align="center" width="11%"><?=$Array[10]?></td>
              </tr>
							<? } ?>
							
							
							
						
						</tbody>
                        </table>