<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
/////////////////////////////////////////
if(isset($_GET['newgardenbed']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_farm` WHERE `user` = '".$user['id']."'"),0)<20)
{
if(isset($_GET['ok']))
{
$cena=cpg(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_farm` WHERE `user` = '".$user['id']."'"),0));
if($user['ruby']>=$cena)
{
mysql_query("INSERT INTO `mystyle_farm` SET `user` = '".$user['id']."'");
mysql_query("UPDATE `mystyle_user` SET `ruby` = '".($user['ruby']-$cena)."' WHERE `id` = '".$user['id']."'");
}
else
{
err_ruby($cena-$user['ruby']);
}
header("Location:./");
exit;
}
else
{
echo '<div>
<div class="feedbackPanel">
<div class="whiteLink">Вы уверены?</div>
<div style="text-align: center;">
<div class="fl" style="width: 49%;">
<a class="btn" href="?newgardenbed&ok">
<img width="16" height="16" alt="o" src="/images/icons/tick.png"/>
<span>Подтверждаю!</span>
</a>
</div>
<div class="fr" style="width: 49%;">
<a class="btn" href="./">
<img width="16" height="16" alt="o" src="/images/icons/cross.png"/>
<span>Отказываюсь!</span>
</a>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>';
}
}
/////////////////////////////////////////
?>