Файл: zfarm.mobi/inc/collective/newUser.php
Строк: 39
<?
$title='Заявки на вступление';
include_once '../system/config.php';
$mcu =mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective_user` WHERE `id_user` = '$ku[id]'"));
$ct =mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective` WHERE `id` = '".intval($_GET['newUser'])."'"));
if(isset($_GET['newUser']) && ($mc['id']==$ct['id']) && ($mcu['status']<=3) && ($_GET['newUser'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective` WHERE `id` = '".($_GET['newUser'])."' LIMIT 1"),0)!=0){
echo"<div class='rzd2'></div><div class='menuin2'>";
echo "<div class='title'>Заявки на вступление</div>";
echo "<div class='div'><a href='/kolhoz/logi/$mc[id]/'>История заявок</a></div>";
echo "<div class='content'><div class='div'>";
$result = mysql_query("SELECT * FROM `start_collective` WHERE `collective` = '$mc[id]' ORDER BY `time` DESC LIMIT 10000000000 ");
while($msg = mysql_fetch_assoc($result)){
if(isset($_GET['go']) && intval($_GET['go'])!=NULL && $mcu['status']<=3 && mysql_result(mysql_query("SELECT COUNT(*) FROM `start_collective` WHERE `id` = '".intval($_GET['go'])."'"),0)!=0)
{
mysql_query("INSERT INTO `logi_collective` SET `dopolnitelno` = '$msg[id_user]', `chto` = 'одобрил(а) заявку пользователя', `collective` = '$msg[collective]', `time` = '$time', `cto` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_collective_user` SET `id_user` = '$msg[id_user]', `id_collective` = '$msg[collective]', `time` = '$time', `status` = '7'");
mysql_query("INSERT INTO `kolhoz_collective_history` SET `id_user` = '$msg[id_user]', `id_who` = '$ku[id]', `id_collective` = '$msg[collective]', `time` = '$time', `type` = 'in', `dei` = 'who'");
mysql_query("DELETE FROM `start_collective` WHERE `id_user` = '$msg[id_user]' AND `id` = '".intval($_GET['go'])."'");
header("Location: /kolhoz/newUser/$mc[id]/");
$_SESSION['msg']='Пользователь принят';
}
}
$result = mysql_query("SELECT * FROM `start_collective` WHERE `collective` = '$mc[id]' ORDER BY `time` DESC LIMIT 10000000000 ");
while($msg = mysql_fetch_assoc($result)){
if(isset($_GET['NOgo']) && intval($_GET['NOgo'])!=NULL && $mcu['status']<=3 && mysql_result(mysql_query("SELECT COUNT(*) FROM `start_collective` WHERE `id` = '".intval($_GET['NOgo'])."'"),0)!=0)
{
mysql_query("INSERT INTO `logi_collective` SET `dopolnitelno` = '$msg[id_user]', `chto` = 'отклонил(а) заявку пользователя', `collective` = '$msg[collective]', `time` = '$time', `cto` = '$ku[id]'");
mysql_query("DELETE FROM `start_collective` WHERE `id_user` = '$msg[id_user]' AND `id` = '".intval($_GET['NOgo'])."'");
header("Location: /kolhoz/newUser/$mc[id]/");
$_SESSION['msg']='Пользователю отказано во вступлении';
}
}
$result = mysql_query("SELECT * FROM `start_collective` WHERE `collective` = '$mc[id]' ORDER BY `time` DESC LIMIT 10000000000 ");
while($msg = mysql_fetch_assoc($result)){
echo' ['.date('d.m.Y в H:i', $msg['time']).'] Заявка на вступление от игрока <a href="?user='.($msg['id_user']).'"><span>'.nc($msg['id_user']).'</span></a>';
if($mcu['status']<=3){echo' <a href="/kolhoz/newUser/'.$msg['collective'].'/go/'.$msg['id'].'">[принять]</a> |
<a href="/kolhoz/newUser/'.$msg['collective'].'/NOgo/'.$msg['id'].'">[отказать]</a><br>';}
}
echo"</div></div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
}
else
{
echo "<div class='title'>Ошибка</h2></div>";
echo "<div class='content'>";
echo "<div class='div'>";
echo 'Так просто ты тут ни чего не узнаешь. Попробуй найти того, кто тебе объяснит.';
include_once '../system/foot.php';
echo "</div></div>";
}
?>