Файл: vkolhoze.com/inc/change_food.php
Строк: 35
<?
if(isset($_GET['mypetfarm']) && isset($_GET['change_food']))
{
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_food` = '$plant[id]' WHERE `id` = '$ku[id]'");
header("Location:/mypetfarm/".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><a class='loc' href='/mypetfarm/change_food/select-$post[id_plant]'><img width='16' height='16' src='images/icons/plate.png' alt='o'> Выбрать <span class='title'>".hsc($plant['name'])."</span> (<span>$post[count]</span> шт.)</a> </li>";
}
echo "<div class='pt'><a class='loc' href='/buy_plant'><img width='16' height='16' src='images/icons/tomato.png' alt='*'> Купить овощи</a></div></div>";
echo "</ul></div>";
include_once 'inc/foot.php';
}
?>