<?php include('files/header.php'); ?>
<div id="content-outer">
<div id="content">
<div id="page-heading">
<h1><?php echo $lang_admin['badwords']; ?></h1>
</div>
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
<th rowspan="3" class="sized"><img src="files/shared/side_shadowleft.jpg" width="20" height="300" alt="shadow_l"></th>
<th class="topleft"></th>
<td id="tbl-border-top"> </td>
<th class="topright"></th>
<th rowspan="3" class="sized"><img src="files/shared/side_shadowright.jpg" width="20" height="300" alt="shadow_r"></th>
</tr>
<tr>
<td id="tbl-border-left"></td>
<td><div id="content-table-inner">
<div id="table-content">
<p><strong><?php echo $lang_admin['enter_new_word']; ?></strong></p>
<p><?php
if(isset($_POST['word'])) {
$_POST = get_magic_quotes_gpc() ? array_map( 'stripslashes', $_POST ) : $_POST;
$word = $_POST['word'];
$sql = "INSERT INTO `badwords`
(`word`)
VALUES('" . mysql_real_escape_string($word) . "')";
mysql_query($sql);
if(mysql_affected_rows() == 1) {
echo '<p>' . $lang_admin['success_badword'] . '</p>';
}else{
echo '<p>' . $lang_admin['couldnot_badword'] . '</p>';
}
}
?>
<form action="?word" method="post" name="badword">
<input name="word" class="fields" type="text" size="40"> <input name="submit" class="button" type="submit" value="<?php echo $lang_admin['new_word_button']; ?>">
</form></p><br />
<p><strong><u><?php echo $lang_admin['entered_badwords']; ?> (<?php $bword = mysql_query("SELECT id FROM badwords");
$allwords = mysql_num_rows($bword);
echo $allwords; ?>)</u></strong></p>
<p><?php
$query = "SELECT id, word FROM badwords";
$result = mysql_query($query);
if($result) {
echo '<table width="100%" class="maintable">
<tr>
<td width="5%"><strong>ID</strong></td>
<td width="85%"><strong>Badword</strong></td>
<td width="10%"><span class="false">' . $lang_admin['delete'] . '</span></td>
</tr>
</table>';
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<table width="100%" class="maintable">
<tr>
<td width="5%"><strong>' . htmlentities($row['id']) . '</strong></td>
<td width="85%"><span class="false">' . htmlentities($row['word']) . '</span></td>
<td width="10%"><a href="badwords_delete.php?id=' . $row['id'] . '"><img src="files/delete.png" width="16" height="16" border="0" title="' . $lang_admin['delete'] . '"></a></td>
</tr>';
}
echo '</table>';
}else{
echo '<p>' . $lang_admin['no_records'] . '.</p>';
}
?></p>
</div>
</div></td>
<td id="tbl-border-right"></td>
</tr>
<tr>
<th class="sized bottomleft"></th>
<td id="tbl-border-bottom"> </td>
<th class="sized bottomright"></th>
</tr>
</table>
<div class="clear"></div>
</div>
<div class="clear"> </div>
</div>
<div class="clear"> </div>
</div>
<?php include('files/footer.php'); ?>