<?
function dostig($level)
{
if($level==5)
{
$img='achievement_brilliant.png';
$text='Бриллиантовый';
}
elseif($level==4)
{
$img='achievement_platina1.png';
$text='Платиновый';
}
elseif($level==3)
{
$img='achievement_gold.png';
$text='Золотой';
}
elseif($level==2)
{
$img='achievement_silver.png';
$text='Серебряный';
}
elseif($level==1)
{
$img='achievement_bronze.png';
$text='Бронзовый';
}
else $img=NULL;
echo "".($img!=NULL?"<img width='16' height='16' src='images/icons/$img' alt='*'> <span>$text</span> ":null)."";
}
echo "<div class='event'><h1>".($ank['id']==$ku['id']?"<a href='?user=$ank[id]'>$anku[nick]</a> / Достижения":"Мои достижения")."</h1></div>";
echo '<div class="content"><div class="block">';
echo "<ul>";
echo "<li><div>";
echo dostig($ank['tdlevel']);
echo "<span>Механизатор</span> <span class='small
minor'>($ank[tdlevel])</span></div><div class='minor small'>Уровень техники: <span class='title'>$ank[tehnika]</span><span class='title'>".($ank['tdlevel']==0?"/10":null)."".($ank['tdlevel']==1?"/40":null)."".($ank['tdlevel']==2?"/65":null)."".($ank['tdlevel']==3?"/90":null)."".($ank['tdlevel']==4?"/120":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['sdlevel']);
echo "<span>Садовод</span> <span class='small minor'>($ank[sdlevel])</span></div><div class='minor small'>Собрано урожаев: <span class='title'>$ank[sadovod]</span><span class='title'>".($ank['sdlevel']==0?"/10":null)."".($ank['sdlevel']==1?"/50":null)."".($ank['sdlevel']==2?"/200":null)."".($ank['sdlevel']==3?"/1000":null)."".($ank['sdlevel']==4?"/2000":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['vdlevel']);
echo "<span>Водолей</span> <span class='small minor'>($ank[vdlevel])</span></div><div class='minor small'>Полито растений: <span
class='title'>$ank[vodoley]</span><span class='title'>".($ank['vdlevel']==0?"/10":null)."".($ank['vdlevel']==1?"/50":null)."".($ank['vdlevel']==2?"/200":null)."".($ank['vdlevel']==3?"/1000":null)."".($ank['vdlevel']==4?"/2000":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['agdlevel']);
echo "<span>Агроном</span> <span class='small minor'>($ank[agdlevel])</span></div><div class='minor small'>Удобрено растений: <span
class='title'>$ank[agronom]</span><span class='title'>".($ank['agdlevel']==0?"/10":null)."".($ank['agdlevel']==1?"/50":null)."".($ank['agdlevel']==2?"/200":null)."".($ank['agdlevel']==3?"/1000":null)."".($ank['agdlevel']==4?"/2000":null)."</span></div></li>";


$ank['gifter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gifts` WHERE `id_kont` = '$ank[id]'"),0);
echo "<li class='pt'><div>";
echo dostig($ank['gdlevel']);
echo "<span>Даритель</span> <span class='small minor'>($ank[gdlevel])</span></div><div class='minor small'>Подарено подарков: <span class='title'>$ank[gifter]</span><span class='title'>".($ank['gdlevel']==0?"/1":null)."".($ank['gdlevel']==1?"/5":null)."".($ank['gdlevel']==2?"/10":null)."".($ank['gdlevel']==3?"/20":null)."".($ank['gdlevel']==4?"/30":null)."</span></div></li>";

echo "<li class='pt'>
<div>";
echo dostig($ank['bdlevel']);
echo "<span>Ботаник</span> <span class='small minor'>($ank[bdlevel])</span></div><div class='minor small'>Аренда гидропоники: <span class='title'>$ank[botanik]</span><span class='title'>".($ank['bdlevel']==0?"/10":null)."".($ank['bdlevel']==1?"/50":null)."".($ank['bdlevel']==2?"/200":null)."".($ank['bdlevel']==3?"/1000":null)."".($ank['bdlevel']==4?"/2000":null)."</span> часов</div></li>";

$ank['planter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ank[id]'"),0);
echo "<li class='pt'><div>";
echo dostig($ank['pdlevel']);
echo "<span>Землевладелец</span> <span class='small minor'>($ank[pdlevel])</span></div><div class='minor small'>Земли в наличии: <span class='title'>$ank[planter]</span><span class='title'>".($ank['pdlevel']==0?"/6":null)."".($ank['pdlevel']==1?"/7":null)."".($ank['pdlevel']==2?"/8":null)."".($ank['pdlevel']==3?"/9":null)."".($ank['pdlevel']==4?"/10":null)."</span></div></li>";

$ank['petplanter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ank[id]'"),0);
echo "<li class='pt'><div>";
echo dostig($ank['ppdlevel']);
echo "<span>Животновод</span> <span class='small minor'>($ank[ppdlevel])</span></div><div class='minor small'>Загонов в наличии: <span class='title'>$ank[petplanter]</span><span class='title'>".($ank['ppdlevel']==0?"/6":null)."".($ank['ppdlevel']==1?"/7":null)."".($ank['ppdlevel']==2?"/8":null)."".($ank['ppdlevel']==3?"/9":null)."".($ank['ppdlevel']==4?"/10":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['kdlevel']);
echo "<span>Кормилец</span> <span class='small minor'>($ank[kdlevel])</span></div><div class='minor small'>Животных накормлено: <span class='title'>$ank[kormer]</span><span class='title'>".($ank['kdlevel']==0?"/10":null)."".($ank['kdlevel']==1?"/50":null)."".($ank['kdlevel']==2?"/200":null)."".($ank['kdlevel']==3?"/1000":null)."".($ank['kdlevel']==4?"/2000":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['pgdlevel']);
echo "<span>Пугач</span> <span class='small minor'>($ank[pgdlevel])</span></div><div class='minor small'>Аренда пугала: <span class='title'>$ank[pugach]</span><span class='title'>".($ank['pgdlevel']==0?"/2":null)."".($ank['pgdlevel']==1?"/10":null)."".($ank['pgdlevel']==2?"/50":null)."".($ank['pgdlevel']==3?"/200":null)."".($ank['pgdlevel']==4?"/1000":null)."</span> часов</div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['vtlevel']);
echo "<span>Электрик</span> <span class='small minor'>($ank[vtlevel])</span></div><div class='minor small'>Аренда ветряка: <span class='title'>$ank[electrik]</span><span class='title'>".($ank['vtlevel']==0?"/2":null)."".($ank['vtlevel']==1?"/10":null)."".($ank['vtlevel']==2?"/50":null)."".($ank['vtlevel']==3?"/200":null)."".($ank['vtlevel']==4?"/1000":null)."</span> часов</div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['nmtlevel']);
echo "<span>Наниматель</span> <span class='small minor'>($ank[nmtlevel])</span></div><div class='minor small'>Найм садовников: <span
class='title'>$ank[naymsad]</span><span class='title'>".($ank['nmtlevel']==0?"/10":null)."".($ank['nmtlevel']==1?"/50":null)."".($ank['nmtlevel']==2?"/200":null)."".($ank['nmtlevel']==3?"/1000":null)."".($ank['nmtlevel']==4?"/2000":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['kmlevel']);
echo "<span>Кулинар</span> <span class='small minor'>($ank[kmlevel])</span></div><div class='minor small'>Заготовок закончено: <span class='title'>$ank[cook_mas]</span><span class='title'>".($ank['kmlevel']==0?"/10":null)."".($ank['kmlevel']==1?"/50":null)."".($ank['kmlevel']==2?"/200":null)."".($ank['kmlevel']==3?"/1000":null)."".($ank['kmlevel']==4?"/2000":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['plklevel']);
$ank['polkplanter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ank[id]'"),0);
echo "<span>Заготовщик</span> <span class='small minor'>($ank[plklevel])</span></div><div class='minor small'>Полок в погребе: <span class='title'>$ank[polkplanter]</span><span class='title'>".($ank['plklevel']==0?"/6":null)."".($ank['plklevel']==1?"/7":null)."".($ank['plklevel']==2?"/8":null)."".($ank['plklevel']==3?"/9":null)."".($ank['plklevel']==4?"/10":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($ank['tkormer']);
echo "<span>Рыбарь</span> <span class='small minor'>($ank[tkormer])</span></div><div class='minor small'>Накормлено рыб: <span class='title'>$ank[tkormer]</span><span class='title'>".($ank['tkormer']==0?"/10":null)."".($ank['tkormer']==1?"/50":null)."".($ank['tkormer']==2?"/200":null)."".($ank['tkormer']==3?"/1000":null)."".($ank['tkormer']==4?"/2000":null)."</span></div></li>";
$ank['fishplanter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pond` WHERE `id_user` = '$ank[id]'"),0);

echo "<li class='pt'><div>";
echo dostig($ank['prdlevel']);
echo "<span>Смотритель прудов</span> <span class='small minor'>($ank[prdlevel])</span></div><div class='minor small'>Прудов в наличии: <span class='title'>$ank[fishplanter]</span><span class='title'>".($ank['prdlevel']==0?"/6":null)."".($ank['prdlevel']==1?"/7":null)."".($ank['prdlevel']==2?"/8":null)."".($ank['prdlevel']==3?"/9":null)."".($ank['prdlevel']==4?"/10":null)."</span></div></li>";
echo "<li class='pt'>Всего очков достижений: <span class='title'>$ank[dostig]</span></li>";
echo "</ul></div>";
include_once 'inc/foot.php';
?>