<?

///TEHNIKA

if($ku['tehnika']>=120)
{
mysql_query("UPDATE `kolhoz_user` SET `tdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['tehnika']>=90)
{
mysql_query("UPDATE `kolhoz_user` SET `tdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['tehnika']>=65)
{
mysql_query("UPDATE `kolhoz_user` SET `tdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['tehnika']>=40)
{
mysql_query("UPDATE `kolhoz_user` SET `tdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['tehnika']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `tdlevel` = '1' WHERE `id` = '$ku[id]'");
}
///SADOVOD
if($ku['sadovod']>=2000)
{
mysql_query("UPDATE `kolhoz_user` SET `sdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['sadovod']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `sdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['sadovod']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `sdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['sadovod']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `sdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['sadovod']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `sdlevel` = '1' WHERE `id` = '$ku[id]'");
}
///VODOLEY
if($ku['vodoley']>=2000)
{
mysql_query("UPDATE `kolhoz_user` SET `vdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['vodoley']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `vdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['vodoley']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `vdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['vodoley']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `vdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['vodoley']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `vdlevel` = '1' WHERE `id` = '$ku[id]'");
}
///AGRONOM
if($ku['agronom']>=2000)
{
mysql_query("UPDATE `kolhoz_user` SET `agdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['agronom']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `agdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['agronom']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `agdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['agronom']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `agdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['agronom']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `agdlevel` = '1' WHERE `id` = '$ku[id]'");
}
///naymsad
if($ku['naymsad']>=2000)
{
mysql_query("UPDATE `kolhoz_user` SET `nmtlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['naymsad']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `nmtlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['naymsad']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `nmtlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['naymsad']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `nmtlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['naymsad']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `nmtlevel` = '1' WHERE `id` = '$ku[id]'");
}
///gifter
$ku['gifter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gifts` WHERE `id_kont` = '$ku[id]'"),0);
if($ku['gifter']>=30)
{
mysql_query("UPDATE `kolhoz_user` SET `gdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['gifter']>=20)
{
mysql_query("UPDATE `kolhoz_user` SET `gdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['gifter']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `gdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['gifter']>=5)
{
mysql_query("UPDATE `kolhoz_user` SET `gdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['gifter']>=1)
{
mysql_query("UPDATE `kolhoz_user` SET `gdlevel` = '1' WHERE `id` = '$ku[id]'");
}
///botanik
if($ku['botanik']>=2000)
{
mysql_query("UPDATE `kolhoz_user` SET `bdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['botanik']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `bdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['botanik']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `bdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['botanik']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `bdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['botanik']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `bdlevel` = '1' WHERE `id` = '$ku[id]'");
}
///electrik
if($ku['electrik']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `vtlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['electrik']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `vtlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['electrik']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `vtlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['electrik']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `vtlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['electrik']>=2)
{
mysql_query("UPDATE `kolhoz_user` SET `vtlevel` = '1' WHERE `id` = '$ku[id]'");
}
$ku['planter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'"),0);
///planter
if($ku['planter']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `pdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['planter']>=9)
{
mysql_query("UPDATE `kolhoz_user` SET `pdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['planter']>=8)
{
mysql_query("UPDATE `kolhoz_user` SET `pdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['planter']>=7)
{
mysql_query("UPDATE `kolhoz_user` SET `pdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['planter']>=6)
{
mysql_query("UPDATE `kolhoz_user` SET `pdlevel` = '1' WHERE `id` = '$ku[id]'");
}
$ku['petplanter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
///petplanter
if($ku['petplanter']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `ppdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['petplanter']>=9)
{
mysql_query("UPDATE `kolhoz_user` SET `ppdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['petplanter']>=8)
{
mysql_query("UPDATE `kolhoz_user` SET `ppdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['petplanter']>=7)
{
mysql_query("UPDATE `kolhoz_user` SET `ppdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['petplanter']>=6)
{
mysql_query("UPDATE `kolhoz_user` SET `ppdlevel` = '1' WHERE `id` = '$ku[id]'");
}
$ku['fishplanter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pond` WHERE `id_user` = '$ku[id]'"),0);
///prud
if($ku['fishplanter']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `prdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['fishplanter']>=9)
{
mysql_query("UPDATE `kolhoz_user` SET `prdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['fishplanter']>=8)
{
mysql_query("UPDATE `kolhoz_user` SET `prdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['fishplanter']>=7)
{
mysql_query("UPDATE `kolhoz_user` SET `prdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['fishplanter']>=6)
{
mysql_query("UPDATE `kolhoz_user` SET `prdlevel` = '1' WHERE `id` = '$ku[id]'");
}
$ku['polkplanter']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]'"),0);
///polka
if($ku['polkplanter']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `plklevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['polkplanter']>=9)
{
mysql_query("UPDATE `kolhoz_user` SET `plklevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['polkplanter']>=8)
{
mysql_query("UPDATE `kolhoz_user` SET `plklevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['polkplanter']>=7)
{
mysql_query("UPDATE `kolhoz_user` SET `plklevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['polkplanter']>=6)
{
mysql_query("UPDATE `kolhoz_user` SET `plklevel` = '1' WHERE `id` = '$ku[id]'");
}
///kormer
if($ku['kormer']>=2000)
{
mysql_query("UPDATE `kolhoz_user` SET `kdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['kormer']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `kdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['kormer']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `kdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['kormer']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `kdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['kormer']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `kdlevel` = '1' WHERE `id` = '$ku[id]'");
}
///ribar
if($ku['tkormer']>=2000)
{
mysql_query("UPDATE `kolhoz_user` SET `kflevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['tkormer']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `kflevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['tkormer']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `kflevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['tkormer']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `kflevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['tkormer']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `kflevel` = '1' WHERE `id` = '$ku[id]'");
}
///Kulinar
if($ku['cook_mas']>=2000)
{
mysql_query("UPDATE `kolhoz_user` SET `kmlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['cook_mas']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `kmlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['cook_mas']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `kmlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['cook_mas']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `kmlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['cook_mas']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `kmlevel` = '1' WHERE `id` = '$ku[id]'");
}
///pugach
if($ku['pugach']>=1000)
{
mysql_query("UPDATE `kolhoz_user` SET `pgdlevel` = '5' WHERE `id` = '$ku[id]'");
}
elseif($ku['pugach']>=200)
{
mysql_query("UPDATE `kolhoz_user` SET `pgdlevel` = '4' WHERE `id` = '$ku[id]'");
}
elseif($ku['pugach']>=50)
{
mysql_query("UPDATE `kolhoz_user` SET `pgdlevel` = '3' WHERE `id` = '$ku[id]'");
}
elseif($ku['pugach']>=10)
{
mysql_query("UPDATE `kolhoz_user` SET `pgdlevel` = '2' WHERE `id` = '$ku[id]'");
}
elseif($ku['pugach']>=2)
{
mysql_query("UPDATE `kolhoz_user` SET `pgdlevel` = '1' WHERE `id` = '$ku[id]'");
}
$count=$ku['tdlevel']+$ku['sdlevel']+$ku['vdlevel']+$ku['agdlevel']+$ku['gdlevel']+$ku['bdlevel']+$ku['vtlevel']+$ku['pdlevel']+$ku['ppdlevel']+$ku['plklevel']+$ku['kdlevel']+$ku['kmlevel']+$ku['prdlevel']+$ku['pgdlevel'];
mysql_query("UPDATE `kolhoz_user` SET `dostig` = '$count' WHERE `id` = '$ku[id]'");
?>