<?
$page = "admin_ban.php";
include "admin_header.php";

if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }




if($task == "dosave") {
$banned_usernames = str_replace(" ", "", $_POST['banned_usernames']);
$banned_weblogs = str_replace(" ", "", $_POST['banned_weblogs']);
$banned_emails = str_replace(" ", "", $_POST['banned_emails']);
$banned_ips = str_replace(" ", "", $_POST['banned_ips']);
$banned_ips_access = str_replace(" ", "", $_POST['banned_ips_access']);
$banned_badwords = str_replace(" ", "", $_POST['banned_badwords']);
$banned_badwords_replace = preg_replace("/[A-Za-z]/", "*", $banned_badwords);
$comment_image = $_POST['comment_image'];

mysql_query("UPDATE bhost_admin SET banned_usernames='$banned_usernames', banned_weblogs='$banned_weblogs', banned_emails='$banned_emails', banned_ips='$banned_ips', banned_ips_access='$banned_ips_access', banned_badwords='$banned_badwords', banned_badwords_replace='$banned_badwords_replace', comment_image='$comment_image'");

echo $head;
echo "
<h2>$admin_ban1</h2>
$admin_ban2
<br><br>
<form action='admin_ban.php' method='POST'>
<input type='submit' class='button' value='$admin_ban3'>
</form>
";
echo $foot;
exit();
}



if($task == "main") {
echo $head;
echo "
<h2>$admin_ban4</h2>
$admin_ban5

<br><br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<form action='admin_ban.php' method='POST'>
<tr><td class='header'>$admin_ban6</td></tr>
<tr>
<td class='box'>
$admin_ban7
<br><br>
<b>$admin_ban8</b><br>
<textarea name='banned_usernames' rows='3' cols='60'>$admin_info[banned_usernames]</textarea>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_ban26</td></tr>
<tr>
<td class='box'>
$admin_ban27
<br><br>
<b>$admin_ban28</b><br>
<textarea name='banned_weblogs' rows='3' cols='60'>$admin_info[banned_weblogs]</textarea>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_ban9</td></tr>
<tr>
<td class='box'>
$admin_ban10
<br><br>
<b>$admin_ban11</b><br>
<textarea name='banned_emails' rows='3' cols='60'>$admin_info[banned_emails]</textarea>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_ban12</td></tr>
<tr>
<td class='box'>
$admin_ban13
<br><br>
<b>$admin_ban14</b><br>
<textarea name='banned_ips' rows='3' cols='60'>$admin_info[banned_ips]</textarea>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_ban15</td></tr>
<tr>
<td class='box'>
$admin_ban16
<br><br>
<b>$admin_ban17</b><br>
<textarea name='banned_ips_access' rows='3' cols='60'>$admin_info[banned_ips_access]</textarea>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_ban19</td></tr>
<tr>
<td class='box'>
$admin_ban20
<br><br>
<b>$admin_ban21</b><br>
<textarea name='banned_badwords' rows='3' cols='60'>$admin_info[banned_badwords]</textarea>
</td>
</tr>
</table>

<br>

<table width='100%' cellpadding='0' cellspacing='0' style='margin-top: 3px;'>
<tr><td class='header'>$admin_ban22</td></tr>
<tr>
<td class='box'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='comment_image' id='comment_image0' value='0'"; if($admin_info[comment_image] == 0) { echo " CHECKED"; } echo "></td><td><label for='comment_image0'>$admin_ban23</label></td></tr>
 <tr><td><input type='radio' name='comment_image' id='comment_image1' value='1'"; if($admin_info[comment_image] == 1) { echo " CHECKED"; } echo "></td><td><label for='comment_image1'>$admin_ban24</label></td></tr>
 </table>
<br>
$admin_ban25
</td>
</tr>
</table>

<br>

<input type='submit' class='button' value='$admin_ban18'>
<input type='hidden' name='task' value='dosave'>
</form>
";
echo $foot;
}

?>