View file waplend/adban.php

File size: 3.13Kb
<? 
	
include "tools.php";
include "head.php";

  	       $page=$_GET['page'];
      if ($page<=0)
      {$page=1;}
$qw = mysql_fetch_array(mysql_query("SELECT * FROM `administration`where `iduser`='".$_SESSION['iduser']."'"));
if (mysql_affected_rows()=="1")
{$r="ok";}
if ($qw['type']=="999" and $r=="ok")
{
	echo "<div class='contur_rek'>
<div class='header_rek'>Раздел Бана</div></div>";
                     
             if ($_GET['act']=="guestban")
             {
             	 $q = mysql_query("select * from `guest` where id='".intval($_GET['id'])."';");
             	 $arr = mysql_fetch_array($q);
             	 if ( mysql_query("insert into `bann` values('".$arr['nik']."','".trim($arr['ip'])."','".trim($arr['browser'])."','".$_SESSION['login']."','".time()."');"))
             	 	 {             	 echo "Пользователь забанен!";}
             }
             
             
                          
             if (!empty($news))
             {$q = mysql_query("select * from `news` where id='".intval($news)."';");
      $arr = mysql_fetch_array($q);
        mysql_query("insert into `bann` values('".$arr['author']."','".trim($arr['ip'])."','".trim($arr['browser'])."','".$_SESSION['login']."','".$realtime."');");
        echo "<br/><div style='color: red'>Автор комментрия забаннен!</div>";
             }
             
             
             
             if (empty($act))
             {	 

      $page=hacker($_GET['page']);
      if ($page<=0)
      {$page=1;}
      
      if (!empty($user))
      {$q11 = mysql_query("select * from `users` where id='".$user."';");
      $arr11 = mysql_fetch_array($q11);
      mysql_query("insert into `bann` values('$arr11[name]','$arr11[ip]','$arr11[browser]','$_SESSION[login]', '".$realtime."');");
      echo "Пользователь забаннен!";
      }
$q = mysql_query("select * from `bann`;");
$count = mysql_num_rows($q);
while($arr = mysql_fetch_array($q))
 {if ($i<=$page*10 & $i>=($page-1)*10)
	{ $q11 = mysql_query("select * from `users` where login='".$arr['user']."';");
      $arr11 = mysql_fetch_array($q11);
		
 	 print "<div class='contur'>
	<div class='header'><a href='showuser.php?user=".$arr11['id']."'>".$arr['user']."</a></div>".$arr['browser']." $arr[ip]<br/><a href='adban.php?act=del&amp;time=".$arr['time']."'>Разбанить</a></div>";
 }
 ++$i;
 	}

 			 }
 			 if ($act=="del")
 			 { if ($_SESSION['login']!=$nikadmina)
 			 {mysql_query("delete from `bann` where time='".intval($_GET['time'])."';");
 			 }
 			 echo "<div class='contur'>
	<div class='header'>Пользователь Разбанен!</div></div>";
 			 }
 			 
 			 if ($count>10 and $count>10*($page))
	{
	$next=$page+1;
	print "<div><a href=\"adban.php?page=".$next."\">Вперёд</a></div>";
	}
	$prev=$page-1;
	
	if ($prev!=0)
	{
		
	print "<div><a href=\"adban.php?page=".$prev."\">Назад</a></div>";
	
	}
				 echo"<div><a href=\"adban.php\">Банцентр</a></div>";
			 }
			 echo"<div><a href=\"adpanel.php\">В админку</a></div>";
			 include ("foot.php");
?>