<?
if(isset($_GET['del']) && $ku['status']==3)mysql_query("DELETE FROM `kolhoz_ground` WHERE `id` = '".intval($_GET['del'])."'");
echo "<div class='event'><g1><b><a href='?user=$ank[id]' style='color:#FFEDA2';>$au[nick]</a> / Ферма</b></g1></div>";
echo '<div class="content"><div class="block">';
if($ank['id']==$ku['id'])header("Location:?farm");
$q=mysql_query("SELECT * FROM `kolhoz_ground` WHERE `id_user` = '$ank[id]'");
echo "<ul>";
while($post=mysql_fetch_array($q))
{
if($post['id_plant']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_plant` WHERE `id` = '$post[id_plant]'"),0)!=0)$plant=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_plant` WHERE `id` = '$post[id_plant]'"));
echo "<li><img width='48' height='48' src='".(!isset($plant)?"i/dirt_new.jpg":"i/plants/$plant[id].png")."' alt='o' class='portrait'>";
echo "<div>";
echo "".(!isset($plant)?"<span class='title'>Земля, готовая к посеву</span>":"<span class='title'>".hsc($plant['name'])."</span>".($post['time']>$time?"<span class='small minor'> (Урожай через <span> ".time_left($post['time']-$time)."</span>)</span>":null)."")."";
if($ku['status']==3)echo " <a class='small minor' href='?uf=$ank[id]&del=$post[id]'>[удалить]</a>";
echo "</div>";
echo "<div style='clear:both'></div></li>";
}
echo "<br><b><font color='black'>
Хозяйство</font></br></b>";
if($ank['scarecrow_time']>$time)echo'<font color="black"><div><img width="16" height="16" src="/i/icons/experience.png" alt="o"/><span><a href="?shop=scarecrow">Менеджер</a></span><sup><b><font size="0.1em">'.time_left($ank['scarecrow_time']-time()).'</b></sup></font></font></span>
</div>';
if($ank['gardener']==3)echo "<img src=i/hr.png width=100% height=2>";
if($ank['gardener']==3)echo'<font color="black"><div><img width="16" height="16" src="/i/cat.png" alt="o"/><span><a href="?shop=gardener&id=3">Кот</a></span><sup><b><font size="0.1em">'.time_left($ank['garden_time']-time()).'</b></sup></font></font></span>
</div>';
if($ank['level']>=30)echo "<img src=i/hr.png width=100% height=2>";
if($ank['level']>=30)echo "<br> </br>";
if($ank['level']>=30)echo "<li><img alt='' width='16' height='16' src='i/tree.png'> <a href='?upf=$ank[id]'>Сад</a></li>";
if($ank['level']>=30)echo "<img src=i/hr.png width=100% height=2>";
echo "</ul>";
echo "</div>";
include_once 'inc/foot.php';
?>