Вход Регистрация
Файл: ferma/inc/petfarm.php
Строк: 251
<?
if($ku['level']<30)
{
echo
'
<div class="event"><font color="F9EDA2"><b><g1>Сад</g1></b></font></div>
<div class="content">
<div class="block">
<font color="red">Сад доступен с 30-го уровня.</font>
</div></div>'
;
include_once 
'inc/foot.php';
exit;
}
include_once 
'inc/new_petground.php';
include_once 
'inc/level.php';
include_once 
'inc/level_all.php';
include_once 
'inc/sell_animal.php';
include_once 
'inc/buy_animal.php';
include_once 
'inc/food.php';
include_once 
'inc/food_all.php';
include_once 
'inc/money.php';
include_once 
'inc/money_all.php';
if(isset(
$_SESSION['err']))
{
echo 
err_game("Не хватает овощей в амбаре");
unset(
$_SESSION['err']);
}
echo 
"<div class='event'><font color='F9EDA2'><b><g1>Сад</g1></b></font></div>";
echo 
"<div class='content'>";
echo 
"<div class='block'>";
if(
$ku['scarecrow_time']>$time)echo "<li><img width='16' height='16' src='i/icons/scarecrow.png' alt='o'> <a class='epic' href='?shop=scarecrow'>Пугало</a><span class='minor'> на <span>".time_left($ku['scarecrow_time']-$time)."</span></span></li>";
if(
$ku['time_shmel']>$time)echo "<li><img width='16' height='16' alt='o' src='i/icons/heli1n.png'> <a class='epic' href='?shop=helicopter&1'>Шмель</a><span class='minor'> на <span>".time_left($ku['time_shmel']-$time)."</span></span></li>";
if(
$ku['time_yastreb']>$time)echo "<li><img width='16' height='16' alt='o' src='i/icons/heli2n.png'> <a class='epic' href='?shop=helicopter&2'>Ястреб</a><span class='minor'> на <span>".time_left($ku['time_yastreb']-$time)."</span></span></li>";
if(
$ku['time_drakon']>$time)echo "<li><img width='16' height='16' alt='o' src='i/icons/heli3n.png'> <a class='epic' href='?shop=helicopter&3'>Дракон</a><span class='minor'> на <span>".time_left($ku['time_drakon']-$time)."</span></span></li>";

if(
$ku['fooder']>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++;
}
if(
$count_gol!=0)echo "<div><img width='16' height='16' src='i/icons/plate.png' alt='o'> <a href='?mypetfarm&food_all'>Накормить всех</a></div>";
}

if(
$ku['conveyor']>&& !isset($_GET['moderate']))
{
$q=mysql_query("SELECT * FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0'");
$money2=0;
while(
$post=mysql_fetch_array($q))
{
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `id` = '$post[id_pet]'"));
$d_money=floor($post['time_money2']/(4*3600));
if(
$d_money>0)
{
$nt=$post['time_money2']-($d_money*14400);
$count=1;
$count_conveyor_act=0;
$count_vet_act=0;
if(isset(
$conveyor_act))$count_conveyor_act=($count/100)*$conveyor_act;
if(isset(
$vet_act))$count_vet_act=($count/100)*$vet_ps_m;
$count=$count_conveyor_act+$count_vet_act+$count;

$money=($count*$pet['money'])*$d_money;
$money2=$money2+$money;
}
}
if(
$money2>0)echo "<div><img width='16' height='16' src='i/icons/harvest.png' alt='o'> <a href='?mypetfarm&money_all'>Продать все</a> за <span><img width='16' height='16' src='i/icons/money.png' alt='o'> <span
class='title'>
$money2</span></span></div>";
}
echo 
"<div class='ptm'><ul>";
$q=mysql_query("SELECT * FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'");
while(
$post=mysql_fetch_array($q))
{
$pet=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pet` WHERE `id` = '$post[id_pet]'"));
echo 
"<g6><img width='60' height='80' src='".($post['id_pet']==0?"i/dirt_new.jpg":"i/pets/$pet[id].png")."' alt='o'  class='portrait'></g6>";
echo 
"<div>";
if(
$post['id_pet']==0)
{
echo 
"<img alt='o' width='16' height='16' src='i/tree.png'> <a href='?mypetfarm&buy=$post[id]'>Купить дерево</a>";
}
else
{
if(!isset(
$_GET['moderate']))
{
echo 
"<span class='title'>".hsc($pet['name'])."</span>";
if(
$post['time']>$time)echo "<span class='small minor'> (Сборка продукта через ".time_left($post['time']-$time).")</span>";
}
if(isset(
$_GET['moderate']))
{
echo 
"<li><img alt='' width='16' height='16' src='i/icons/money.png'> <a href='?mypetfarm&sell=$post[id]'>Продать дерево</a> за <span><img width='16' height='16' src='i/icons/money.png' alt='o'> <span
class='title'>"
.($pet['cena']/2)."</span></span></li>";
if(
$post['level']<20)
{
$post['next_level']=$post['level']+1;
$money_all_levels=0;
for(
$kp=$post['next_level'];$kp<=20;$kp++)
{
$money_all_levels=$money_all_levels+$kp;
}
}
}
else
{
echo 
"</div><div>";
$d_money=floor($post['time_money2']/(4*3600));
if(
$d_money>0)
{
$nt=$post['time_money2']-($d_money*14400);
$count=1;
$count_conveyor_act=0;
$count_vet_act=0;
if(isset(
$conveyor_act))$count_conveyor_act=($count/100)*$conveyor_act;
if(isset(
$vet_act))$count_vet_act=($count/100)*$vet_ps_m;
$count=$count_conveyor_act+$count_vet_act+$count;

$money=($count*$pet['money'])*$d_money;
echo 
"<img width='16' height='16' src='i/icons/money.png' alt='o'> <a class='' href='?mypetfarm&money=$post[id]'>Продать</a> за <span><img width='16' height='16' src='i/icons/money.png' alt='o'> <span
class='title'>
$money</span></span>";
}
else
{
$max_time=$time+$post['level']*(3600*4);
$mezh_time=$max_time-$post['time'];
if(
$mezh_time>=4*3600)echo "<img width='11' height='11' src='i/dot.png' alt='o'> <a class='' href='?mypetfarm&food=$post[id]'><span>Пришпилить</span></a>";
}
}
}
echo 
"</div>";
echo 
"<div style='clear:both'></div></li>";
}
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0)<20)echo "<li><img width='48' height='48' src='i/dirt_new.jpg' alt='o' class='portrait'><div><span class='title'>Новый загон</span></div><div><img width='16' height='16' src='i/icons/cart.png' alt='o'> <a href='?mypetfarm&new_petground'>Купить</a>
за <span class='title'><img width='16' height='16' src='i/icons/ruby.png' alt='o'> <span>"
.cpg(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0))."</span> рубинов</span></div><div style='clear:both'></div></li>";
echo 
"</ul></div>";
echo 
"<div class='ptm'><img width='16' height='16' src='i/icons/refresh.png' alt='o'> <a href='?mypetfarm&reflesh=".rand(99999,99999999)."'>Обновить</a><img alt='o' width='16' height='16' src='i/icons/moderate.png'> <a href='?mypetfarm&moderate'>Управление</a></div></div>";
echo 
"<b><font color='black'>Город</font></b>";
echo 
"<li><div><img width='12'
height='12'src='i/dot.png' alt='o'>
<a href='?shop'>Магазин</a></div></li>"
;
echo 
"<li><div><img width='12'height='12'src='i/dot.png' alt='o'><a href=' ?buy_plant '> Овошебаза</a></div></li>";
echo 
"<li><div><img width='12'height='12'src='i/dot.png' alt='o'><a href=' ?converter '> Обменник</a></div></li>";
echo 
"<li><div><img
width='12'height='12'src='i/dot.png' alt='o'><a href='?zags'> ЗАГС</a></div></li>"
;
echo 
"<b><font color='black'> Общественные места</font></b>";
echo 
"<li><div><img
width='12'height='12'src='i/dot.png' alt='o'><a href='?forum'> Форум</a></div></li>"
;
echo 
"<li><div><img
width='12'height='12'src='i/dot.png' alt='o'><a href='?chat'> Чат</a></div></li>"
;
echo 
"<b><font color='black'>Хозяйство</font></b>"
echo 
"<li><div><img width='12'height='12'src='i/dot.png'
alt='o'><a href='?farm'> Ферма</a></div></li>"
;
echo 
"<li><div><img I X
125 width='12'height='12'src='i/dot.png'
alt='o'><a href='?mypetfarm'> Загоны </a>"
;
if(
$ku['level']<30)echo "<font color='red'> с 30 уровня</
font> </a></div></li>"
;
echo 
"<li><div><img  width='12'height='12'src='i/dot.png'
alt='o'><a href='?vodoem_771351354'> Озеро </a>"
;
if(
$ku['level']<40)echo "<font color='red'>с 40 уровня</
font></a></div></li>"
;
echo 
"<br><li><img width='12' height='12'
src='i/dot.png' alt='o'> <a href='?
online'>Кто в игре</a> <span class='title'>
<span>"
.mysql_result(mysql_query("SELECT
COUNT(*) FROM `kolhoz_user` WHERE `date_last`
> '"
.(time()-600)."'"), 0)."</span></span></li>"
include_once 
'inc/foot.php';
?>
Онлайн: 1
Реклама