<?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 Not&iacute;cia</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                    <td colspan=\"3\" align=\"center\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    <table width=\"100%\" border=\"0\" hspace=\"0\" vspace=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                    <form name=\"form1\" action=\"?page=noticia&action=adicionar&go=1\" method=\"post\">\r\n                        <tr>\r\n\t\t\t\t\t\t\t<td class=\"noticia\" width=\"15%\">T&iacute;tulo:</td>\r\n                            <td class=\"noticia3\"><select name=\"tipo\" id=\"tipo\" style=\"width: 100px;\" class=\"noticia\">\r\n                                \t<option value=\"Noticia\">Not&iacute;cia</option>\r\n                                    <option value=\"Evento\">Evento</option>\r\n                                    <option value=\"Atualizacao\">Atualizacao</option>\r\n                                    <option value=\"Aviso\">Aviso</option>\r\n                                </select> <input type=\"text\" name=\"titulo\" id=\"titulo\" maxlength=\"100\" style=\"width: 350px;\"></td>\r\n                        </tr>\r\n                    \t<tr>\r\n                        \t<td colspan=\"2\">\r\n                    \t";
        include( "modules/fckeditor/fckeditor.php" );
        echo "\t\t\t\t\t\t\r\n";
        $sBasePath = "/fckeditor/";
        $oFCKeditor = new fckeditor( "noticia" );
        $oFCKeditor->Height = "400";
        $oFCKeditor->Value = "This is some <strong>sample text</strong>. You are using <a href=\"http://www.fckeditor.net/\">FCKeditor</a>.";
        $oFCKeditor->create( );
        echo "                       \t\t\t</td>\r\n                        \t</tr>\r\n                            <tr>\r\n                            \t<td align=\"center\" colspan=\"2\"><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/addnoticiao.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/addnoticia.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/addnoticia.gif\" Array border=\"0\" name=\"specbut1\"></a></td>\r\n                            </tr>\r\n                        </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 )
    {
        $noticia = $_POST['noticia'];
        $tipo = $_POST['tipo'];
        $titulo = $_POST['titulo'];
        $check->checacampobranco( $noticia, "Noticia" );
        $check->checacampobranco( $tipo, "Tipo" );
        $check->checacampobranco( $titulo, "Titulo" );
        $sql->executaadicionarnoticia( $noticia, $titulo, $tipo, "Autor" );
    }
}
if ( $action == "alterar" )
{
    if ( $go == false && $id == false )
    {
        echo "<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Alterar Not&iacute;cia</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\">Not&iacute;cia</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"shoptitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Tituto</td>\r\n\t\t\t\t\t\t\t<td>Tipo</td>\r\n\t\t\t\t\t\t\t<td>Autor</td>\r\n                            <td>Data</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";
        $sql->query( "SELECT Numero, Titulo, Tipo, Autor, Data, Hora FROM SITE_NOTICIA" );
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "noticia2";
            }
            else
            {
                $estilo = "noticia1";
            }
            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 "\" align=\"center\">";
            echo $info[1];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo " ";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=novidades&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 ( $go == false && $id == true )
    {
        $id = $_GET['id'];
        $check->checanumeropositivo( $id, "Id" );
        $sql->verificaidnoticia( $id, 1 );
        echo "        \t<table width=\"100%\"><tr><td>\r\n        \t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">\r\n            \t<tr>\r\n                \t<td width=\"1\"><img src=\"images/bdy05.gif\" width=\"1\" height=\"23\"></td>\r\n                \t<td width=\"22\" background=\"images/bdy06.gif\" align=\"center\"><nobr>&nbsp;<img src=\"images/bullet090.gif\">&nbsp;</nobr></td>\r\n                \t<td width=\"95%\" background=\"images/bdy06.gif\" class=\"nrm02\" align=\"left\">&nbsp;<b><font color=\"#2283BF\">Alterar Not&iacute;cia</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                    <td colspan=\"3\" align=\"center\"><!--<img src=\"images/spacer.gif\" width=\"100\" height=\"5\">-->\r\n                    <table width=\"100%\" border=\"0\" hspace=\"0\" vspace=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n                    ";
        $sql->query( "SELECT Titulo, Tipo, Conteudo, Autor, Data, Hora FROM SITE_NOTICIA WHERE Numero='".$id."'" );
        while ( $info = $sql->row( ) )
        {
            if ( $info[1] == "Noticia" )
            {
                $opcao[1] = " selected=\"selected\"";
            }
            if ( $info[1] == "Evento" )
            {
                $opcao[2] = " selected=\"selected\"";
            }
            if ( $info[1] == "Atualizacao" )
            {
                $opcao[3] = " selected=\"selected\"";
            }
            if ( $info[1] == "Aviso" )
            {
                $opcao[4] = " selected=\"selected\"";
            }
            echo "                    <form name=\"form1\" action=\"?page=noticia&action=alterar&go=1\" method=\"post\">\r\n                    <input type=\"hidden\" name=\"id\" id=\"id\" value=\"";
            echo $id;
            echo "\" />\r\n                        <tr>\r\n\t\t\t\t\t\t\t<td class=\"noticia\" width=\"15%\">T&iacute;tulo:</td>\r\n                            <td class=\"noticia3\"><select name=\"tipo\" id=\"tipo\" style=\"width: 100px;\" class=\"noticia\">\r\n                                \t<option value=\"Noticia\"";
            echo $opcao[1];
            echo ">Not&iacute;cia</option>\r\n                                    <option value=\"Evento\"";
            echo $opcao[2];
            echo ">Evento</option>\r\n                                    <option value=\"Atualizacao\"";
            echo $opcao[3];
            echo ">Atualizacao</option>\r\n                                    <option value=\"Aviso\"";
            echo $opcao[4];
            echo ">Aviso</option>\r\n                                </select> <input type=\"text\" name=\"titulo\" id=\"titulo\" maxlength=\"100\" style=\"width: 350px;\" value=\"";
            echo $info[0];
            echo "\"></td>\r\n                        </tr>\r\n                        <tr>\r\n\t\t\t\t\t\t\t<td class=\"noticia\" width=\"15%\">Autor:</td>\r\n                            <td class=\"noticia3\"><input type=\"text\" name=\"autor\" id=\"autor\" maxlength=\"20\" style=\"width: 250px;\" value=\"";
            echo $info[3];
            echo "\"> Data: <input type=\"text\" name=\"data\" id=\"data\" maxlength=\"10\" style=\"width: 70px;\" value=\"";
            echo $info[4];
            echo "\"> Hora: <input type=\"text\" name=\"hora\" id=\"hora\" maxlength=\"8\" style=\"width: 70px;\" value=\"";
            echo $info[5];
            echo "\"></td>\r\n                        </tr>\r\n                    \t<tr>\r\n                        \t<td colspan=\"2\">\r\n                    \t";
            include( "modules/fckeditor/fckeditor.php" );
            echo "\t\t\t\t\t\t\r\n";
            $sBasePath = "/fckeditor/";
            $oFCKeditor = new fckeditor( "noticia" );
            $oFCKeditor->Height = "400";
            $oFCKeditor->Value = $sql->descodificatexto( $info[2] );
            $oFCKeditor->create( );
            echo "                       \t\t\t</td>\r\n                        \t</tr>\r\n                            <tr>\r\n                            \t<td align=\"center\" colspan=\"2\"><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/altnoticiao.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/altnoticia.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/altnoticia.gif\" Array border=\"0\" name=\"specbut1\"></a></td>\r\n                            </tr>\r\n                        </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 ( $go == true && $id == false )
    {
        $id = $_POST['id'];
        $noticia = $_POST['noticia'];
        $tipo = $_POST['tipo'];
        $titulo = $_POST['titulo'];
        $autor = $_POST['autor'];
        $data = $_POST['data'];
        $hora = $_POST['hora'];
        $check->checacampobranco( $noticia, "Noticia" );
        $check->checacampobranco( $tipo, "Tipo" );
        $check->checacampobranco( $titulo, "Titulo" );
        $check->checacampobranco( $autor, "Autor" );
        $check->checacampobranco( $data, "Data" );
        $check->checacampobranco( $hora, "Hora" );
        $check->checanumeropositivo( $id, "ID" );
        $sql->verificaidnoticia( $id, 1 );
        $sql->executaalterarnoticia( $id, $titulo, $tipo, $noticia, $autor, $data, $hora );
    }
}
if ( $action == "remover" )
{
    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 Not&iacute;cia</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\">Not&iacute;cia</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"shoptitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Tituto</td>\r\n\t\t\t\t\t\t\t<td>Tipo</td>\r\n\t\t\t\t\t\t\t<td>Autor</td>\r\n                            <td>Data</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";
        $sql->query( "SELECT Numero, Titulo, Tipo, Autor, Data, Hora FROM SITE_NOTICIA" );
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "noticia2";
            }
            else
            {
                $estilo = "noticia1";
            }
            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 "\" align=\"center\">";
            echo $info[1];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo " ";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:RemoverNoticia('";
            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->verificaidnoticia( $id, 1 );
        $sql->executaremovernoticia( $id );
    }
}
if ( $action == "informacoes" )
{
    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 Not&iacute;cia</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\">Not&iacute;cia</td>\r\n                        </tr>\r\n\t\t\t\t\t\t<tr class=\"shoptitulo\">\r\n\t\t\t\t\t\t\t<td>#ID</td>\r\n\t\t\t\t\t\t\t<td>Tituto</td>\r\n\t\t\t\t\t\t\t<td>Tipo</td>\r\n\t\t\t\t\t\t\t<td>Autor</td>\r\n                            <td>Data</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";
        $sql->query( "SELECT Numero, Titulo, Tipo, Autor, Data, Hora FROM SITE_NOTICIA" );
        while ( $info = $sql->row( ) )
        {
            ++$x;
            if ( $x % 2 == 0 )
            {
                $estilo = "noticia2";
            }
            else
            {
                $estilo = "noticia1";
            }
            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 "\" align=\"center\">";
            echo $info[1];
            echo "</td>\r\n\t\t\t\t\t\t\t<td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[2];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[3];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\">";
            echo $info[4];
            echo " ";
            echo $info[5];
            echo "</td>\r\n                            <td class=\"";
            echo $estilo;
            echo "\" align=\"center\"><a href=\"javascript:;\" onClick=\"javascript:location='?page=novidades&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->verificaidnoticia( $id, 1 );
        $sql->query( "SELECT Titulo, Tipo, Autor, Data, Hora, Conteudo FROM SITE_NOTICIA WHERE Numero='".$id."'" );
        while ( $info = $sql->row( ) )
        {
            echo "\t\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\">Informa&ccedil;&otilde;es Not&iacute;cia</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 Not&iacute;cia</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>Titulo:</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>Tipo:</b></td>\r\n                                <td class=\"infodown\">";
            echo $info[1];
            echo "</a></td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"right\" width=\"35%\"><b>Postada por:</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>Postada em:</b></td>\r\n                                <td class=\"infodown\">";
            echo $info[3]." ".$info[4];
            echo "</td>\r\n                            </tr>\r\n                            <tr>\r\n                                <td class=\"infodown2\" align=\"center\" colspan=\"2\"><b>Not&iacute;cia:</b></td>\r\n                            </tr>\r\n                           \t<tr>\r\n                            \t<td class=\"infodown\" align=\"center\" colspan=\"2\">";
            echo $sql->descodificatexto( $info[5] );
            echo "</td>\r\n                            <tr>\r\n                            \t<td class=\"infodown2\" 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/altnoticiao.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/altnoticia.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/remnoticiao.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/remnoticia.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=novidades&action=alterar&id=";
            echo $id;
            echo "';\" onMouseOver='ShowHide(\"specbut1\",\"specbut1On\");' onMouseOut='ShowHide(\"specbut1\",\"specbut1Off\")'><img src=\"images/en/buttons/altnoticia.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:RemoverNoticia('";
            echo $info[0];
            echo "');\" onMouseOver='ShowHide(\"specbut2\",\"specbut2On\");' onMouseOut='ShowHide(\"specbut2\",\"specbut2Off\")'><img src=\"images/en/buttons/remnoticia.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";
        }
    }
}
?>
