<?php
if ( $__TOKEN == 'ILoveAthensFiestaReallyBad' )
{
	echo '<h1>Top players</h1>';
	$mssql_link = mssql_connect( '.\SQLEXPRESS', 'sa', 'Password' );
	if ( !$mssql_link )
	{
		showMessage( 'info', 'Top is temporarly offline' );
	}
	else
	{
		$selectPlayers = mssql_query( "SELECT TOP 100 sID, nLevel, nFame FROM World00_Character..tCharacter WHERE nAdminLevel = 0 AND bDeleted = 0 ORDER by nLevel DESC" );
		$i = 1;
		echo '<table width="100%">';
		echo '<tr><th>#</th><th>Name</th><th>Fame</th><th>Level</th></tr>';
		while ( $player = mssql_fetch_array( $selectPlayers ) )
		{
			echo '<tr><td width="20px">'.$i.'</td><td>'.$player['sID'].'</td><td>'.$player['nFame'].'</td><td>'.$player['nLevel'].'</td></tr>';
			$i++;
		}
		echo '</table>';
	}
}
?>