<?
if(isset($_GET['mygarden']) && isset($_GET['change_isoil']))
{
echo '<div class="event"><h1>Магазин удобрений</h1></div>';
echo "<div class='content'>";
echo "<div class='block'>";

if(isset($_GET['select']) && intval($_GET['select'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_sad_soil` WHERE `id` = '".intval($_GET['select'])."' AND (`level` = '$ku[level]' OR `level` < '$ku[level]')"),0)!=0)
{
mysql_query("UPDATE `kolhoz_user` SET `last_soil3` = '".intval($_GET['select'])."' WHERE `id` = '$ku[id]'");
header("Location:?mygarden&".passgen());
exit;
}
echo "<h3>Выбери Удобрение</h3>";
$q=mysql_query("SELECT * FROM `kolhoz_sad_soil`");
echo "<ul>";
while($post=mysql_fetch_array($q))
{
echo "<li style='padding-bottom:8px'>";
echo "<img width='48' height='48' src='images/soils/sad_$post[id].png' alt='o' class='portrait'><div>".($ku['level']>=$post['level']?"<a href='?mygarden&change_isoil&select=$post[id]'>":null)."<span>".hsc($post['name'])."</span>".($ku['level']>=$post['level']?"</a>":null)."<span class='minor'>, ".($ku['level']>=$post['level']?"цена: </span><span>".(empty($post['rubu'])?"<img width='16' height='16' src='images/icons/money.png' alt='o'><span class='title'> $post[cena]":"<img width='16' height='16' src='images/icons/ruby.png' alt='o'><span class='title'> $post[rubu]")."</span>":"доступно с $post[level] уровня</span>")."</div><div class='minor small'>Ускоряет рост на <span class='title'>".time_left($post['time'])."</span>,опыт: <img width='16' height='16' src='images/icons/experience.png' alt='o'> <span class='title'>$post[rating]</span></div><div style='clear:both'></div></li>";
}
echo "</ul></div>";
include_once 'inc/foot.php';
}
?>