<?
if($ank['id']==701)
{
    header("location:/online/admin");
}
if(isset($_GET['tehnika'])){
echo "<div class='block'>";
echo "<ul>";
echo'<li class="pavelgrey">';

if($ank['flowerbed']>0)echo "<li><img width='16' height='16' src='images/icons/flowerbed.png' alt='*'> <a class='epic' href='/shop-flowerbed'>Клумба</a> <span class='minor'>(<span>$ank[flowerbed]</span>)</span></li>";
if($ank['cultivator']>0)echo "<li><img width='16' height='16' src='images/icons/dig.png' alt='*'> <a class='epic' href='/shop-cultivator'>Культиватор</a> <span class='minor'>(<span>$ank[cultivator]</span>)</span></li>";
if($ank['irregate']>0)echo "<li><img width='16' height='16' src='images/icons/water.png' alt='*'> <a class='epic' href='/shop-irregate'>Ороситель</a> <span class='minor'>(<span>$ank[irregate]</span>)</span></li>";
if($ank['seeder']>0)echo "<li><img width='16' height='16' src='images/icons/seat.png' alt='*'> <a class='epic' href='/shop-seeder'>Сеялка</a>
<span class='minor'>(<span>$ank[seeder]</span>)</span></li>";
if($ank['harvester']>0)echo "<li><img width='16' height='16' src='images/icons/harvest.png' alt='*'> <a class='epic' href='/shop-harvester'>Комбайн</a> <span class='minor'>(<span>$ank[harvester]</span>)</span></li>";
if($ank['soiler']>0)echo "<li><img width='16' height='16' src='images/icons/soil.png' alt='*'> <a class='epic' href='/shop-soiler'>Удобритель</a> <span class='minor'>(<span>$ank[soiler]</span>)</span></li>";
if($ank['conveyor']>0)echo "<li><img width='16' height='16' src='images/icons/harvest.png' alt='*'> <a class='epic' href='/shop-conveyor'>Конвейер</a> <span class='minor'>(<span>$ank[conveyor]</span>)</span></li>";
if($ank['fooder']>0)echo "<li><img width='16' height='16' src='images/icons/plate.png' alt='*'> <a class='epic' href='/shop-fooder'>Кормушка</a> <span class='minor'>(<span>$ank[fooder]</span>)</span></li>";

if($ank['cultivator2']>0)echo "<li><img width='16' height='16' src='images/icons/dig2.png' alt='*'> <a class='epic' href='/shop-cultivator2'>Пылесос</a> <span class='minor'>(<span>$ank[cultivator2]</span>)</span></li>";
if($ank['seeder2']>0)echo "<li><img width='16' height='16' src='images/icons/seeder2.png' alt='*'> <a class='epic' href='/shop-seeder2'>Поставилка</a> <span class='minor'>(<span>$ank[seeder2]</span>)</span></li>";
if($ank['harvester2']>0)echo "<li><img width='16' height='16' src='images/icons/har2.png' alt='*'> <a class='epic' href='/shop-harvester2'>Комбайн Дон</a> <span class='minor'>(<span>$ank[harvester2]</span>)</span></li>";
if($ank['avtoconveyor']>0)echo "<li><img width='16' height='16' src='images/icons/truck_empty.png' alt='*'> <a class='epic' href='/shop-avtoconveyor'>Автоконвейер</a> <span class='minor'>(<span>$ank[avtoconveyor]</span>)</span></li>";
if($ank['avtofooder']>0)echo "<li><img width='16' height='16' src='images/icons/autosoil.png' alt='*'> <a class='epic' href='/shop-avtofooder'>Авто-удобритель</a> <span class='minor'>(<span>$ank[avtofooder]</span>)</span></li>";
if($ank['fishfooder']>0)echo "<li><img width='16' height='16' src='images/icons/avtofooder.png' alt='*'> <a class='epic' href='/shop-fishfooder'>Автокормушка</a> <span class='minor'>(<span>$ank[fishfooder]</span>)</span></li>";
if($ank['autocrane']>0)echo "<li><img width='16' height='16' src='images/icons/avtokonveer.png' alt='*'> <a class='epic' href='/shop-autocrane'>Автопогрузчик</a> <span class='minor'>(<span>$ank[autocrane]</span>)</span></li>";
if($ank['incubator']>0)echo "<li><img width='16' height='16' src='images/fish/ss-hrvst.png' alt='*'> <a class='epic' href='/shop-incubator'>Инкубатор</a> <span class='minor'>(<span>$ank[incubator]</span>)</span></li>";
if($ank['garden_time']>$time){
if($ank['gardener']==1)$gardenName='Молчан';
if($ank['gardener']==2)$gardenName='Казимир';
if($ank['gardener']==3)$gardenName='Ярило';
echo "<li><img width='16' height='16' src='images/icons/gardener$ank[gardener].png' alt=''> <a class='epic' href='/shop-gardener/id-$ank[gardener]'>Садовник $gardenName</a> <span class='minor'> на <span>".time_left($ank['garden_time']-$time)."</span></span></li>";}
if($ank['hydropinics_time']>$time)echo "<li><img width='16' height='16' src='images/icons/hydropinics.png' alt='*'> <a class='epic' href='/shop-hydropinics'>Гидропоника</a><span class='minor'> $ank[hydropinics_type]% на <span>".time_left($ank['hydropinics_time']-$time)."</span></span></li>";
if($ank['scarecrow_time']>$time)echo "<li><img width='16' height='16' src='images/icons/scarecrow.png' alt='*'> <a class='epic' href='/shop-scarecrow'>Пугало</a><span class='minor'> на <span>".time_left($ank['scarecrow_time']-$time)."</span></span></li>";
if($ank['dog_time']>$time)echo "<li><img width='16' height='16' src='images/icons/dog.png' alt='*'> <a class='epic' href='/shop-dog'>Собака</a><span class='minor'> на <span>".time_left($ank['dog_time']-$time)."</span></span></li>";
if($ank['time_shmel']>$time)echo "<li><img width='16' height='16' alt='*' src='images/icons/heli1n.png'> <a class='epic' href='/shop-helicopter/1'>Шмель</a><span class='minor'> на <span>".time_left($ank['time_shmel']-$time)."</span></span></li>";
if($ank['time_yastreb']>$time)echo "<li><img width='16' height='16' alt='*' src='images/icons/heli2n.png'> <a class='epic' href='/shop-helicopter/2'>Ястреб</a><span class='minor'> на <span>".time_left($ank['time_yastreb']-$time)."</span></span></li>";
if($ank['time_drakon']>$time)echo "<li><img width='16' height='16' alt='*' src='images/icons/heli3n.png'> <a class='epic' href='/shop-helicopter/3'>Дракон</a><span class='minor'> на <span>".time_left($ank['time_drakon']-$time)."</span></span></li>";
if($ank['money2x_time']>$time)echo "<li><img width='25' alt='*' src='/pavelgrey/img/2xmoney.png'> <a class='epic' href='/payment'>Двойной доход</a><span class='minor'> на <span>".time_left($ank['money2x_time']-$time)."</span></span></li>";
if($ank['premium_time']>$time)echo "<li><img width='16' alt='*' src='/pavelgrey/img/gold.png'> <a class='epic' href='/payment'>Премиум карта</a><span class='minor'> на <span>".time_left($ank['premium_time']-$time)."</span></span></li>";
if($ank['WingsLove_time']>$time)echo "<li><img width='16' alt='*' src='/pavelgrey/img/WingsLove.png'> <a class='epic' href='/'>Крылья любви</a><span class='minor'> на <span>".time_left($ank['WingsLove_time']-$time)."</span></span></li>";

echo "</ul>";
echo "</div>";
        include_once'inc/foot.php';
}
if(isset($_GET['build'])){
echo "<div class='block'>";
echo "<ul>";
echo'<li class="pavelgrey">';
echo "<li><img width='25' src='/pavelgrey/img/MyBuildings/lfertilizer.png' alt='*'> Лаборатория удобрений <span class='minor'>(<span>$ank[lfertilizer]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/MyBuildings/treasury.png' alt='*'> Казначейство <span class='minor'>(<span>$ank[treasury]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/MyBuildings/vfactory.png' alt='*'> Ванильная фабрика <span class='minor'>(<span>$ank[vfactory]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/MyBuildings/rshop.png' alt='*'> Ремонтный цех <span class='minor'>(<span>$ank[rshop]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/MyBuildings/biowarehouse.png' alt='*'> Био склад <span class='minor'>(<span>$ank[biowarehouse]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/MyBuildings/labspices.png' alt='*'> Лаборатория пряностей <span class='minor'>(<span>$ank[labspices]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/MyBuildings/labsweets.png' alt='*'> Лаборатория сладостей <span class='minor'>(<span>$ank[labsweets]</span>)</span></li>";

echo "</ul>";
echo "</div>";
    include_once'inc/foot.php';
}
if(isset($_GET['talent'])){
echo "<div class='block'>";
echo "<ul>";
echo'<li class="pavelgrey">';
echo "<li><img width='25' src='/pavelgrey/img/talents/sadovod.png' alt='*'> Садовод <span class='minor'>(<span>$ank[talent_1]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/talents/zhivotnovod.png' alt='*'> Животновод <span class='minor'>(<span>$ank[talent_2]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/talents/pekar.png' alt='*'> Пекарь <span class='minor'>(<span>$ank[talent_3]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/talents/industrialist.png' alt='*'> Промышленник <span class='minor'>(<span>$ank[talent_4]</span>)</span></li>";
echo "<li><img width='25' src='/pavelgrey/img/talents/chef.png' alt='*'> Шеф-повар <span class='minor'>(<span>$ank[talent_5]</span>)</span></li>";

echo "</ul>";
echo "</div>";
    include_once'inc/foot.php';
}
error_reporting(E_ALL^E_NOTICE);
if(isset($_GET['history']))include_once 'inc/history.php';
if(isset($_GET['vipstatus']))include_once 'inc/vipstatus.php';
elseif(isset($_GET['bans']) && ($ank['id']==$ku['id'] || $ku['status']>0))include_once 'inc/bans.php';

if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_user` WHERE `id_user` = '$ank[id]'"),0)!=0)
{
$uctu=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective_user` WHERE `id_user` = '$ank[id]'"));
$uct=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective` WHERE `id` = '$uctu[id_collective]'"));
if($au['pol']==1)$uctu['status_name']='колхозник';else $uctu['status_name']='колхозница';
if($uctu['status']==1)$uctu['status_name']='председатель';
elseif($uctu['status']==2)$uctu['status_name']='зампред';
elseif($uctu['status']==3)$uctu['status_name']='агроном';
elseif($uctu['status']==4)$uctu['status_name']=($au['pol']==1?'бригадир':'хозяйка');
elseif($uctu['status']==5)$uctu['status_name']='староста';
elseif($uctu['status']==6)$uctu['status_name']=($au['pol']==1?'механизатор':'товаровёд');
}

if(isset($_GET['izg']) && ($ku['id']==1 || $ku['status']==3 || $ku['status']==1) && $ku['id']!=$ank['id'])
{
if(isset($_POST['msg']) OR isset($_POST['msg_fix']))
{
if(!empty($_POST['msg_fix']))$msg=$_POST['msg_fix'];else $msg=$_POST['msg'];
$timeban=$time;
if ($_POST['time']=='min')$timeban+=intval($_POST['timec'])*60;
if ($_POST['time']=='chas')$timeban+=intval($_POST['timec'])*60*60;
if ($_POST['time']=='sut')$timeban+=intval($_POST['timec'])*60*60*24;
if ($_POST['time']=='mes')$timeban+=intval($_POST['timec'])*60*60*24*30;
if ($_POST['time']=='forever')$timeban=0;
if ($timeban<$time && $_POST['time']!=='forever')err_game('Ошибка времени бана');

else if(strlen2($msg)<1)err_game("Введите причину");
else
{
mysql_query("INSERT INTO `kolhoz_ban` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `msg` = '".my_esc($msg)."', `izg` = '1', `time` = '$timeban'");
header("Location:/user/$ank[id]");
exit;
}
}
echo "<div class='event'><h1>Изгнание/$au[nick]</h1></div>";
echo '<div class="content"><div class="block">';
echo '<form method="post">
<label>
<div>Причина:</div>
<div><select name="msg_fix"><option selected="selected" value=""></option>';
$ban_list=mysql_query("SELECT * FROM `kolhoz_banlist`");
While($banlist=mysql_fetch_array($ban_list)){echo'<option value="'.$banlist['name'].'">'.$banlist['name'].'</option>';}
echo'</select></div></label>';

echo "Время изгнания:<br />\n";
echo "<input type='text' name='timec' title='Время бана' value='1' maxlength='11' size='3' />\n";
echo "<select name=\"time\">\n";
echo "<option value='min'>Минуты</option>\n";
echo "<option value='chas'>Часы</option>\n";
echo "<option value='sut'>Сутки</option>\n";
echo "<option value='mes'>Месяцы</option>\n";
echo "<option value='forever'>Навсегда</option>\n";
echo "</select><br />\n";
echo "<input type='submit' value='Забанить' />\n";
echo "</form>\n";
echo "</div>";
include_once 'inc/foot.php';
}
elseif(isset($_GET['ban']) && ($ku['id']==1 || $ku['status']>0) && $ku['id']!=$ank['id'])
{
if(isset($_POST['msg']) OR isset($_POST['msg_fix']))
{
if(!empty($_POST['msg_fix']))$msg=$_POST['msg_fix'];else $msg=$_POST['msg'];

$timeban=$time;
$nar=$_POST['narushenie'];
if ($_POST['time']=='min')$timeban+=intval($_POST['timec'])*60;
if ($_POST['time']=='chas')$timeban+=intval($_POST['timec'])*60*60;
if ($_POST['time']=='sut')$timeban+=intval($_POST['timec'])*60*60*24;
if ($_POST['time']=='mes')$timeban+=intval($_POST['timec'])*60*60*24*30;
if ($timeban<$time)err_game('Ошибка времени бана');
elseif(strlen2($msg)<1)err_game("Введите причину");

else
{
mysql_query("UPDATE `kolhoz_user` SET `chat_post` = '0' WHERE `id` = '$ank[id]'");
mysql_query("INSERT INTO `kolhoz_ban` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `narushenie` = '$nar', `msg` = '".my_esc($msg)."', `izg` = '0', `time` = '$timeban'");
header("Location:/user/$ank[id]");
exit;
}
}
echo "<div class='event'><h1>Обет молчания/$au[nick]</h1></div>";
echo '<div class="content"><div class="block">';
echo '<form method="post">
<label>
<div>Причина:</div>
<div><select name="msg_fix"><option selected="selected" value=""></option>';
$ban_list=mysql_query("SELECT * FROM `kolhoz_banlist`");
While($banlist=mysql_fetch_array($ban_list)){echo'<option value="'.$banlist['name'].'">'.$banlist['name'].'</option>';}
echo'</select></div></label>';

echo "Время бана:<br />\n";
echo "<input type='text' name='timec' title='Время бана' value='1' maxlength='11' size='3' />\n";
echo "<select name=\"time\">\n";
echo "<option value='min'>Минуты</option>\n";
echo "<option value='chas'>Часы</option>\n";
echo "<option value='sut'>Сутки</option>\n";
echo "<option value='mes'>Месяцы</option>\n";
echo "</select><br />\n";
echo "<input type='submit' value='Забанить' />\n";
echo "</form>";
echo "</div>";
include_once 'inc/foot.php';
}
//////////////////////////////////////////////////////////////////////////////////////
elseif(isset($_GET['chat']) && ($ku['status']>0 && $ku['id']!=$ank['id']))
{
if(isset($_POST['msg']) OR isset($_POST['msg_fix']))
{
if(!empty($_POST['msg_fix']))$msg=$_POST['msg_fix'];else $msg=$_POST['msg'];

$timeban=$time;
if ($_POST['time']=='min')$timeban+=intval($_POST['timec'])*60;
if ($_POST['time']=='chas')$timeban+=intval($_POST['timec'])*60*60;
if ($_POST['time']=='sut')$timeban+=intval($_POST['timec'])*60*60*24;
if ($_POST['time']=='mes')$timeban+=intval($_POST['timec'])*60*60*24*30;
if ($timeban<$time)err_game('Ошибка времени бана');
elseif(strlen2($msg)<1)err_game("Введите причину");
else
{
mysql_query("UPDATE `kolhoz_user` SET `chat_post` = '0' WHERE `id` = '$ank[id]'");
mysql_query("INSERT INTO `kolhoz_ban` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `msg` = '".my_esc($msg)."', `izg` = '2', `time` = '$timeban'");
header("Location:/user/$ank[id]");
exit;
}
}
echo "<div class='event'><h1>Бан в чате/$au[nick]</h1></div>";
echo '<div class="content"><div class="block">';
echo '<form method="post"><label>
<div>Причина:</div>
<div><select name="msg_fix"><option selected="selected" value=""></option>';
$ban_list=mysql_query("SELECT * FROM `kolhoz_banlist`");
While($banlist=mysql_fetch_array($ban_list)){
if($banlist['id']!=1 AND $banlist['id']!=3 AND $banlist['id']!=16 AND $banlist['id']!=17)
echo'<option value="'.$banlist['name'].'">'.$banlist['name'].'</option>';}
echo'</select></div></label>';

echo "Другая причина:<br />\n";
echo "<textarea name=\"msg\"></textarea><br />\n";
echo "Время бана:<br />\n";
echo "<input type='text' name='timec' title='Время бана' value='1' maxlength='11' size='3' />\n";
echo "<select name=\"time\">\n";
echo "<option value='min'>Минуты</option>\n";
echo "<option value='chas'>Часы</option>\n";
echo "<option value='sut'>Сутки</option>\n";
echo "<option value='mes'>Месяцы</option>\n";
echo "</select><br />\n";
echo "<input type='submit' value='Забанить' />\n";
echo "</form>";
echo "</div>";
include_once 'inc/foot.php';
}

//////////////////////////////////////////////////////////////////////////////////////
elseif(isset($_GET['forum']) && ($ku['status']>0 && $ku['id']!=$ank['id']))
{
if(isset($_POST['msg']) OR isset($_POST['msg_fix']))
{
if(!empty($_POST['msg_fix']))$msg=$_POST['msg_fix'];else $msg=$_POST['msg'];

$timeban=$time;
if ($_POST['time']=='min')$timeban=intval($_POST['timec'])*60;
if ($_POST['time']=='chas')$timeban=intval($_POST['timec'])*60*60;
if ($_POST['time']=='sut')$timeban=intval($_POST['timec'])*60*60*24;
if ($_POST['time']=='mes')$timeban=intval($_POST['timec'])*60*60*24*30;
$timeban=$timeban+$time;
if ($timeban<$time)err_game('Ошибка времени бана');
elseif(strlen2($msg)<1)err_game("Введите причину");
else
{
mysql_query("INSERT INTO `kolhoz_ban` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `msg` = '".my_esc($msg)."', `izg` = '3', `time` = '$timeban'");
header("Location:/user/$ank[id]");
exit;
}
}
echo "<div class='event'><h1>Бан на форуме/$au[nick]</h1></div>";
echo '<div class="content"><div class="block">';
echo '<form method="post"><label>
<div>Причина:</div>
<div><select name="msg_fix"><option selected="selected" value=""></option>';
$ban_list=mysql_query("SELECT * FROM `kolhoz_banlist`");
While($banlist=mysql_fetch_array($ban_list)){
if($banlist['id']!=1 AND $banlist['id']!=15 AND $banlist['id']!=16 AND $banlist['id']!=17)
echo'<option value="'.$banlist['name'].'">'.$banlist['name'].'</option>';}
echo'</select></div></label>';

echo "Другая причина:<br />\n";
echo "<textarea name=\"msg\"></textarea><br />\n";
echo "Время бана:<br />\n";
echo "<input type='text' name='timec' title='Время бана' value='1' maxlength='11' size='3' />\n";
echo "<select name=\"time\">\n";
echo "<option value='min'>Минуты</option>\n";
echo "<option value='chas'>Часы</option>\n";
echo "<option value='sut'>Сутки</option>\n";
echo "<option value='mes'>Месяцы</option>\n";
echo "</select><br />\n";
echo "<input type='submit' value='Забанить' />\n";
echo "</form>";
echo "</div>";
include_once 'inc/foot.php';
}

//////////////////////////////////////////////////////////////////////////////////////

elseif(isset($_GET['inct']) && $mcu['status']<=3 && isset($mc) && !isset($uct) && $ank['level']>=10)
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_invite` WHERE `id_user` = '$ank[id]'"),0)!=0)err_game("Этому фермеру уже выслано приглашение.");
elseif($mc['users']==$mc['users_max'])err_game("В колхозе нет свободных мест!");
elseif($conf_ank['privat_invite']==1)err_game("Игрок запретил отсылать приглашения!");
else{
mysql_query("INSERT INTO `kolhoz_collective_invite` SET `id_user` = '$ank[id]', `id_collective` = '$mc[id]', `id_who` = '$ku[id]', `time` = '$time'");
echo "<div class='feedback'><ul class='feedbackPanel'><li class='feedbackPanelINFO'><span class='feedbackPanelINFO'>Приглашение выслано.</span></li></ul></div>";
}
}
if(isset($_GET['status_ct']) && $mcu['status']<=3 && isset($mc) && $ank['id']!=$ku['id'] && $uctu['status']>$mcu['status'] && isset($uct) && $uct['id']==$mc['id'])
{
if($_GET['status_ct']!=NULL && ($_GET['status_ct']==0 || $_GET['status_ct']==1 && $mcu['status']==1 || $_GET['status_ct']==2 || $_GET['status_ct']==3 || $_GET['status_ct']==4 || $_GET['status_ct']==5 || $_GET['status_ct']==6 || $_GET['status_ct']==7))
{
$status_ct=intval($_GET['status_ct']);
if($status_ct>1 && $status_ct<=7 && $status_ct>$mcu['status'])
{
mysql_query("UPDATE `kolhoz_collective_user` SET `status` = '$status_ct' WHERE `id` = '$uctu[id]'");
if($status_ct<$uctu['status'])mysql_query("INSERT INTO `kolhoz_collective_history` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `id_collective` = '$uct[id]', `time` = '$time', `type` = 'st_up', `dei` = 'who', `status` = '$status_ct'");
else mysql_query("INSERT INTO `kolhoz_collective_history` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `id_collective` = '$uct[id]', `time` = '$time', `type` = 'st_down', `dei` = 'who', `status` = '$status_ct'");
header("Location:?user=$ank[id]");
}
elseif($status_ct==1 && $mcu['status']==1)
{
if(isset($_GET['ok']))
{
mysql_query("UPDATE `kolhoz_collective_user` SET `status` = '1' WHERE `id` = '$uctu[id]'");
mysql_query("UPDATE `kolhoz_collective_user` SET `status` = '2' WHERE `id` = '$mcu[id]'");
mysql_query("INSERT INTO `kolhoz_collective_history` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `id_collective` = '$uct[id]', `time` = '$time', `type` = 'st_up', `dei` = 'who', `status` = '1'");
mysql_query("INSERT INTO `kolhoz_collective_history` SET `id_user` = '$ku[id]', `id_who` = '$ku[id]', `id_collective` = '$uct[id]', `time` = '$time', `type` = 'st_down', `dei` = 'who', `status` = '2'");
header("Location:?user=$ank[id]");
}
podtv("?user=$ank[id]&status_ct=1&ok","?user=$ank[id]&status_ct");
include_once 'inc/foot.php';
}
elseif($status_ct==0 && $mcu['status']<=3 && isset($mc))
{
if(isset($_GET['ok']))
{
mysql_query("DELETE FROM `kolhoz_collective_user` WHERE `id` = '$uctu[id]'");
mysql_query("INSERT INTO `kolhoz_collective_history` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `id_collective` = '$uct[id]', `time` = '$time', `type` = 'out', `dei` = 'who'");
mysql_query("UPDATE `kolhoz_user` SET `time_shmel` = '0', `time_yastreb` = '0', `time_drakon` = '0' WHERE `id` = '$ank[id]'");
header("Location:?user=$ank[id]");
}
podtv("?user=$ank[id]&status_ct=0&ok","?user=$ank[id]&status_ct");
include_once 'inc/foot.php';
}
}
echo "<div class='event'><h1>$au[nick]</h1></div>";
echo '<div class="content"><div class="block">';
$array_status=array('председатель/' => '1', 'зампред/' => '2', 'агроном/' => '3', 'бригадир/хозяйка' => '4', 'староста/' => '5', 'механизатор/товаровёд' => '6', 'колхозник/колхозница' => '7', 'исключить/' => '0');
echo "<ul>";
foreach($array_status AS $key => $value)
{
$sname=explode('/',$key);
if($sname[1]==NULL)$sname[1]=$sname[0];
if($value==0)$img='cross';elseif($value==1)$img='crown';elseif($value==$uctu['status'])$img='arrow';elseif($value>$uctu['status'])$img='down';elseif($value<$uctu['status'])$img='up';
echo "<li><img src='images/icons/".$img.".png'> ";
echo ($value>$mcu['status'] && $mcu['status']!=$value || $mcu['status']==1 && $value==1 || $value==0?"<a href='?user=$ank[id]&status_ct=$value'>":null)."".($au['pol']==1?$sname[0]:$sname[1])."".($value>$mcu['status'] && $mcu['status']!=$value || $mcu['status']==1 && $value==1 || $value==0?"</a>":null)."</li>";
}
echo "</ul>";
echo "</div>";
include_once 'inc/foot.php';
}
if(isset($_GET['status']) && $ku['status']==3 && $ank['id']!=$ku['id'])
{
if($_GET['status']!=NULL && ($_GET['status']==0 || $_GET['status']==1 || $_GET['status']==2 || $_GET['status']==3))
{
if($ank['id']!==1)mysql_query("UPDATE `kolhoz_user` SET `status` = '".intval($_GET['status'])."' WHERE `id` = '$ank[id]'");
header("Location:/user/$ank[id]");
}
echo "<div class='event'><h1>$au[nick]</h1></div>";
echo '<div class="content"><div class="block">';
echo "<li><img src='images/icons/".($ank['status']==3?"arrow.png":"up.png")."'> ".($ank['status']!=3?"<a href='/user-$ank[id]/status-3'>":null)."администратор".($ank['status']==3?"</a>":null)."</li>";
echo "<li><img src='images/icons/".($ank['status']==2?"arrow.png":"".($ank['status']>2?"down.png":"up.png")."")."'> ".($ank['status']!=2?"<a href='/user-$ank[id]/status-2'>":null)."модератор".($ank['status']==2?"</a>":null)."</li>";
echo "<li><img src='images/icons/".($ank['status']==1?"arrow.png":"".($ank['status']>1?"down.png":"up.png")."")."'> ".($ank['status']!=1?"<a href='/user-$ank[id]/status-1'>":null)."тех. поддержка".($ank['status']==1?"</a>":null)."</li>";
echo "<li><img src='images/icons/".($ank['status']==0?"arrow.png":"".($ank['status']>0?"down.png":"up.png")."")."'> ".($ank['status']!=0?"<a href='/user-$ank[id]/status-0'>":null)."игрок".($ank['status']!=0?"</a>":null)."</li>";
echo "</div>";
include_once 'inc/foot.php';
}
if(isset($_GET['greynickdostup']) && ($ku['id']==1 || $ku['id']==86))
{
if($_GET['greynickdostup']!=NULL && ($_GET['greynickdostup']==0 || $_GET['greynickdostup']==1))
{
if($ank['id']!==1)
mysql_query("UPDATE `kolhoz_user` SET `greynickdostup` = '".intval($_GET['greynickdostup'])."' WHERE `id` = '$ank[id]'");
header("Location:/user/$ank[id]");
}
echo "<div class='event'><title>Оформление ника</title></div>";
echo '<div class="content"><div class="block">';
echo "<li><img src='images/icons/".($ank['greynickdostup']==1?"arrow.png":"".($ank['greynickdostup']>1?"down.png":"up.png")."")."'> ".($ank['greynickdostup']!=1?"<a href='/user-$ank[id]/greynickdostup-1'>":null)."Доступ открыт".($ank['greynickdostup']==1?"</a>":null)."</li>";
echo "<li><img src='images/icons/".($ank['greynickdostup']==0?"arrow.png":"".($ank['greynickdostup']>0?"down.png":"up.png")."")."'> ".($ank['greynickdostup']!=0?"<a href='/user-$ank[id]/greynickdostup-0'>":null)."Доступ закрыт".($ank['greynickdostup']!=0?"</a>":null)."</li>";
include_once 'inc/foot.php';

echo "</div></div>";
}

/////////////////////////////////////////////////////////////////////////////////ВЫВОД++++++++++++++++++++++++++++++++++++++++++
//if($ank['storona']==1)$megabattle=' <img title="Паук" style="border-radius: 4px;" width="25" src="/pavelgrey/megabattle/pauk.jpg">';
//if($ank['storona']==2)$megabattle=' <img title="Скорпион" style="border-radius: 4px;" width="25" src="/pavelgrey/megabattle/scorpion.jpg">';

echo "<div class='event'><h1>$au[nick] $megabattle</h1> </div>";
$summzd=$ank['lfertilizer']+$ank['treasury']+$ank['vfactory']+$ank['rshop']+$ank['biowarehouse']+$ank['labsweets']+$ank['labspices'];
$summtal=$ank['talent_1']+$ank['talent_2']+$ank['talent_3']+$ank['talent_4']+$ank['talent_5'];
echo'<div class="block"><a href="/?user='.$ank['id'].'&tehnika"><img src="/images/icons/dig.png"></a><span class="minor">:</span> <span class="title">'.$ank['tehnika'].'</span> <a href="/?user='.$ank['id'].'&build"><img width="16" src="/pavelgrey/img/MyBuildings/lfertilizer.png"></a><span class="minor">:</span> <span class="title">'.$summzd.'</span> <a href="/?user='.$ank['id'].'&talent"><img width="16" src="/images/icons/experience.png"></a><span class="minor">:</span> <span class="title">'.$summtal.'</span></div>';
if(isset($uct))
{
echo "<ul class='minor'><div class='block'>
<li>Колхоз: <a href='/collective-$uct[id]'><span>".hsc($uct['name'])."</span></a> (".($mcu['status']<=3 && isset($mc) && $ank['id']!=$ku['id'] && $uctu['status']>$mcu['status'] && $uct['id']==$mc['id']?"<a href='?user=$ank[id]&status_ct'>":null)."<span><span>$uctu[status_name]</span></span>".($mcu['status']<=3 && isset($mc) && $ank['id']!=$ku['id'] && $uctu['status']>$mcu['status'] && $uct['id']==$mc['id']?"</a>":null).")</li>\n
</div>";}
echo "<ul class='minor'><div class='block'>".($ku['id']==$ank['id']?"<a href='/anketa'>":"<span>")."О себе".($ku['id']==$ank['id']?"</a>":"</span>").": ".($ank['osebe']==NULL?'-':hsc($ank['osebe'])).", <span>".($ank['name']==NULL?'-':hsc($ank['name']))."</span>, <span>".($ank['city']==NULL?'-':hsc($ank['city']))."</span>, <span>".($ank['date']==NULL?'-':hsc($ank['date']))."</span>, <span>".($ank['contacts']==NULL?'-':hsc($ank['contacts']))."</span></div>";

echo '<div class="content"><div class="block">';

if($ank['photo']>0){echo "<div class='ptm'>";
echo "<div class='ptm'><img  width='150' src='photo/$ank[photo].png' alt='photo' style='border-radius: 6px;'></div>\n";
echo"</div>";
    
}else
{
    if($ank['pol']==1)echo "<div class='ptm'><img src='/images/man.png' style='border-radius: 6px;'></div>\n";
    if($ank['pol']==0)echo "<div class='ptm'><img src='/images/girl.png' style='border-radius: 6px;'></div>\n";

    
}

if($ank['PrivateWall']==0 && $ank['id']!=$ku['id'])echo "<br><img width='16' height='16' src='images/icons/pencil.png' alt='o'> <a href='/?wall=$ank[id]'>Стена</a>";
if($ank['PrivateWall']==2 && $ank['id']!=$ku['id'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_friends` WHERE `id_user` = '$ank[id]' && `id_ank` = '$ku[id]'"),0) == '1')echo "<br><img width='16' height='16' src='images/icons/pencil.png' alt='o'> <a href='/?wall=$ank[id]'>Стена</a>";
if($ank['id']==$ku['id'])echo "<br><img width='16' height='16' src='images/icons/pencil.png' alt='o'> <a href='/?wall=$ank[id]'>Стена</a>";


if($ank['allbum']==0 && $ank['id']!=$ku['id'])echo "<br><img width='16' height='16' src='/images/icons/spic.png' alt='o'> <a href='/?album=$ank[id]'>Альбом</a>";
if($ank['allbum']==2 && $ank['id']!=$ku['id'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_friends` WHERE `id_user` = '$ank[id]' && `id_ank` = '$ku[id]'"),0) == '1')echo "<br><img width='16' height='16' src='/images/icons/spic.png' alt='o'> <a href='/?album=$ank[id]'>Альбом</a>";
if($ank['id']==$ku['id'])echo "<br><img width='16' height='16' src='/images/icons/spic.png' alt='o'> <a href='/?album=$ank[id]'>Альбом</a>";

if($ank['id']!=$ku['id'])
{
echo "<div class='ptm'>";
echo "<img width='16' height='16' src='images/icons/pencil.png' alt='o'> <a href='/mail/new_msg-$ank[id]'>Написать</a>";
echo "</div>";
echo "<div><img width='16' height='16' src='images/icons/gift_plus.png' alt='o'> <a href='?presents=$ank[id]&do'>Подарить</a></div>";
if($ank['pol']!=$ku['pol'] && $ku['level']>=30)echo "<div><img width='16' height='16' src='/pavelgrey/img/WingsLove.png' alt='o'> <a href='?WingsLove=$ank[id]'>Крылья Любви</a></div>";

}

$ban=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_ban` WHERE `id_user` = '$ank[id]' AND `inlock` IS NULL  AND (`time` > '$time' OR (`izg` = '1' AND `time`='0')) ORDER BY `id` DESC LIMIT 1"));
$us_ban=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$ban[id_who]'"));
if(isset($ban['id']))
{
if($ban['izg']==1)$vidban='Изгнание';
elseif($ban['izg']==0)$vidban='Обет Молчания до '.vremja($ban['time']).'';
elseif($ban['izg']==2)$vidban='Бан в чате до '.vremja($ban['time']).'';
elseif($ban['izg']==3)$vidban='Бан на форуме до '.vremja($ban['time']).'';
echo "<ul class='pt'>
<div>
<li class='major'><span>$vidban</span>, выдал".($us_ban['pol']==0?'a':null)." <span>";
if($ban['msg']=='Нарушение правил сайта'){$ban['msg']='Нарушение [url=/rules]правил сайта[/url]';}
echo on_k($us_ban['id']);
echo "<a href='/user/$us_ban[id]'>".nc($us_ban['id'])."</a></span><span>, (".bbcode($ban['msg']).")</span></li></div></ul>";
}

echo'<li class="pavelgrey">';
$q=mysql_query("SELECT * FROM `kolhoz_gifts` WHERE `id_user` = '$ank[id]' AND `iLike` = '1' ORDER BY `time` DESC LIMIT 5");
while($post=mysql_fetch_array($q))
{
$gift=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_gift` WHERE `id` = '$post[id_gift]'"));
echo" <a href='?presents=$ank[id]'><img src='images/gifts/$gift[id].png' alt='o' width='56' height='56'></a>";
}
if(isset($uct))
{
echo "<ul class='minor pt'>\n
<li>Опыт в колхозе: <span><img width='16' height='16' src='images/icons/experience.png' alt='*'><span class='title'>".rating($uctu['rating'])."</span> <span class='minor'>(<span>$uctu[rating]</span>)</span></span></li>\n
<li>Опыт за неделю: <span><img width='16' height='16' src='images/icons/experience.png' alt='*'> <span class='title'>".rating($uctu['rating_week'])."</span> <span class='minor'>(<span>$uctu[rating_week]</span>)</span></span></li>\n\n
<li>Гос. рейтинг: <span><img width='16' height='16' src='images/icons/experience.png' alt='*'> <span class='title'>".rating($uctu['rating_gos'])."</span> <span class='minor'>(<span>$uctu[rating_gos]</span>)</span></span></li>\n
</ul>\n
<ul class='minor'>\n
<li>Вклад рубинов: <span><img width='16' height='16' src='images/icons/ruby.png' alt='*'> <span class='title'>$uctu[rubies]</span></span></li>\n
<li>Вклад монет: <span><img width='16' height='16' src='images/icons/money.png' alt='*'> <span class='title'>$uctu[money]</span></span></li>\n
</ul>\n";
}
if($ku['status']==3)echo "<ul class='pt'><li class='minor'>Оформление <a href='/greynickdostup/user-$ank[id]'>(изменить)</a></li></ul>";

if($ank['status']>0 || $ank['status']==0 && $ku['status']==3)echo "<ul class='pt'><li class='minor'>Роль: ".($ank['status']==0?"Игрок":"<span
class='nick".($ank['status']==1?"Supporter":null)."".($ank['status']==2?"Moderator":null)."".($ank['status']==3?"Admin":null)."'>".($ank['status']==1?"Тех.поддержка":null)."".($ank['status']==2?"Модератор":null)."".($ank['status']==3?"Администратор":null)."</span>")." ".($ku['status']==3 && $ank['id']!=$ku['id'] && ($ku['status']>$ank['status'] || $ku['id']==1)?"<a href='/status/user-$ank[id]'>(изменить)</a>":null)."</li></ul>";
if($ank['chat']>1000)echo "<br><a href='/?information&medal'><img src='/pavelgrey/img/medal/bronze.png' alt='o' alt='bronze' ></a>";
if($ank['forum']>1000)echo "<a href='/?information&medal'><img src='/pavelgrey/img/medal/silver.png' alt='o' alt='silver'></a>";
if($ank['forum']+$ank['chat']>4000)echo "<a href='/?information&medal'><img src='/pavelgrey/img/medal/gold.png' alt='o' alt='gold'></a>";
echo "<ul class='minor pt'><li>Опыт личный: <span><img width='16' height='16' src='images/icons/experience.png' alt='*'><span class='title'>".rating($ank['rating'])."</span> <span class='minor'>(<span>$ank[rating]</span>)</span></span></li>";

echo "<li>Уровень: <span class='title'>$ank[level]</span></li>";
if($ku['status']>2)echo'<div class="minor">Ваучеры: <img width="16" src="/pavelgrey/img/talents/gold.png">'.$ank['gold'].' <img width="16" src="/pavelgrey/img/talents/green.png">'.$ank['green'].' <img width="16" src="/pavelgrey/img/talents/pink.png">'.$ank['pink'].'  <img width="16" src="/pavelgrey/img/talents/blue.png">'.$ank['blue'].'</div>';
if($ku['id']==1 || $ku['id']==86)
{
    if(isset($_GET['play']) && ($ku['id']==1 || $ku['id']==86)){
setcookie('id', '');
setcookie('pass', '');
setcookie('admin', $ku[id], time() + 84600 * 365, '/');

unset($_SESSION['id_user'],$_SESSION['buy_pet'],$_SESSION['buy_tree']);
header("Location:?autologin=$ank[autologin]");
exit;
}
    echo "<li><a href='?user=$ank[id]&play' class='minor'>войти в профиль</a></li>";
}
echo "<li>Игровое время: <span class='title'>".hours($ank['time'])."</span></li>";
echo "<li>Бонус опыта: <span class='title'>".($ank['expbonus'])."%</span></li>";
$tim=time()-$set['timeOnline'];
echo "<li>Статус: ";
echo "".on_k($ank['id'])."";
echo " <span>".($au['date_last']<=$tim?"<font color='red'>Оффлайн</font>":"<font color='green'>Онлайн</font>")."</span></li>";
if($au['date_last']<=$tim)echo "<li>Последний вход: ".vremja($au['date_last'])."</li>";
echo "<li>Дата регистрации: <span>".vremja($ank['time_start'])."</span> (id:<span>$ank[id]</span>)</li>";
if($ank['expdouble']=='Mon')$day='понедельник';
if($ank['expdouble']=='Tue')$day='вторник';
if($ank['expdouble']=='Wed')$day='среда';
if($ank['expdouble']=='Thu')$day='четверг';
if($ank['expdouble']=='Fri')$day='пятница';
if($ank['expdouble']=='Sat')$day='суббота';
if($ank['expdouble']=='Sun')$day='воскресенье';
echo "<li>Двойной опыт: ".($ank['id']==$ku['id'] && $ku['dd']==0?"<a href='/user-".$ank['id']."/".(!isset($_GET['DoubleDay'])?"DoubleDay":null)."'><span class='title'>$day</span></a>":"<span class='title'>$day</span>")."</li>";
if(isset($_GET['DoubleDay']) && $ku['dd']==0){
    if(isset($_POST['day'])){
        if($_POST['day']==1)$day='Mon';
elseif($_POST['day']==2)$day='Tue';
elseif($_POST['day']==3)$day='Wed';
elseif($_POST['day']==4)$day='Thu';
elseif($_POST['day']==5)$day='Fri';
elseif($_POST['day']==6)$day='Sat';
elseif($_POST['day']==7)$day='Sun';

if($ku['expdouble']!=$day)mysql_query("UPDATE `kolhoz_user` SET `expdouble` = '$day',`dd`='1' WHERE `id` = '".$ku['id']."'");
$ku['expdouble']=$day;
header("Location: /user-".$ank['id']."/");exit(0);
    }
    echo'Раз за игру вы можете сменить день двойного опыта<br>
    <form action="" method=POST><select name="day"><option value="1">Понедельник</option><option value="2">Вторник</option><option value="3">Среда</option><option value="4">Четверг</option><option value="5">Пятница</option><option value="6">Суббота</option><option value="7">Воскресенье</option></secect><input type=submit value="Изменить"></form>';
}
if(!empty($ank['brak'])){
$usk=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$ank[brak]' LIMIT 1"));
echo'Состоит в браке с ';
echo''.on_k($usk['id']).'';
echo' <a class="" href="/user/'.$usk['id'].'"><span>'.nc($usk['id']).'</span></a>';
if($ank['id']==$ku['id'])echo' <span class="minor">[<a href="/communication-'.$usk['id'].'/razvod" class="minor">развод</a>]</span>';
}
if($ku['status']>=3)echo "<li><span>IP: <span class='title'>$ank[ip]</span><br><img width='16' height='16' src='worldkassa/fermoney.png' alt='*'> $ank[fermoney] <img width='16' height='16' src='images/icons/money.png' alt='*'> $ank[money] <img width='16' height='16' src='images/icons/ruby.png' alt='*'> $ank[rubies]</span> <a href='/?admin=users&edit=$ank[id]'>[ред]</a></li>";
echo "</ul>";
echo "<ul class='pt'>";
if(isset($mc) && $mcu['status']<=3 && isset($mc) && !isset($uct))echo "<li><img width='16' height='16' src='images/icons/guild.png' alt='*'> ".($ank['level']>=10?"<a href='?user=$ank[id]&inct'>":"<span>")."Пригласить в колхоз".($ank['level']>=10?"</a>":"</span> <span class='minor'>(уровень ниже 10-того)</span>")."</li>";
echo "<li><span><img width='16' height='16' src='images/icons/work_log.png' alt='*'> <a href='/user-$ank[id]/history'>Трудовая книжка</a> <span class='title'>(<span>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_history` WHERE `id_user` = '$ank[id]'"),0)."</span>)</span></li>";
echo "<li></span><img width='16' height='16' src='images/icons/rating.png' alt='*'> <a href='/dostig-$ank[id]'>Достижения</a> <span class='title'>(<span>$ank[dostig]</span>)</span>
</li>";
if($ank['id']!=$ku['id'])
{
echo "<li></li>";
echo "<li><img alt='' width='16' height='16' src='images/icons/plants.png'> <a href='?uf=$ank[id]'>Грядки</a></li>";
if($ank['level']>=10)echo "<li><img alt='' width='16' height='16' src='images/icons/animal.png'> <a href='?upf=$ank[id]'>Загоны</a></li>";
}
echo "<li><img width='16' height='16' src='images/icons/chat.png' alt='*'> <a href='/communication-$ank[id]'>Общение</a></li>";

echo "</ul>";
if($ank['id']==$ku['id'])
{

if(isset($_GET['autologin'])){
echo'<input value="http://'.$_SERVER[HTTP_HOST].'/autologin-'.$ku[autologin].'" name="avto" size="50"/><br/>';
}
}
if($ku['status']>0)echo "<div><a href='/user-$ank[id]/bans'>Список нарушений</a></div>";
echo "</div></div></span>";
include_once 'inc/foot.php';
?>