educar_categoria_nivel_lst.php
5.19 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
/*
* i-Educar - Sistema de gestão escolar
*
* Copyright (C) 2006 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 posterior.
*
* Este programa é distribuído na expectativa de que seja útil, porém, SEM
* NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU
* ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral
* do GNU para mais detalhes.
*
* Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto
* com este programa; se não, escreva para a Free Software Foundation, Inc., no
* endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
*/
/**
* Listagem de níveis de categoria.
*
* @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>
* @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL
* @package Core
* @since Arquivo disponível desde a versão 1.0.0
* @version $Id$
*/
require_once 'include/clsBase.inc.php';
require_once 'include/clsListagem.inc.php';
require_once 'include/clsBanco.inc.php';
require_once 'include/pmieducar/geral.inc.php';
class clsIndexBase extends clsBase
{
public function Formular() {
$this->SetTitulo($this->_instituicao . 'Categorias ou níveis do servidor');
$this->processoAp = '829';
}
}
class indice extends clsListagem {
/**
* Referencia pega da session para o idpes do usuario atual
*
* @var int
*/
var $__pessoa_logada;
/**
* Titulo no topo da pagina
*
* @var int
*/
var $__titulo;
/**
* Quantidade de registros a ser apresentada em cada pagina
*
* @var int
*/
var $__limite;
/**
* Inicio dos registros a serem exibidos (limit)
*
* @var int
*/
var $__offset;
var $cod_categoria_nivel;
var $ref_usuario_exc;
var $ref_usuario_cad;
var $nm_categoria_nivel;
var $data_cadastro;
var $data_exclusao;
var $ativo;
public function Gerar() {
$this->__pessoa_logada = $this->pessoa_logada;
$this->__titulo = 'Categoria Nivel - Listagem';
// passa todos os valores obtidos no GET para atributos do objeto
foreach ($_GET as $var => $val) {
$this->$var = ($val === "") ? NULL : $val;
}
$this->addBanner('imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg', 'Intranet');
$this->addCabecalhos(array(
'Nome Categoria Nivel'
));
// Filtros
$this->campoTexto('nm_categoria_nivel', 'Nome Categoria Nivel',
$this->nm_categoria_nivel, 30, 255, FALSE);
// Paginador
$this->__limite = 20;
$this->__offset = ($_GET['pagina_' . $this->nome]) ?
$_GET['pagina_' . $this->nome] * $this->__limite-$this->__limite : 0;
$obj_categoria_nivel = new clsPmieducarCategoriaNivel();
$obj_categoria_nivel->setOrderby('nm_categoria_nivel ASC');
$obj_categoria_nivel->setLimite($this->__limite, $this->__offset);
$lista = $obj_categoria_nivel->lista(
NULL, NULL, $this->nm_categoria_nivel, NULL, NULL, NULL, NULL, NULL, 1
);
$total = $obj_categoria_nivel->_total;
// Monta a lista
if (is_array($lista) && count($lista)) {
foreach ($lista as $registro) {
// muda os campos data
$registro['data_cadastro_time'] = strtotime( substr( $registro['data_cadastro'], 0, 16));
$registro['data_cadastro_br'] = date('d/m/Y H:i', $registro['data_cadastro_time']);
$registro['data_exclusao_time'] = strtotime(substr( $registro['data_exclusao'], 0, 16));
$registro['data_exclusao_br'] = date('d/m/Y H:i', $registro['data_exclusao_time']);
$obj_ref_usuario_cad = new clsPmieducarUsuario($registro['ref_usuario_cad']);
$det_ref_usuario_cad = $obj_ref_usuario_cad->detalhe();
$registro['ref_usuario_cad'] = $det_ref_usuario_cad['data_cadastro'];
$obj_ref_usuario_exc = new clsPmieducarUsuario( $registro['ref_usuario_exc']);
$det_ref_usuario_exc = $obj_ref_usuario_exc->detalhe();
$registro['ref_usuario_exc'] = $det_ref_usuario_exc['data_cadastro'];
$this->addLinhas(array(
sprintf('<a href="educar_categoria_nivel_det.php?cod_categoria_nivel=%s">%s</a>',
$registro['cod_categoria_nivel'], $registro['nm_categoria_nivel'])
));
}
}
$this->addPaginador2('educar_categoria_nivel_lst.php', $total, $_GET,
$this->nome, $this->__limite);
$obj_permissoes = new clsPermissoes();
if ($obj_permissoes->permissao_cadastra(829, $this->__pessoa_logada, 3,
NULL, TRUE)) {
$this->acao = 'go("educar_categoria_nivel_cad.php")';
$this->nome_acao = 'Novo';
}
$this->largura = '100%';
$this->breadcrumb('Categorias ou níveis do servidor', [
url('intranet/educar_servidores_index.php') => 'Servidores',
]);
}
}
// Instancia a classe da página
$pagina = new clsIndexBase();
// Instancia o conteúdo
$miolo = new indice();
// Passa o conteúdo para a classe da página
$pagina->addForm( $miolo );
// Imprime o HTML
$pagina->MakeAll();