public_uf_lst.php
2.95 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
<?php
require_once 'include/clsBase.inc.php';
require_once 'include/clsListagem.inc.php';
require_once 'include/clsBanco.inc.php';
require_once 'include/public/geral.inc.php';
class clsIndexBase extends clsBase
{
public function Formular()
{
$this->SetTitulo("{$this->_instituicao} Uf");
$this->processoAp = 754;
}
}
class indice extends clsListagem
{
public $__limite;
public $__offset;
public $sigla_uf;
public $nome;
public $geom;
public $idpais;
public function Gerar()
{
$this->__titulo = 'Uf - Listagem';
foreach ($_GET as $var => $val) {
$this->$var = ($val === '') ? null : $val;
}
$this->addCabecalhos([
'Nome',
'Sigla Uf',
'Pais'
]);
$opcoes = ['' => 'Selecione'];
$objTemp = new clsPais();
$lista = $objTemp->lista(false, false, false, false, false, 'nome ASC');
if (is_array($lista) && count($lista)) {
foreach ($lista as $registro) {
$opcoes["{$registro['idpais']}"] = "{$registro['nome']}";
}
}
$this->campoLista('idpais', 'Pais', $opcoes, $this->idpais, '', false, '', '', false, false);
$this->campoTexto('sigla_uf', 'Sigla Uf', $this->sigla_uf, 3, 3, false);
$this->campoTexto('nome', 'Nome', $this->nome, 30, 30, false);
$this->__limite = 20;
$this->__offset = ($_GET["pagina_{$this->nome}"]) ? $_GET["pagina_{$this->nome}"] * $this->__limite - $this->__limite : 0;
$obj_uf = new clsPublicUf();
$obj_uf->setOrderby('nome ASC');
$obj_uf->setLimite($this->__limite, $this->__offset);
$lista = $obj_uf->lista(
$this->nome,
$this->geom,
$this->idpais,
$this->sigla_uf
);
$total = $obj_uf->_total;
if (is_array($lista) && count($lista)) {
foreach ($lista as $registro) {
$this->addLinhas([
"<a href=\"public_uf_det.php?sigla_uf={$registro['sigla_uf']}\">{$registro['nome']}</a>",
"<a href=\"public_uf_det.php?sigla_uf={$registro['sigla_uf']}\">{$registro['sigla_uf']}</a>",
"<a href=\"public_uf_det.php?sigla_uf={$registro['sigla_uf']}\">{$registro['nm_pais']}</a>"
]);
}
}
$this->addPaginador2('public_uf_lst.php', $total, $_GET, $this->nome, $this->__limite);
$obj_permissao = new clsPermissoes();
if ($obj_permissao->permissao_cadastra(754, $this->pessoa_logada, 7, null, true)) {
$this->acao = 'go("public_uf_cad.php")';
$this->nome_acao = 'Novo';
}
$this->largura = '100%';
$this->breadcrumb('Listagem de UFs', [
url('intranet/educar_enderecamento_index.php') => 'Endereçamento',
]);
}
}
$pagina = new clsIndexBase();
$miolo = new indice();
$pagina->addForm($miolo);
$pagina->MakeAll();