Файл: inc/user/menu.php
Строк: 266
<?
$title='Главная';
include_once '../system/config.php';
echo '<img src="http://'.$_SERVER['HTTP_HOST'].'/img/logo.gif">';
define('TIME', time());
$ixp =mysql_fetch_array(mysql_query("SELECT * FROM `exp` WHERE `id` = '1'"));
if(isset($exp3))echo"<div class ='block'><center><img src='/img/icons/new/dostig.png' alt='0' n=''/> тройной опыт на ".time_left($ixp['time']-$time)." </center></div>";
if($ku['expdouble']==date("D"))echo"<div class ='block'><center><img src='/img/icons/new/dostig.png' alt='0' n=''/> двойной опыт </center></div>";
echo "<a class='menu-foot' href='/garden/'><img src='/icon/1.png' alt='o'></div> Грядки ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND (`id_plant` = '0' OR `time_water` = '$time' OR `time` = '$time' OR `time_water` < '$time' OR `time` < '$time' OR (`time_soil` = '$time' AND `soil` = '0') OR (`time_soil` < '$time' AND `soil` = '0'))"),0)!=0?"<span class='n'>(".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND (`id_plant` = '0' OR `time_water` = '$time' OR `time` = '$time' OR `time_water` < '$time' OR `time` < '$time' OR (`time_soil` = '$time' AND `soil` = '0') OR (`time_soil` < '$time' AND `soil` = '0'))"),0).")</span>":null)."</a></div>";
{
$count_mon=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0' AND (`time_money` = '$time' OR `time_money` < '$time')"),0);
$q=mysql_query("SELECT * FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0'");
$count_gol=0;
while($post=mysql_fetch_array($q))
{
$max_time=$time+$post['level']*(3600*4);
$mezh_time=$max_time-$post['time'];
if($mezh_time>=4*3600)$count_gol++;
}
$q=mysql_query("SELECT * FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0'");
$count_mon=0;
while($post=mysql_fetch_array($q))
{
$d_money=floor($post['time_money2']/(4*3600));
if($d_money>0)$count_mon++;
}
if($count_gol>$count_mon)$count_zag=$count_mon;else $count_zag=$count_mon;
if($ku['level']>1)echo "<a class='menu-foot' href='/barnyard/'><img src='/icon/2.png' alt='o'> Загоны ".($count_zag?"<span class='n'>($count_zag)</span>":null)."</a></div>";
if($ku['level']<1)echo "<a class='menu-foot'><img src='/icon/2_no.png' alt='o'> С 10 ур. ".($count_zag?"<span class='n'>($count_zag)</span>":null)."";
}
if($ku['level']>1)echo "<a class='menu-foot' href='/cellar/'><img src='/icon/3.png' alt='o'> Погреб ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]' AND (`id_recipes` = '0' OR `clean` = '0' OR `time` = '$time' OR `time` < '$time')"),0)!=0?"<span class='n'>(".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]' AND (`id_recipes` = '0' OR `time_water` = '$time' OR `time` = '$time' OR `clean` = '0' OR `time` = '$time' OR `time` < '$time')"),0).")</span>":null)."</a></div>";
if($ku['level']<1)echo "<a class='menu-foot'><img src='/icon/3_no.png' alt='o'> С 10 ур. ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]' AND (`id_recipes` = '0' OR `clean` = '0' OR `time` = '$time' OR `time` < '$time')"),0)!=0?"<span class='n'>(".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]' AND (`id_recipes` = '0' OR `time_water` = '$time' OR `time` = '$time' OR `clean` = '0' OR `time` = '$time' OR `time` < '$time')"),0).")</span>":null)."</a></div>";
$fish = mysql_fetch_array(mysql_query('SELECT * FROM `kolhoz_fishery` WHERE `id_user`="'.$ku['id'].'" LIMIT 1'));
if ($fish['bait'] > 0){
$bait = mysql_fetch_array(mysql_query('SELECT * FROM `kolhoz_fishery_data` WHERE `type`="bait" and `id`="'.$fish['bait'].'" LIMIT 1'));
$bait_tf = ($fish['food_time'] > TIME ? $bait['time'] - ($bait['time'] * $food['interest'] / 100) : $bait['time']);
$ttb_prog = (TIME - $fish['rod_time']) / ($bait_tf / 100);
}else $ttb_prog = 0;
if($ku['level']>1)echo '<a class="menu-foot" href="/fishery/"><img src="/icon/7.png" alt="o"> Рыбалка '.($ttb_prog>=100&&$fish['rod_act']==1?"(!)":null).'</a></div>';
if($ku['level']<1)echo '<a class="menu-foot"><img src="/icon/7_no.png" alt="o"> С 10 ур.</a></div>';
echo '<a class="menu-foot" href="/warehouse/"><img src="/icon/3.png" alt="o"> Амбар</a></div>';
echo '<a class="menu-foot" href="/village/"><img src="/icon/4.png" alt="o"> Деревня</a></div>';
echo '<a class="menu-foot" href="/action/"><img src="/icon/10.png"> Акция</a></div>';
echo "<a class='menu-foot' href='/mail/'><img src='/icon/11.png'> Почта ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0?" (".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0).")":null)."</a></div>";
echo '<a class="menu-foot" href="/payment/"><img src="/icon/14.png" alt="o"> Рубины</a></div>';
echo '<a class="menu-foot" href="/shop/"><img src="/icon/15.png" alt="o"> Магазин</a></div>';
echo '<a class="menu-foot" href="/chat"><img src="/icon/13.png" alt="o"> Общение</a></div>';
echo "</center>";
/*
$assignment = mysql_fetch_array(mysql_query("SELECT * FROM `assignments_user` WHERE `id_user` = '$ku[id]'"));
$ass = mysql_fetch_array(mysql_query("SELECT * FROM `assignments` WHERE `id` = '$assignment[assignment]'"));
if($ku['level']>=10 && $assignment['assignment']<1)echo'<br><a class="button24" href="/assignments/">Задания</a>';
if($assignment['assignment']>0)echo'<br><a class="button24" href="/assignments/id/'.$ass['id'].'">'.$ass['name'].'</a>';
*/
echo "<table style='width:100%;'><tr>";
echo'<td style="25%">
<a class="menu-foot" href="/user/'.$ku['id'].'">
<center>Профиль</center></a>
</td></div> ';
if($mc['id']>0)
echo'<td style="25%">
<a class="menu-foot" href="/kolhoz/'.$mc['id'].'">
<center>Колхоз</center></a>
</td> ';
if($mc['id']<1)
echo'<td style="25%">
<a class="menu-foot" href="/RatingKolhoz/">
<center>Колхоз</center></a>
</td></div>';
echo "</tr></table>";
echo'</div></div></div></div></div>';
$max = $level['rating'];
$tek = $kr;
$forl = ($tek/$max)*100;
$lol=$level['rating']-$kr;
$x = $kr / $level['rating'] * 100;
$xs = ceil($x);
echo '
<div class="gray_container"><div class="f-progress-exp">
<span class="f-progress-exp-text">
<span>'.rating($tek).'</span>/<span>'.rating($level['rating']).'</span> опыта
</span>
<div class="level"></div>
<span class="level left">'.$ku['level'].'</span><div class="f-progress-exp-fill" ></div></div><div class="f center bigger">
<div class="lblue">';
echo"Вы вошли как $ku[nick]<br />";
echo'</div>';
echo '<span class="lgray">
<a href="help/">Помощь</a> |
<a href="/online"><span>Онлайн('.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-3600)."'"), 0).')</span></a> | <a href="/settings">Настройки</a><br/>';
echo '<a href="/support">Поддержка</a> |
</span>
<span class="lgray">
<a href="/out">Выйти</a>
</span>
</div></div>';
echo"<div class='div5'><div style='text-align:center;'>";
echo" ".($ku['status']==3?"<a href='/AdminPanel'>Админка</a>":null)."".($ku['status']>0?" | <a href='/ModerationPhoto'>Модерация фото</a> ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `user_avatar` WHERE `check` = '0'"),0)!=0?" (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user_avatar` WHERE `check` = '0'"),0).")":null)."</a>":null)."".($ku['status']==1 || $ku['status']==3?"| <a href='/TicketSupport'>Тикеты</a> ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `me_tikets` WHERE `read` < '1'"),0)!=0?" (".mysql_result(mysql_query("SELECT COUNT(*) FROM `me_tikets` WHERE `read` < '1'"),0).")":null)."":null)." ".($ku['status']>0?" | <a href='/AdminComplaint'>Жалобы</a> ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `complaint` WHERE `check` = '0'"),0)!=0?" (".mysql_result(mysql_query("SELECT COUNT(*) FROM `complaint` WHERE `check` = '0'"),0).")":null)."</a>":null)."<br>";
echo '</div>';
echo'<div style="text-align:center;" class="small">';
echo "Онлайн игра <span class='epic'>Милая Ферма</span><div> </span>";
$date = date("d $m");
$today[1] = date("H:i:s");
echo(" $date $today[1]");
echo "<div></div><div style='text-align:center;'><div></span>";
echo "</div>";
echo '<center><script type="text/javascript" src="http://mobtop.ru/c/108696.js"></script><noscript><a href="http://mobtop.ru/in/108696"><img src="http://mobtop.ru/108696.gif" alt="MobTop.Ru - рейтинг мобильных сайтов"/></a></noscript>
<br /> <!--LiveInternet counter--><script type="text/javascript">new Image().src = "//counter.yadro.ru/hit?r" + escape(document.referrer) + ((typeof(screen)=="undefined")?"" : ";s"+screen.width+"*"+screen.height+"*" + (screen.colorDepth?screen.colorDepth:screen.pixelDepth)) + ";u"+escape(document.URL) + ";" +Math.random();</script>
<!--/LiveInternet-->
<!--LiveInternet logo--><a href="//www.liveinternet.ru/click" target="_blank"><img src="//counter.yadro.ru/logo?26.6" border="0" width="88" height="15" alt="" title="LiveInternet: показано число посетителей за сегодня"/></a><!--/LiveInternet--></center>';
if(isset($mc))
{
include_once $_SERVER['DOCUMENT_ROOT'].'/inc/collective/next_level_collective.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/inc/collective/station_act.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/inc/collective/count_cash.php';
}
$count=$ku['flowerbed']+$ku['cultivator']+$ku['irregate']+$ku['soiler']+$ku['conveyor']+$ku['seeder']+$ku['fooder']+$ku['fishfooder']+$ku['autocrane']+$ku['incubator']+$ku['iseeder']+$ku['plug']+$ku['harvester'];
mysql_query("UPDATE `kolhoz_user` SET `tehnika` = '$count' WHERE `id` = '$ku[id]'");
if($ku['time_start']==0 || $ku['time_start']==NULL)mysql_query("UPDATE `kolhoz_user` SET `time_start` = '$time' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `count_cp` = '0' WHERE `time_cp` < '$time'");
mysql_query("UPDATE `kolhoz_collective_user` SET `rubies` = '0' WHERE `rubies` = ''");
exit;
?>