<?
if(isset($_GET['level']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_prud` WHERE `id` = '".intval($_GET['level'])."' AND `id_user` = '$ku[id]' AND `id_fish` != '0' AND `level` < '20'"),0)!=0)
{
$prud=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_prud` WHERE `id` = '".intval($_GET['level'])."' AND `id_user` = '$ku[id]' AND `id_fish` != '0' AND `level` < '20'"));
$prud['next_level']=$prud['level']+1;
$money_level=$prud['next_level']*1000;
if($ku['money']>=$money_level)
{
mysql_query("UPDATE `kolhoz_user` SET `money` = '".($ku['money']-$money_level)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_prud` SET `level` = '$prud[next_level]' WHERE `id` = '$prud[id]'");
}
else $_SESSION['no_money']=$ku['money']-$money_level;
header("Location:?myprud&moderate&".passgen());
exit;
}
?>