<?php
//error_reporting(E_ALL^E_NOTICE);
define( '_IN_JOHNCMS', 1 );
$headmod = 'kolhoz';
require( '../incfiles/core.php' );
$set[ p_str ] = $kmess;
include_once 'inc/head.php';
//$shift = ($resa['timeshift'] + $user_set['timeshift']) * 3600;
$shift = ( core::$system_set[ 'timeshift' ] + core::$user_set[ 'timeshift' ] ) * 3600;
$time  = time() + $shift;
$textl = "Удивительный колхоз";
require_once( '../incfiles/head.php' );
echo '<link rel="stylesheet" href="' . $set[ 'homeurl' ] . '/kolhoz/main.css" type="text/css" />';
if ( $ku[ 'pda' ] == 1 )
{
    echo '<link rel="stylesheet" href="' . $set[ 'homeurl' ] . '/kolhoz/tch.css" type="text/css" />';
}
//Даем СВ права админа в игре
if ( $rights == 9 && $ku[ dostup ] != 1 )
{
    mysql_query( "UPDATE `$db_base`.`kolhoz_user` SET `dostup` = '1',`status` = '3' WHERE `idus` = '$user_id'" ) or die( mysql_error() );
}
//Функции
include_once 'inc/functions.php';
//если еще не играл
if ( !isset( $ku ) )
{
    include_once 'inc/no_auth.php';
}
include_once 'inc/start.php';
echo '<div class="block2">';
//ТЕХНИКA
include_once 'inc/tehnika.php';
//ПЕРЕХОД НА СЛЕДУЮЩИЙ УРОВЕНЬ
include_once 'inc/next_level.php';
//Шапка
include_once 'inc/uhead.php';
$idm = 365;
if ( $ku[ 'level' ] >= 15 )
{
    if ( isset( $_GET[ 'get_prize' ] ) )
    {
        echo "<div class='event'><h1>Вы поймали сюрприз!</h1></div>";
        echo '<div class="content"><div class="block">';
        if ( isset( $_GET[ 'gen_code' ] ) && $_SESSION[ 'prize' ] == $_GET[ 'gen_code' ] && isset( $_SESSION[ 'prize' ] ) )
        {
            $rr             = rand( 3, 150 );
            $ku[ 'rubies' ] = plus_rubies( $rr );
            $rm             = rand( 0, 500000 );
            $ku[ 'money' ]  = plus_money( $rm );
            $ra             = rand( 1, 50 );
            $ku[ 'almaz' ]  = plus_almaz( $ra );
            echo "Поздравляем! Вы поймали <img src='images/icons/ruby.png'/> <span class='title'>$rr</span>, <img width='16' height='16' src='images/icons/almaz.png' alt='o'> <span>$ra</span> " . ( $rm != 0 ? " и <img src='images/icons/money.png'/> <span class='title'>$rm</span>" : null ) . ".";
            unset( $_SESSION[ 'prize' ] );
        }
        else
        {
            echo "Эх, не успели!";
        }
        echo "</div>";
        include_once 'inc/foot.php';
    }
    $rand = rand( 1, 100 );
    if ( $rand == 38 || $rand == 67 || $rand == 96 )
    {
        $_SESSION[ 'prize' ] = md5( $rand );
        echo "<div class='feedback'><center><img src='images/icons/ruby.png'> <a href='?get_prize=1&gen_code=" . md5( $rand ) . "'>Лови сюрприз!</a> <img src='images/icons/ruby.png'></center></div>";
    }
}
if ( isset( $_GET[ 'shop' ] ) )
{
    include_once 'inc/shop.php';
} //Магазин
elseif ( isset( $_GET[ 'mywork' ] ) )
{
    include_once 'inc/mywork.php';
} //робота
elseif ( isset( $_GET[ 'tur' ] ) )
{
    include_once 'inc/tur.php';
} //Турнир
elseif ( isset( $_GET[ 'zags' ] ) )
{
    include_once 'zags/index.php';
} //Загс
elseif ( isset( $_GET[ 'razvod' ] ) )
{
    include_once 'zags/razvod.php';
} //Развестись
elseif ( isset( $_GET[ 'action' ] ) )
{
    include_once 'zags/zags.php';
} //Сделать предложение
elseif ( isset( $_GET[ 'act=svad' ] ) )
{
    include_once '?act=svad';
}
elseif ( isset( $_GET[ 'kustatus' ] ) )
{
    include_once 'status/index.php';
} //Статус
elseif ( isset( $_GET[ 'myfarm' ] ) )
{
    include_once 'inc/myfarm.php';
} //Грядки
elseif ( isset( $_GET[ 'ozero' ] ) )
{
    include_once 'inc/fish.php';
} //Пруды
elseif ( isset( $_GET[ 'mypetfarm' ] ) )
{
    include_once 'inc/petfarm.php';
} //Загоны
elseif ( isset( $_GET[ 'warehouse' ] ) )
{
    include_once 'inc/warehouse.php';
} //Амбар
elseif ( isset( $_GET[ 'center' ] ) )
{
    include_once 'inc/center.php';
} //Город
elseif ( isset( $_GET[ 'mycellar' ] ) && $ku[ 'level' ] >= 16 )
{
    include_once 'inc/mycellar.php';
} //Погреб
elseif ( isset( $_GET[ 'ikonka' ] ) )
{
    include_once 'inc/ica.php';
} //Иконка
elseif ( isset( $_GET[ 'mailing' ] ) )
{
    include_once 'inc/mailing.php';
} //Почта колхоза
elseif ( isset( $_GET[ 'buy_plant' ] ) )
{
    include_once 'inc/buy_plant.php';
} //Магазин овощей
elseif ( isset( $_GET[ 'converter' ] ) )
{
    include_once 'inc/converter.php';
} //Обменник
elseif ( isset( $_GET[ 'lottery' ] ) && $ku[ 'level' ] >= 20 )
{
    include_once 'inc/lottery.php';
} //Лотерея
elseif ( isset( $_GET[ 'lotteryk' ] ) && $ku[ 'level' ] >= 1 )
{
    include_once 'inc/lotterry.php';
} //лотерея рубины
elseif ( isset( $_GET[ 'online' ] ) )
{
    include_once 'inc/online.php';
} //Онлайн
elseif ( isset( $_GET[ 'chat' ] ) )
{
    include_once 'inc/chat.php';
} //Чат
elseif ( isset( $_GET[ 'search' ] ) )
{
    include_once 'inc/search.php';
} //Поиск юзера
elseif ( isset( $_GET[ 'search_collective' ] ) )
{
    include_once 'inc/search_ct.php';
} //поиск колхоза
elseif ( isset( $_GET[ 'mytreefarm' ] ) )
{
    include_once 'inc/treefarm.php';
} //Сад
elseif ( isset( $_GET[ 'settings' ] ) )
{
    include_once 'inc/settings.php';
} //Настройки
elseif ( isset( $_GET[ 'ava' ] ) )
{
    include_once 'inc/ava.php';
} //Ава
elseif ( isset( $_GET[ 'rules' ] ) )
{
    include_once 'inc/rules.php';
} //Правила
elseif ( isset( $_GET[ 'market' ] ) )
{
    include_once 'inc/market.php';
} //Рынок
elseif ( isset( $_GET[ 'help' ] ) && ( $_GET[ 'help' ] == 'recipes' || $_GET[ 'help' ] == 'plants' || $_GET[ 'help' ] == 'animals' || $_GET[ 'help' ] == 'works' || $_GET[ 'help' ] == 'fishs' || $_GET[ 'help' ] == 'trees' || $_GET[ 'help' ] == 'soils' ) )
//Справка в магазине
{
    if ( $_GET[ 'help' ] == 'plants' )
        include_once 'inc/help/hp.php';
    elseif ( $_GET[ 'help' ] == 'animals' )
        include_once 'inc/help/ha.php';
    elseif ( $_GET[ 'help' ] == 'soils' )
        include_once 'inc/help/hs.php';
    elseif ( $_GET[ 'help' ] == 'trees' )
        include_once 'inc/help/ht.php';
    elseif ( $_GET[ 'help' ] == 'fishs' )
        include_once 'inc/help/hf.php';
    elseif ( $_GET[ 'help' ] == 'recipes' )
        include_once 'inc/help/hr.php';
    if ( $_GET[ 'help' ] == 'works' )
        include_once 'inc/help/hw.php';
}
elseif ( isset( $_GET[ 'user' ] ) && intval( $_GET[ 'user' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'user' ] ) . "'" ), 0 ) != 0 )
//Анкета
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'user' ] ) . "'" ) );
    $au  = mysql_fetch_array( mysql_query( "SELECT * FROM `users` WHERE `id` = '$ank[idus]'" ) );
    include_once 'inc/user.php';
}
elseif ( isset( $_GET[ 'presents' ] ) && intval( $_GET[ 'presents' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'presents' ] ) . "'" ), 0 ) != 0 )
//Подарки
{
    include_once 'inc/presents.php';
}
elseif ( isset( $_GET[ 'collectives' ] ) )
{
    include_once 'inc/collectives.php';
} //Колхозы список
    
//Госзаказ
elseif ( isset( $_GET[ 'gos' ] ) && $goss = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_collective_gos` WHERE `id` = '" . intval( $_GET[ 'gos' ] ) . "'" ) ) )
{
    include_once 'inc/gos.php';
}
elseif ( isset( $_GET[ 'gos' ] ) )
{
    include_once 'inc/action.php';
}
elseif ( isset( $_GET[ 'goshistory' ] ) )
{
    include_once 'inc/goshistory.php';
}
//Госконкурс
elseif ( isset( $_GET[ 'comp' ] ) && $comp = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_collective_comp` WHERE `id` = '" . intval( $_GET[ 'comp' ] ) . "'" ) ) )
{
    include_once 'inc/comp.php';
}
elseif ( isset( $_GET[ 'comphistory' ] ) )
{
    include_once 'inc/comphistory.php';
}
elseif ( isset( $_GET[ 'comp' ] ) )
{
    include_once 'inc/comp_page.php';
}
elseif ( isset( $_GET[ 'anketa' ] ) )
{
    $au = mysql_fetch_array( mysql_query( "SELECT * FROM `users` WHERE `id` = '$ku[idus]'" ) );
    include_once 'inc/anketa.php';
} //Редактировать профиль
elseif ( isset( $_GET[ 'mycollective' ] ) )
{
    include_once 'inc/mycollective.php';
}
elseif ( isset( $_GET[ 'collective_create' ] ) )
{
    include_once 'inc/collective_create.php';
}
elseif ( isset( $_GET[ 'friends' ] ) )
{
    include_once 'inc/friends.php';
} //Друзья
elseif ( isset( $_GET[ 'blacklist' ] ) )
{
    include_once 'inc/blacklist.php';
} //Блеклист
elseif ( isset( $_GET[ 'rating' ] ) && !isset( $_GET[ 'collective' ] ) )
{
    include_once 'inc/rating.php';
}
elseif ( isset( $_GET[ 'p_mail' ] ) )
{
    include_once 'inc/p_mail.php';
}//Почта
elseif ( isset( $_GET[ 'mail' ] ) )
{
    include_once 'inc/mail.php';
}//Почта
elseif ( isset( $_GET[ 'presents' ] ) && intval( $_GET[ 'presents' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'presents' ] ) . "'" ), 0 ) != 0 )
{
    include_once 'inc/presents.php';
}//Подарок дарить


//elseif(isset($_GET['zg'])){include_once 'inc/zg.php';}
    
//elseif(isset($_GET['forum'])){include_once 'inc/forum.php';}
    
//elseif(isset($_GET['support'])){include_once 'inc/support.php';}
    
//elseif(isset($_GET['db_connect'])) {include_once 'inc/db_connect.php';}
    
//elseif(isset($_GET['mailshpion'])){include_once 'mailshpion.php';}
    
//elseif(isset($_GET['change_nickname'])){include_once 'inc/change_nick.php';}
    
//elseif(isset($_GET['anketa'])){include_once 'inc/anketa.php';}
elseif ( isset( $_GET[ 'pr' ] ) )
{
    include_once 'inc/pr.php';
}
elseif ( isset( $_GET[ 'pkey' ] ) )
{
    include_once 'inc/pkey.php';
}
elseif ( isset( $_GET[ 'pkeyp' ] ) )
{
    include_once 'inc/pkeyp.php';
}
elseif ( isset( $_GET[ 'nk' ] ) )
{
    include_once 'inc/nk.php';
}
elseif ( isset( $_GET[ 'bank' ] ) )
{
    include_once 'inc/bank.php';
}

elseif ( isset( $_GET[ 'warehouse' ] ) )
{
    include_once 'inc/warehouse.php';
}
elseif ( isset( $_GET[ 'center' ] ) )
{
    include_once 'inc/center.php';
}
elseif ( isset( $_GET[ 'airport' ] ) )
{
    include_once 'inc/airport.php';
}
elseif ( isset( $_GET[ 'kassa' ] ) )
{
    include_once 'inc/kassa.php';
}
elseif ( isset( $_GET[ 'pkey' ] ) )
{
    include_once 'inc/pkey.php';
}
elseif ( isset( $_GET[ 'pkeyp' ] ) )
{
    include_once 'inc/pkeyp.php';
}
elseif ( isset( $_GET[ 'zkeyz' ] ) )
{
    include_once 'inc/zkeyz.php';
}
elseif ( isset( $_GET[ 'nk' ] ) )
{
    include_once 'inc/nk.php';
}
elseif ( isset( $_GET[ 'ta' ] ) )
{
    include_once 'inc/ta.php';
}
elseif ( isset( $_GET[ 'tb' ] ) )
{
    include_once 'inc/tb.php';
}
elseif ( isset( $_GET[ 'df' ] ) )
{
    include_once 'inc/df.php';
}
elseif ( isset( $_GET[ 'rd' ] ) )
{
    include_once 'inc/rd.php';
}
elseif ( isset( $_GET[ 'firm' ] ) )
{
    include_once 'inc/firm.php';
}
elseif ( isset( $_GET[ 'rating' ] ) && !isset( $_GET[ 'collective' ] ) )
{
    include_once 'inc/rating.php';
}
elseif ( isset( $_GET[ 'collective_create' ] ) )
{
    include_once 'inc/collective_create.php';
}
elseif ( isset( $_GET[ 'online' ] ) )
{
    include_once 'inc/online.php';
}
elseif ( isset( $_GET[ 'mailror' ] ) )
{
    include_once 'inc/mailror.php';
}
elseif ( isset( $_GET[ 'chat' ] ) )
{
    include_once 'inc/chat.php';
}
elseif ( isset( $_GET[ 'search' ] ) )
{
    include_once 'inc/search.php';
}
elseif ( isset( $_GET[ 'search_collective' ] ) )
{
    include_once 'inc/search_ct.php';
}
elseif ( isset( $_GET[ 'collectives' ] ) )
{
    include_once 'inc/collectives.php';
}
elseif ( isset( $_GET[ 'mycollective' ] ) )
{
    include_once 'inc/mycollective.php';
}
elseif ( isset( $_GET[ 'send' ] ) )
{
    include_once 'inc/send.php';
}
elseif ( isset( $_GET[ 'pozor' ] ) )
{
    include_once 'inc/pozor.php';
}
elseif ( isset( $_GET[ 'mail' ] ) )
{
    include_once 'inc/mail.php';
}
elseif ( isset( $_GET[ 'uf' ] ) && intval( $_GET[ 'uf' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uf' ] ) . "'" ), 0 ) != 0 )
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uf' ] ) . "'" ) );
    $au  = $ank;
    include_once 'inc/uf.php';
}
elseif ( isset( $_GET[ 'upf' ] ) && intval( $_GET[ 'upf' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'upf' ] ) . "' AND (`level` = '10' OR `level` > '10')" ), 0 ) != 0 )
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'upf' ] ) . "'" ) );
    $au  = $ank;
    include_once 'inc/upf.php';
}
elseif ( isset( $_GET[ 'uo' ] ) && intval( $_GET[ 'uo' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uo' ] ) . "'" ), 0 ) != 0 )
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uo' ] ) . "'" ) );
    $au  = $ank;
    include_once 'inc/uo.php';
}
elseif ( isset( $_GET[ 'uc' ] ) && intval( $_GET[ 'uc' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uc' ] ) . "' AND (`level` = '1' OR `level` > '1')" ), 0 ) != 0 )
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uc' ] ) . "'" ) );
    include_once 'inc/uc.php';
}
elseif ( isset( $_GET[ 'uw' ] ) && intval( $_GET[ 'uw' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uw' ] ) . "' AND (`level` = '15' OR `level` > '15')" ), 0 ) != 0 )
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uw' ] ) . "'" ) );
    $au  = $ank;
    include_once 'inc/uw.php';
}

elseif ( isset( $_GET[ 'perevod' ] ) && intval( $_GET[ 'perevod' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'perevod' ] ) . "' AND `rating` < '$ku[rating]'" ), 0 ) != 0 )
{
    $ank  = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'perevod' ] ) . "'" ) );
    $anku = $ank;
    include_once 'inc/perevod.php';
}
elseif ( isset( $_GET[ 'perevod2' ] ) && intval( $_GET[ 'perevod2' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'perevod2' ] ) . "'" ), 0 ) != 0 && $ku[ 'status' ] == 3 )
{
    $ank  = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'perevod2' ] ) . "'" ) );
    $anku = $ank;
    include_once 'inc/perevod2.php';
}
elseif ( isset( $_GET[ 'perevod3' ] ) && intval( $_GET[ 'perevod3' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'perevod3' ] ) . "'" ), 0 ) != 0 && $ku[ 'status' ] == 3 )
{
    $ank  = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'perevod2' ] ) . "'" ) );
    $anku = $ank;
    include_once 'inc/perevod3.php';
}
elseif ( isset( $_GET[ 'dostig' ] ) && intval( $_GET[ 'dostig' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'dostig' ] ) . "'" ), 0 ) != 0 )
{
    $ank  = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'dostig' ] ) . "'" ) );
    $anku = $ank;
    include_once 'inc/dostig.php';
}
elseif ( isset( $_GET[ 'collective' ] ) && $ct = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_collective` WHERE `id` = '" . intval( $_GET[ 'collective' ] ) . "'" ) ) )
{
    include_once 'inc/collective.php';
}
elseif ( isset( $_GET[ 'uf' ] ) && intval( $_GET[ 'uf' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uf' ] ) . "'" ), 0 ) != 0 )
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uf' ] ) . "'" ) );
    $au  = mysql_fetch_array( mysql_query( "SELECT * FROM `users` WHERE `id` = '$ank[idus]'" ) );
    include_once 'inc/uf.php';
}
elseif ( isset( $_GET[ 'upf' ] ) && intval( $_GET[ 'upf' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'upf' ] ) . "' AND (`level` = '10' OR `level` > '10')" ), 0 ) != 0 )
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'upf' ] ) . "'" ) );
    $au  = mysql_fetch_array( mysql_query( "SELECT * FROM `users` WHERE `id` = '$ank[idus]'" ) );
    include_once 'inc/upf.php';
}
elseif ( isset( $_GET[ 'uc' ] ) && intval( $_GET[ 'uc' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uc' ] ) . "' AND (`level` = '10' OR `level` > '10')" ), 0 ) != 0 )
{
    $ank = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'uc' ] ) . "'" ) );
    $ku  = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '$ku[id]'" ) );
    include_once 'inc/uc.php';
}
elseif ( isset( $_GET[ 'perevod' ] ) && intval( $_GET[ 'perevod' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'perevod' ] ) . "' AND `rating` < '$ku[rating]'" ), 0 ) != 0 )
{
    $ank  = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'perevod' ] ) . "'" ) );
    $anku = mysql_fetch_array( mysql_query( "SELECT * FROM `users` WHERE `id` = '$ank[idus]'" ) );
    include_once 'inc/perevod.php';
}
elseif ( isset( $_GET[ 'communication' ] ) && intval( $_GET[ 'communication' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'communication' ] ) . "'" ), 0 ) != 0 )
{
    $ank  = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'communication' ] ) . "'" ) );
    $anku = mysql_fetch_array( mysql_query( "SELECT * FROM `users` WHERE `id` = '$ank[idus]'" ) );
    include_once 'inc/communication.php';
}
elseif ( isset( $_GET[ 'dostig' ] ) && intval( $_GET[ 'dostig' ] ) != NULL && mysql_result( mysql_query( "SELECT COUNT(*) FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'dostig' ] ) . "'" ), 0 ) != 0 )
{
    $ank  = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_user` WHERE `id` = '" . intval( $_GET[ 'dostig' ] ) . "'" ) );
    $anku = mysql_fetch_array( mysql_query( "SELECT * FROM `users` WHERE `id` = '$ank[idus]'" ) );
    include_once 'inc/dostig.php';
}
elseif ( isset( $_GET[ 'collective' ] ) && $ct = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_collective` WHERE `id` = '" . intval( $_GET[ 'collective' ] ) . "'" ) ) )
{
    include_once 'inc/collective.php';
}
elseif ( isset( $_GET[ 'gos' ] ) && $goss = mysql_fetch_array( mysql_query( "SELECT * FROM `$db_base`.`kolhoz_collective_gos` WHERE `id` = '" . intval( $_GET[ 'gos' ] ) . "'" ) ) )
{
    include_once 'inc/gos.php';
}
elseif ( isset( $_GET[ 'change_nick' ] ) )
{
    include_once 'inc/change_nick.php';
}
elseif ( isset( $_GET[ 'comphistory' ] ) )
{
    include_once 'inc/comphistory.php';
}
elseif ( isset( $_GET[ 'admin' ] ) && $ku[ 'dostup' ] == 1 && $rights==9)
{
    $admin = hsc( $_GET[ 'admin' ] );
    if ( $admin == 'plants' )
        $admin_name = 'Растения';
    elseif ( $admin == 'works' )
        $admin_name = 'Работы';
    elseif ( $admin == 'recipes' )
        $admin_name = 'Рецепты';
    elseif ( $admin == 'pets' )
        $admin_name = 'Животные';
    elseif ( $admin == 'fish' )
        $admin_name = 'Рыбы';
    elseif ( $admin == 'soils' )
        $admin_name = 'Удобрения';
    elseif ( $admin == 'levels' )
        $admin_name = 'Уровни';
    elseif ( $admin == 'gifts' )
        $admin_name = 'Подарки';
    elseif ( $admin == 'users' )
        $admin_name = 'Пользователи';
    elseif ( $admin == 'collectives' )
        $admin_name = 'Колхозы';
    elseif ( $admin == 'trees' )
        $admin_name = 'Деревья';
    else
        $admin_name = 'Админка';
    if ( in_array( $_GET[ 'admin' ], array(
         'pets',
        'plants',
        'fish',
        'trees',
        'recipes',
        'soils',
        'users',
        'collectives',
        'levels',
        'works',
        'gifts' 
    ) ) )
        include_once 'inc/admin/admin.' . trim( $_GET[ 'admin' ] ) . '.php';
    else
        include_once 'inc/admin/admin.list.php';
}
else
{
    include_once 'inc/myfarm.php';
}
include_once 'inc/foot.php';
?>