<?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 "<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 Download</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                    <form name=\"form1\" id=\"form1\" action=\"?page=downloads&action=adicionar&go=1\" method=\"post\">\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td class=\"down\">Descri&ccedil;&atilde;o:</td>\r\n                          <td><input type=\"text\" name=\"descricao\" id=\"descricao\" maxlength=\"500\" style=\"width: 300px\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                          <td class=\"down\">Link:</td>\r\n                          <td><input type=\"text\" name=\"link\" id=\"link\" maxlength=\"500\" style=\"width: 300px\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                          <td class=\"down\">Tamanho:</td>\r\n                          <td><input type=\"text\" name=\"tamanho\" id=\"tamanho\" maxlength=\"10\" style=\"width: 300px\"></td>\r\n                        </tr>\r\n              \t\t\t<tr>\r\n                \t\t\t<td colspan=\"2\" align=\"center\">\r\n\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/adddowno.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/adddown.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<a href=\"#\" onClick=\"document.form1.submit(); return false;\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/adddown.gif\" Array border=\"0\" name=\"specbut1\"></a></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 )
    {
        $descricao = $_POST['descricao'];
        $link = $_POST['link'];
        $tamanho = $_POST['tamanho'];
        $check->checacampobranco( $descricao, "Descricao" );
        $check->checacampobranco( $link, "Link" );
        $check->checacampobranco( $tamanho, "Tamanho" );
        $sql->executaadicionardownload( $descricao, $link, $tamanho, "Autor" );
    }
}
if ( $action == "alterar" )
{
    $sql->query( "SELECT Id, Descricao, Link, Tamanho, Downloads, Autor FROM SITE_DOWNLOAD" );
    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 Downloads</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\">Downloads</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"downtitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Descricao</td>\r\n\t\t\t\t\t\t\t<td>Link</td>\r\n\t\t\t\t\t\t\t<td>Tamanho</td>\r\n                            <td>Downloads</td>\r\n\t\t\t\t\t\t\t<td>Autor</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 = "down2";
            }
            else
            {
                $estilo = "down1";
            }
            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[1];
            echo "')\" class=\"down\">";
            if ( strlen( 20 < $info[1] ) )
            {
                echo substr( $info[1], 0, 20 )."(...)";
            }
            else
            {
                echo substr( $info[1], 0, 20 );
            }
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"";
            echo $info[2];
            echo "\" target=\"_blank\">Visualizar Link</a></td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n\t\t\t\t\t\t\t<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\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=downloads&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->verificaiddownload( $id, 1 );
        $sql->query( "SELECT Descricao, Link, Tamanho, Downloads, Autor FROM SITE_DOWNLOAD WHERE Id='".$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 Download</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=downloads&action=alterar&go=1\" method=\"post\">\r\n                    \t<input type=\"hidden\" name=\"id\" id=\"id\" value=\"";
            echo $id;
            echo "\">\r\n                \t\t<table width=\"100%\" cellpadding=\"5\">\r\n                        <tr>\r\n                          <td class=\"down\">Descri&ccedil;&atilde;o:</td>\r\n                          <td><input type=\"text\" name=\"descricao\" id=\"descricao\" maxlength=\"500\" style=\"width: 300px\" value=\"";
            echo $info[0];
            echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                          <td class=\"down\">Link:</td>\r\n                          <td><input type=\"text\" name=\"link\" id=\"link\" maxlength=\"500\" style=\"width: 300px\" value=\"";
            echo $info[1];
            echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                          <td class=\"down\">Tamanho:</td>\r\n                          <td><input type=\"text\" name=\"tamanho\" id=\"tamanho\" maxlength=\"10\" style=\"width: 300px\" value=\"";
            echo $info[2];
            echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                          <td class=\"down\">Downloads:</td>\r\n                          <td><input type=\"text\" name=\"download\" id=\"download\" maxlength=\"10\" style=\"width: 300px\" value=\"";
            echo $info[3];
            echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n                          <td class=\"down\">Autor:</td>\r\n                          <td><input type=\"text\" name=\"autor\" id=\"autor\" maxlength=\"20\" style=\"width: 300px\" value=\"";
            echo $info[4];
            echo "\"></td>\r\n                        </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/altdowno.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/altdown.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/adddown.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                        ";
        }
        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['id'];
        $descricao = $_POST['descricao'];
        $link = $_POST['link'];
        $tamanho = $_POST['tamanho'];
        $download = $_POST['download'];
        $autor = $_POST['autor'];
        $check->checacampobranco( $descricao, "Descricao" );
        $check->checacampobranco( $link, "Link" );
        $check->checacampobranco( $tamanho, "Tamanho" );
        $check->checacampobranco( $autor, "Autor" );
        $check->checanumeropositivo( $id, "Id" );
        $check->checanumeropositivo( $download, "Download" );
        $sql->verificaiddownload( $id, 1 );
        $sql->executaalterardownload( $id, $descricao, $link, $tamanho, $download, $autor );
    }
}
if ( $action == "remover" )
{
    $sql->query( "SELECT Id, Descricao, Link, Tamanho, Downloads, Autor FROM SITE_DOWNLOAD" );
    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 Downloads</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\">Downloads</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"downtitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Descricao</td>\r\n\t\t\t\t\t\t\t<td>Link</td>\r\n\t\t\t\t\t\t\t<td>Tamanho</td>\r\n                            <td>Downloads</td>\r\n\t\t\t\t\t\t\t<td>Autor</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 = "down2";
            }
            else
            {
                $estilo = "down1";
            }
            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[1];
            echo "')\" class=\"down\">";
            if ( strlen( 20 < $info[1] ) )
            {
                echo substr( $info[1], 0, 20 )."(...)";
            }
            else
            {
                echo substr( $info[1], 0, 20 );
            }
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"";
            echo $info[2];
            echo "\" target=\"_blank\">Visualizar Link</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n\t\t\t\t\t\t\t<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\"><a href=\"javascript:;\" onClick=\"javascript:RemoverDownload('";
            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->verificaiddownload( $id, 1 );
        $sql->executaremoverdownload( $id );
    }
}
if ( $action == "informacoes" )
{
    $sql->query( "SELECT Id, Descricao, Link, Tamanho, Downloads, Autor FROM SITE_DOWNLOAD" );
    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\">Informa&ccedil;&otilde;es Downloads</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\">Downloads</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"downtitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Descricao</td>\r\n\t\t\t\t\t\t\t<td>Link</td>\r\n\t\t\t\t\t\t\t<td>Tamanho</td>\r\n                            <td>Downloads</td>\r\n\t\t\t\t\t\t\t<td>Autor</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 = "down2";
            }
            else
            {
                $estilo = "down1";
            }
            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[1];
            echo "')\" class=\"down\">";
            if ( strlen( 20 < $info[1] ) )
            {
                echo substr( $info[1], 0, 20 )."(...)";
            }
            else
            {
                echo substr( $info[1], 0, 20 );
            }
            echo "</a></td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"";
            echo $info[2];
            echo "\" target=\"_blank\">Visualizar Link</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n\t\t\t\t\t\t\t<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\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=downloads&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";
    }
    if ( $id == true )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaiddownload( $id, 1 );
        $sql->query( "SELECT Descricao, Link, Tamanho, Downloads, Autor FROM SITE_DOWNLOAD 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 Downloads</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 do Download</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\" width=\"35%\"><b>#ID:</b></td>\r\n                                <td class=\"infodown\">";
        echo $id;
        echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\"><b>Descri&ccedil;&atilde;o:</b></td>\r\n                                <td class=\"infodown2\">";
        echo $info[0];
        echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\" width=\"35%\"><b>Link:</b></td>\r\n                                <td class=\"infodown\"><a href=\"";
        echo $info[1];
        echo "\" target=\"_blank\">";
        echo $info[1];
        echo "</a></td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\" width=\"35%\"><b>Tamanho:</b></td>\r\n                                <td class=\"infodown2\">";
        echo $info[2];
        echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown\" align=\"right\"><b>Downloads:</b></td>\r\n                                <td class=\"infodown\">";
        echo $info[3];
        echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\" width=\"35%\"><b>Criado por:</b></td>\r\n                                <td class=\"infodown2\">";
        echo $info[4];
        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\t\t";
    }
}
?>
