<?
function medal($user = 0)
{
	$ank = mysql_fetch_array(mysql_query("SELECT `balls` FROM `user` WHERE `id` = $user LIMIT 1"));
	
	$img = 0;

	if ($ank['balls'] >= 3000 && $ank['balls'] <= 7000)
		$img = 1;
		
	elseif ($ank['balls'] >= 7001 && $ank['balls'] <= 15000)
		$img = 2;

	elseif ($ank['balls'] >= 15001 && $ank['balls'] <= 99999999999)
		$img = 3;
	
	if ($img != 0)
	{
		return ' <img src="/style/medal/' . $img . '.gif" alt="Tw1nGo" />';
	}
}
?>
