View file funin/acp/blockwords.php

File size: 3.99Kb
<?php
	session_start();
	if(!isset($_SESSION["user"]))
	{
		header("location: index.html");
	}
?>
<html>
<title>Showing Blocked Words</title>
<body>
<?php
include("setup.php");
$tk= $_GET['token'];
$uu= $_GET['uu'];
$token= md5("pass");
if($token == $tk & $uu == $user){
$nickid=$_REQUEST["nick"];
$ipid=$_REQUEST["ip"];
$bid=$_REQUEST["b"];
require '../pteam.php';
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$rowpage=10; // Number of files show in per pages


$start_from = ($page-1) * $rowpage; 
$sql = "SELECT * FROM chat_spam ORDER BY id DESC limit $start_from,$rowpage";
$page2=$page+1;
$start_from2 = ($page2-1) * $rowpage;

$sql2 = "SELECT * FROM chat_spam ORDER BY id DESC limit $start_from2,$rowpage";
$sql3 = "SELECT * FROM chat_spam ORDER BY id DESC";

	//count rows start
		$resultcountrow = mysql_query($sql2) or die(mysql_error());
					$num_rows = mysql_num_rows($resultcountrow);

//count row end
	$result = mysql_query($sql) or die(mysql_error());
	$result2 = mysql_query($sql3) or die(mysql_error());

if (mysql_num_rows($result) == 0)
{
echo"<table border='1'>";

echo"<th>ID</th>";
echo"<th>Words</th>";
echo"<th>Edite</th>";
echo"<th>Delete</th>";
echo "<tr><td>No rows found,nothing to print.</td></td>";
echo"</td></tr>";
echo"</table>";
echo"<br/><br/>";
echo"<< <a href='adminpanel.php?uu=$uu&token=$token'>Back To AdminPanel</a>";
echo"<br/><br/>";
echo"<a href='logout.php'><b>LogOut</b></a>";
}
else
{
	//File List start
	echo"<b><u>Showing Blocked Words</u><b><br/>";
$num_rows = mysql_num_rows($result2);
echo "$num_rows Words Blocked";
echo"<table border='1'>";

echo"<th>ID</th>";
echo"<th>Words</th>";
echo"<th>Edite</th>";
echo"<th>Delete</th>";

while ($row = mysql_fetch_assoc($result)) {  
echo"<form method='post' action='updateword.php?uu=$uu&token=$token&id={$row['id']}' enctype='multipart/form-data'>";
        echo"<tr>";
	echo"<td>";
        echo"{$row['id']}";
        echo"</td><td>";
        echo"<input type='text' name='word' size='35' value='{$row['word']}'/>";
        echo"</td><td>";

	echo"<input type='submit' name='Edite' value='Edite'>";
        echo"</form>";

        echo"</td><td>";
	echo"(<a href=deleteword.php?uu=$uu&token=$token&id={$row['id']} >Delete</a>)";

        echo"</td></tr>";


	
            
	//File List end
}; 
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 

$pgnext = ($page+1);
$pgprevious = ($page-1);

// paging system
                         echo"<br/>";
                         echo"<table>";
                         echo"<tr>";
                         echo"<td>";
if($page!="1")
{
                         echo " <a href='blockwords.php?uu=$uu&token=$token&page=".$pgprevious."'>< Prev</a> ";
                         echo "| <a href='blockwords.php?uu=$uu&token=$token&page=".$pgprevious."'>".$pgprevious."</a> |";
}
                         echo"</td><td>";
                         echo"| $page |"; 
                         echo"</td><td>";
if (mysql_num_rows($resultcountrow) != 0)
{

                       echo "| <a href='blockwords.php?uu=$uu&token=$token&page=".$pgnext."'>".$pgnext."</a> |";
                      echo " <a href='blockwords.php?uu=$uu&token=$token&page=".$pgnext."'>Next ></a> ";

                        }
                       
                         echo"</td></tr>";
                         echo"</table>";
echo"*) <u>ADD Words ::</u>";
echo"<form method='post' action='addword.php?uu=$uu&token=$token' enctype='multipart/form-data'>";
echo"<table border='1'>";
echo"<tr><td>";
echo"Word :";
echo"</td><td>";
echo"<input type='text' name='word' size='15'/>";
echo"</tr><td>";
echo"<p><input type='submit' name='submit' value='submit'>";
echo"</td></tr>";
echo" </form>";
echo"</table>";
echo"<br/>";

// paging system end
echo"<br/>";
echo"<< <a href=showblockid.php?uu=$uu&token=$token>Show Blocked Nick</a>";
echo"<br/>";
echo"<br/>";
echo"<< <a href='adminpanel.php?uu=$uu&token=$token'>Back To AdminPanel</a>";
echo"<br/><br/>";
echo"<a href='logout.php'><b>LogOut</b></a>";
}
}
?>
</body>
</html>