<?php
if($__TOKEN = "hardcodeshitbykernstudios"){
echo '<h2 class="bg-h2-1 bot">Top 100 Guilds</h2>';
$conn = sqlsrv_connect($__CONFIG['SQLHost'], array("Database"=>$__CONFIG['SQLDB'], "UID"=>$__CONFIG['SQLUID'], "PWD"=>$__CONFIG['SQLPWD']));
	if(!$conn){
		echo print_r(sqlsrv_errors(), true);
	}else{
		
		echo '<center><table width="550px">';
		echo '<tr><th>#</th><th>Name</th><th>Win</th><th>Lose</th><th>Draw</th></tr>';
		$i = 1;
		$getGuild = sqlsrv_query($conn, "SELECT TOP 100 sName, nWarWinCount, nWarLoseCount, nWarDrawCount FROM w00_Character..tGuild ORDER BY nWarWinCount DESC;", array());
		while($fetchGuild = sqlsrv_fetch_array($getGuild)){
			echo '<tr><th>'.$i.'</th><th>'.utf8_encode($fetchGuild['sName']).'</th><th>'.$fetchGuild['nWarWinCount'].'</th><th>'.$fetchGuild['nWarLoseCount'].'</th><th>'.$fetchGuild['nWarDrawCount'].'</th></tr>';
			$i++;
		}
		echo '</table></center>';
	}
}
?>