<?
if(isset($_SESSION['converter']))
{
ratingg($_SESSION['converter']);
unset($_SESSION['converter']);
}
if(isset($_SESSION['myfarm777']))
{
ratingg($_SESSION['myfarm777']);
unset($_SESSION['myfarm777']);
}
if(isset($_SESSION['panel']))
{
ratingg($_SESSION['panel']);
unset($_SESSION['panel']);
}
if(isset($_SESSION['harvest']))
{
harvest($_SESSION['harvest']);
unset($_SESSION['harvest']);
}
if(isset($_SESSION['rating']))
{
ratingg($_SESSION['rating']);
unset($_SESSION['rating']);
}
if($ku['umoney']!=0)
{
money($ku['umoney']);
}

if(isset($_SESSION['no_rubies']))
{
no_rubies($_SESSION['no_rubies']);
unset($_SESSION['no_rubies']);
}
if(isset($_SESSION['no_money']))
{
no_money($_SESSION['no_money']);
unset($_SESSION['no_money']);
}
if($ku['guest']==1){echo"<div class='feedback'><img src='images/face-mex.png' alt='o'><span style='color:#FF0000;'> Упс! А вы не <a href='?reg'>Cохранились</a>!</span><br></div>";}
{
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0)
{
echo "<div class='feedback'><div><img width='16' height='16' src='images/perevoz/054.jpg' alt='o'> Новая почта <span class='title'>(<span>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)."</span>)</span><br><a href='?mail&new'><img width='16' height='16' src='images/perevoz/Logo002.jpg' alt='o'> Читать</a><br></div></div>";
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gifts` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0)
{
echo "<div class='feedback'><div>У вас новый подарок<br><a href='?presents=$ku[id]'>Смотреть</a><br></div></div>";
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_invite` WHERE `id_user` = '$ku[id]'"),0)!=0)
{
$invite=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective_invite` WHERE `id_user` = '$ku[id]'"));
$cti=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective` WHERE `id` = '$invite[id_collective]'"));
$who=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$invite[id_who]'"));
if(isset($_GET['invite_collective']) && $_GET['invite_collective']=='yes')
{
mysql_query("DELETE FROM `kolhoz_collective_invite` WHERE `id` = '$invite[id]'");
mysql_query("INSERT INTO `kolhoz_collective_user` SET `id_user` = '$ku[id]', `id_collective` = '$cti[id]', `time` = '$time', `status` = '7'");
mysql_query("INSERT INTO `kolhoz_collective_history` SET `id_user` = '$ku[id]', `id_who` = '$who[id]', `id_collective` = '$cti[id]', `time` = '$time', `type` = 'in', `dei` = 'who'");
header("Location:?collective=$cti[id]");
}
elseif(isset($_GET['invite_collective']) && $_GET['invite_collective']=='no')
{
mysql_query("DELETE FROM `kolhoz_collective_invite` WHERE `id` = '$invite[id]'");
}
else
{

echo "<div class='feedback'>";
echo  on_k($who['id']);
echo "<a class='' href='?user=$who[id]'>".nc($who['id'])."</a></span> приглашает Вас в свою Компанию <a href='?collective=$cti[id]'><span>".hsc($cti['name'])."</span></a><br/>";
echo "<img width='16' height='16' src='images/icons/tick.png' alt='o'> <a href='?myfarm&invite_collective=yes'>Принять приглашение</a><br/>";
echo "<img width='16' height='16' src='images/icons/delete.png' alt='o'> <a href='?myfarm&invite_collective=no'>Отказаться</a>";
echo "</div></span>\n
</div>";
}
}
if(isset($_SESSION['msg']))
{
msg_game($_SESSION['msg']);
unset($_SESSION['msg']);
}
$x=mysql_query("SELECT * FROM `obyv` ORDER BY `id` DESC LIMIT 1");
while($row=mysql_fetch_assoc($x))
{
if($ku['read_obyv']==0)
{
if(isset($_GET['read_obyv']))
{
mysql_query("UPDATE `kolhoz_user` SET `read_obyv` = '1' WHERE `id` = '$ku[id]'");
header("Location:?obyv");
}
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$row[id_user]'"));
echo '<div class="feedback"><div>'.($row['name']!=NULL?'<font color="red"><b>'.$row['name'].'...</b></font><br/>':null).'';
echo "".output_text($row['opis'], $ank['id'])."<br/>";
echo '<b>'.on_k($ank['id']).' <a href="?user='.$ank['id'].'">'.nc($ank['id']).'</a></b><br/>';
echo "<img width='16' height='16' src='images/icons/tick.png' alt='o'> <a href='?read_obyv'>Просмотреть</a></div></div>";
}
{
echo "<div class='feedback'><TABLE WIDTH='100%' >";
echo "<TR>";

echo "<TD><center><a href='?taxi'><div class='block'><img width='23' height='23' src='images/Avto/cabrioletred_2546.png' alt='o'></div></a></center></TD>";
echo "<TD><center><a href='?mypetfarm'><div class='block'><img width='23' height='23' src='images/perevoz/avtobus.png' alt='o'></div></a></center></TD>";
echo "<TD><center><a href='?shop'><div class='block'><img width='23' height='23' src='images/icons/cart.png' alt='o'></div></a></center></TD>";
echo "<TD><center><a href='?settings'><div class='block'><img width='23' height='23' src='images/panel.png' alt='o'></div></a></center></TD>";
echo "<TD><center><a href='?center'><div class='block'><img width='23' height='23' src='images/icons/center.png' alt='o'></div></a></center></TD>";
echo "<TD><center><a href='?converter'><div class='block'><img width='23' height='23' src='images/icons/obmen.png' alt='o'></div></a></center></TD>";
echo "</TR>";
echo "</TABLE></div></span>";
}
}
?>