View file admin/ban.php

File size: 1.28Kb
<? $page_name="Админ-меню"; $dir="../"; include("../include/1.php"); require "../include/avto.php";
if(!isset($_SESSION['user_id']) or @$me['admin']!=2)exit("Нет доступа");

if(!isset($_GET['user']))exit();
$id=$_GET['user'];

if(!isset($_POST['submit1']))
{echo '
Блокировка на<br/><form action="ban.php?user='.$id.'" method="post">
<input name="mes" type="text" size="5" />месяцев<br/>
<input name="week" type="text" size="5" />недель<br/>
<input name="day" type="text" size="5" />дней<br/>
<input name="chas" type="text" size="5" />часов<br/>
<input name="min" type="text" size="5" />минут<br/>
<input name="sec" type="text" size="5" />секунд<br/>
Причина<br/>
<textarea name="ban" cols="25" rows="4"></textarea><br/>
<input name="submit1" type="submit" value="Заблокировать" /></form>';

}


else
{$mes=$_POST['mes']*2419200; $week=$_POST['week']*604800; $day=$_POST['day']*86400; $chas=$_POST['chas']*3600; $min=$_POST['min']*60; $sec=$_POST['sec'];
$ban=code($_POST['ban']);
$time_ban=$mes + $week + $day + $chas + $min +$sec + time();

$ban_user=mysql_query("insert into `shurik_ban` set `user`=$id, `razban`='$time_ban', `ban`='$ban'");
if($ban_user)echo "Пользователь заблокирован";
else echo error("Пользователь не заблокирован", '../');
}

include("../include/2.php"); ?>