Файл: vkolhoze.com/garden/change_soil.php
Строк: 36
<?
if(isset($_GET['mygarden']) && isset($_GET['change_soil']))
{
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_plant` WHERE `id` = '".intval($_GET['select'])."'"),0)!=0)
{
$plant=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_plant` WHERE `id` = '".intval($_GET['select'])."'"));
mysql_query("UPDATE `kolhoz_user` SET `last_soil_garden` = '$plant[id]' WHERE `id` = '$ku[id]'");
header("Location:/mygarden/".passgen());
exit;
}
$q=mysql_query("SELECT * FROM `kolhoz_warehouse` WHERE `id_user` = '$ku[id]' AND `arena` = '0' AND `fish`='0'");
while($post=mysql_fetch_array($q))
{
$plant=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_plant` WHERE `id` = '$post[id_plant]'"));
echo "<li><img width='16' height='16' src='images/icons/plate.png' alt='o'> <a href='/mygarden/change_soil/select-$post[id_plant]'>Выбрать</a> <span class='title'>".hsc($plant['name'])."</span> (<span>$post[count]</span> шт.)</li>";
}
echo "</ul></div>";
include_once 'inc/foot.php';
}
?>