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


	if ($ank['rating']>=6 && $ank['rating']<=11){echo " <img src='/style/medal/1.png' alt=''/>";}

	if ($ank['rating']>=12 && $ank['rating']<=19){echo " <img src='/style/medal/2.png' alt=''/>";}

	if ($ank['rating']>=20 && $ank['rating']<=27){echo " <img src='/style/medal/3.png' alt=''/>";}

	if ($ank['rating']>=28 && $ank['rating']<=37){echo " <img src='/style/medal/4.png' alt=''/>";}

	if ($ank['rating']>=38 && $ank['rating']<=47){echo " <img src='/style/medal/5.png' alt=''/>";}

	if ($ank['rating']>=48 && $ank['rating']<=59){echo " <img src='/style/medal/6.png' alt=''/>";}

	if ($ank['rating']>=60 && $ank['rating']<=9999999){echo " <img src='/style/medal/7.png' alt=''/>";}

}
?>
