<?php
$admin = 2;
$file = __FILE__;
include ("../inc/inc_common.php");
include ("../inc/inc_connect.php");
include ("../inc/inc_admincheck.php");

if ($action == "go")
{
    if ($num == 1)
    {
        $query = "UPDATE $sweartable SET strSwear = '$name' WHERE intId = '$id'";
    }

    if ($num == 2)
    {
        $query = "UPDATE $sweartable SET strReplace1 = '$name' WHERE intId = '$id'";
    }

    if ($num == 3)
    {
        $query = "UPDATE $sweartable SET strReplace2 = '$name' WHERE intId = '$id'";
    }

    if ($num == 4)
    {
        $query = "UPDATE $sweartable SET strReplace3 = '$name' WHERE intId = '$id'";
    }

    if ($num == 5)
    {
        $query = "UPDATE $sweartable SET strReplace4 = '$name' WHERE intId = '$id'";
    }

    if ($num == 6)
    {
        $query = "UPDATE $sweartable SET strReplace5 = '$name' WHERE intId = '$id'";
    }

    mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );

    header("Location: admin_swearing.php");
    exit;

}

include ("../inc/inc_getdate.php");
include ("../inc/inc_forumname.php");
$page = "Admin - Change Password";
$pagelink = $file;
include("../inc/inc_setonline.php");
$title = "$name1 Admin - $gfcookie[1] - Change Password";
include ("../inc/inc_head.php");
include ("../inc/inc_body.php");
$title = "Change Password";

$result=mysql_query("SELECT * FROM $sweartable WHERE intId = '$id'");
$num_rows = mysql_num_rows( $result );
while ( $a_row = mysql_fetch_object( $result ) )
{
    if ($num == 1)
    {
        $change = $a_row->strSwear;
    }

    if ($num == 2)
    {
        $change = $a_row->strReplace1;
    }

    if ($num == 3)
    {
        $change = $a_row->strReplace2;
    }

    if ($num == 4)
    {
        $change = $a_row->strReplace3;
    }

    if ($num == 5)
    {
        $change = $a_row->strReplace4;
    }

    if ($num == 6)
    {
        $change = $a_row->strReplace5;
    }


}

?>

<center><br><br><br><br><br>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#111111" width="60%" bgcolor=<?php print "$fgcolour"; ?>>
  <tr>
    <td width="100%">
    <br><br><center><font face=<?php print "$font"; ?> size="2">
    <form action="admin_swearingchange.php?action=go" method="post">
    Change Word <input type="text" onfocus="document.onkeypress=function(){};" name="name" size="20" style="color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')" value="<?php print "$change"; ?>">
    <input type="hidden" name="id" value="<?php print "$id"; ?>">
    <input type="hidden" name="num" value="<?php print "$num"; ?>">
    <br><br>
    <input type="submit" value="&nbsp;Set&nbsp;" name="B1">
    <br><br></td></tr></table>

<?php
include("../inc/inc_footer.php");
?>