noticias_det.php
4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* @author Prefeitura Municipal de Itajaí *
* @updated 29/03/2007 *
* Pacote: i-PLB Software Público Livre e Brasileiro *
* *
* Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí *
* ctima@itajai.sc.gov.br *
* *
* Este programa é software livre, você pode redistribuí-lo e/ou *
* modificá-lo sob os termos da Licença Pública Geral GNU, conforme *
* publicada pela Free Software Foundation, tanto a versão 2 da *
* Licença como (a seu critério) qualquer versão mais nova. *
* *
* Este programa é distribuído na expectativa de ser útil, mas SEM *
* QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- *
* ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- *
* sulte a Licença Pública Geral GNU para obter mais detalhes. *
* *
* Você deve ter recebido uma cópia da Licença Pública Geral GNU *
* junto com este programa. Se não, escreva para a Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *
* 02111-1307, USA. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
$desvio_diretorio = "";
require_once ("include/clsBase.inc.php");
require_once ("include/clsDetalhe.inc.php");
require_once ("include/clsBanco.inc.php");
class clsIndex extends clsBase
{
function Formular()
{
$this->SetTitulo( "{$this->_instituicao} Notícias" );
$this->processoAp = "26";
}
}
class indice extends clsDetalhe
{
function Gerar()
{
$this->titulo = "Detalhe de notícias";
$id_noticia = @$_GET['id_noticia'];
$db = new clsBanco();
$db->Consulta( "SELECT n.titulo, n.data_noticia, n.descricao, n.ref_ref_cod_pessoa_fj FROM not_portal n WHERE cod_not_portal={$id_noticia}" );
if ($db->ProximoRegistro())
{
list ($titulo, $data, $descricao, $cod_responsavel) = $db->Tupla();
$objPessoa = new clsPessoaFj();
list($responsavel) = $objPessoa->queryRapida($cod_responsavel,"nome");
$data = explode(".",$data);
$data= date("d/m/Y", strtotime(substr($data[0],0,19) ));
$this->addDetalhe( array("Responsável", $responsavel) );
$this->addDetalhe( array("Data", $data) );
$this->addDetalhe( array("Título", $titulo) );
$descricao = str_replace("\n\r", "<br>", $descricao);
$descricao = str_replace("\n", "<br>", $descricao);
$this->addDetalhe( array("Descrição", $descricao) );
$db->Consulta( "SELECT tipo,cod_vinc,caminho,nome_arquivo FROM not_vinc_portal n WHERE ref_cod_not_portal={$id_noticia}" );
while($db->ProximoRegistro())
{
list($tipo,$cod,$caminho,$nome_arquivo) = $db->Tupla();
if($tipo =="F")
{
$dba = new clsBanco();
$dba->Consulta( "SELECT titulo, caminho, altura, largura FROM foto_portal WHERE cod_foto_portal={$cod}" );
$dba->ProximoRegistro();
list ($titulo,$caminho,$altura,$largura) = $dba->Tupla();
$this->addDetalhe( array("Fotos Vinculadas", "<a href='#' onclick='javascript:openfoto(\"$titulo\",\"$caminho\",$altura,$largura)'><img src='fotos/small/{$caminho}' border='0'></a>") );
}
if($tipo =="N")
{
$dba = new clsBanco();
$dba->Consulta( "SELECT titulo FROM not_portal WHERE cod_not_portal={$cod}" );
$dba->ProximoRegistro();
list ($titulo) = $dba->Tupla();
$this->addDetalhe( array("Noticias Vinculadas", "<img src='imagens/noticia.jpg' border=0> <a href='noticias_det.php?id_noticia=$cod'><strong>$titulo</strong></a>") );
$dba->Consulta( "SELECT v.cod_vinc, n.titulo FROM not_vinc_portal v, not_portal n WHERE v.ref_cod_not_portal={$cod} AND v.tipo='N' AND v.cod_vinc = n.cod_not_portal " );
while($dba->ProximoRegistro())
{
list($cod, $titulo) = $dba->Tupla();
$this->addDetalhe( array("Noticias Vinculadas", " <img src='imagens/noticia.jpg' border=0> <a href='noticias_det.php?id_noticia=$cod'><strong>$titulo</strong></a>") );
}
}
if($tipo =="A")
{
$this->addDetalhe( array("Arquivos Vinculados", "<strong>$nome_arquivo</strong> <a href='$caminho'><img width='20' height='20' src='imagens/noticia.jpg' border=0></a>") );
}
}
}
$this->url_novo = "noticias_cad.php";
$this->url_editar = "noticias_cad.php?id_noticia=$id_noticia";
$this->url_cancelar = "noticias_lst.php";
$this->largura = "100%";
}
}
$pagina = new clsIndex();
$miolo = new indice();
$pagina->addForm( $miolo );
$pagina->MakeAll();
?>