

<html>

<head>

<SCRIPT language=JavaScript>
var message="";
function clickIE()
{
    if (document.all)
    {
        (message);
        return false;
    }
}
function clickNS(e)
{
    if(document.layers||(document.getElementById&&!document.all))
    {
        if (e.which==2||e.which==3)
        {
            (message);
            return false;
        }
    }
}
if (document.layers)
{
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS;
}
else
{
    document.onmouseup=clickNS;
    document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")
</SCRIPT>

<LINK REL="StyleSheet" HREF="style10.css" TYPE="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<? session_start();
include 'cnn.php';
include 'estilo.css';?>
<p>

<?PHP
$char     = stripslashes($_POST['char']);
$acao     = stripslashes($_POST['acao']);
$reason = stripslashes($_POST['reason']);
$bloc_by = stripslashes($_POST['admchar']);
$diasbloc = stripslashes($_POST['tempo']);

if (empty($admchar) || empty($reason) || empty($diasbloc) || empty($char) || empty($acao))
{
    ?>
    <script>
    window.alert("ERRO: campos em branco.");
    window.location='ir.php?pagina=banir';
    </script>
    <?PHP
}
else
{
    $sql_name_check = mssql_query("SELECT Name FROM Character WHERE Name='$char'");
    $name_check = mssql_num_rows($sql_name_check);
    $bloc_by  = $admchar;
            if ($name_check <= 0)
            {
                ?>
                <script>
                    window.alert("ERRO: CHAR não existe.");
                    window.location='ir.php?pagina=banir';
                </script>
                    <?PHP
                }
                else
                {
                    if ($acao == 2)
                    {
                     mssql_query("UPDATE Character SET
								 CtlCode = '1',
								 blocpor='$admchar',
								 motivobloc='$reason',
								 diasdesbloc='$diasbloc'
                                    WHERE Name='$char'");
	echo "<script>alert('$char bloquiado com sucesso'); 
	location='javascript:history.back()'</script>";	

                        ?>
                        
                        <?PHP
              }
         }
    }
?>
</body>
</html>
