<?
//
//  cP Account Creator Version 0.4 Beta Build 01
//  Copyright (C) 2004 Brian Freeman
//  All Rights Reserved.
//
//  This script set is distributed as is with absolutely no warranty.
//  Users of this script set agree to use at their own risk.
//  Questions or comments?  Contact webmaster@freemans-web.com
//
//



include("../config.php");

$cp_email="$email@$domain";

if($view=="1") {
$b_field="banned_ip";
$b_name="Banned IP's";
}elseif($view=="2") {
$b_field="banned_host";
$b_name="Banned Hosts";
}elseif($view=="3") {
$b_field="free_email";
$b_name="Banned Free Email Server's";
}elseif($view=="4") {
$b_field="banned_email";
$b_name="Banned Email's";
}else{
$b_field="";
}
?>
<center><img src="../images/back.gif" width=300 height=120>
<h1>Admin Center</h1> </center>
<center>

<?
if($view!="1" && $view!="2" && $view!="3" && $view!="4") {
?>

<table border=2><tr><td colspan=4><center><font size=5><b>Banned List</b></font></center><a href=admin.php>Back to Admin</a></td></tr><tr><td width=150><a href=view_ban.php?view=1>View Banned IP's</a></td><td width=150><a href=view_ban.php?view=2>View Banned Hosts</a></td><td width=150><a href=view_ban.php?view=3>View Banned Free Email Servers</a></td><td width=150><a href=view_ban.php?view=4>View Banned Emails List</a></td></tr>


<?

}else {

?>
<table border=2><tr><td colspan=4><center><font size=5><b>Banned List</b></font></center><a href=admin.php>Back to Admin</a></td></tr><tr><td width=150><a href=view_ban.php?view=1>View Banned IP's</a></td><td width=150><a href=view_ban.php?view=2>View Banned Hosts</a></td><td width=150><a href=view_ban.php?view=3>View Banned Free Email Servers</a></td><td width=150><a href=view_ban.php?view=4>View Banned Emails List</a></td></tr>
<?

//$conn  = mysql_connect($dbhost, $dbusername, $dbpass) or die(mysql_error( ));
//mysql_select_db($dbname,$conn) or die(mysql_error( ));
$display_block = "<table border=2><tr><td colspan=4><center><font size=5><b>$b_name</b></font></center><br>Click Link to Remove</td></tr>";

$get_items="SELECT $b_field FROM banned";
$get_items_res=mysql_query($get_items)  or die(mysql_error( ));
if (mysql_num_rows($get_items_res)<1) {
	$display_block .= "<h1>No Records</h1>";

} else {

	while ($items = mysql_fetch_array ($get_items_res)) {
		$banned=$items[$b_field];

	$display_block .= "<tr><td><a href=functions.php?rem_ban=1&b_field=$b_field&b_entry=$banned>$banned</a></td></tr>";
							}
	}
echo $display_block;
echo "</table>";
include("footer.php");
}



?>