<?

if($ku['level']>=30 && $ku['level']<50)$cenamoneystandart='350000000';$cenaruby='50000';
if($ku['level']>=50 && $ku['level']<100)$cenamoneystandart='1000000000';$cenaruby='90000';
if($ku['level']>=100 && $ku['level']<150)$cenamoneystandart='15000000000';$cenaruby='150000';
if($ku['level']>=150 && $ku['level']<200)$cenamoneystandart='35000000000';$cenaruby='250000';
if($ku['level']>=200 && $ku['level']<300)$cenamoneystandart='95000000000';$cenaruby='250000';
if($ku['level']>=300 && $ku['level']<400)$cenamoneystandart='150000000000';$cenaruby='250000';
if($ku['level']>=400 && $ku['level']<500)$cenamoneystandart='250000000000';$cenaruby='250000';
if($ku['level']>=600 && $ku['level']<700)$cenamoneystandart='450000000000';$cenaruby='250000';
if($ku['level']>=700)$cenamoneystandart='750000000000';$cenaruby='250000';
if($ku['money']>=$cenamoneystandart*200)
{
    $cenamoney=$cenamoneystandart*200;
}else
{
    $cenamoney=$cenamoneystandart;
}
if(isset($_GET['bonus']) && ($ku['bonus_ticket']>0))
{
    $random=rand(1,40);
    if($random<4)
    {
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `dostup` = '1' ORDER BY RAND() LIMIT 1"));
   mysql_query("INSERT INTO `kolhoz_petground` SET `id_pet` = '$pet[id]', `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/pets/'.$pet['id'].'.png[/img] '.($pet['name']).'[/color]';
}
if($random>=4 && $random<10)
{
    $timee=(3600*24*3);
    mysql_query("UPDATE `kolhoz_user` SET `money2x_time` = '".($ku['money2x_time']>$time?"".($ku['money2x_time']+$timee)."":"".($time+$timee)."")."' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow]Двойной доход (3 дня)[/color]';

}
if($random>=10 && $random<20)
{
    mysql_query("UPDATE `kolhoz_user` SET `expbonus` = '".($ku['expbonus']+50)."' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow]Бонус к опыту (50%)[/color]';

}
if($random>=20 && $random<=30)
{
    mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+100000)."' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow]100 000 рубинов[/color]';

}
if($random>=30 && $random<40)
{
    $timee=(3600*24*3);
    mysql_query("UPDATE `kolhoz_user` SET `time_vip` = '".($ku['time_vip']>$time?"".($ku['time_vip']+$timee)."":"".($time+$timee)."")."' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow]VIP-статус (3 дня)[/color]';

}
mysql_query("UPDATE `kolhoz_user` SET `bonus_ticket` = `bonus_ticket` - '1' WHERE `id` = '$ku[id]'");
$_SESSION['msg']=''.$text.'';
header("location:/?lottery");  
}
if(isset($_GET['animal']) && ($ku['animal_ticket']>0))
{
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `dostup` = '1' ORDER BY RAND() LIMIT 1"));
   mysql_query("INSERT INTO `kolhoz_petground` SET `id_pet` = '$pet[id]', `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/pets/'.$pet['id'].'.png[/img] '.($pet['name']).'[/color]';
mysql_query("UPDATE `kolhoz_user` SET `animal_ticket` = `animal_ticket` - '1' WHERE `id` = '$ku[id]'");
$_SESSION['msg']=''.$text.'';
header("location:/?lottery");  
}
if(isset($_GET['bronze']) && ($ku['money']>=$cenamoney) && ($ku['money']<$cenamoneystandart*200))
{
$random=rand(1,153);
if($random<=125 && $random>120)
{
$rand=rand(1,4);
if($rand==1)
{
$ground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'"),0);
if($ground<=99)
{
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Грядка[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
update_mc($rat);

$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';

}
}
if($rand==2)
{
$petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
if($petground<=99)
{
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Загон[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';

}
}
if($rand==3)
{
$pground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pool` WHERE `id_user` = '$ku[id]'"),0);
if($pground<=99)
{
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/empty.jpg[/img] Пруд[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';

}  
}
if($rand==4)
{
$pсground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id_user` = '$ku[id]'"),0);
if($pсground<=99)
{
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/polka.png[/img] Полка[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';

}
}
}
//////////опыт
if($random<=100)
{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
}
///////////монетки
if($random<=120 && $random>100)
{
$rand=rand(1,63);
if($rand<=30)$money=100000000;
if($rand<=40 && $rand>30)$money=500000000;
if($rand<=50 && $rand>40)$money=5000000000;
if($rand<=55 && $rand>50)$money=10000000000;
if($rand<=60 && $rand>55)$money=20000000000;
if($rand<=63 && $rand>60)$money=50000000000;
mysql_query("UPDATE `kolhoz_user` SET `money` = `money` + '$money' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/money.png[/img] '.strkol($money).'[/color]';
}
////////////полки хуелки


/////////////рубины
if($random<150 && $random>125)
{
    $rand=rand(1,63);
if($rand<=30)$ruby=1000;
if($rand<=40 && $rand>30)$ruby=5000;
if($rand<=50 && $rand>40)$ruby=7000;
if($rand<=55 && $rand>50)$ruby=10000;
if($rand<=60 && $rand>55)$ruby=100000;
if($rand<=63 && $rand>60)$ruby=300000;
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` + '$ruby' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/ruby.png[/img] '.strkol($ruby).'[/color]';

}
if($random>=150 && $random<=153)
{
$petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
if($petground<=99)
{    
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `dostup` = '0' ORDER BY RAND() LIMIT 1"));
mysql_query("INSERT INTO `kolhoz_petground` SET `id_pet` = '$pet[id]', `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/pets/'.$pet['id'].'.png[/img] '.($pet['name']).'[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
}
}
$_SESSION['msg']=''.$text.'';

mysql_query("UPDATE `kolhoz_user` SET `money` = `money` - '$cenamoney' WHERE `id` = '$ku[id]'");
header("location:/?lottery");
}
if(isset($_GET['bronzeTwo']) && ($ku['money']>=$cenamoney))
{
$random=rand(1,153);
if($random<=125 && $random>120)
{
$rand=rand(1,4);
if($rand==1)
{
$ground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'"),0);
if($ground<=94)
{
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");

$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Грядка (5)[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=($rat*100);
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';

}
}
if($rand==2)
{
$petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
if($petground<=94)
{
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");

$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Загон (5)[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=($rat*100);
$rat=double_exp(base_exp($rat));
update_mc($rat);
mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';

}
}
if($rand==3)
{
$pground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pool` WHERE `id_user` = '$ku[id]'"),0);
if($pground<=94)
{
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");

$text='Вы выиграли: [color=yellow][img]/images/empty.jpg[/img] Пруд (5)[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=($rat*100);

$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';

}  
}
if($rand==4)
{
$pсground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id_user` = '$ku[id]'"),0);
if($pсground<=94)
{
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");

$text='Вы выиграли: [color=yellow][img]/images/icons/polka.png[/img] Полка (5)[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=($rat*100);

$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';

}
}
}
//////////опыт
if($random<=100)
{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=($rat*100);

$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
}
///////////монетки
if($random<=120 && $random>100)
{
$rand=rand(1,63);
if($rand<=30)$money=100000000;
if($rand<=40 && $rand>30)$money=500000000;
if($rand<=50 && $rand>40)$money=5000000000;
if($rand<=55 && $rand>50)$money=10000000000;
if($rand<=60 && $rand>55)$money=20000000000;
if($rand<=63 && $rand>60)$money=50000000000;
$money=$money*1000;
mysql_query("UPDATE `kolhoz_user` SET `money` = `money` + '$money' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/money.png[/img] '.strkol($money).'[/color]';
}
////////////полки хуелки


/////////////рубины
if($random<150 && $random>125)
{
    $rand=rand(1,63);
if($rand<=30)$ruby=1000;
if($rand<=40 && $rand>30)$ruby=5000;
if($rand<=50 && $rand>40)$ruby=7000;
if($rand<=55 && $rand>50)$ruby=10000;
if($rand<=60 && $rand>55)$ruby=100000;
if($rand<=63 && $rand>60)$ruby=300000;
$ruby=$ruby*100;
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` + '$ruby' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/ruby.png[/img] '.strkol($ruby).'[/color]';

}
if($random>=150 && $random<=153)
{
$petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
if($petground<=99)
{    
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `dostup` = '0' ORDER BY RAND() LIMIT 1"));
mysql_query("INSERT INTO `kolhoz_petground` SET `id_pet` = '$pet[id]', `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/pets/'.$pet['id'].'.png[/img] '.($pet['name']).'[/color]';
}else{
if($ku['level']<=50)$rat='80000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='8000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='800000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='3000000000000*'.floor($ku['level']).'';
$rat=($rat*100);
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
}
}
$_SESSION['msg']=''.$text.'';

mysql_query("UPDATE `kolhoz_user` SET `money` = `money` - '$cenamoney' WHERE `id` = '$ku[id]'");
header("location:/?lottery");
}
if(isset($_GET['silver']) && ($ku['rubies']>=$cenaruby))
{
$random=rand(1,153);
if($random<=125 && $random>120)
{
    $rand=rand(1,4);
 if($rand==1)
 {
  $ground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'"),0);
  if($ground<=119)
  {
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Грядка[/color]';
  }
  else
  {
if($ku['level']<=50)$rat='500000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='50000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='5000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='10000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
  
 }
  if($rand==2)
 {
   $petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
  if($petground<=119)
  {
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Загон[/color]';
  }else
  {
if($ku['level']<=50)$rat='500000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='50000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='5000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='10000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
 }
 if($rand==3)
 {
   $pground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pool` WHERE `id_user` = '$ku[id]'"),0);
  if($pground<=119)
  {
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/empty.jpg[/img] Пруд[/color]';
  }else
  {
if($ku['level']<=50)$rat='500000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='50000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='5000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='10000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
 }
  if($rand==4)
 {
   $pсground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id_user` = '$ku[id]'"),0);
  if($pсground<=119)
  {
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/polka.png[/img] Полка[/color]';
  }else
  {
if($ku['level']<=50)$rat='500000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='50000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='5000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='10000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
 }
}
//////////опыт
if($random<=100)
{
if($ku['level']<=50)$rat='500000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='50000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='5000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='10000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
}
///////////монетки
if($random<=120 && $random>100)
{
$rand=rand(1,63);
if($rand<=30)$money=500000000;
if($rand<=40 && $rand>30)$money=700000000;
if($rand<=50 && $rand>40)$money=9000000000;
if($rand<=55 && $rand>50)$money=25000000000;
if($rand<=60 && $rand>55)$money=35000000000;
if($rand<=63 && $rand>60)$money=90000000000;
mysql_query("UPDATE `kolhoz_user` SET `money` = `money` + '$money' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/money.png[/img] '.strkol($money).'[/color]';
}
////////////полки хуелки


/////////////рубины
if($random<150 && $random>125)
{
    $rand=rand(1,63);
if($rand<=30)$ruby=10000;
if($rand<=40 && $rand>30)$ruby=50000;
if($rand<=50 && $rand>40)$ruby=90000;
if($rand<=55 && $rand>50)$ruby=300000;
if($rand<=60 && $rand>55)$ruby=550000;
if($rand<=63 && $rand>60)$ruby=900000;
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` + '$ruby' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/ruby.png[/img] '.strkol($ruby).'[/color]';

}
if($random>=150 && $random<=153)
{
   $petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
  if($petground<=119)
  {    
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `dostup` = '0' ORDER BY RAND() LIMIT 1"));
   mysql_query("INSERT INTO `kolhoz_petground` SET `id_pet` = '$pet[id]', `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/pets/'.$pet['id'].'.png[/img] '.($pet['name']).'[/color]';
  }else{
if($ku['level']<=50)$rat='500000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='50000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='5000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='10000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
}
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` - '$cenaruby' WHERE `id` = '$ku[id]'");
$_SESSION['msg']=''.$text.'';
header("location:/?lottery");
}
if(isset($_GET['gold']) && ($ku['fermoney']>=75))
{
$random=rand(1,153);
if($random<=125 && $random>120)
{
    $rand=rand(1,4);
 if($rand==1)
 {
  $ground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'"),0);
  if($ground<=149)
  {
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Грядка[/color]';
  }
  else
  {
if($ku['level']<=50)$rat='900000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='90000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='9000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='20000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
  
 }
  if($rand==2)
 {
   $petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
  if($petground<=149)
  {
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Загон[/color]';
  }else
  {
if($ku['level']<=50)$rat='900000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='90000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='9000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='20000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
 }
 if($rand==3)
 {
   $pground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pool` WHERE `id_user` = '$ku[id]'"),0);
  if($pground<=149)
  {
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/empty.jpg[/img] Пруд[/color]';
  }else
  {
if($ku['level']<=50)$rat='900000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='90000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='9000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='20000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
 }
  if($rand==4)
 {
   $pсground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id_user` = '$ku[id]'"),0);
  if($pсground<=149)
  {
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/polka.png[/img] Полка[/color]';
  }else
  {
if($ku['level']<=50)$rat='900000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='90000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='9000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='20000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
 }
}
//////////опыт
if($random<=100)
{
if($ku['level']<=50)$rat='900000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='90000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='9000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='20000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
}
///////////монетки
if($random<=120 && $random>100)
{
$rand=rand(1,63);
if($rand<=30)$money=900000000;
if($rand<=40 && $rand>30)$money=1700000000;
if($rand<=50 && $rand>40)$money=19000000000;
if($rand<=55 && $rand>50)$money=55000000000;
if($rand<=60 && $rand>55)$money=65000000000;
if($rand<=63 && $rand>60)$money=190000000000;
mysql_query("UPDATE `kolhoz_user` SET `money` = `money` + '$money' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/money.png[/img] '.strkol($money).'[/color]';
}
////////////полки хуелки


/////////////рубины
if($random<150 && $random>125)
{
    $rand=rand(1,63);
if($rand<=30)$ruby=50000;
if($rand<=40 && $rand>30)$ruby=100000;
if($rand<=50 && $rand>40)$ruby=190000;
if($rand<=55 && $rand>50)$ruby=500000;
if($rand<=60 && $rand>55)$ruby=400000;
if($rand<=63 && $rand>60)$ruby=700000;
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` + '$ruby' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/ruby.png[/img] '.strkol($ruby).'[/color]';

}
if($random>=150 && $random<=153)
{
   $petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
  if($petground<=149)
  {    
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `dostup` = '1' ORDER BY RAND() LIMIT 1"));
   mysql_query("INSERT INTO `kolhoz_petground` SET `id_pet` = '$pet[id]', `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/pets/'.$pet['id'].'.png[/img] '.($pet['name']).'[/color]';
  }else{
if($ku['level']<=50)$rat='900000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='90000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='9000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='20000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
  }
}
mysql_query("UPDATE `kolhoz_user` SET `fermoney` = `fermoney` - '75' WHERE `id` = '$ku[id]'");
$_SESSION['msg']=''.$text.'';
header("location:/?lottery");
}
if(isset($_GET['premium']) && ($ku['fermoney']>=200))
{
$random=rand(1,130);
if($random<=125 && $random>=100)
{
    $rand=rand(1,4);
 if($rand==1)
 {
  $ground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'"),0);
  if($ground<=197)
  {
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]'");

$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Грядка (3 шт.)[/color]';
  }
  else
  {
   if($ku['level']<=50)$rat='1200000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='110000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='15000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='50000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
   }
  
 }
  if($rand==2)
 {
   $petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
  if($petground<=197)
  {
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");

$text='Вы выиграли: [color=yellow][img]/images/dirt_new.jpg[/img] Загон (3 шт.)[/color]';
  }else
  {
   if($ku['level']<=50)$rat='1200000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='110000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='15000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='50000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
   }
 }
 if($rand==3)
 {
   $pground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pool` WHERE `id_user` = '$ku[id]'"),0);
  if($pground<=197)
  {
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");

$text='Вы выиграли: [color=yellow][img]/images/empty.jpg[/img] Пруд (3 шт.)[/color]';
  }else
  {
   if($ku['level']<=50)$rat='1200000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='110000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='15000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='50000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
   }
 }
  if($rand==4)
 {
   $pсground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id_user` = '$ku[id]'"),0);
  if($pсground<=197)
  {
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka2` SET `id_user` = '$ku[id]'");

$text='Вы выиграли: [color=yellow][img]/images/icons/polka.png[/img] Полка (3 шт.)[/color]';
  }else
  {
   if($ku['level']<=50)$rat='1200000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='110000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='15000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='50000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
   }
 }
}
if($random<=50)
{
   if($ku['level']<=50)$rat='1200000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='110000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='15000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='50000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
 
}
//////////опыт
if($random<=100 && $random>50)
{
$rand=rand(1,63);
if($rand<=30)$ruby=3;
if($rand<=40 && $rand>30)$ruby=7;
if($rand<=50 && $rand>40)$ruby=10;
if($rand<=55 && $rand>50)$ruby=13;
if($rand<=60 && $rand>55)$ruby=17;
if($rand<=63 && $rand>60)$ruby=20;
mysql_query("UPDATE `kolhoz_user` SET `expbonus` = `expbonus` + '$ruby' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] Бонус к опыту ('.$ruby.'%)[/color]';
}
if($random>=126 && $random<=130)
{
   $petground=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0);
  if($petground<=199)
  {    
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `dostup` = '1' ORDER BY RAND() LIMIT 1"));
   mysql_query("INSERT INTO `kolhoz_petground` SET `id_pet` = '$pet[id]', `id_user` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/pets/'.$pet['id'].'.png[/img] '.($pet['name']).'[/color]';
  }else{
   if($ku['level']<=50)$rat='1200000000*'.floor($ku['level']).'';
if($ku['level']<=100 && $ku['level']>50)$rat='110000000000*'.floor($ku['level']).'';
if($ku['level']<=150 && $ku['level']>100)$rat='15000000000000*'.floor($ku['level']).'';
if($ku['level']>150)$rat='50000000000000*'.floor($ku['level']).'';
$rat=double_exp(base_exp($rat));
update_mc($rat);

mysql_query("UPDATE `kolhoz_user` SET `rating` = `rating` + '$rat' WHERE `id` = '$ku[id]'");
$text='Вы выиграли: [color=yellow][img]/images/icons/experience.png[/img] '.strkol($rat).'[/color]';
   }
}
mysql_query("UPDATE `kolhoz_user` SET `fermoney` = `fermoney` - '200' WHERE `id` = '$ku[id]'");
$_SESSION['msg']=''.$text.'';
header("location:/?lottery");
}
$lottery=mysql_fetch_array(mysql_query("SELECT * FROM `lottery` WHERE `id_user` = '$ku[id]'"));

/////////////////Ограничение/////////////////
echo'<div class="event"><h1>Лотерея "Спринт"</h1></div>';
if($ku['bonus_ticket']>0 || $ku['animal_ticket']>0) echo'<div class="block"><span class="minor">Ивентовые билеты: <span class="title"><img width="23" src="/pavelgrey/img/animal_ticket.png"> '.$ku['animal_ticket'].'</span> и <span class="title"><img width="23" src="/pavelgrey/img/bonus_ticket.png"> '.$ku['bonus_ticket'].'</span></span></div>';

   echo'<div class="block"><h3>Выберите билет</h3>';
   if($ku['money']<$cenamoneystandart*200)echo'<img width="23" src="/pavelgrey/img/bronze_ticket.png"> <a href="/?lottery&bronze">Бронзовый билет</a> <span class="title"><img src="/images/icons/money.png"> '.strkol($cenamoney).'</span></span>';
      if($ku['money']>=$cenamoneystandart*200)echo'<img width="23" src="/pavelgrey/img/bronze_ticket.png"> <a href="/?lottery&bronzeTwo">Новобронзовый билет</a> <span class="title"><img src="/images/icons/money.png"> '.strkol($cenamoney).'</span></span>';

   echo'<li  class="pavelgrey"><img width="23" src="/pavelgrey/img/silver_ticket.png"> <a href="/?lottery&silver">Серебряный билет</a> <span class="title"><img src="/images/icons/ruby.png"> '.strkol($cenaruby).'</span></span>';
   echo'<li  class="pavelgrey"><img width="23" src="/pavelgrey/img/gold_ticket.png"> <a href="/?lottery&gold">Золотой билет</a> <span class="title"><img src="/worldkassa/fermoney.png"> 75</span></span>';
   echo'<li  class="pavelgrey"><img width="23" src="/pavelgrey/img/premium_ticket.png"> <a href="/?lottery&premium">Премиум билет</a> <span class="title"><img src="/worldkassa/fermoney.png"> 200</span></span>';

   if($ku['bonus_ticket']>0)echo'<li  class="pavelgrey"><img width="23" src="/pavelgrey/img/bonus_ticket.png"> <a href="/?lottery&bonus">Бонусный билет</a> <span class="title">ивент</span></span>';
   if($ku['animal_ticket']>0)echo'<li  class="pavelgrey"><img width="23" src="/pavelgrey/img/animal_ticket.png"> <a href="/?lottery&animal">"Животный" билет</a> <span class="title">ивент</span></span>';

 echo'<div class="pavelgrey"><span class="minor">Лотерея - беспроигрышная, минимальный выигрыш зависит от <span class="title">типа билета</span> (<a href="/?forum=1859" class="minor">подробнее</a>)</span></div>';
 echo'</div>';

echo "</ul></div>";
include_once 'inc/foot.php';
?>