Файл: ferma/inc/user .php
Строк: 465
<?
if(isset($_GET['history']))include_once 'inc/history.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']))
{
if(strlen2($_POST['msg'])<1)err_game("Введите причину");
else
{
mysql_query("INSERT INTO `kolhoz_ban` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `msg` = '".my_esc($_POST['msg'])."', `izg` = '1'");
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'>";
echo "Причина:<br />n";
echo "<textarea name="msg"></textarea><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']))
{
$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($_POST['msg'])<1)err_game("Введите причину");
else
{
mysql_query("INSERT INTO `kolhoz_ban` SET `id_user` = '$ank[id]', `id_who` = '$ku[id]', `msg` = '".my_esc($_POST['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'>";
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($ank['invitect']==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='i/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'] && ($ku['status']>$ank['status'] || $ku['id']==1))
{
if($_GET['status']!=NULL && ($_GET['status']==0 || $_GET['status']==1 || $_GET['status']==2 || $_GET['status']==3 || $_GET['status']==4))
{
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='i/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='i/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='i/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='i/icons/".($ank
['status']==4?"arrow.png":"".($ank
['status']>4?"down.png":"up.png")."")."'> ".($ank
['status']!=4?"<a href='?user=$ank
[id]&status=4'>":null)."модератор".($ank
['status']==4?"</a>":null)."</li>";
echo "<li><img src='i/icons/".($ank
['status']==4?"arrow.png":"".($ank
['status']>4?"down.png":"up.png")."")."'> ".($ank
['status']!=4?"<a href='?user=$ank
[id]&status=4'>":null)."vip".($ank
['status']==4?"</a>":null)."</li>";
echo "<li><img src='i/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['adm']) && $ku['id']==1 && $ank['id']!=$ku['id'] && ($ku['dostup']>$ank['dostup'] || $ku['id']==1))
{
if($_GET['adm']!=NULL && ($_GET['dostup']==0 || $_GET['dostup']==1))
{
mysql_query("UPDATE `kolhoz_user` SET `dostup` = '".intval($_GET['adm'])."' 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='i/icons/".($ank['dostup']==1?"arrow.png":"up.png")."'> ".($ank['dostup']!=1?"<a href='?user=$ank[id]&adm=1'>":null)."Доступ открыт".($ank['dostup']==1?"</a>":null)."</li>";
echo "<li><img src='i/icons/".($ank['dostup']==0?"arrow.png":"".($ank['dostup']>0?"down.png":"up.png")."")."'> ".($ank['dostup']!=0?"<a href='?user=$ank[id]&adm=0'>":null)."Доступ закрыт".($ank['dostup']!=0?"</a>":null)."</li>";
echo "</div>";
include_once 'inc/foot.php';
}
echo "<div class='event'><b><font color='F9EDA2'><g1>$au[nick]</g1></b></div></font>";
echo '<div class="content"><div class="block">';
echo "<li><img alt='' width='16' height='16'
src='i/ic/e.png'><a href='?uf=$ank[id]'> Смотреть ферму</a></li>";
echo '</div></div></div><div class="content"><div class="block">';
if($ank['status_icon']==0 && $ank['status_text']==NULL){
echo'<img src="i/ic/1.png" alt="o"> <font color="black"> </font> ';
if($ank['id']==$ku['id'])echo'[<a href="?pr">Ред</a>]<br>';
}else{
echo '<a href="?pr"><span class="nick'.($ank['status']==1?'Supporter':null).''.($ank['status']==2?'Moderator':null).''.($ank['status']==3?'Admin':null).'">'.$ank['status_text'].'</span></a>';
if($ank['id']==$ku['id']) echo' <a href="?pr"></a><br>';
}
echo "</span></div></li></div>";if (file_exists('i/avatars/'.$au['id'].'.png'))
{
echo "<img src='i/avatars/$au[id].png' alt='o'>";
}
else
{
}
echo '<div class="content"><div class="block">';
if($ank['id']!=$ku['id'])
{
echo "<div class='ptm'>";
echo "</ul>";
echo "<ul class='pt'>";
echo "<img width='16' height='16' src='i/icons/pencil.png' alt='o'> <a href='?mail&new_msg=$ank[id]'>Отправить почту</a>";
echo "</div>";
echo "<div><img width='16' height='16' src='i/icons/gift_plus.png' alt='o'> <a href='?presents=$ank[id]&do'>Подарить подарок</a></div>";
}
echo "</div>";
$ban=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_ban` WHERE `id_user` = '$ank[id]' AND (`time` > '$time' OR `izg` = '1') ORDER BY `id` DESC LIMIT 1"));
$us_ban=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$ban[id_who]'"));
if($ban['id'])
{
echo "<ul class='pt'>
<div>
<li class='major'><span>".($ban['izg']==1?'Изгнание':"Обет Молчания до ".vremja($ban['time']))."</span>, выдал".($us_ban['pol']==0?'a':null)." <span>";
echo on_k($us_ban['id']);
echo "<a href='?user=$us_ban[id]'>".nc($us_ban['id'])."</a></span><span>, (".output_text($ban['msg']).")</span></li></div></ul>";
}
if(isset($uct))
{
}
echo "<ul class='minor pt'><li><img width='12' height='12' src='i/dot.png' alt='o'><font color='black'> Уровень: <span class='title'>$ank[level]</span></li>";
echo "<li><img width='12' height='12' src='i/dot.png' alt='o'> Опыт: <span>".number_format($ank[rating])."</span></span></li>";
echo "<li><img width='12' height='12' src='i/dot.png' alt='o'> Время онлайн: <span class='title'>".time_left($ank['time'])."</span></li>";
echo "<li><img width='12' height='12' src='i/dot.png' alt='o'> Дата регистрации: <span>".vremja($ank['time_start'])."</span></li>";
echo "<li><img width='12' height='12' src='i/dot.png' alt='o'><font color='black'> id игрока: <span class='title'>$ank[id]</span></li>";
if($ku['status']>0)echo "<li><img width='12' height='12' src='i/dot.png' alt='o'><font color='black'> ip игрока: <span class='title'>$ank[ip]</span></li>";
if($au['date_last']<=$t)echo "<li>Последний вход: ".vremja($au['date_last'])."</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='воскресенье';
if($ku['status']==3)
{
}
if($ank['brak']!=NULL){
$brak = mysql_query("SELECT * FROM `kolhoz_user` WHERE `nick`='$ank[brak]'");
$brak = mysql_fetch_assoc($brak);
echo '<li>Состоит в браке с: ';
echo''.on_k($brak["id"]).'';
echo'<span> <a href="?user='.$brak["id"].'">'.nc($brak["id"]).'</a> </span></li>';
};
echo "</ul>";
echo "<ul class='pt'>";
echo "<li></span><img width='16' height='16' src='i/ic/an.png' alt='o'> <a href='?dostig=$ank[id]'>Информация</a> <span class='title'></li>";
echo '<li><img width="12" height="12" src="i/
dot.png" alt="o"> <a href="?friends">Мои друзья</
a></li>';
if($ank['id']!=$ku['id'])
{
echo "<li></li>";
}
if($ank['id']!=$ku['id'])echo "<li><img alt='' width='16' height='16' src='i/icons/gift_plus.png'> <a href='?presents=$ank[id]&do'>Подарить</a></li>";
echo "<li><img alt='' width='16' height='16' src='i/icons/gift.png'> <a href='?presents=$ank[id]'>Подарки</a></li>";
if($ank['id']!=$ku['id'])echo "<li><img alt='' width='16' height='16' src='i/icons/ignore.png'> <a href='?communication=$ank[id]&blacklist'><span>".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_blacklist` WHERE `id_user` = '$ku[id]' AND `id_ank` = '$ank[id]' LIMIT 1"),0)==0?"Добавит в игнор":"Отменить игнор")."</span></a></li>";
echo "</ul>";
if($ank['id']==$ku['id'])
{
echo "<div><a href='?settings'>Настройки</a></div>";
echo "<img width='16' height='16' src='i/icons/pencil.png' alt='o'> <a href='?mailss=$ank[id]'>Отправить почту</a>";
}
if($ku['status']>0)echo "<div><a href='?user=$ank[id]&bans'>нарушения</a></div>";
if($ku['status']>0)echo "<ul class='bd'><li class='minor'>".($ank['dostup']==0?"X":"<span
class='nick".($ank['dostup']==1?"Admin":null)."'>".($ank['dostup']==1?"O":null)."</span>")." ".($ku['id']==1 && $ank['id']!=$ku['id'] && ($ku['dostup']==1 || $ku['id']==1)?"<a href='?user=$ank[id]&adm'>и</a>":null)."</li></ul>";
if($ku['status']>0)echo "<li><sup><b><span><img width='16' height='16' src='i/icons/money1.png' alt='o'> ".number_format($ank[money])." <img width='16' height='16' src='i/icons/ok.png' alt='o'> ".number_format($ank[rubies])."</b></li></sup>";
if($ku['status']>0)if($ank['status']>0 || $ank['status']==0 && $ku['status']==3)echo "".($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['status']==3)?"<a href='?user=$ank[id]&status'>[ред]</a>":null)."";
echo "</div>";
echo "</div>";
include_once 'inc/foot.php';
?>