Файл: public_html/clan_z.php
Строк: 51
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if(!$user) {header('location: /');exit;}
$title = 'Заявки в клан';
include './system/h.php';
$za = mysql_fetch_array(mysql_query('SELECT * FROM `clan_z` WHERE `clan` = '.$clan['id'].' ORDER BY `id` DESC LIMIT 10'));
$zay = mysql_query('SELECT * FROM `clan_z` WHERE `clan` = '.$clan['id'].' ORDER BY `id` DESC LIMIT 10');
if($za){
while($row = mysql_fetch_array($zay)){
$us = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = '.$row['user'].''));
if($_GET['true'] == '1') {
mysql_query('INSERT INTO `ass_br` (`msg`,`clan_id`,`avtor`,`time`) VALUES ("<span class=dgreen>Приветствуем новичка:</span> <img src=/images/icon/race/'.$us['r'].'.png><a href=/user/'.$us['id'].'/> '.$us['login'].'</a>", "'.$us['id'].'", "12", "'.time().'")');
mysql_query('INSERT INTO `clan_memb` (`clan`,`user`,`time`,`last_update`) VALUES ("'.$clan['id'].'", "'.$row['user'].'","'.time().'","'.(time() + ((60 * 60) * 24)).'")');
mysql_query('DELETE FROM `clan_z` WHERE `user` = "'.$us['id'].'"');
$text = 'Вы вступили в клан - '.$clan['name'].'';
mysql_query("INSERT INTO `message` SET `text` = '".$text."', `kto` = '6', `komy` = '".$us['id']."', `time` = '".time()."', `readlen` = '0'");
header('location: /clan/');
exit;
}
if($_GET['false'] == '1') {
mysql_query('DELETE FROM `clan_z` WHERE `user` = "'.$us['id'].'"');
$text = 'Клан - '.$clan['name'].' отклонил вашу заявку';
mysql_query("INSERT INTO `message` SET `text` = '".$text."', `kto` = '6', `komy` = '".$us['id']."', `time` = '".time()."', `readlen` = '0'");
header('location: /clan/');
exit;
}
?>
<div class='god'>
<center>Персонаж <?=nick($row['user'])?> хочет вступить в клан!<br>
<?if($clan_memb['rank'] >= 3){?><div class='link_center'><a href='?true=1'>[Прийнять]</a></div><div class='link_center'><a href='?false=1'>[Отклонить]</a></div><?}?></center>
</div>
<div class='hr'></div>
<?
}
}else{
?>
<center><div class='god'>Нету заявок в ваш клан</div></center>
<?
}
?>
<a class='link' href='/clan/'>Вернуться в клан</a>
<?
include './system/f.php';
?>