Commit 3c55a34b471e70019f78f0eeae9ae0b5e272fd4d

Authored by Eriksen Costa Paixão
1 parent 7b756b05
Exists in master

Refactoring para coding standards

ieducar/intranet/educar_servidor_formacao_cad.php
1 1 <?php
2   -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3   - * *
4   - * @author Prefeitura Municipal de Itajaí *
5   - * @updated 29/03/2007 *
6   - * Pacote: i-PLB Software Público Livre e Brasileiro *
7   - * *
8   - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí *
9   - * ctima@itajai.sc.gov.br *
10   - * *
11   - * Este programa é software livre, você pode redistribuí-lo e/ou *
12   - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme *
13   - * publicada pela Free Software Foundation, tanto a versão 2 da *
14   - * Licença como (a seu critério) qualquer versão mais nova. *
15   - * *
16   - * Este programa é distribuído na expectativa de ser útil, mas SEM *
17   - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- *
18   - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- *
19   - * sulte a Licença Pública Geral GNU para obter mais detalhes. *
20   - * *
21   - * Você deve ter recebido uma cópia da Licença Pública Geral GNU *
22   - * junto com este programa. Se não, escreva para a Free Software *
23   - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *
24   - * 02111-1307, USA. *
25   - * *
26   - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2 +
27 3 /**
28   - * @author Adriano Erik Weiguert Nagasava
  4 + * i-Educar - Sistema de gestão escolar
  5 + *
  6 + * Copyright (C) 2006 Prefeitura Municipal de Itajaí
  7 + * <ctima@itajai.sc.gov.br>
  8 + *
  9 + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo
  10 + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free
  11 + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério)
  12 + * qualquer versão posterior.
  13 + *
  14 + * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM
  15 + * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU
  16 + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral
  17 + * do GNU para mais detalhes.
  18 + *
  19 + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto
  20 + * com este programa; se não, escreva para a Free Software Foundation, Inc., no
  21 + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  22 + *
  23 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  24 + * @category i-Educar
  25 + * @license @@license@@
  26 + * @package iEd_Pmieducar
  27 + * @since Arquivo disponível desde a versão 1.0.0
  28 + * @version $Id$
29 29 */
30   -require_once ("include/clsBase.inc.php");
31   -require_once ("include/clsCadastro.inc.php");
32   -require_once ("include/clsBanco.inc.php");
33   -require_once( "include/pmieducar/geral.inc.php" );
34 30  
  31 +require_once 'include/clsBase.inc.php';
  32 +require_once 'include/clsCadastro.inc.php';
  33 +require_once 'include/clsBanco.inc.php';
  34 +require_once 'include/pmieducar/geral.inc.php';
  35 +
  36 +/**
  37 + * clsIndexBase class.
  38 + *
  39 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  40 + * @category i-Educar
  41 + * @license @@license@@
  42 + * @package iEd_Pmieducar
  43 + * @since Classe disponível desde a versão 1.0.0
  44 + * @version @@package_version@@
  45 + */
35 46 class clsIndexBase extends clsBase
36 47 {
37   - function Formular()
38   - {
39   - $this->SetTitulo( "{$this->_instituicao} i-Educar - Servidor Formacao" );
40   - $this->processoAp = "635";
41   - }
  48 + function Formular()
  49 + {
  50 + $this->SetTitulo($this->_instituicao . ' i-Educar - Servidor Formação');
  51 + $this->processoAp = 635;
  52 + }
42 53 }
43 54  
  55 +/**
  56 + * indice class.
  57 + *
  58 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  59 + * @category i-Educar
  60 + * @license @@license@@
  61 + * @package iEd_Pmieducar
  62 + * @since Classe disponível desde a versão 1.0.0
  63 + * @version @@package_version@@
  64 + */
44 65 class indice extends clsCadastro
45 66 {
46   - /**
47   - * Referencia pega da session para o idpes do usuario atual
48   - *
49   - * @var int
50   - */
51   - var $pessoa_logada;
52   -
53   - var $cod_formacao;
54   - var $ref_usuario_exc;
55   - var $ref_usuario_cad;
56   - var $ref_cod_servidor;
57   - var $nm_formacao;
58   - var $tipo;
59   - var $descricao;
60   - var $data_cadastro;
61   - var $data_exclusao;
62   - var $ativo;
63   - var $passo;
64   - var $data_conclusao;
65   - var $data_registro;
66   - var $diplomas_registros;
67   - var $ref_cod_instituicao;
68   - var $data_vigencia_homolog;
69   - var $data_publicacao;
70   - var $cod_servidor_curso;
71   - var $cod_servidor_titulo;
72   -
73   - function Inicializar()
74   - {
75   - $retorno = "";
76   - @session_start();
77   - $this->pessoa_logada = $_SESSION['id_pessoa'];
78   - @session_write_close();
79   -
80   - $this->cod_formacao = $_GET["cod_formacao"];
81   - $this->ref_cod_servidor = $_GET["ref_cod_servidor"];
82   - $this->ref_cod_instituicao = $_GET["ref_cod_instituicao"];
83   - $this->passo = $_POST["passo"];
84   - $this->tipo = $_POST["tipo"];
85   -
86   - $obj_permissoes = new clsPermissoes();
87   - $obj_permissoes->permissao_cadastra( 635, $this->pessoa_logada, 3, "educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
88   -
89   - if( is_string( $this->passo ) && $this->passo == 1 )
90   - $retorno = "Novo";
91   -
92   - if( is_numeric( $this->cod_formacao ) )
93   - {
94   -
95   - $obj = new clsPmieducarServidorFormacao( $this->cod_formacao, null, null, $this->ref_cod_servidor, null, null, null, null, null, 1, $this->ref_cod_instituicao );
96   - $registro = $obj->detalhe();
97   - if( $registro )
98   - {
99   - $this->nm_formacao = $registro["nm_formacao"];
100   - $this->tipo = $registro["tipo"];
101   - $this->descricao = $registro["descricao"];
102   -
103   - if ( $this->tipo == "C" ) {
104   - $obj_curso = new clsPmieducarServidorCurso( null, $this->cod_formacao );
105   - $det_curso = $obj_curso->detalhe();
106   - $this->data_conclusao = dataFromPgToBr( $det_curso["data_conclusao"] );
107   - $this->data_registro = dataFromPgToBr( $det_curso["data_registro"] );
108   - $this->diplomas_registros = $det_curso["diplomas_registros"];
109   - $this->cod_servidor_curso = $det_curso["cod_servidor_curso"];
110   - }
111   - else {
112   - $obj_outros = new clsPmieducarServidorTituloConcurso( null, $this->cod_formacao );
113   - $det_outros = $obj_outros->detalhe();
114   - $this->data_vigencia_homolog = dataFromPgToBr( $det_outros["data_vigencia_homolog"] );
115   - $this->data_publicacao = dataFromPgToBr( $det_outros["data_publicacao"] );
116   - $this->cod_servidor_titulo = $det_outros["cod_servidor_titulo"];
117   - }
118   -
119   - $obj_permissoes = new clsPermissoes();
120   - if( $obj_permissoes->permissao_excluir( 635, $this->pessoa_logada, 3 ) )
121   - {
122   - $this->fexcluir = true;
123   - }
124   -
125   - $retorno = "Editar";
126   - $this->passo = 1;
127   - }
128   - }
129   - $this->url_cancelar = ($retorno == "Editar") ? "educar_servidor_formacao_det.php?cod_formacao={$registro["cod_formacao"]}" : "educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}";
130   - $this->nome_url_cancelar = "Cancelar";
131   - return $retorno;
132   - }
133   -
134   - function Gerar()
135   - {
136   - //$this->ref_cod_servidor = $_GET["ref_cod_servidor"];// ($this->ref_cod_servidor == "") ? : $this->ref_cod_servidore
137   - //echo "what --> ".$this->ref_cod_servidor;
138   - if ( !is_numeric( $this->passo ) ) {
139   - $this->passo = 1;
140   - $this->campoOculto( "passo", $this->passo );
141   - $opcoes = array( "C" => "Cursos", "T" => "Títulos", "O" => "Concursos" );
142   - $this->campoLista( "tipo", "Tipo de Formação", $opcoes, $this->tipo );
143   - $this->acao_enviar = false;
144   - $this->array_botao[] = 'Continuar';
145   - $this->array_botao_url_script[] = 'acao();';
146   - $this->url_cancelar = false;
147   - $this->array_botao[] = 'Cancelar';
148   - $this->array_botao_url_script[] = "go('educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}')";
149   - }
150   - elseif ( is_numeric( $this->passo ) && $this->passo == 1 ) {
151   -
152   - if ( $this->tipo == "C" ) {
153   - // primary keys
154   - $this->campoOculto( "cod_formacao", $this->cod_formacao );
155   - $this->campoOculto( "tipo", $this->tipo );
156   - $this->campoOculto( "ref_cod_servidor", $this->ref_cod_servidor );
157   - $this->campoOculto( "ref_cod_instituicao", $this->ref_cod_instituicao );
158   - $this->campoOculto( "cod_servidor_curso", $this->cod_servidor_curso );
159   - $obrigatorio = true;
160   - $get_instituicao = true;
161   - include("include/pmieducar/educar_campo_lista.php");
162   -
163   - $this->campoRotulo( "nm_tipo", "Tipo de Formação", ( $this->tipo == "C" ) ? "Curso" : "Error" );
164   - $this->campoTexto( "nm_formacao", "Nome do Curso", $this->nm_formacao, 30, 255, true );
165   -
166   - // foreign keys
167   - $nm_servidor = "";
168   - $objTemp = new clsFuncionario( $this->ref_cod_servidor );
169   - $detalhe = $objTemp->detalhe();
170   - if ( $detalhe ) {
171   - $objTmp = new clsPessoa_( $detalhe["ref_cod_pessoa_fj"] );
172   - $det = $objTmp->detalhe();
173   - if ( $det ) {
174   - $nm_servidor = $det["nome"];
175   - }
176   - }
177   - $this->campoMemo( "descricao", "Descric&atilde;o", $this->descricao, 60, 5, false );
178   - $this->campoRotulo( "nm_servidor", "Nome do Servidor", $nm_servidor );
179   - $this->campoData( "data_conclusao", "Data de Conclus&atilde;o", $this->data_conclusao, true );
180   - $this->campoData( "data_registro", "Data de Registro", $this->data_registro );
181   - $this->campoMemo( "diplomas_registros", "Diplomas e Registros", $this->diplomas_registros, 60, 5, false );
182   - }
183   - elseif ( $this->tipo == "T" ) {
184   - // primary keys
185   - $this->campoOculto( "cod_formacao", $this->cod_formacao );
186   - $this->campoOculto( "tipo", $this->tipo );
187   - $this->campoOculto( "ref_cod_servidor", $this->ref_cod_servidor );
188   - $this->campoOculto( "ref_cod_instituicao", $this->ref_cod_instituicao );
189   - $this->campoOculto( "cod_servidor_titulo", $this->cod_servidor_titulo );
190   - $obrigatorio = true;
191   - $get_instituicao = true;
192   - include("include/pmieducar/educar_campo_lista.php");
193   -
194   - $this->campoRotulo( "nm_tipo", "Tipo de Formação", ( $this->tipo == "T" ) ? "T&icirc;tulo" : "Error" );
195   - $this->campoTexto( "nm_formacao", "Nome do Título", $this->nm_formacao, 30, 255, true );
196   -
197   - // foreign keys
198   - $nm_servidor = "";
199   - $objTemp = new clsFuncionario( $this->ref_cod_servidor );
200   - $detalhe = $objTemp->detalhe();
201   - if ( $detalhe ) {
202   - $objTmp = new clsPessoa_( $detalhe["ref_cod_pessoa_fj"] );
203   - $det = $objTmp->detalhe();
204   - if ( $det ) {
205   - $nm_servidor = $det["nome"];
206   - }
207   - }
208   - $this->campoMemo( "descricao", "Descric&atilde;o", $this->descricao, 60, 5, false );
209   - $this->campoRotulo( "nm_servidor", "Nome do Servidor", $nm_servidor );
210   - $this->campoData( "data_vigencia_homolog", "Data de Vig&ecirc;ncia", $this->data_vigencia_homolog, true );
211   - $this->campoData( "data_publicacao", "Data de Publica&ccedil;&atilde;o", $this->data_publicacao, true );
212   - }
213   - elseif ( $this->tipo == "O" ) {
214   - // primary keys
215   - $this->campoOculto( "cod_formacao", $this->cod_formacao );
216   - $this->campoOculto( "tipo", $this->tipo );
217   - $this->campoOculto( "ref_cod_servidor", $this->ref_cod_servidor );
218   - $this->campoOculto( "ref_cod_instituicao", $this->ref_cod_instituicao );
219   - $this->campoOculto( "cod_servidor_titulo", $this->cod_servidor_titulo );
220   - $obrigatorio = true;
221   - $get_instituicao = true;
222   - include("include/pmieducar/educar_campo_lista.php");
223   -
224   - $this->campoRotulo( "nm_tipo", "Tipo de Formação", ( $this->tipo == "O" ) ? "Forma&ccedil;&atilde;o" : "Error" );
225   - $this->campoTexto( "nm_formacao", "Nome do Concurso", $this->nm_formacao, 30, 255, true );
226   -
227   - // foreign keys
228   - $nm_servidor = "";
229   - $objTemp = new clsFuncionario( $this->ref_cod_servidor );
230   - $detalhe = $objTemp->detalhe();
231   - if ( $detalhe ) {
232   - $objTmp = new clsPessoa_( $detalhe["ref_cod_pessoa_fj"] );
233   - $det = $objTmp->detalhe();
234   - if ( $det ) {
235   - $nm_servidor = $det["nome"];
236   - }
237   - }
238   - $this->campoMemo( "descricao", "Descric&atilde;o", $this->descricao, 60, 5, false );
239   - $this->campoRotulo( "nm_servidor", "Nome do Servidor", $nm_servidor );
240   - $this->campoData( "data_vigencia_homolog", "Data de Homologa&ccedil;&atilde;o", $this->data_vigencia_homolog, true );
241   - $this->campoData( "data_publicacao", "Data de Publica&ccedil;&atilde;o", $this->data_publicacao, true );
242   - }
243   - }
244   - }
245   -
246   - function Novo()
247   - {
248   - @session_start();
249   - $this->pessoa_logada = $_SESSION['id_pessoa'];
250   - @session_write_close();
251   -
252   - $obj_permissoes = new clsPermissoes();
253   - $obj_permissoes->permissao_cadastra( 635, $this->pessoa_logada, 3, "educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
254   -
255   - $obj = new clsPmieducarServidorFormacao( null, null, $this->pessoa_logada, $this->ref_cod_servidor, $this->nm_formacao, $this->tipo, $this->descricao, null, null, $this->ativo, $this->ref_cod_instituicao );
256   - $cadastrou = $obj->cadastra();
257   - if( $cadastrou )
258   - {
259   - if ( $this->tipo == "C" ) {
260   - $obj = new clsPmieducarServidorCurso( null, $cadastrou, dataToBanco( $this->data_conclusao ), dataToBanco( $this->data_registro ), $this->diplomas_registros );
261   - if ( $obj->cadastra() ) {
262   - $this->mensagem .= "Cadastro efetuado com sucesso.<br>";
263   - header( "Location: educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
264   - die();
265   - return true;
266   - }
267   - }
268   - elseif ( $this->tipo == "T" || $this->tipo == "O" ) {
269   - $obj = new clsPmieducarServidorTituloConcurso( null, $cadastrou, dataToBanco( $this->data_vigencia_homolog ), dataToBanco( $this->data_publicacao ) );
270   - if ( $obj->cadastra() ) {
271   - $this->mensagem .= "Cadastro efetuado com sucesso.<br>";
272   - header( "Location: educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
273   - die();
274   - return true;
275   - }
276   - }
277   - }
278   -
279   - $this->mensagem = "Cadastro n&atilde;o realizado.<br>";
280   - echo "<!--\nErro ao cadastrar clsPmieducarServidorFormacao\nvalores obrigatorios\nis_numeric( $this->ref_usuario_cad ) && is_numeric( $this->ref_cod_servidor ) && is_string( $this->nm_formacao ) && is_string( $this->tipo )\n-->";
281   - return false;
282   - }
283   -
284   - function Editar()
285   - {
286   - @session_start();
287   - $this->pessoa_logada = $_SESSION['id_pessoa'];
288   - @session_write_close();
289   -
290   - $obj_permissoes = new clsPermissoes();
291   - $obj_permissoes->permissao_cadastra( 635, $this->pessoa_logada, 3, "educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
292   -
293   -
294   - $obj = new clsPmieducarServidorFormacao( $this->cod_formacao, $this->pessoa_logada, null, $this->ref_cod_servidor, $this->nm_formacao, $this->tipo, $this->descricao, null, null, 1 );
295   - $editou = $obj->edita();
296   - if( $editou )
297   - {
298   - if ( $this->tipo == "C" ) {
299   - $obj_curso = new clsPmieducarServidorCurso( $this->cod_servidor_curso, $this->cod_formacao, dataToBanco( $this->data_conclusao ), dataToBanco( $this->data_registro ), $this->diplomas_registros );
300   - $editou_cur = $obj_curso->edita();
301   - if ( $editou_cur ) {
302   - $this->mensagem .= "Edi&ccedil;&atilde;o efetuada com sucesso.<br>";
303   - header( "Location: educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
304   - die();
305   - return true;
306   - }
307   - }
308   - else {
309   - $obj_titulo = new clsPmieducarServidorTituloConcurso( $this->cod_servidor_titulo, $this->cod_formacao, dataToBanco( $this->data_vigencia_homolog ), dataToBanco( $this->data_publicacao ) );
310   - $editou_tit = $obj_titulo->edita();
311   - if ( $editou_tit ) {
312   - $this->mensagem .= "Edi&ccedil;&atilde;o efetuada com sucesso.<br>";
313   - header( "Location: educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
314   - die();
315   - return true;
316   - }
317   - }
318   - }
319   -
320   - $this->mensagem = "Edi&ccedil;&atilde;o n&atilde;o realizada.<br>";
321   - echo "<!--\nErro ao editar clsPmieducarServidorFormacao\nvalores obrigatorios\nif( is_numeric( $this->cod_formacao ) && is_numeric( $this->ref_usuario_exc ) )\n-->";
322   - return false;
323   - }
324   -
325   - function Excluir()
326   - {
327   - @session_start();
328   - $this->pessoa_logada = $_SESSION['id_pessoa'];
329   - @session_write_close();
330   -
331   - $obj_permissoes = new clsPermissoes();
332   - $obj_permissoes->permissao_excluir( 635, $this->pessoa_logada, 3, "educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
333   -
334   -
335   - $obj = new clsPmieducarServidorFormacao( $this->cod_formacao, $this->pessoa_logada, null, $this->ref_cod_servidor, $this->nm_formacao, $this->tipo, $this->descricao, null, null, 0, $this->ref_cod_instituicao );
336   - $excluiu = $obj->excluir();
337   - if( $excluiu )
338   - {
339   - $this->mensagem .= "Exclus&atilde;o efetuada com sucesso.<br>";
340   - header( "Location: educar_servidor_formacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}" );
341   - die();
342   - return true;
343   - }
344   -
345   - $this->mensagem = "Exclus&atilde;o n&atilde;o realizada.<br>";
346   - echo "<!--\nErro ao excluir clsPmieducarServidorFormacao\nvalores obrigatorios\nif( is_numeric( $this->cod_formacao ) && is_numeric( $this->ref_usuario_exc ) )\n-->";
347   - return false;
348   - }
  67 + var $pessoa_logada;
  68 +
  69 + var $cod_formacao;
  70 + var $ref_usuario_exc;
  71 + var $ref_usuario_cad;
  72 + var $ref_cod_servidor;
  73 + var $nm_formacao;
  74 + var $tipo;
  75 + var $descricao;
  76 + var $data_cadastro;
  77 + var $data_exclusao;
  78 + var $ativo;
  79 + var $passo;
  80 + var $data_conclusao;
  81 + var $data_registro;
  82 + var $diplomas_registros;
  83 + var $ref_cod_instituicao;
  84 + var $data_vigencia_homolog;
  85 + var $data_publicacao;
  86 + var $cod_servidor_curso;
  87 + var $cod_servidor_titulo;
  88 +
  89 + function Inicializar()
  90 + {
  91 + $retorno = '';
  92 +
  93 + @session_start();
  94 + $this->pessoa_logada = $_SESSION['id_pessoa'];
  95 + @session_write_close();
  96 +
  97 + $this->cod_formacao = $_GET['cod_formacao'];
  98 + $this->ref_cod_servidor = $_GET['ref_cod_servidor'];
  99 + $this->ref_cod_instituicao = $_GET['ref_cod_instituicao'];
  100 + $this->passo = $_POST['passo'];
  101 + $this->tipo = $_POST['tipo'];
  102 +
  103 + // URL para redirecionamento
  104 + $backUrl = sprintf(
  105 + 'educar_servidor_formacao_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d',
  106 + $this->ref_cod_servidor, $this->ref_cod_instituicao
  107 + );
  108 +
  109 + $obj_permissoes = new clsPermissoes();
  110 + $obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 3, $backUrl);
  111 +
  112 + if (is_string($this->passo) && $this->passo == 1) {
  113 + $retorno = 'Novo';
  114 + }
  115 +
  116 + if (is_numeric($this->cod_formacao)) {
  117 + $obj = new clsPmieducarServidorFormacao($this->cod_formacao, NULL, NULL,
  118 + $this->ref_cod_servidor, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);
  119 +
  120 + $registro = $obj->detalhe();
  121 +
  122 + if ($registro) {
  123 + $this->nm_formacao = $registro['nm_formacao'];
  124 + $this->tipo = $registro['tipo'];
  125 + $this->descricao = $registro['descricao'];
  126 +
  127 + if ( $this->tipo == 'C' ) {
  128 + $obj_curso = new clsPmieducarServidorCurso(NULL, $this->cod_formacao);
  129 + $det_curso = $obj_curso->detalhe();
  130 + $this->data_conclusao = dataFromPgToBr($det_curso['data_conclusao']);
  131 + $this->data_registro = dataFromPgToBr($det_curso['data_registro']);
  132 + $this->diplomas_registros = $det_curso['diplomas_registros'];
  133 + $this->cod_servidor_curso = $det_curso['cod_servidor_curso'];
  134 + }
  135 + else {
  136 + $obj_outros = new clsPmieducarServidorTituloConcurso(NULL, $this->cod_formacao);
  137 + $det_outros = $obj_outros->detalhe();
  138 + $this->data_vigencia_homolog = dataFromPgToBr($det_outros['data_vigencia_homolog']);
  139 + $this->data_publicacao = dataFromPgToBr($det_outros['data_publicacao']);
  140 + $this->cod_servidor_titulo = $det_outros['cod_servidor_titulo'];
  141 + }
  142 +
  143 + $obj_permissoes = new clsPermissoes();
  144 + if ($obj_permissoes->permissao_excluir(635, $this->pessoa_logada, 3)) {
  145 + $this->fexcluir = TRUE;
  146 + }
  147 +
  148 + $retorno = 'Editar';
  149 + $this->passo = 1;
  150 + }
  151 + }
  152 +
  153 + $this->url_cancelar = ($retorno == 'Editar') ?
  154 + 'educar_servidor_formacao_det.php?cod_formacao=' . $registro['cod_formacao'] :
  155 + $backUrl;
  156 +
  157 + $this->nome_url_cancelar = 'Cancelar';
  158 +
  159 + return $retorno;
  160 + }
  161 +
  162 + function Gerar()
  163 + {
  164 + if (! is_numeric($this->passo)) {
  165 + $this->passo = 1;
  166 + $this->campoOculto('passo', $this->passo);
  167 +
  168 + $opcoes = array(
  169 + 'C' => 'Cursos',
  170 + 'T' => 'Títulos',
  171 + 'O' => 'Concursos'
  172 + );
  173 +
  174 + $this->campoLista('tipo', 'Tipo de Formação', $opcoes, $this->tipo);
  175 +
  176 + $this->acao_enviar = FALSE;
  177 +
  178 + $this->array_botao[] = 'Continuar';
  179 + $this->array_botao_url_script[] = 'acao();';
  180 +
  181 + $this->url_cancelar = FALSE;
  182 +
  183 + $this->array_botao[] = 'Cancelar';
  184 + $this->array_botao_url_script[] = sprintf(
  185 + 'go("educar_servidor_formacao_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d")',
  186 + $this->ref_cod_servidor, $this->ref_cod_instituicao
  187 + );
  188 + }
  189 + elseif (is_numeric($this->passo) && $this->passo == 1) {
  190 + if ($this->tipo == 'C') {
  191 + // Primary keys
  192 + $this->campoOculto('cod_formacao', $this->cod_formacao);
  193 + $this->campoOculto('tipo', $this->tipo);
  194 + $this->campoOculto('ref_cod_servidor', $this->ref_cod_servidor);
  195 + $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao);
  196 + $this->campoOculto('cod_servidor_curso', $this->cod_servidor_curso);
  197 +
  198 + $obrigatorio = TRUE;
  199 + $get_instituicao = TRUE;
  200 +
  201 + include 'include/pmieducar/educar_campo_lista.php';
  202 +
  203 + $this->campoRotulo('nm_tipo', 'Tipo de Formação', ($this->tipo == 'C') ? 'Curso' : 'Error');
  204 + $this->campoTexto('nm_formacao', 'Nome do Curso', $this->nm_formacao, 30, 255, TRUE );
  205 +
  206 + // Foreign keys
  207 + $nm_servidor = '';
  208 + $objTemp = new clsFuncionario( $this->ref_cod_servidor );
  209 + $detalhe = $objTemp->detalhe();
  210 +
  211 + if ($detalhe) {
  212 + $objTmp = new clsPessoa_($detalhe['ref_cod_pessoa_fj']);
  213 + $det = $objTmp->detalhe();
  214 +
  215 + if ($det) {
  216 + $nm_servidor = $det['nome'];
  217 + }
  218 + }
  219 +
  220 + $this->campoMemo('descricao', 'Descricão', $this->descricao, 60, 5, FALSE);
  221 +
  222 + $this->campoRotulo('nm_servidor', 'Nome do Servidor', $nm_servidor);
  223 +
  224 + $this->campoData('data_conclusao', 'Data de Conclusão', $this->data_conclusao, TRUE);
  225 +
  226 + $this->campoData('data_registro', 'Data de Registro', $this->data_registro);
  227 +
  228 + $this->campoMemo('diplomas_registros', 'Diplomas e Registros',
  229 + $this->diplomas_registros, 60, 5, FALSE);
  230 + }
  231 + elseif ( $this->tipo == 'T' ) {
  232 + // Primary keys
  233 + $this->campoOculto('cod_formacao', $this->cod_formacao);
  234 + $this->campoOculto('tipo', $this->tipo);
  235 + $this->campoOculto('ref_cod_servidor', $this->ref_cod_servidor);
  236 + $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao);
  237 + $this->campoOculto('cod_servidor_titulo', $this->cod_servidor_titulo);
  238 +
  239 + $obrigatorio = TRUE;
  240 + $get_instituicao = TRUE;
  241 +
  242 + include 'include/pmieducar/educar_campo_lista.php';
  243 +
  244 + $this->campoRotulo('nm_tipo', 'Tipo de Formação', ($this->tipo == 'T') ? 'Título' : 'Error');
  245 + $this->campoTexto('nm_formacao', 'Nome do Título', $this->nm_formacao, 30, 255, TRUE);
  246 +
  247 + // Foreign keys
  248 + $nm_servidor = '';
  249 + $objTemp = new clsFuncionario($this->ref_cod_servidor);
  250 + $detalhe = $objTemp->detalhe();
  251 +
  252 + if ($detalhe) {
  253 + $objTmp = new clsPessoa_($detalhe['ref_cod_pessoa_fj']);
  254 + $det = $objTmp->detalhe();
  255 +
  256 + if ($det) {
  257 + $nm_servidor = $det['nome'];
  258 + }
  259 + }
  260 +
  261 + $this->campoMemo('descricao', 'Descrição', $this->descricao, 60, 5, FALSE);
  262 +
  263 + $this->campoRotulo('nm_servidor', 'Nome do Servidor', $nm_servidor);
  264 +
  265 + $this->campoData('data_vigencia_homolog', 'Data de Vigência', $this->data_vigencia_homolog, TRUE);
  266 +
  267 + $this->campoData('data_publicacao', 'Data de Publicação', $this->data_publicacao, TRUE);
  268 + }
  269 + elseif ( $this->tipo == 'O' ) {
  270 + // Primary keys
  271 + $this->campoOculto('cod_formacao', $this->cod_formacao);
  272 + $this->campoOculto('tipo', $this->tipo);
  273 + $this->campoOculto('ref_cod_servidor', $this->ref_cod_servidor);
  274 + $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao);
  275 + $this->campoOculto('cod_servidor_titulo', $this->cod_servidor_titulo);
  276 +
  277 + $obrigatorio = TRUE;
  278 + $get_instituicao = TRUE;
  279 +
  280 + include 'include/pmieducar/educar_campo_lista.php';
  281 +
  282 + $this->campoRotulo('nm_tipo', 'Tipo de Formação', ($this->tipo == 'O') ? 'Formação' : 'Error');
  283 + $this->campoTexto('nm_formacao', 'Nome do Concurso', $this->nm_formacao, 30, 255, TRUE);
  284 +
  285 + // Foreign keys
  286 + $nm_servidor = '';
  287 + $objTemp = new clsFuncionario($this->ref_cod_servidor);
  288 + $detalhe = $objTemp->detalhe();
  289 +
  290 + if ($detalhe) {
  291 + $objTmp = new clsPessoa_($detalhe['ref_cod_pessoa_fj']);
  292 + $det = $objTmp->detalhe();
  293 +
  294 + if ($det) {
  295 + $nm_servidor = $det['nome'];
  296 + }
  297 + }
  298 + $this->campoMemo('descricao', 'Descrição', $this->descricao, 60, 5, FALSE);
  299 +
  300 + $this->campoRotulo('nm_servidor', 'Nome do Servidor', $nm_servidor);
  301 +
  302 + $this->campoData('data_vigencia_homolog', 'Data de Homologação', $this->data_vigencia_homolog, TRUE);
  303 +
  304 + $this->campoData('data_publicacao', 'Data de Publicação', $this->data_publicacao, TRUE);
  305 + }
  306 + }
  307 + }
  308 +
  309 + function Novo()
  310 + {
  311 + @session_start();
  312 + $this->pessoa_logada = $_SESSION['id_pessoa'];
  313 + @session_write_close();
  314 +
  315 + $backUrl = sprintf(
  316 + 'educar_servidor_formacao_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d',
  317 + $this->ref_cod_servidor, $this->ref_cod_instituicao
  318 + );
  319 +
  320 + $obj_permissoes = new clsPermissoes();
  321 + $obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 3, $backUrl);
  322 +
  323 + $obj = new clsPmieducarServidorFormacao(NULL, NULL, $this->pessoa_logada,
  324 + $this->ref_cod_servidor, $this->nm_formacao, $this->tipo, $this->descricao,
  325 + NULL, NULL, $this->ativo, $this->ref_cod_instituicao);
  326 +
  327 + $cadastrou = $obj->cadastra();
  328 + if ($cadastrou) {
  329 + if ($this->tipo == 'C') {
  330 +
  331 + $obj = new clsPmieducarServidorCurso(NULL, $cadastrou, dataToBanco($this->data_conclusao),
  332 + dataToBanco($this->data_registro), $this->diplomas_registros);
  333 +
  334 + if ($obj->cadastra()) {
  335 + $this->mensagem .= 'Cadastro efetuado com sucesso.<br>';
  336 + header('Location: ' . $backUrl);
  337 + die();
  338 + }
  339 + }
  340 + elseif ( $this->tipo == 'T' || $this->tipo == 'O' ) {
  341 + $obj = new clsPmieducarServidorTituloConcurso(NULL, $cadastrou,
  342 + dataToBanco($this->data_vigencia_homolog), dataToBanco($this->data_publicacao));
  343 +
  344 + if ($obj->cadastra()) {
  345 + $this->mensagem .= 'Cadastro efetuado com sucesso.<br>';
  346 + header('Location: ' . $backUrl);
  347 + die();
  348 + }
  349 + }
  350 + }
  351 +
  352 + $this->mensagem = 'Cadastro não realizado.<br>';
  353 + return FALSE;
  354 + }
  355 +
  356 + function Editar()
  357 + {
  358 + @session_start();
  359 + $this->pessoa_logada = $_SESSION['id_pessoa'];
  360 + @session_write_close();
  361 +
  362 + $backUrl = sprintf(
  363 + 'educar_servidor_formacao_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d',
  364 + $this->ref_cod_servidor, $this->ref_cod_instituicao
  365 + );
  366 +
  367 + $obj_permissoes = new clsPermissoes();
  368 + $obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 3, $backUrl);
  369 +
  370 + $obj = new clsPmieducarServidorFormacao($this->cod_formacao, $this->pessoa_logada,
  371 + NULL, $this->ref_cod_servidor, $this->nm_formacao, $this->tipo, $this->descricao,
  372 + NULL, NULL, 1);
  373 +
  374 + $editou = $obj->edita();
  375 +
  376 + if ($editou) {
  377 + if ($this->tipo == 'C') {
  378 + $obj_curso = new clsPmieducarServidorCurso($this->cod_servidor_curso,
  379 + $this->cod_formacao, dataToBanco($this->data_conclusao),
  380 + dataToBanco($this->data_registro), $this->diplomas_registros
  381 + );
  382 +
  383 + $editou_cur = $obj_curso->edita();
  384 +
  385 + if ($editou_cur) {
  386 + $this->mensagem .= 'Edição efetuada com sucesso.<br>';
  387 + header('Location: ' . $backUrl);
  388 + die();
  389 + }
  390 + }
  391 + else {
  392 + $obj_titulo = new clsPmieducarServidorTituloConcurso($this->cod_servidor_titulo,
  393 + $this->cod_formacao, dataToBanco($this->data_vigencia_homolog),
  394 + dataToBanco($this->data_publicacao));
  395 +
  396 + $editou_tit = $obj_titulo->edita();
  397 +
  398 + if ($editou_tit) {
  399 + $this->mensagem .= 'Edição efetuada com sucesso.<br>';
  400 + header('Location: ' . $backUrl);
  401 + die();
  402 + }
  403 + }
  404 + }
  405 +
  406 + $this->mensagem = "Edição não realizada.<br>";
  407 + return FALSE;
  408 + }
  409 +
  410 + function Excluir()
  411 + {
  412 + @session_start();
  413 + $this->pessoa_logada = $_SESSION['id_pessoa'];
  414 + @session_write_close();
  415 +
  416 + $backUrl = sprintf(
  417 + 'educar_servidor_formacao_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d',
  418 + $this->ref_cod_servidor, $this->ref_cod_instituicao
  419 + );
  420 +
  421 + $obj_permissoes = new clsPermissoes();
  422 + $obj_permissoes->permissao_excluir(635, $this->pessoa_logada, 3, $backUrl);
  423 +
  424 + $obj = new clsPmieducarServidorFormacao($this->cod_formacao, $this->pessoa_logada,
  425 + NULL, $this->ref_cod_servidor, $this->nm_formacao, $this->tipo, $this->descricao,
  426 + NULL, NULL, 0, $this->ref_cod_instituicao);
  427 +
  428 + $excluiu = $obj->excluir();
  429 +
  430 + if ($excluiu) {
  431 + $this->mensagem .= 'Exclusão efetuada com sucesso.<br>';
  432 + header('Location:' . $backUrl);
  433 + die();
  434 + }
  435 +
  436 + $this->mensagem = 'Exclusão não realizada.<br>';
  437 + return FALSE;
  438 + }
349 439 }
350 440  
351   -// cria uma extensao da classe base
  441 +// Instancia objeto de página
352 442 $pagina = new clsIndexBase();
353   -// cria o conteudo
  443 +
  444 +// Instancia objeto de conteúdo
354 445 $miolo = new indice();
355   -// adiciona o conteudo na clsBase
356   -$pagina->addForm( $miolo );
357   -// gera o html
358   -$pagina->MakeAll();
359   -?>
360 446 \ No newline at end of file
  447 +
  448 +// Atribui o conteúdo à  página
  449 +$pagina->addForm($miolo);
  450 +
  451 +// Gera o código HTML
  452 +$pagina->MakeAll();
361 453 \ No newline at end of file
... ...
ieducar/intranet/educar_servidor_formacao_det.php
1 1 <?php
2   -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3   - * *
4   - * @author Prefeitura Municipal de Itajaí *
5   - * @updated 29/03/2007 *
6   - * Pacote: i-PLB Software Público Livre e Brasileiro *
7   - * *
8   - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí *
9   - * ctima@itajai.sc.gov.br *
10   - * *
11   - * Este programa é software livre, você pode redistribuí-lo e/ou *
12   - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme *
13   - * publicada pela Free Software Foundation, tanto a versão 2 da *
14   - * Licença como (a seu critério) qualquer versão mais nova. *
15   - * *
16   - * Este programa é distribuído na expectativa de ser útil, mas SEM *
17   - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- *
18   - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- *
19   - * sulte a Licença Pública Geral GNU para obter mais detalhes. *
20   - * *
21   - * Você deve ter recebido uma cópia da Licença Pública Geral GNU *
22   - * junto com este programa. Se não, escreva para a Free Software *
23   - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *
24   - * 02111-1307, USA. *
25   - * *
26   - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2 +
27 3 /**
28   - * @author Adriano Erik Weiguert Nagasava
  4 + * i-Educar - Sistema de gestão escolar
  5 + *
  6 + * Copyright (C) 2006 Prefeitura Municipal de Itajaí
  7 + * <ctima@itajai.sc.gov.br>
  8 + *
  9 + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo
  10 + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free
  11 + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério)
  12 + * qualquer versão posterior.
  13 + *
  14 + * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM
  15 + * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU
  16 + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral
  17 + * do GNU para mais detalhes.
  18 + *
  19 + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto
  20 + * com este programa; se não, escreva para a Free Software Foundation, Inc., no
  21 + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  22 + *
  23 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  24 + * @category i-Educar
  25 + * @license @@license@@
  26 + * @package iEd_Pmieducar
  27 + * @since Arquivo disponível desde a versão 1.0.0
  28 + * @version $Id$
29 29 */
30   -require_once ("include/clsBase.inc.php");
31   -require_once ("include/clsDetalhe.inc.php");
32   -require_once ("include/clsBanco.inc.php");
33   -require_once( "include/pmieducar/geral.inc.php" );
34 30  
  31 +require_once 'include/clsBase.inc.php';
  32 +require_once 'include/clsDetalhe.inc.php';
  33 +require_once 'include/clsBanco.inc.php';
  34 +require_once 'include/pmieducar/geral.inc.php';
  35 +
  36 +/**
  37 + * clsIndexBase class.
  38 + *
  39 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  40 + * @category i-Educar
  41 + * @license @@license@@
  42 + * @package iEd_Pmieducar
  43 + * @since Classe disponível desde a versão 1.0.0
  44 + * @version @@package_version@@
  45 + */
35 46 class clsIndexBase extends clsBase
36 47 {
37   - function Formular()
38   - {
39   - $this->SetTitulo( "{$this->_instituicao} i-Educar - Servidor Formacao" );
40   - $this->processoAp = "635";
41   - }
  48 + function Formular()
  49 + {
  50 + $this->SetTitulo($this->_instituicao . ' i-Educar - Servidor Formação');
  51 + $this->processoAp = 635;
  52 + }
42 53 }
43 54  
  55 +/**
  56 + * indice class.
  57 + *
  58 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  59 + * @category i-Educar
  60 + * @license @@license@@
  61 + * @package iEd_Pmieducar
  62 + * @since Classe disponível desde a versão 1.0.0
  63 + * @version @@package_version@@
  64 + */
44 65 class indice extends clsDetalhe
45 66 {
46   - /**
47   - * Titulo no topo da pagina
48   - *
49   - * @var int
50   - */
51   - var $titulo;
52   -
53   - var $cod_formacao;
54   - var $ref_usuario_exc;
55   - var $ref_usuario_cad;
56   - var $ref_cod_servidor;
57   - var $nm_formacao;
58   - var $tipo;
59   - var $descricao;
60   - var $data_cadastro;
61   - var $data_exclusao;
62   - var $ativo;
63   -
64   - function Gerar()
65   - {
66   - @session_start();
67   - $this->pessoa_logada = $_SESSION['id_pessoa'];
68   - session_write_close();
69   -
70   - $this->titulo = "Servidor Formacao - Detalhe";
71   - $this->addBanner( "imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet" );
72   -
73   - $this->cod_formacao=$_GET["cod_formacao"];
74   -
75   - $tmp_obj = new clsPmieducarServidorFormacao( $this->cod_formacao );
76   - $registro = $tmp_obj->detalhe();
77   -
78   - if( ! $registro )
79   - {
80   - header( "location: educar_servidor_formacao_lst.php" );
81   - die();
82   - }
83   -
84   - if( class_exists( "clsPmieducarServidor" ) )
85   - {
86   - $obj_ref_cod_servidor = new clsPmieducarServidor( $registro["ref_cod_servidor"], null, null, null, null, null, 1, $registro["ref_ref_cod_instituicao"] );
87   - $det_ref_cod_servidor = $obj_ref_cod_servidor->detalhe();
88   - $registro["ref_cod_servidor"] = $det_ref_cod_servidor["cod_servidor"];
89   - }
90   - else
91   - {
92   - $registro["ref_cod_servidor"] = "Erro na geracao";
93   - echo "<!--\nErro\nClasse nao existente: clsPmieducarServidor\n-->";
94   - }
95   - if( $registro["nm_formacao"] )
96   - {
97   - $this->addDetalhe( array( "Nome Forma&ccedil;&atilde;o", "{$registro["nm_formacao"]}") );
98   - }
99   - if ( $registro["tipo"] == "C" ) {
100   - $obj_curso = new clsPmieducarServidorCurso( null, $this->cod_formacao );
101   - $det_curso = $obj_curso->detalhe();
102   - }
103   - elseif ( $registro["tipo"] == "T" || $registro["tipo"] == "O" ) {
104   - $obj_titulo = new clsPmieducarServidorTituloConcurso( null, $this->cod_formacao );
105   - $det_titulo = $obj_titulo->detalhe();
106   - }
107   - if( $registro["tipo"] )
108   - {
109   - if ( $registro["tipo"] == "C" ) {
110   - $registro["tipo"] = "Curso";
111   - }
112   - elseif ( $registro["tipo"] == "T" ) {
113   - $registro["tipo"] = "T&iacute;tulo";
114   - }
115   - else {
116   - $registro["tipo"] = "Concurso";
117   - }
118   - $this->addDetalhe( array( "Tipo", "{$registro["tipo"]}") );
119   - }
120   - if( $registro["descricao"] )
121   - {
122   - $this->addDetalhe( array( "Descric&atilde;o", "{$registro["descricao"]}") );
123   - }
124   - if ( $det_curso["data_conclusao"] ) {
125   - $this->addDetalhe( array( "Data de Conclus&atilde;o", "".dataFromPgToBr( $det_curso["data_conclusao"] )."" ) );
126   - }
127   - if ( $det_curso["data_registro"] ) {
128   - $this->addDetalhe( array( "Data de Registro", "".dataFromPgToBr( $det_curso["data_registro"] )."" ) );
129   - }
130   - if ( $det_curso["diplomas_registros"] ) {
131   - $this->addDetalhe( array( "Diplomas e Registros", "{$det_curso["diplomas_registros"]}" ) );
132   - }
133   - if ( $det_titulo["data_vigencia_homolog"] && $registro["tipo"] == "T&iacute;tulo") {
134   - $this->addDetalhe( array( "Data de Vigência", "".dataFromPgToBr( $det_titulo["data_vigencia_homolog"] )."" ) );
135   - }
136   - elseif ( $det_titulo["data_vigencia_homolog"] && $registro["tipo"] == "Concurso") {
137   - $this->addDetalhe( array( "Data de Homologação", "".dataFromPgToBr( $det_titulo["data_vigencia_homolog"] )."" ) );
138   - }
139   - if ( $det_titulo["data_publicacao"] ) {
140   - $this->addDetalhe( array( "Data de Publicação", "".dataFromPgToBr( $det_titulo["data_publicacao"] )."" ) );
141   - }
142   -
143   - $obj_permissoes = new clsPermissoes();
144   - if( $obj_permissoes->permissao_cadastra( 635, $this->pessoa_logada, 3 ) )
145   - {
146   - $this->url_novo = "educar_servidor_formacao_cad.php";
147   - $this->url_editar = "educar_servidor_formacao_cad.php?cod_formacao={$registro["cod_formacao"]}&ref_cod_instituicao={$registro["ref_ref_cod_instituicao"]}&ref_cod_servidor={$registro["ref_cod_servidor"]}";
148   - }
149   -
150   - $this->url_cancelar = "educar_servidor_formacao_lst.php?ref_cod_servidor={$registro["ref_cod_servidor"]}&ref_cod_instituicao={$registro["ref_ref_cod_instituicao"]}";
151   - $this->largura = "100%";
152   - }
  67 + var $titulo;
  68 +
  69 + var $cod_formacao;
  70 + var $ref_usuario_exc;
  71 + var $ref_usuario_cad;
  72 + var $ref_cod_servidor;
  73 + var $nm_formacao;
  74 + var $tipo;
  75 + var $descricao;
  76 + var $data_cadastro;
  77 + var $data_exclusao;
  78 + var $ativo;
  79 +
  80 + function Gerar()
  81 + {
  82 + @session_start();
  83 + $this->pessoa_logada = $_SESSION['id_pessoa'];
  84 + session_write_close();
  85 +
  86 + $this->titulo = 'Servidor Formacao - Detalhe';
  87 + $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
  88 +
  89 + $this->cod_formacao = $_GET['cod_formacao'];
  90 +
  91 + $tmp_obj = new clsPmieducarServidorFormacao($this->cod_formacao);
  92 + $registro = $tmp_obj->detalhe();
  93 +
  94 + if (! $registro) {
  95 + header('Location: educar_servidor_formacao_lst.php');
  96 + die();
  97 + }
  98 +
  99 + if (class_exists('clsPmieducarServidor')) {
  100 + $obj_ref_cod_servidor = new clsPmieducarServidor($registro['ref_cod_servidor'],
  101 + null, null, null, null, null, 1, $registro['ref_ref_cod_instituicao']
  102 + );
  103 +
  104 + $det_ref_cod_servidor = $obj_ref_cod_servidor->detalhe();
  105 + $registro['ref_cod_servidor'] = $det_ref_cod_servidor['cod_servidor'];
  106 + }
  107 + else {
  108 + $registro['ref_cod_servidor'] = 'Erro na geracao';
  109 + }
  110 +
  111 + if ($registro['nm_formacao']) {
  112 + $this->addDetalhe(array('Nome Formação', $registro['nm_formacao']));
  113 + }
  114 +
  115 + if ($registro['tipo'] == 'C') {
  116 + $obj_curso = new clsPmieducarServidorCurso( null, $this->cod_formacao );
  117 + $det_curso = $obj_curso->detalhe();
  118 + }
  119 + elseif ($registro['tipo'] == 'T' || $registro['tipo'] == 'O') {
  120 + $obj_titulo = new clsPmieducarServidorTituloConcurso(NULL, $this->cod_formacao);
  121 + $det_titulo = $obj_titulo->detalhe();
  122 + }
  123 +
  124 + if ($registro['tipo']) {
  125 + if ($registro['tipo'] == 'C') {
  126 + $registro['tipo'] = 'Curso';
  127 + }
  128 + elseif ($registro['tipo'] == 'T') {
  129 + $registro['tipo'] = 'T&iacute;tulo';
  130 + }
  131 + else {
  132 + $registro['tipo'] = 'Concurso';
  133 + }
  134 +
  135 + $this->addDetalhe(array('Tipo', $registro['tipo']));
  136 + }
  137 +
  138 + if ($registro['descricao']) {
  139 + $this->addDetalhe(array('Descricção', $registro['descricao']));
  140 + }
  141 +
  142 + if ($det_curso['data_conclusao']) {
  143 + $this->addDetalhe(array('Data de Conclusão', dataFromPgToBr($det_curso['data_conclusao'])));
  144 + }
  145 +
  146 + if ($det_curso['data_registro']) {
  147 + $this->addDetalhe(array('Data de Registro', dataFromPgToBr($det_curso['data_registro'])));
  148 + }
  149 +
  150 + if ($det_curso['diplomas_registros']) {
  151 + $this->addDetalhe(array('Diplomas e Registros', $det_curso['diplomas_registros']));
  152 + }
  153 +
  154 + if ($det_titulo['data_vigencia_homolog'] && $registro['tipo'] == 'Título') {
  155 + $this->addDetalhe(array('Data de Vigência', dataFromPgToBr($det_titulo['data_vigencia_homolog'])));
  156 + }
  157 + elseif ($det_titulo['data_vigencia_homolog'] && $registro['tipo'] == 'Concurso') {
  158 + $this->addDetalhe(array('Data de Homologação', dataFromPgToBr($det_titulo['data_vigencia_homolog'])));
  159 + }
  160 +
  161 + if ($det_titulo['data_publicacao']) {
  162 + $this->addDetalhe(array('Data de Publicação', dataFromPgToBr($det_titulo['data_publicacao'])));
  163 + }
  164 +
  165 + $obj_permissoes = new clsPermissoes();
  166 +
  167 + if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 3)) {
  168 + $this->url_novo = 'educar_servidor_formacao_cad.php';
  169 +
  170 + $this->url_editar = sprintf(
  171 + 'educar_servidor_formacao_cad.php?cod_formacao=%d&ref_cod_instituicao=%d&ref_cod_servidor=%d',
  172 + $registro['cod_formacao'], $registro['ref_ref_cod_instituicao'], $registro['ref_cod_servidor']
  173 + );
  174 + }
  175 +
  176 + $this->url_cancelar = sprintf(
  177 + 'educar_servidor_formacao_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d',
  178 + $registro['ref_cod_servidor'], $registro['ref_ref_cod_instituicao']
  179 + );
  180 +
  181 + $this->largura = '100%';
  182 + }
153 183 }
154 184  
155   -// cria uma extensao da classe base
  185 +// Instancia objeto de página
156 186 $pagina = new clsIndexBase();
157   -// cria o conteudo
  187 +
  188 +// Instancia objeto de conteúdo
158 189 $miolo = new indice();
159   -// adiciona o conteudo na clsBase
160   -$pagina->addForm( $miolo );
161   -// gera o html
162   -$pagina->MakeAll();
163   -?>
164 190 \ No newline at end of file
  191 +
  192 +// Atribui o conteúdo à  página
  193 +$pagina->addForm($miolo);
  194 +
  195 +// Gera o código HTML
  196 +$pagina->MakeAll();
165 197 \ No newline at end of file
... ...
ieducar/intranet/educar_servidor_formacao_lst.php
1 1 <?php
2   -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3   - * *
4   - * @author Prefeitura Municipal de Itajaí *
5   - * @updated 29/03/2007 *
6   - * Pacote: i-PLB Software Público Livre e Brasileiro *
7   - * *
8   - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí *
9   - * ctima@itajai.sc.gov.br *
10   - * *
11   - * Este programa é software livre, você pode redistribuí-lo e/ou *
12   - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme *
13   - * publicada pela Free Software Foundation, tanto a versão 2 da *
14   - * Licença como (a seu critério) qualquer versão mais nova. *
15   - * *
16   - * Este programa é distribuído na expectativa de ser útil, mas SEM *
17   - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- *
18   - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- *
19   - * sulte a Licença Pública Geral GNU para obter mais detalhes. *
20   - * *
21   - * Você deve ter recebido uma cópia da Licença Pública Geral GNU *
22   - * junto com este programa. Se não, escreva para a Free Software *
23   - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *
24   - * 02111-1307, USA. *
25   - * *
26   - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2 +
27 3 /**
28   - * @author Adriano Erik Weiguert Nagasava
  4 + * i-Educar - Sistema de gestão escolar
  5 + *
  6 + * Copyright (C) 2006 Prefeitura Municipal de Itajaí
  7 + * <ctima@itajai.sc.gov.br>
  8 + *
  9 + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo
  10 + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free
  11 + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério)
  12 + * qualquer versão posterior.
  13 + *
  14 + * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM
  15 + * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU
  16 + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral
  17 + * do GNU para mais detalhes.
  18 + *
  19 + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto
  20 + * com este programa; se não, escreva para a Free Software Foundation, Inc., no
  21 + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  22 + *
  23 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  24 + * @category i-Educar
  25 + * @license @@license@@
  26 + * @package iEd_Pmieducar
  27 + * @since Arquivo disponível desde a versão 1.0.0
  28 + * @version $Id$
29 29 */
30   -require_once ("include/clsBase.inc.php");
31   -require_once ("include/clsListagem.inc.php");
32   -require_once ("include/clsBanco.inc.php");
33   -require_once( "include/pmieducar/geral.inc.php" );
34 30  
  31 +require_once 'include/clsBase.inc.php';
  32 +require_once 'include/clsListagem.inc.php';
  33 +require_once 'include/clsBanco.inc.php';
  34 +require_once 'include/pmieducar/geral.inc.php';
  35 +
  36 +/**
  37 + * clsIndexBase class.
  38 + *
  39 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  40 + * @category i-Educar
  41 + * @license @@license@@
  42 + * @package iEd_Pmieducar
  43 + * @since Classe disponível desde a versão 1.0.0
  44 + * @version @@package_version@@
  45 + */
35 46 class clsIndexBase extends clsBase
36 47 {
37   - function Formular()
38   - {
39   - $this->SetTitulo( "{$this->_instituicao} i-Educar - Servidor Formacao" );
40   - $this->processoAp = "635";
41   - }
  48 + function Formular()
  49 + {
  50 + $this->SetTitulo($this->_instituicao . ' i-Educar - Servidor Formacao' );
  51 + $this->processoAp = 635;
  52 + }
42 53 }
43 54  
  55 +/**
  56 + * indice class.
  57 + *
  58 + * @author Adriano Erik Weiguert Nagasava <ctima@itajai.sc.gov.br>
  59 + * @category i-Educar
  60 + * @license @@license@@
  61 + * @package iEd_Pmieducar
  62 + * @since Classe disponível desde a versão 1.0.0
  63 + * @version @@package_version@@
  64 + */
44 65 class indice extends clsListagem
45 66 {
46   - /**
47   - * Referencia pega da session para o idpes do usuario atual
48   - *
49   - * @var int
50   - */
51   - var $pessoa_logada;
52   -
53   - /**
54   - * Titulo no topo da pagina
55   - *
56   - * @var int
57   - */
58   - var $titulo;
59   -
60   - /**
61   - * Quantidade de registros a ser apresentada em cada pagina
62   - *
63   - * @var int
64   - */
65   - var $limite;
66   -
67   - /**
68   - * Inicio dos registros a serem exibidos (limit)
69   - *
70   - * @var int
71   - */
72   - var $offset;
73   -
74   - var $cod_formacao;
75   - var $ref_usuario_exc;
76   - var $ref_usuario_cad;
77   - var $ref_cod_servidor;
78   - var $nm_formacao;
79   - var $tipo;
80   - var $descricao;
81   - var $data_cadastro;
82   - var $data_exclusao;
83   - var $ativo;
84   - var $ref_cod_instituicao;
85   -
86   - function Gerar()
87   - {
88   - @session_start();
89   - $this->pessoa_logada = $_SESSION['id_pessoa'];
90   - session_write_close();
91   -
92   - $this->ref_cod_servidor = $_GET["ref_cod_servidor"];
93   - $this->ref_cod_instituicao = $_GET["ref_cod_instituicao"];
94   -
95   - $this->titulo = "Servidor Formacao - Listagem";
96   -
97   - foreach( $_GET AS $var => $val ) // passa todos os valores obtidos no GET para atributos do objeto
98   - $this->$var = ( $val === "" ) ? null: $val;
99   -
100   - $this->addBanner( "imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet" );
101   -
102   - $this->addCabecalhos( array(
103   - "Nome Forma&ccedil;&atilde;o",
104   - "Tipo"
105   - ) );
106   - $this->campoOculto( "ref_cod_servidor", $this->ref_cod_servidor );
107   - $this->campoOculto( "ref_cod_instituicao", $this->ref_cod_instituicao );
108   -
109   - // outros Filtros
110   - $this->campoTexto( "nm_formacao", "Nome da Forma&ccedil;&atilde;o", $this->nm_formacao, 30, 255, false );
111   - $opcoes = array( "" => "Selecione", "C" => "Cursos", "T" => "Títulos", "O" => "Concursos" );
112   - $this->campoLista( "tipo", "Tipo de Formação", $opcoes, $this->tipo );
113   -
114   - // Paginador
115   - $this->limite = 20;
116   - $this->offset = ( $_GET["pagina_{$this->nome}"] ) ? $_GET["pagina_{$this->nome}"]*$this->limite-$this->limite: 0;
117   -
118   - $obj_servidor_formacao = new clsPmieducarServidorFormacao();
119   - $obj_servidor_formacao->setOrderby( "nm_formacao ASC" );
120   - $obj_servidor_formacao->setLimite( $this->limite, $this->offset );
121   -
122   - if ( !isset( $this->tipo ) ) {
123   - $this->tipo = null;
124   - }
125   - $lista = $obj_servidor_formacao->lista(
126   - null,
127   - null,
128   - null,
129   - $this->ref_cod_servidor,
130   - $this->nm_formacao,
131   - $this->tipo,
132   - null,
133   - null,
134   - null,
135   - 1
136   - );
137   - $total = $obj_servidor_formacao->_total;
138   -
139   - // monta a lista
140   - if( is_array( $lista ) && count( $lista ) )
141   - {
142   - foreach ( $lista AS $registro )
143   - {
144   - // pega detalhes de foreign_keys
145   - if( class_exists( "clsPmieducarUsuario" ) )
146   - {
147   - $obj_ref_usuario_exc = new clsPmieducarUsuario( $registro["ref_usuario_exc"] );
148   - $det_ref_usuario_exc = $obj_ref_usuario_exc->detalhe();
149   - $registro["ref_usuario_exc"] = $det_ref_usuario_exc["data_cadastro"];
150   - }
151   - else
152   - {
153   - $registro["ref_usuario_exc"] = "Erro na geracao";
154   - echo "<!--\nErro\nClasse nao existente: clsPmieducarUsuario\n-->";
155   - }
156   -
157   - if( class_exists( "clsPmieducarServidor" ) )
158   - {
159   - $obj_ref_cod_servidor = new clsPmieducarServidor( $registro["ref_cod_servidor"] );
160   - $det_ref_cod_servidor = $obj_ref_cod_servidor->detalhe();
161   - $registro["ref_cod_servidor"] = $det_ref_cod_servidor["cod_servidor"];
162   - }
163   - else
164   - {
165   - $registro["ref_cod_servidor"] = "Erro na geracao";
166   - echo "<!--\nErro\nClasse nao existente: clsPmieducarServidor\n-->";
167   - }
168   -
169   - if ( $registro["tipo"] == "C" ) {
170   - $registro["tipo"] = "Curso";
171   - }
172   - elseif ( $registro["tipo"] == "T" ) {
173   - $registro["tipo"] = "T&iacute;tulo";
174   - }
175   - else {
176   - $registro["tipo"] = "Concurso";
177   - }
178   -
179   - $this->addLinhas( array(
180   - "<a href=\"educar_servidor_formacao_det.php?cod_formacao={$registro["cod_formacao"]}\">{$registro["nm_formacao"]}</a>",
181   - "<a href=\"educar_servidor_formacao_det.php?cod_formacao={$registro["cod_formacao"]}\">{$registro["tipo"]}</a>"
182   - ) );
183   - $this->tipo = "";
184   - }
185   - }
186   - $this->addPaginador2( "educar_servidor_formacao_lst.php", $total, $_GET, $this->nome, $this->limite );
187   - $obj_permissoes = new clsPermissoes();
188   - if( $obj_permissoes->permissao_cadastra( 635, $this->pessoa_logada, 3 ) )
189   - {
190   - $this->array_botao[] = "Novo";
191   - $this->array_botao_url[] = "educar_servidor_formacao_cad.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}";
192   - //$this->acao = "go(\"educar_servidor_formacao_cad.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}\")";
193   - //$this->nome_acao = "Novo";
194   - }
195   - $this->array_botao[] = "Voltar";
196   - $this->array_botao_url[] = "educar_servidor_det.php?cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}";
197   -
198   - $this->largura = "100%";
199   - }
  67 + var $pessoa_logada;
  68 + var $titulo;
  69 + var $limite;
  70 + var $offset;
  71 +
  72 + var $cod_formacao;
  73 + var $ref_usuario_exc;
  74 + var $ref_usuario_cad;
  75 + var $ref_cod_servidor;
  76 + var $nm_formacao;
  77 + var $tipo;
  78 + var $descricao;
  79 + var $data_cadastro;
  80 + var $data_exclusao;
  81 + var $ativo;
  82 + var $ref_cod_instituicao;
  83 +
  84 + function Gerar()
  85 + {
  86 + @session_start();
  87 + $this->pessoa_logada = $_SESSION['id_pessoa'];
  88 + session_write_close();
  89 +
  90 + $this->ref_cod_servidor = $_GET['ref_cod_servidor'];
  91 + $this->ref_cod_instituicao = $_GET['ref_cod_instituicao'];
  92 +
  93 + $this->titulo = 'Servidor Formacao - Listagem';
  94 +
  95 + // passa todos os valores obtidos no GET para atributos do objeto
  96 + foreach( $_GET AS $var => $val ) {
  97 + $this->$var = ($val === '') ? NULL : $val;
  98 + }
  99 +
  100 + $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
  101 +
  102 + $this->addCabecalhos(array(
  103 + 'Nome Formação',
  104 + 'Tipo'
  105 + ));
  106 +
  107 + $this->campoOculto('ref_cod_servidor', $this->ref_cod_servidor);
  108 + $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao);
  109 +
  110 + // Filtros
  111 + $this->campoTexto('nm_formacao', 'Nome da Formação', $this->nm_formacao,
  112 + 30, 255, FALSE);
  113 +
  114 + $opcoes = array(
  115 + '' => 'Selecione',
  116 + 'C' => 'Cursos',
  117 + 'T' => 'Títulos',
  118 + 'O' => 'Concursos'
  119 + );
  120 +
  121 + $this->campoLista('tipo', 'Tipo de Formação', $opcoes, $this->tipo);
  122 +
  123 + // Paginador
  124 + $this->limite = 20;
  125 + $this->offset = ($_GET['pagina_' . $this->nome]) ?
  126 + $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
  127 +
  128 + $obj_servidor_formacao = new clsPmieducarServidorFormacao();
  129 + $obj_servidor_formacao->setOrderby('nm_formacao ASC');
  130 + $obj_servidor_formacao->setLimite($this->limite, $this->offset);
  131 +
  132 + if (! isset($this->tipo)) {
  133 + $this->tipo = NULL;
  134 + }
  135 +
  136 + $lista = $obj_servidor_formacao->lista(
  137 + NULL,
  138 + NULL,
  139 + NULL,
  140 + $this->ref_cod_servidor,
  141 + $this->nm_formacao,
  142 + $this->tipo,
  143 + NULL,
  144 + NULL,
  145 + NULL,
  146 + 1
  147 + );
  148 +
  149 + $total = $obj_servidor_formacao->_total;
  150 +
  151 + // Monta a lista
  152 + if (is_array($lista) && count($lista)) {
  153 + foreach ($lista as $registro) {
  154 + // Pega detalhes de foreign_keys
  155 + if (class_exists('clsPmieducarUsuario')) {
  156 + $obj_ref_usuario_exc = new clsPmieducarUsuario($registro['ref_usuario_exc']);
  157 + $det_ref_usuario_exc = $obj_ref_usuario_exc->detalhe();
  158 +
  159 + $registro['ref_usuario_exc'] = $det_ref_usuario_exc['data_cadastro'];
  160 + }
  161 + else {
  162 + $registro['ref_usuario_exc'] = 'Erro na geracao';
  163 + }
  164 +
  165 + if (class_exists('clsPmieducarServidor')) {
  166 + $obj_ref_cod_servidor = new clsPmieducarServidor($registro['ref_cod_servidor']);
  167 + $det_ref_cod_servidor = $obj_ref_cod_servidor->detalhe();
  168 +
  169 + $registro['ref_cod_servidor'] = $det_ref_cod_servidor['cod_servidor'];
  170 + }
  171 + else {
  172 + $registro['ref_cod_servidor'] = 'Erro na geracao';
  173 + }
  174 +
  175 + if ($registro['tipo'] == 'C') {
  176 + $registro['tipo'] = 'Curso';
  177 + }
  178 + elseif ($registro['tipo'] == 'T') {
  179 + $registro['tipo'] = 'Título';
  180 + }
  181 + else {
  182 + $registro['tipo'] = 'Concurso';
  183 + }
  184 +
  185 + $this->addLinhas(array(
  186 + "<a href=\"educar_servidor_formacao_det.php?cod_formacao={$registro["cod_formacao"]}\">{$registro["nm_formacao"]}</a>",
  187 + "<a href=\"educar_servidor_formacao_det.php?cod_formacao={$registro["cod_formacao"]}\">{$registro["tipo"]}</a>"
  188 + ));
  189 +
  190 + $this->tipo = '';
  191 + }
  192 + }
  193 +
  194 + $this->addPaginador2( "educar_servidor_formacao_lst.php", $total, $_GET, $this->nome, $this->limite );
  195 + $obj_permissoes = new clsPermissoes();
  196 +
  197 + if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 3)) {
  198 + $this->array_botao[] = "Novo";
  199 + $this->array_botao_url[] = "educar_servidor_formacao_cad.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}";
  200 + }
  201 +
  202 + $this->array_botao[] = 'Voltar';
  203 + $this->array_botao_url[] = "educar_servidor_det.php?cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}";
  204 +
  205 + $this->largura = '100%';
  206 + }
200 207 }
201   -// cria uma extensao da classe base
  208 +
  209 +// Instancia objeto de página
202 210 $pagina = new clsIndexBase();
203   -// cria o conteudo
  211 +
  212 +// Instancia objeto de conteúdo
204 213 $miolo = new indice();
205   -// adiciona o conteudo na clsBase
206   -$pagina->addForm( $miolo );
207   -// gera o html
208   -$pagina->MakeAll();
209   -?>
210 214 \ No newline at end of file
  215 +
  216 +// Atribui o conteúdo à  página
  217 +$pagina->addForm($miolo);
  218 +
  219 +// Gera o código HTML
  220 +$pagina->MakeAll();
211 221 \ No newline at end of file
... ...