<?php





include_once '../sys/inc/start.php';




include_once '../sys/inc/compress.php';




include_once '../sys/inc/sess.php';




include_once '../sys/inc/home.php';




include_once '../sys/inc/settings.php';




include_once '../sys/inc/db_connect.php';




include_once '../sys/inc/ipua.php';




include_once '../sys/inc/fnc.php';








include_once '../sys/inc/user.php';








if(isset($user) && user_access('comm') && isset($_GET['id'])){

$comm=mysql_query("SELECT * FROM `comm` WHERE `id` = '".intval($_GET['id'])."'");
$comm=mysql_fetch_array($comm);



$set['title'] = 'Сообщество - '.htmlspecialchars($comm['name']).' - Нарушения'; // Заголовок страницы




include_once '../sys/inc/thead.php';




title();









aut();



if (isset($_POST['submited'])){

$time_ban = intval($_POST['time_ban']);


$time_ban = $time + $time_ban;

$msg = $_POST['msg'];if (strlen2($msg)<1)$err[] = "Введите причину";
$reason = intval($_POST['reason']);
if (!isset($err)){
mysql_query("INSERT INTO `comm_ban` SET `id_comm` = '$comm[id]', `id_banned` = '$user[id]', `time` = '$time_ban', `prich` = '".my_esc($msg)."', `type` = '$reason'");
header("Location: /comm/?act=comm_ban&id=$comm[id]");exit();
}




}

echo "<form method='post' class='main'>\n";

echo "Блокируем на: </br>\n";


echo'<select name="time_ban"><br/><option value="3600">1 ч.</option><option value="10800">3 ч.</option><option value="86400">24 ч.</option><option value="432000">120 ч.</option></select><br/>';



echo'Тип:<br/>';
echo'
	<input type="radio" name="reason" value="1" checked="checked"> Бан<br/>';
echo'
	<input type="radio" name="reason" value="2" checked="checked"> Предупреждение<br/>';

echo'
	<input type="radio" name="reason" value="3" checked="checked"> Блок<br/>';
echo'
Причина:<br/><textarea name="msg"></textarea>';
echo'<input type="submit" name="submited" value="Заблокировать"/>';echo " <a href='/comm/?act=comm_ban&id=$comm[id]'>Назад</a></form>";
echo "<div class='foot'><img src='/style/icons/str2.gif'> <a href='/comm/?act=comm&id=$comm[id]'>В сообщество</a></div>";
}
else{header("Location:/comm");exit;}
include_once '../sys/inc/tfoot.php';

?>