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

$action = $_GET['action'];
$go = $_GET['go'];
$id = $_GET['id'];
if ( $action == "adicionar" )
{
    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 Leil&atilde;o</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=leilao&action=adicionar&go=1\" method=\"post\">\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"leilao\">T&iacute;tulo:</td>\r\n                \t\t\t<td align=\"left\"><input type=\"text\" name=\"titulo\" id=\"titulo\" maxlength=\"100\" style=\"width: 250px;\"></td>\r\n                            <td align=\"left\" valign=\"top\" colspan=\"2\" rowspan=\"5\">\r\n                            \t<input type=\"hidden\" id=\"foto\" name=\"foto\" value=\"\">\r\n                            \t<input type=\"hidden\" id=\"mini\" name=\"mini\" value=\"\">\r\n                            \t<input type=\"hidden\" id=\"i_foto\" name=\"i_foto\" value=\"\">\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\t\tspecbut2On = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On.src = \"images/en/buttons/procuraro.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off.src = \"images/en/buttons/procurar.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                                        <a href=\"javascript:;\" onClick=\"BuscaImagem();\" onMouseOver='ShowHide(\"specbut2\",\"specbut2On\");' onMouseOut='ShowHide(\"specbut2\",\"specbut2Off\")'><img src=\"images/en/buttons/procurar.gif\" Array border=\"0\" name=\"specbut2\"></a><br />\r\n                                     <span id=\"produto\" style=\"height: 182px; text-align:center;\"></span>\r\n                            </td>\r\n                \t\t</tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Pr&ecirc;mio:</td>\r\n                \t\t\t<td align=\"left\"><input type=\"text\" name=\"premio\" id=\"premio\" maxlength=\"100\" style=\"width: 250px;\"></td>\r\n                \t\t</tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Lance Inicial:</td>\r\n                    \t\t<td align=\"left\"><input type=\"text\" name=\"lanceinicial\" id=\"lanceinicial\" maxlength=\"4\" style=\"width: 250px;\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Termino Leil&atilde;o:</td>\r\n                    \t\t<td align=\"left\"><input type=\"text\" name=\"termino\" id=\"termino\" maxlength=\"20\" style=\"width: 250px;\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Status Leil&atilde;o:</td>\r\n                    \t\t<td align=\"left\">\r\n                            \t<select name=\"status\" id=\"status\" class=\"leilao\" style=\"width: 250px;\">\r\n                                \t<option value=\"0\">Ativado</option>\r\n                                    <option value=\"1\">Finalizado</option>\r\n                                    <option value=\"2\">Desativado</option>\r\n                                </select>\r\n                            </td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"4\">\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/addleilaoo.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/addleilao.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/addleilao.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n                            </td>\r\n                       </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 )
    {
        $titulo = $_POST['titulo'];
        $premio = $_POST['premio'];
        $imagem = $_POST['foto'];
        $lanceinicial = $_POST['lanceinicial'];
        $termino = $_POST['termino'];
        $status = $_POST['status'];
        $check->checacampobranco( $titulo, "Titulo" );
        $check->checacampobranco( $premio, "Premio" );
        $check->checacampobranco( $imagem, "Imagem" );
        $check->checacampobranco( $termino, "Termino" );
        $check->checanumeropositivo( $lanceincial, "Lance Incial" );
        $check->checanumeropositivo( $status, "Status" );
        $sql->executaadicionarleilao( $titulo, $premio, $imagem, $lanceinicial, $termino, $status );
    }
}
if ( $action == "alterar" )
{
    $sql->query( "SELECT Numero, Titulo, Premio, Imagem, LanceIncial, Lances, Status FROM SITE_LEILAO" );
    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 Leil&atilde;o</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\">Leil&atilde;o</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"leilaotitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Titulo</td>\r\n\t\t\t\t\t\t\t<td>Premio</td>\r\n\t\t\t\t\t\t\t<td>Lance Inicial</td>\r\n\t\t\t\t\t\t\t<td>Lances</td>\r\n\t\t\t\t\t\t\t<td>Status</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 = "leilao2";
            }
            else
            {
                $estilo = "leilao1";
            }
            if ( $info[6] == 0 )
            {
                $info[6] = "Ativado";
            }
            if ( $info[6] == 1 )
            {
                $info[6] = "Finalizado";
            }
            if ( $info[6] == 2 )
            {
                $info[6] = "Desativado";
            }
            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('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onmouseover=\"Tip('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[2];
            echo "</a></td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[6];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=leilao&action=alterar&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 )
    {
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->query( "SELECT Titulo, Premio, Imagem, LanceIncial, Termino, Status FROM SITE_LEILAO WHERE Numero='".$id."'" );
        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 Leil&atilde;o</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                    ";
        while ( $info = $sql->row( ) )
        {
            if ( $info[5] == 0 )
            {
                $stats[0] = " selected=\"selected\"";
            }
            if ( $info[5] == 1 )
            {
                $stats[1] = " selected=\"selected\"";
            }
            if ( $info[6] == 2 )
            {
                $stats[2] = " selected=\"selected\"";
            }
            echo "                    <form name=\"form1\" id=\"form1\" action=\"?page=leilao&action=alterar&go=1\" method=\"post\">\r\n                    <input type=\"hidden\" id=\"leilaoid\" name=\"leilaoid\" value=\"";
            echo $id;
            echo "\">\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"leilao\">T&iacute;tulo:</td>\r\n                \t\t\t<td align=\"left\"><input type=\"text\" name=\"titulo\" id=\"titulo\" maxlength=\"100\" style=\"width: 250px;\" value=\"";
            echo $info[0];
            echo "\"></td>\r\n                            <td align=\"left\" valign=\"top\" colspan=\"2\" rowspan=\"5\">\r\n                            \t<input type=\"hidden\" id=\"foto\" name=\"foto\" value=\"";
            echo $info[2];
            echo "\">\r\n                            \t<input type=\"hidden\" id=\"mini\" name=\"mini\" value=\"";
            echo $info[2];
            echo "\">\r\n                            \t<input type=\"hidden\" id=\"i_foto\" name=\"i_foto\" value=\"";
            echo $info[2];
            echo "\">\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\t\tspecbut2On = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On.src = \"images/en/buttons/procuraro.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off.src = \"images/en/buttons/procurar.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                                        <a href=\"javascript:;\" onClick=\"BuscaImagem();\" onMouseOver='ShowHide(\"specbut2\",\"specbut2On\");' onMouseOut='ShowHide(\"specbut2\",\"specbut2Off\")'><img src=\"images/en/buttons/procurar.gif\" Array border=\"0\" name=\"specbut2\"></a><br />\r\n                                     <span id=\"produto\" style=\"height: 182px; text-align:center;\"><img src=\"";
            echo $info[2];
            echo "\" /></span>\r\n                            </td>\r\n                \t\t</tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Pr&ecirc;mio:</td>\r\n                \t\t\t<td align=\"left\"><input type=\"text\" name=\"premio\" id=\"premio\" maxlength=\"100\" style=\"width: 250px;\" value=\"";
            echo $info[1];
            echo "\"></td>\r\n                \t\t</tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Lance Inicial:</td>\r\n                    \t\t<td align=\"left\"><input type=\"text\" name=\"lanceinicial\" id=\"lanceinicial\" maxlength=\"4\" style=\"width: 250px;\" value=\"";
            echo $info[3];
            echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Termino Leil&atilde;o:</td>\r\n                    \t\t<td align=\"left\"><input type=\"text\" name=\"termino\" id=\"termino\" maxlength=\"20\" style=\"width: 250px;\" value=\"";
            echo $info[4];
            echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Status Leil&atilde;o:</td>\r\n                    \t\t<td align=\"left\">\r\n                            \t<select name=\"status\" id=\"status\" class=\"leilao\" style=\"width: 250px;\">\r\n                                \t<option value=\"0\"";
            echo $stats[0];
            echo ">Ativado</option>\r\n                                    <option value=\"1\"";
            echo $stats[1];
            echo ">Finalizado</option>\r\n                                    <option value=\"2\"";
            echo $stats[2];
            echo ">Desativado</option>\r\n                                </select>\r\n                            </td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"4\">\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/altleilaoo.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/altleilao.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/altleilao.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n                            </td>\r\n                       </tr>\r\n\t\t\t\t\t\t</table>\r\n                        ";
        }
        echo "                    </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 )
    {
        $id = $_POST['leilaoid'];
        $titulo = $_POST['titulo'];
        $premio = $_POST['premio'];
        $imagem = $_POST['foto'];
        $lanceinicial = $_POST['lanceinicial'];
        $termino = $_POST['termino'];
        $status = $_POST['status'];
        $check->checacampobranco( $titulo, "Titulo" );
        $check->checacampobranco( $premio, "Premio" );
        $check->checacampobranco( $imagem, "Imagem" );
        $check->checacampobranco( $termino, "Termino" );
        $check->checanumeropositivo( $lanceincial, "Lance Incial" );
        $check->checanumeropositivo( $status, "Status" );
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->executaalterarleilao( $id, $titulo, $premio, $imagem, $lanceinicial, $termino, $status );
    }
}
if ( $action == "remover" )
{
    $sql->query( "SELECT Numero, Titulo, Premio, Imagem, LanceIncial, Lances, Status FROM SITE_LEILAO" );
    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\">Remover Leil&atilde;o</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\">Leil&atilde;o</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"leilaotitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Titulo</td>\r\n\t\t\t\t\t\t\t<td>Premio</td>\r\n\t\t\t\t\t\t\t<td>Lance Inicial</td>\r\n\t\t\t\t\t\t\t<td>Lances</td>\r\n\t\t\t\t\t\t\t<td>Status</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 = "leilao2";
            }
            else
            {
                $estilo = "leilao1";
            }
            if ( $info[6] == 0 )
            {
                $info[6] = "Ativado";
            }
            if ( $info[6] == 1 )
            {
                $info[6] = "Finalizado";
            }
            if ( $info[6] == 2 )
            {
                $info[6] = "Desativado";
            }
            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('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onmouseover=\"Tip('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[2];
            echo "</a></td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[6];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:RemoverLeilao('";
            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";
    }
    if ( $id == true )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->executaremoverleilao( $id );
    }
}
if ( $action == "informacoes" )
{
    $sql->query( "SELECT Numero, Titulo, Premio, Imagem, LanceIncial, Lances, Status FROM SITE_LEILAO ORDER BY Numero ASC" );
    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 Leil&atilde;o</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\">Leil&atilde;o</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"leilaotitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Titulo</td>\r\n\t\t\t\t\t\t\t<td>Premio</td>\r\n\t\t\t\t\t\t\t<td>Lance Inicial</td>\r\n\t\t\t\t\t\t\t<td>Lances</td>\r\n\t\t\t\t\t\t\t<td>Status</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 = "leilao2";
            }
            else
            {
                $estilo = "leilao1";
            }
            if ( $info[6] == 0 )
            {
                $info[6] = "Ativado";
            }
            if ( $info[6] == 1 )
            {
                $info[6] = "Finalizado";
            }
            if ( $info[6] == 2 )
            {
                $info[6] = "Desativado";
            }
            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('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onmouseover=\"Tip('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[2];
            echo "</a></td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[6];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location = 'index.php?page=leilao&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>";
    }
    if ( $id == true )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->query( "SELECT Titulo, Premio, Imagem, LanceIncial, Termino, Status FROM SITE_LEILAO WHERE Numero='".$id."'" );
        while ( $info = $sql->row( ) )
        {
            if ( $info[5] == 0 )
            {
                $info[5] = "Ativado";
            }
            if ( $info[5] == 1 )
            {
                $info[5] = "Finalizado";
            }
            if ( $info[5] == 2 )
            {
                $info[5] = "Desativado";
            }
            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 Leil&atilde;o</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 Leil&atilde;o</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infoleilao\" align=\"right\" width=\"35%\"><b>#ID:</b></td>\r\n                                <td class=\"infoleilao\">";
            echo $id;
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infoleilao2\" align=\"right\"><b>Titulo:</b></td>\r\n                                <td class=\"infoleilao2\">";
            echo $info[0];
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infoleilao\" align=\"right\"><b>Premio:</b></td>\r\n                                <td class=\"infoleilao\">";
            echo $info[1];
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infoleilao2\" align=\"right\"><b>Lance Incial:</b></td>\r\n                                <td class=\"infoleilao2\">";
            echo $info[3];
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infoleilao\" align=\"right\" width=\"35%\"><b>Termino:</b></td>\r\n                                <td class=\"infoleilao\">";
            echo $info[4];
            echo "</td>\r\n                            </tr>   \r\n                            <tr>\r\n                                <td class=\"infoleilao2\" align=\"right\"><b>Status:</b></td>\r\n                                <td class=\"infoleilao2\">";
            echo $info[5];
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infoleilao\" align=\"right\" width=\"35%\"><b>Imagem:</b></td>\r\n                                <td class=\"infoleilao\"><a href=\"javascript:;\" onmouseover=\"Tip('<img src=\\'";
            echo $info[2];
            echo "\\'')\">Clique aqui para visualizar</a></td>\r\n                            </tr>\r\n                            ";
            $sql->query( "SELECT Numero, Login, Lance, Data, Hora FROM SITE_LEILAOLANCE WHERE LeilaoID = '".$id."' AND Numero <> '0'" );
            if ( 1 <= $sql->rowcount( ) )
            {
                echo "                            <tr>\r\n                            \t<td colspan=\"2\" class=\"infoleilao2\">\r\n                                \t<table cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">\r\n                                    \t<tr>\r\n                                        \t<td colspan=\"4\" align=\"center\" class=\"infoleilao\">Lances</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                        \t<td align=\"center\">#ID</td>\r\n                                            <td align=\"center\">Login</td>\r\n                                            <td align=\"center\">Lance</td>\r\n                                            <td align=\"center\">Data</td>\r\n                                        </tr>\r\n                                        ";
                while ( $info = $sql->row( ) )
                {
                    ++$x;
                    if ( $x % 2 == 0 )
                    {
                        $estilo = "leilao2";
                    }
                    else
                    {
                        $estilo = "leilao1";
                    }
                    echo "                                            <tr>\r\n                                                <td class=\"";
                    echo $estilo;
                    echo "\" align=\"center\">";
                    echo $info[0];
                    echo "</td>\r\n                                                <td class=\"";
                    echo $estilo;
                    echo "\">";
                    echo $info[1];
                    echo "</td>\r\n                                                <td class=\"";
                    echo $estilo;
                    echo "\">";
                    echo $info[2];
                    echo "</td>\r\n                                                <td class=\"";
                    echo $estilo;
                    echo "\">";
                    echo $info[3];
                    echo " ";
                    echo $info[4];
                    echo "</td>\r\n                                            </tr>\r\n                                        ";
                }
                echo "                                    </table>\r\n                                </td>\r\n                            </tr>\r\n                            ";
            }
            echo "                            <tr>\r\n                            \t<td class=\"infoleilao\" align=\"center\" colspan=\"2\">\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\t\tspecbut1On = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut1On.src = \"images/en/buttons/altleilaoo.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut1Off = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut1Off.src = \"images/en/buttons/altleilao.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2On.src = \"images/en/buttons/remleilaoo.gif\";\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off = new Image();\r\n\t\t\t\t\t\t\t\t\t\tspecbut2Off.src = \"images/en/buttons/remleilao.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=\"javascript:location = 'index.php?page=leilao&action=alterar&id=";
            echo $id;
            echo "';\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/altleilao.gif\" Array border=\"0\" name=\"specbut1\"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n                                    <a href=\"#\" onClick=\"javascript:RemoverLeilao('";
            echo $info[0];
            echo "');\" onMouseOver='ShowHide(\"specbut2\",\"specbut2On\");' onMouseOut='ShowHide(\"specbut2\",\"specbut2Off\")'><img src=\"images/en/buttons/remleilao.gif\" Array border=\"0\" name=\"specbut1\"></a></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        ";
        }
    }
}
if ( $action == "finalizar" )
{
    $sql->query( "SELECT Numero, Titulo, Premio, Imagem, LanceIncial, Lances, Status FROM SITE_LEILAO WHERE Status<>'1'" );
    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\">Finalizar Leil&atilde;o</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\">Leil&atilde;o</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"leilaotitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Titulo</td>\r\n\t\t\t\t\t\t\t<td>Premio</td>\r\n\t\t\t\t\t\t\t<td>Lance Inicial</td>\r\n\t\t\t\t\t\t\t<td>Lances</td>\r\n\t\t\t\t\t\t\t<td>Status</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 = "leilao2";
            }
            else
            {
                $estilo = "leilao1";
            }
            if ( $info[6] == 0 )
            {
                $info[6] = "Ativado";
            }
            if ( $info[6] == 1 )
            {
                $info[6] = "Finalizado";
            }
            if ( $info[6] == 2 )
            {
                $info[6] = "Desativado";
            }
            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('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onmouseover=\"Tip('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[2];
            echo "</a></td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[6];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:FinalizarLeilao('";
            echo $info[0];
            echo "');\">Finalizar</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 )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->executafinalizarleilao( $id );
    }
}
if ( $action == "alterarlance" )
{
    $lanceid = $_GET['lanceid'];
    $sql->query( "SELECT Numero, Titulo, Premio, Imagem, LanceIncial, Lances, Status FROM SITE_LEILAO WHERE Lances > '0' ORDER BY Numero ASC" );
    if ( $id == false && $lanceid == 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 Lance</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\">Leil&atilde;o</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"leilaotitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Titulo</td>\r\n\t\t\t\t\t\t\t<td>Premio</td>\r\n\t\t\t\t\t\t\t<td>Lance Inicial</td>\r\n\t\t\t\t\t\t\t<td>Lances</td>\r\n\t\t\t\t\t\t\t<td>Status</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 = "leilao2";
            }
            else
            {
                $estilo = "leilao1";
            }
            if ( $info[6] == 0 )
            {
                $info[6] = "Ativado";
            }
            if ( $info[6] == 1 )
            {
                $info[6] = "Finalizado";
            }
            if ( $info[6] == 2 )
            {
                $info[6] = "Desativado";
            }
            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('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onmouseover=\"Tip('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[2];
            echo "</a></td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[6];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location = 'index.php?page=leilao&action=alterarlance&id=";
            echo $info[0];
            echo "';\">Ver lances</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 && $lanceid == false )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->verificalance( $id, 1 );
        $sql->query( "SELECT Numero, Login, Lance, Data, Hora FROM SITE_LEILAOLANCE WHERE LeilaoID = '".$id."' AND Numero <> '0' ORDER BY Numero ASC" );
        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 Lance</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\">Lances</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"leilaotitulo\">\r\n                            <td align=\"center\">#ID</td>\r\n                            <td align=\"center\">Login</td>\r\n                            <td align=\"center\">Lance</td>\r\n                            <td align=\"center\">Data</td>\r\n                            <td align=\"center\">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 = "leilao2";
            }
            else
            {
                $estilo = "leilao1";
            }
            echo "                            <tr>\r\n                                <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n                                <td class=\"";
            echo $estilo;
            echo "\">";
            echo $info[1];
            echo "</td>\r\n                                <td class=\"";
            echo $estilo;
            echo "\">";
            echo $info[2];
            echo "</td>\r\n                                <td class=\"";
            echo $estilo;
            echo "\">";
            echo $info[3];
            echo " ";
            echo $info[4];
            echo "</td>\r\n                                <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location = 'index.php?page=leilao&action=alterarlance&id=";
            echo $id;
            echo "&lanceid=";
            echo $info[0];
            echo "';\">Alterar lance</a></td>\r\n                            </tr>\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 && $lanceid == true && $go == false )
    {
        $id = $_GET['id'];
        $lanceid = $_GET['lanceid'];
        $check->checanumeropositivo( $id, "Id" );
        $check->checanumeropositivo( $lanceid, "Lance Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->verificaidlance( $id, $lanceid );
        $sql->query( "SELECT Login, Lance, Data, Hora FROM SITE_LEILAOLANCE WHERE LeilaoID = '".$id."' AND Numero = '".$lanceid."'" );
        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 Lance</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                    ";
        while ( $info = $sql->row( ) )
        {
            echo "                    <form name=\"form1\" id=\"form1\" action=\"?page=leilao&action=alterarlance&go=1\" method=\"post\">\r\n                    <input type=\"hidden\" id=\"leilaoid\" name=\"leilaoid\" value=\"";
            echo $id;
            echo "\">\r\n                    <input type=\"hidden\" id=\"lanceid\" name=\"lanceid\" value=\"";
            echo $lanceid;
            echo "\">\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                \t\t\t<td class=\"leilao\">Login:</td>\r\n                \t\t\t<td align=\"left\"><input type=\"text\" name=\"login\" id=\"login\" maxlength=\"10\" style=\"width: 250px;\" value=\"";
            echo $info[0];
            echo "\" disabled=\"disabled\"></td>\r\n                        </tr>\r\n                \t\t<tr>\r\n                \t\t\t<td class=\"leilao\">Lance:</td>\r\n                \t\t\t<td align=\"left\"><input type=\"text\" name=\"lance\" id=\"lance\" maxlength=\"5\" style=\"width: 250px;\" value=\"";
            echo $info[1];
            echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                        \t<td align=\"center\" class=\"shop\" valign=\"top\" colspan=\"4\">\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/altleilaoo.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/altleilao.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/altleilao.gif\" Array border=\"0\" name=\"specbut1\"></a>\r\n                            </td>\r\n                       </tr>\r\n\t\t\t\t\t\t</table>\r\n                        ";
        }
        echo "                    </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\t\r\n\t\t";
    }
    if ( $id == false && $lanceid == false && $go == true )
    {
        $lanceid = $_POST['leilaoid'];
        $lanceid = $_POST['lanceid'];
        $valor = $_POST['lance'];
        $check->checanumeropositivo( $lanceid, "Id" );
        $check->checanumeropositivo( $lanceid, "Lance Id" );
        $check->checanumeropositivo( $valor, "Valor Lance" );
        $sql->verificaidleilao( $lanceid, 1 );
        $sql->verificaidlance( $lanceid, $lanceid );
        $sql->executaralterarlance( $leilaoid, $lanceid, $valor );
    }
}
if ( $action == "removerlance" )
{
    $lanceid = $_GET['lanceid'];
    $sql->query( "SELECT Numero, Titulo, Premio, Imagem, LanceIncial, Lances, Status FROM SITE_LEILAO WHERE Lances > '0' ORDER BY Numero ASC" );
    if ( $id == false && $lanceid == 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 Lance</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\">Leil&atilde;o</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"leilaotitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Titulo</td>\r\n\t\t\t\t\t\t\t<td>Premio</td>\r\n\t\t\t\t\t\t\t<td>Lance Inicial</td>\r\n\t\t\t\t\t\t\t<td>Lances</td>\r\n\t\t\t\t\t\t\t<td>Status</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 = "leilao2";
            }
            else
            {
                $estilo = "leilao1";
            }
            if ( $info[6] == 0 )
            {
                $info[6] = "Ativado";
            }
            if ( $info[6] == 1 )
            {
                $info[6] = "Finalizado";
            }
            if ( $info[6] == 2 )
            {
                $info[6] = "Desativado";
            }
            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('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[1];
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onmouseover=\"Tip('<img src=\\'";
            echo $info[3];
            echo "\\'>')\" class=\"leilao\">";
            echo $info[2];
            echo "</a></td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[6];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location = 'index.php?page=leilao&action=removerlance&id=";
            echo $info[0];
            echo "';\">Ver lances</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 && $lanceid == false )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->verificalance( $id, 1 );
        $sql->query( "SELECT Numero, Login, Lance, Data, Hora FROM SITE_LEILAOLANCE WHERE LeilaoID = '".$id."' AND Numero <> '0' ORDER BY Numero ASC" );
        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 Lance</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\">Lances</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"leilaotitulo\">\r\n                            <td align=\"center\">#ID</td>\r\n                            <td align=\"center\">Login</td>\r\n                            <td align=\"center\">Lance</td>\r\n                            <td align=\"center\">Data</td>\r\n                            <td align=\"center\">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 = "leilao2";
            }
            else
            {
                $estilo = "leilao1";
            }
            echo "                            <tr>\r\n                                <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[0];
            echo "</td>\r\n                                <td class=\"";
            echo $estilo;
            echo "\">";
            echo $info[1];
            echo "</td>\r\n                                <td class=\"";
            echo $estilo;
            echo "\">";
            echo $info[2];
            echo "</td>\r\n                                <td class=\"";
            echo $estilo;
            echo "\">";
            echo $info[3];
            echo " ";
            echo $info[4];
            echo "</td> \r\n                                <!-- onClick=\"\"></a> -->\r\n                                <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:RemoverLance('";
            echo $id;
            echo "', '";
            echo $info[0];
            echo "');\">Remover lance</a></td>\r\n                            </tr>\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 && $lanceid == true )
    {
        $id = $_GET['id'];
        $lanceid = $_GET['lanceid'];
        $check->checanumeropositivo( $id, "Id" );
        $check->checanumeropositivo( $lanceid, "Lance Id" );
        $sql->verificaidleilao( $id, 1 );
        $sql->verificaidlance( $id, $lanceid );
        $sql->executarremoverlance( $id, $lanceid );
    }
}
?>
