<?
if($ku['status']==3){
if(isset($_POST['ok']) && $_POST['mdp']==$ku['mdp'] && intval($_POST['sum'])>0)
{
$summ=floor($_POST['sum']);
$sum=floor((($summ/100)*10)+$summ);
if($ku['money']>=$sum)
{
	if($sum>0)
	{
		$ku['money']=minus_money($sum);
		mysql_querll("UPDATE `kolhoz_user` SET `money` = '".($ank['money']+$summ)."' WHERE `id` = '$ank[id]'");
		mysql_querll("INSERT INTO `kolhoz_mail` SET `id_user` = '$ank[id]', `id_kont` = '300', `msg` = '".("$ku[nick] переслал".($ku['pol']==0?'a':null)." Вам .золото.$summ монет")."', `time` = '$time', `type` = 'to'");
		//mysql_querll("INSERT INTO `kolhoz_mail` SET `id_user` = '$ku[id]', `id_kont` = '0', `msg` = '".("Вы переслали $summ мон. фермеру $ank[nick]")."', `time` = '$time', `type` = 'at', `read` = '1'");
		msg_game("Передача успешно завершена");
	}
	else
	{
	  echo "<center><img width='400' height='400' src='http://img8.joyreactor.cc/pics/comment/%D0%9A%D0%BE%D0%BC%D0%B8%D0%BA%D1%81%D1%8B-buttersafe-%D0%B2%D0%BE%D0%BB%D0%BA%D0%B8-%D0%BE%D0%B2%D1%86%D1%8B-553508.jpeg' alt='o'></center>";	
	}
}
else no_money($summ-$ku['money']);
}
echo "<div class='event'><h1>Передача Монет</h1></div>";
echo "<div class='content'>";
echo "<div class='block'>";
echo "Введите количество монет:</span><br/><form method='post'>";
echo "<input type='text' name='sum' value=''><input type='hidden' name='mdp' value='$ku[mdp]'><br/>";
echo "<input type='submit' name='ok' value='Передать'>";
echo "</form></div>";
include_once 'inc/foot.php';
}
?>