<?
$sett=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_setting` WHERE `id_user`='$ank[id]'"));
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?"/30":null)."".($ank['tdlevel']==2?"/50":null)."".($ank['tdlevel']==3?"/75":null)."".($ank['tdlevel']==4?"/100":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($sett['arena_dost']);
echo "<span>Боец</span> <span class='small minor'>($sett[arena_dost])</span></div><div class='minor small'>Арен сыграно: <span class='title'>$sett[arena_win]</span><span class='title'>".($sett['arena_dost']==0?"/25":null)."".($sett['arena_dost']==1?"/50":null)."".($sett['arena_dost']==2?"/250":null)."".($sett['arena_dost']==3?"/1000":null)."".($sett['arena_dost']==4?"/4000":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($sett['garden_dost']);
echo "<span>Наниматель</span> <span class='small minor'>($sett[garden_dost])</span></div><div class='minor small'>Найм садовников: <span class='title'>$sett[garden_dost_count]</span><span class='title'>".($sett['garden_dost']==0?"/2":null)."".($sett['garden_dost']==1?"/50":null)."".($sett['garden_dost']==2?"/200":null)."".($sett['garden_dost']==3?"/1000":null)."".($sett['garden_dost']==4?"/3000":null)."</span> часов</div></li>";

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

$ank['zagotov']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id_user` = '$ank[id]'"),0);
echo "<li class='pt'><div>";
echo dostig($sett['zagotov_dost']);
echo "<span>Заготовщик</span> <span class='small minor'>($conf[zagotov_dost])</span></div><div class='minor small'>Полок в погребе: <span class='title'>$ank[zagotov]</span><span class='title'>".($conf['zagotov_dost']==0?"/6":null)."".($conf['zagotov_dost']==1?"/8":null)."".($conf['zagotov_dost']==2?"/11":null)."".($conf['zagotov_dost']==3?"/14":null)."".($conf['zagotov_dost']==4?"/18":null)."</span></div></li>";
if($ku['level']>=40){

echo "<li class='pt'><div>";
echo dostig($sett['pcclevel']);
echo "<span>Рыбарь</span> <span class='small minor'>($sett[pcclevel])</span></div><div class='minor small'>Выращено рыб: <span class='title'>$sett[pool_fish_count]</span><span class='title'>".($sett['pcclevel']==0?"/1000":null)."".($sett['pcclevel']==1?"/5000":null)."".($sett['pcclevel']==2?"/15000":null)."".($sett['pcclevel']==3?"/30000":null)."".($sett['pcclevel']==4?"/50000":null)."</span></div></li>";

$ank['pdpool']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pool` WHERE `id_user` = '$ank[id]'"),0);
echo "<li class='pt'><div>";
echo dostig($sett['pclevel']);
echo "<span>Смотритель прудов</span> <span class='small minor'>($conf[pclevel])</span></div><div class='minor small'>Прудов: <span class='title'>$ank[pdpool]</span><span class='title'>".($conf['pclevel']==0?"/5":null)."".($conf['pclevel']==1?"/8":null)."".($conf['pclevel']==2?"/12":null)."".($conf['pclevel']==3?"/17":null)."".($conf['pclevel']==4?"/25":null)."</span></div></li>";

echo "<li class='pt'><div>";
echo dostig($sett['surprize_dost']);
echo "<span>Собиратель сюрпризов</span> <span class='small minor'>($sett[surprize_dost])</span></div><div class='minor small'>Собрано сюрпризов: <span class='title'>$sett[surprize_dost_count]</span><span class='title'>".($conf['surprize_dost']==0?"/20":null)."".($conf['surprize_dost']==1?"/100":null)."".($conf['surprize_dost']==2?"/250":null)."".($conf['surprize_dost']==3?"/500":null)."".($conf['surprize_dost']==4?"/1000":null)."</span></div></li>";


}
echo "<li class='pt'>Всего очков достижений: <span class='title'>$ank[dostig]</span></li>";
echo "</ul></div>";
include_once 'inc/foot.php';
?>