<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

$action = $_GET['action'];
$go = $_GET['go'];
$id = $_GET['id'];
if ( $action == "adicionarconta" )
{
    if ( $go == false )
    {
        echo "    \t<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Adicionar Conta LanHouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    \t<form name=\"form1\" id=\"form1\" action=\"?page=lanhouse&action=adicionarconta&go=1\" method=\"post\">\r\n                \t\t<table width=\"100%\" cellpadding=\"5\" cellspacing=\"2\">\r\n                        <tr>\r\n                        \t<td colspan=\"2\" class=\"conta\"><b><center>Dados pessoais</center></b></td>\r\n                        </tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"conta\">Nome:</td>\r\n                \t\t\t<td><input type=\"text\" name=\"nome\" id=\"nome\" maxlength=\"200\" class=\"conta\" style=\"width: 300px\"></td>\r\n                \t\t</tr>\r\n                \t\t<tr>\r\n                \t\t<td class=\"conta\">Endere&ccedil;o:</td>\r\n                \t\t<td><input type=\"text\" name=\"endereco\" id=\"endereco\" maxlength=\"400\" class=\"conta\" style=\"width: 300px\"></td>\r\n                \t\t</tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Cidade:</td>\r\n                            <td><input type=\"text\" name=\"cidade\" id=\"cidade\" maxlength=\"100\" class=\"conta\" style=\"width: 200px\"> Estado: <select name=\"estado\" id=\"estado\" class=\"conta\" style=\"width: 50px\">\r\n                          <option value=\"AL\">AL</option><option value=\"AP\">AP</option><option value=\"AM\">AM</option><option value=\"BA\">BA</option><option value=\"CE\">CE</option><option value=\"DF\">DF</option><option value=\"ES\">ES</option><option value=\"GO\">GO</option><option value=\"MA\">MA</option><option value=\"MG\">MG</option><option value=\"MS\">MS</option><option value=\"MT\">MT</option><option value=\"PA\">PA</option><option value=\"PB\">PB</option><option value=\"PE\">PE</option><option value=\"PI\">PI</option><option value=\"PR\">PR</option><option value=\"RJ\">RJ</option><option value=\"RN\">RN</option><option value=\"RO\">RO</option><option value=\"RR\">RR</option><option value=\"RS\">RS</option><option value=\"SC\">SC</option><option value=\"SE\">SE</option><option value=\"SP\" selected>SP</option><option value=\"TO\">TO</option>\r\n                        </select></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Site:</td>\r\n                            <td><input type=\"text\" name=\"site\" id=\"site\" maxlength=\"300\" class=\"conta\" style=\"width: 300px\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Email:</td>\r\n                            <td><input type=\"text\" name=\"email\" id=\"email\" maxlength=\"100\" class=\"conta\" style=\"width: 300px\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Banner:</td>\r\n                            <td><input type=\"text\" name=\"banner\" id=\"banner\" maxlength=\"300\" class=\"conta\" style=\"width: 300px\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Descri&ccedil;&atilde;o:</td>\r\n                            <td><textarea name=\"descricao\" id=\"descricao\" class=\"conta\" style=\"width: 300px; height: 120px;\"></textarea></td>\r\n                        </tr>\r\n                        \r\n                        <tr>\r\n                        \t<td colspan=\"2\" class=\"conta\" align=\"center\"><b><center>Dados da Conta</center></b></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Conta: </td>\r\n                            <td><input type=\"text\" name=\"conta\" id=\"conta\" maxlength=\"20\" class=\"conta\" style=\"width: 300px\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Senha: </td>\r\n                            <td><input type=\"text\" name=\"senha\" id=\"senha\" maxlength=\"20\" class=\"conta\" style=\"width: 300px\"></td>\r\n                        </tr>\r\n                        \r\n                        \r\n               \t\t\t<tr>\r\n                \t\t\t<td colspan=\"2\" align=\"center\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/addcontao.gif\";\r\n\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/addconta.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/addconta.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n                        </form>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n    ";
    }
    if ( $go == true )
    {
        $nome = $_POST['nome'];
        $endereco = $_POST['endereco'];
        $cidade = $_POST['cidade'];
        $estado = $_POST['estado'];
        $site = $_POST['site'];
        $email = $_POST['email'];
        $banner = $_POST['banner'];
        $descricao = $_POST['descricao'];
        $conta = $_POST['conta'];
        $senha = $_POST['senha'];
        $check->checacampobranco( $nome, "Nome" );
        $check->checacampobranco( $endereco, "Endereco" );
        $check->checacampobranco( $cidade, "Cidade" );
        $check->checacampobranco( $estado, "Estado" );
        $check->checacampobranco( $email, "Email" );
        $check->checacampobranco( $site, "Site" );
        $check->checacampobranco( $banner, "Banner" );
        $check->checacampobranco( $descricao, "Descricao" );
        $check->checacampobranco( $conta, "Conta" );
        $check->checacampobranco( $senha, "Senha" );
        $sql->verificacontalanhouse( $conta, 1 );
        $sql->verificaemaillanhouse( $email, 1 );
        $sql->executaadicionarcontalanhouse( $nome, $conta, $senha, $endereco, $cidade, $estado, $site, $email, $descricao, $banner );
    }
}
if ( $action == "alterarconta" )
{
    $sql->query( "SELECT Id, Nome, Endereco, Cidade, Estado, Site, Email, Banner, Descricao, Login, Credito FROM SITE_LANHOUSE" );
    if ( $id == false && $go == false )
    {
        echo "<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Alterar Conta LanHouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Lan Houses</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"lanhousetitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Endereco</td>\r\n                            <td>Cidade</td>\r\n                            <td>Conta</td>\r\n\t\t\t\t\t\t\t<td>Credito</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "lanhouse2";
            }
            else
            {
                $estilo = "lanhouse1";
            }
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('";
            echo $info[5];
            echo "<br>";
            echo $info[6];
            echo "<br><img src=\\'";
            echo $info[7];
            echo "\\'>')\" class=\"lanhouse\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo " - ";
            echo $info[4];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[9];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[10];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=lanhouse&action=alterarconta&id=";
            echo $info[0];
            echo "'\">Alterar</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n    ";
    }
    if ( $id == true && $go == false )
    {
        $id = $_GET['id'];
        $check->checacampobranco( $id, "Id" );
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidlanhouse( $id, 1 );
        $sql->query( "SELECT Nome, Endereco, Cidade, Site, Email, Banner, Descricao, Login, Senha FROM SITE_LANHOUSE WHERE Id='".$id."'" );
        $info = $sql->row( );
        echo "    \t<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Alterar Conta LanHouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    \t<form name=\"form1\" id=\"form1\" action=\"?page=lanhouse&action=alterarconta&go=1\" method=\"post\">\r\n                        <input type=\"hidden\" name=\"id\" id=\"id\" value=\"";
        echo $id;
        echo "\">\r\n                \t\t<table width=\"100%\" cellpadding=\"5\" cellspacing=\"2\">\r\n                        <tr>\r\n                        \t<td colspan=\"2\" class=\"conta\"><b><center>Dados pessoais</center></b></td>\r\n                        </tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"conta\">Nome:</td>\r\n                \t\t\t<td><input type=\"text\" name=\"nome\" id=\"nome\" maxlength=\"200\" class=\"conta\" style=\"width: 300px\" value=\"";
        echo $info[0];
        echo "\"></td>\r\n                \t\t</tr>\r\n                \t\t<tr>\r\n                \t\t<td class=\"conta\">Endere&ccedil;o:</td>\r\n                \t\t<td><input type=\"text\" name=\"endereco\" id=\"endereco\" maxlength=\"400\" class=\"conta\" style=\"width: 300px\" value=\"";
        echo $info[1];
        echo "\"></td>\r\n                \t\t</tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Cidade:</td>\r\n                            <td><input type=\"text\" name=\"cidade\" id=\"cidade\" maxlength=\"100\" class=\"conta\" style=\"width: 200px\" value=\"";
        echo $info[2];
        echo "\"> Estado: <select name=\"estado\" id=\"estado\" class=\"conta\" style=\"width: 50px\" value=\"";
        echo $info[2];
        echo "\">\r\n                          <option value=\"AL\">AL</option><option value=\"AP\">AP</option><option value=\"AM\">AM</option><option value=\"BA\">BA</option><option value=\"CE\">CE</option><option value=\"DF\">DF</option><option value=\"ES\">ES</option><option value=\"GO\">GO</option><option value=\"MA\">MA</option><option value=\"MG\">MG</option><option value=\"MS\">MS</option><option value=\"MT\">MT</option><option value=\"PA\">PA</option><option value=\"PB\">PB</option><option value=\"PE\">PE</option><option value=\"PI\">PI</option><option value=\"PR\">PR</option><option value=\"RJ\">RJ</option><option value=\"RN\">RN</option><option value=\"RO\">RO</option><option value=\"RR\">RR</option><option value=\"RS\">RS</option><option value=\"SC\">SC</option><option value=\"SE\">SE</option><option value=\"SP\" selected>SP</option><option value=\"TO\">TO</option>\r\n                        </select></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Site:</td>\r\n                            <td><input type=\"text\" name=\"site\" id=\"site\" maxlength=\"300\" class=\"conta\" style=\"width: 300px\" value=\"";
        echo $info[3];
        echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Email:</td>\r\n                            <td><input type=\"text\" name=\"email\" id=\"email\" maxlength=\"100\" class=\"conta\" style=\"width: 300px\" value=\"";
        echo $info[4];
        echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Banner:</td>\r\n                            <td><input type=\"text\" name=\"banner\" id=\"banner\" maxlength=\"300\" class=\"conta\" style=\"width: 300px\" value=\"";
        echo $info[5];
        echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Descri&ccedil;&atilde;o:</td>\r\n                            <td><textarea name=\"descricao\" id=\"descricao\" class=\"conta\" style=\"width: 300px; height: 120px;\">";
        echo $sql->descodificatexto( $info[6] );
        echo "</textarea></td>\r\n                        </tr>\r\n                        \r\n                        <tr>\r\n                        \t<td colspan=\"2\" class=\"conta\" align=\"center\"><b><center>Dados da Conta</center></b></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Conta: </td>\r\n                            <td><input type=\"text\" name=\"contad\" id=\"contad\" maxlength=\"20\" class=\"conta\" style=\"width: 300px\" value=\"";
        echo $info[7];
        echo "\" disabled=\"disabled\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td class=\"conta\">Senha: </td>\r\n                            <td><input type=\"text\" name=\"senha\" id=\"senha\" maxlength=\"20\" class=\"conta\" style=\"width: 300px\" value=\"";
        echo $info[8];
        echo "\"></td>\r\n                        </tr>\r\n                        \r\n                        \r\n               \t\t\t<tr>\r\n                \t\t\t<td colspan=\"2\" align=\"center\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/altcontao.gif\";\r\n\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/altconta.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/altconta.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n                        </form>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n\t";
    }
    if ( $id == false && $go == true )
    {
        $id = $_POST['id'];
        $nome = $_POST['nome'];
        $endereco = $_POST['endereco'];
        $cidade = $_POST['cidade'];
        $estado = $_POST['estado'];
        $site = $_POST['site'];
        $email = $_POST['email'];
        $banner = $_POST['banner'];
        $descricao = $_POST['descricao'];
        $senha = $_POST['senha'];
        $check->checacampobranco( $nome, "Nome" );
        $check->checacampobranco( $endereco, "Endereco" );
        $check->checacampobranco( $cidade, "Cidade" );
        $check->checacampobranco( $estado, "Estado" );
        $check->checacampobranco( $email, "Email" );
        $check->checacampobranco( $site, "Site" );
        $check->checacampobranco( $banner, "Banner" );
        $check->checacampobranco( $descricao, "Descricao" );
        $check->checacampobranco( $senha, "Senha" );
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidlanhouse( $id, 1 );
        $sql->executaalterarcontalanhouse( $id, $nome, $senha, $endereco, $cidade, $estado, $site, $email, $descricao, $banner );
    }
}
if ( $action == "removerconta" )
{
    $sql->query( "SELECT Id, Nome, Endereco, Cidade, Estado, Site, Email, Banner, Descricao, Login, Credito FROM SITE_LANHOUSE" );
    if ( $id == false )
    {
        echo "<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Alterar Conta LanHouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Lan Houses</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"lanhousetitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Endereco</td>\r\n                            <td>Cidade</td>\r\n                            <td>Conta</td>\r\n\t\t\t\t\t\t\t<td>Credito</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "lanhouse2";
            }
            else
            {
                $estilo = "lanhouse1";
            }
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('";
            echo $info[5];
            echo "<br>";
            echo $info[6];
            echo "<br><img src=\\'";
            echo $info[7];
            echo "\\'>')\" class=\"lanhouse\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo " - ";
            echo $info[4];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[9];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[10];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:RemoverContaLanhouse('";
            echo $info[0];
            echo "')\">Remover</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n\t";
    }
    if ( $id == true )
    {
        $id = $_GET['id'];
        $check->checacampobranco( $id, "Id" );
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidlanhouse( $id, 1 );
        $sql->executaremovercontalanhouse( $id );
    }
}
if ( $action == "adicionarcredito" )
{
    $sql->query( "SELECT Id, Nome, Endereco, Cidade, Estado, Site, Email, Banner, Descricao, Login, Credito FROM SITE_LANHOUSE" );
    if ( $id == false && $go == false )
    {
        echo "<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Adicionar Cr&eacute;dito LanHouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Lan Houses</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"lanhousetitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Endereco</td>\r\n                            <td>Conta</td>\r\n\t\t\t\t\t\t\t<td>Credito</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "lanhouse2";
            }
            else
            {
                $estilo = "lanhouse1";
            }
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('";
            echo $info[5];
            echo "<br>";
            echo $info[6];
            echo "<br><img src=\\'";
            echo $info[7];
            echo "\\'>')\" class=\"lanhouse\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[9];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[10];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=lanhouse&action=adicionarcredito&id=";
            echo $info[0];
            echo "'\">Adicionar Cr&eacute;dito</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n\t";
    }
    if ( $id == true && $go == false )
    {
        $id = $_GET['id'];
        $check->checacampobranco( $id, "Id" );
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidlanhouse( $id, 1 );
        $sql->query( "SELECT Login FROM SITE_LANHOUSE WHERE Id='".$id."'" );
        $info = $sql->row( );
        echo "            \t<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Adicionar Cr&eacute;dito Lanhouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    \t<form name=\"form1\" id=\"form1\" action=\"?page=lanhouse&action=adicionarcredito&go=1\" method=\"post\">\r\n                        <input type=\"hidden\" name=\"conta\" id=\"conta\" value=\"";
        echo $info[0];
        echo "\">\r\n                \t\t<table width=\"100%\">\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"gold\">Conta:</td>\r\n                \t\t\t<td><input type=\"text\" name=\"contad\" id=\"contad\" maxlength=\"10\" class=\"gold\" disabled=\"disabled\" value=\"";
        echo $info[0];
        echo "\"></td>\r\n                \t\t</tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"gold\">Cr&eacute;dito:</td>\r\n                \t\t\t<td><input type=\"text\" name=\"credito\" id=\"credito\" maxlength=\"4\" class=\"gold\"></td>\r\n                \t\t</tr>\r\n               \t\t\t<tr>\r\n                \t\t\t<td colspan=\"2\" align=\"center\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/addcreditoo.gif\";\r\n\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/addcredito.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/addcredito.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n                        </form>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n        ";
    }
    if ( $id == false && $go == true )
    {
        $conta = $_POST['conta'];
        $credito = $_POST['credito'];
        $check->checacampobranco( $conta, "Conta" );
        $check->checacampobranco( $credito, "Credito" );
        $check->checanumeropositivo( $credito, "Credito" );
        $sql->verificacontalanhouse( $conta, 2 );
        $sql->executaadicionarcreditolanhouse( $conta, $credito );
    }
}
if ( $action == "alterarcredito" )
{
    $sql->query( "SELECT Id, Nome, Endereco, Cidade, Estado, Site, Email, Banner, Descricao, Login, Credito FROM SITE_LANHOUSE" );
    if ( $id == false && $go == false )
    {
        echo "<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Alterar Cr&eacute;dito LanHouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Lan Houses</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"lanhousetitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Endereco</td>\r\n                            <td>Conta</td>\r\n\t\t\t\t\t\t\t<td>Credito</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "lanhouse2";
            }
            else
            {
                $estilo = "lanhouse1";
            }
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('";
            echo $info[5];
            echo "<br>";
            echo $info[6];
            echo "<br><img src=\\'";
            echo $info[7];
            echo "\\'>')\" class=\"lanhouse\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[9];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[10];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=lanhouse&action=alterarcredito&id=";
            echo $info[0];
            echo "'\">Alterar Cr&eacute;dito</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n\t";
    }
    if ( $id == true && $go == false )
    {
        $id = $_GET['id'];
        $check->checacampobranco( $id, "Id" );
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidlanhouse( $id, 1 );
        $sql->query( "SELECT Login, Credito FROM SITE_LANHOUSE WHERE Id='".$id."'" );
        $info = $sql->row( );
        echo "            \t<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Alterar Cr&eacute;dito Lanhouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    \t<form name=\"form1\" id=\"form1\" action=\"?page=lanhouse&action=alterarcredito&go=1\" method=\"post\">\r\n                        <input type=\"hidden\" name=\"conta\" id=\"conta\" value=\"";
        echo $info[0];
        echo "\">\r\n                \t\t<table width=\"100%\">\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"gold\">Conta:</td>\r\n                \t\t\t<td><input type=\"text\" name=\"contad\" id=\"contad\" maxlength=\"10\" class=\"gold\" disabled=\"disabled\" value=\"";
        echo $info[0];
        echo "\"></td>\r\n                \t\t</tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"gold\">Cr&eacute;dito:</td>\r\n                \t\t\t<td><input type=\"text\" name=\"credito\" id=\"credito\" maxlength=\"4\" class=\"gold\" value=\"";
        echo $info[1];
        echo "\"></td>\r\n                \t\t</tr>\r\n               \t\t\t<tr>\r\n                \t\t\t<td colspan=\"2\" align=\"center\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/altcreditoo.gif\";\r\n\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/altcredito.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/altcredito.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n                        </form>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n        ";
    }
    if ( $id == false && $go == true )
    {
        $conta = $_POST['conta'];
        $credito = $_POST['credito'];
        $check->checacampobranco( $conta, "Conta" );
        $check->checacampobranco( $credito, "Credito" );
        $check->checanumeropositivo( $credito, "Credito" );
        $sql->verificacontalanhouse( $conta, 2 );
        $sql->executaalterarcreditolanhouse( $conta, $credito );
    }
}
if ( $action == "removercredito" )
{
    $sql->query( "SELECT Id, Nome, Endereco, Cidade, Estado, Site, Email, Banner, Descricao, Login, Credito FROM SITE_LANHOUSE" );
    if ( $id == false && $go == false )
    {
        echo "<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Remover Cr&eacute;dito LanHouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Lan Houses</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"lanhousetitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Endereco</td>\r\n                            <td>Conta</td>\r\n\t\t\t\t\t\t\t<td>Credito</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "lanhouse2";
            }
            else
            {
                $estilo = "lanhouse1";
            }
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('";
            echo $info[5];
            echo "<br>";
            echo $info[6];
            echo "<br><img src=\\'";
            echo $info[7];
            echo "\\'>')\" class=\"lanhouse\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[9];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[10];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=lanhouse&action=removercredito&id=";
            echo $info[0];
            echo "'\">Remover Cr&eacute;dito</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n\t";
    }
    if ( $id == true && $go == false )
    {
        $id = $_GET['id'];
        $check->checacampobranco( $id, "Id" );
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidlanhouse( $id, 1 );
        $sql->query( "SELECT Login, Credito FROM SITE_LANHOUSE WHERE Id='".$id."'" );
        $info = $sql->row( );
        echo "            \t<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Remover Cr&eacute;dito Lanhouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    \t<form name=\"form1\" id=\"form1\" action=\"?page=lanhouse&action=removercredito&go=1\" method=\"post\">\r\n                        <input type=\"hidden\" name=\"conta\" id=\"conta\" value=\"";
        echo $info[0];
        echo "\">\r\n                \t\t<table width=\"100%\">\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"gold\">Conta:</td>\r\n                \t\t\t<td><input type=\"text\" name=\"contad\" id=\"contad\" maxlength=\"10\" class=\"gold\" disabled=\"disabled\" value=\"";
        echo $info[0];
        echo "\"></td>\r\n                \t\t</tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"gold\">Cr&eacute;dito:</td>\r\n                \t\t\t<td><input type=\"text\" name=\"credito\" id=\"credito\" maxlength=\"4\" class=\"gold\" value=\"";
        echo $info[1];
        echo "\"></td>\r\n                \t\t</tr>\r\n               \t\t\t<tr>\r\n                \t\t\t<td colspan=\"2\" align=\"center\">\r\n\t\t\t\t\t\t\t\t<script language=\"JavaScript\">\r\n\t\t\t\t\t\t\t\t\t<!--\r\n\t\t\t\t\t\t\t\t\t//hide me\r\n\t\t\t\t\t\t\t\t\tif (document.images) {\r\n\t\t\t\t\t\t\t\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/remcreditoo.gif\";\r\n\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/remcredito.gif\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//-->\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t\t<a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/remcredito.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n                        </form>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n        ";
    }
    if ( $id == false && $go == true )
    {
        $conta = $_POST['conta'];
        $credito = $_POST['credito'];
        $check->checacampobranco( $conta, "Conta" );
        $check->checacampobranco( $credito, "Credito" );
        $check->checanumeropositivo( $credito, "Credito" );
        $sql->verificacontalanhouse( $conta, 2 );
        $sql->verificacreditolanhouse( $conta, 3, $credito );
        $sql->executaremovercreditolanhouse( $conta, $credito );
    }
}
if ( $action == "informacoes" )
{
    $sql->query( "SELECT Id, Nome, Endereco, Cidade, Estado, Site, Email, Banner, Descricao, Login, Credito FROM SITE_LANHOUSE" );
    if ( $id == false )
    {
        echo "<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Informa&ccedil;&otilde;es LanHouse</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"8\" class=\"infotitulo\">Lan Houses</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"lanhousetitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Nome</td>\r\n\t\t\t\t\t\t\t<td>Endereco</td>\r\n                            <td>Conta</td>\r\n\t\t\t\t\t\t\t<td>Credito</td>\r\n                            <td>A&ccedil;&atilde;o</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t";
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "lanhouse2";
            }
            else
            {
                $estilo = "lanhouse1";
            }
            echo "                            <form name=\"form";
            echo $x;
            echo "\" action=\"\" method=\"post\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\"><a href=\"javascript:;\" onmouseover=\"Tip('";
            echo $info[5];
            echo "<br>";
            echo $info[6];
            echo "<br><img src=\\'";
            echo $info[7];
            echo "\\'>')\" class=\"lanhouse\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[9];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[10];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=lanhouse&action=informacoes&id=";
            echo $info[0];
            echo "'\">Informa&ccedil;&otilde;es</a></td>\r\n                        </tr>\r\n                        \t</form>\r\n\t\t\t\t\t\t\t";
        }
        echo "\t\t\t\t\t\t</table>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n\t";
    }
    if ( $id == true )
    {
        $id = $_GET['id'];
        $check->checacampobranco( $id, "Id" );
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidlanhouse( $id, 1 );
        $sql->query( "SELECT Nome, Login, Credito, Email, Endereco, Cidade, Estado, Site, Descricao, Banner FROM SITE_LANHOUSE WHERE Id='".$id."'" );
        $info = $sql->row( );
        echo "<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Informa&ccedil;&otilde;es Conta</font></b></td>\r\n                \t<td background=\"images/bdy06.gif\" align=\"right\"><img src=\"images/bullet031.gif\" width=\"6\" height=\"10\">&nbsp;&nbsp;</td>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                </tr>\r\n                <tr>\r\n                \t<td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                \t<td colspan=\"3\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td colspan=\"2\" class=\"infotitulo\">Informa&ccedil;&atilde;o da Conta</td>\r\n                        </tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"infovip\" align=\"right\" width=\"35%\"><b>#ID:</b></td>\r\n                            <td class=\"infovip\">";
        echo $id;
        echo "</td>\r\n\t\t\t\t\t\t</tr>    \r\n                \t\t<tr>\r\n                \t\t\t<td class=\"infovip\" align=\"right\" width=\"35%\"><b>Nome:</b></td>\r\n                            <td class=\"infovip\">";
        echo $info[0];
        echo "</td>\r\n\t\t\t\t\t\t</tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"infovip2\" align=\"right\"><b>Conta:</b></td>\r\n                            <td class=\"infovip2\">";
        echo $info[1];
        echo "</td>\r\n                        <tr>\r\n                \t\t\t<td class=\"infovip\" align=\"right\"><b>Cr&eacute;ditos:</b></td>\r\n                            <td class=\"infovip\">";
        echo $info[2];
        echo " cr&eacute;ditos</td>\r\n\t\t\t\t\t\t</tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"infovip\" align=\"right\" width=\"35%\"><b>Email:</b></td>\r\n                            <td class=\"infovip\">";
        echo $info[3];
        echo "</td>\r\n\t\t\t\t\t\t</tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"infovip2\" align=\"right\"><b>Endere&ccedil;o:</b></td>\r\n                            <td class=\"infovip2\">";
        echo $info[4];
        echo "</td>\r\n\t\t\t\t\t\t</tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"infovip\" align=\"right\" width=\"35%\"><b>Cidade:</b></td>\r\n                            <td class=\"infovip\">";
        echo $info[5];
        echo " - ";
        echo $info[6];
        echo "</td>\r\n\t\t\t\t\t\t</tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"infovip2\" align=\"right\"><b>Site:</b></td>\r\n                            <td class=\"infovip2\"><a href=\"";
        echo $info[7];
        echo "\" target=\"_blank\">";
        echo $info[7];
        echo "</a></td>\r\n\t\t\t\t\t\t</tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"infovip\" align=\"right\"><b>Descri&ccedil;&atilde;o:</b></td>\r\n                            <td class=\"infovip\">";
        echo $info[8];
        echo "</td>\r\n\t\t\t\t\t\t</tr>\r\n                        <tr>\r\n                        \t<td class=\"infovip2\" align=\"right\"><b>Publicidade:</b></td>\r\n                            <td class=\"infovip2\" align=\"center\"><img src=\"";
        echo $info[9];
        echo "\"></td>\r\n                        </tr>\r\n\t\t\t\t\t\t</table>\r\n                    </td>\r\n                    <td width=\"1\" bgcolor=\"#666666\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n                <tr>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td bgcolor=\"#666666\" colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                    <td width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\r\n                </tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n        ";
    }
}
?>
