function Gerar()
 {
     session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->ref_cod_servidor = $_GET['ref_cod_servidor'];
     $this->ref_ref_cod_instituicao = $_GET['ref_cod_instituicao'];
     $this->titulo = 'Faltas e atrasos - Listagem';
     foreach ($_GET as $var => $val) {
         $this->{$var} = $val === '' ? NULL : $val;
     }
     $this->addCabecalhos(array('Escola', 'Instituição', 'Tipo', 'Horas', 'Minutos'));
     // Filtros de Foreign Keys
     $obrigatorio = FALSE;
     $get_instituicao = TRUE;
     $get_escola = TRUE;
     include_once 'include/pmieducar/educar_campo_lista.php';
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_falta_atraso = new clsPmieducarFaltaAtraso(NULL, $this->ref_cod_escola, $this->ref_ref_cod_instituicao, NULL, NULL, $this->ref_cod_servidor);
     $obj_falta_atraso->setOrderby('tipo ASC');
     $obj_falta_atraso->setLimite($this->limite, $this->offset);
     // Recupera a lista de faltas/atrasos
     $lista = $obj_falta_atraso->lista(NULL, NULL, NULL, NULL, NULL, $this->ref_cod_servidor);
     $total = $obj_falta_atraso->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // Recupera o nome da escola
             $obj_ref_cod_escola = new clsPmieducarEscola($registro['ref_cod_escola']);
             $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
             $registro['nm_escola'] = $det_ref_cod_escola['nome'];
             $obj_ins = new clsPmieducarInstituicao($registro['ref_ref_cod_instituicao']);
             $det_ins = $obj_ins->detalhe();
             $obj_comp = new clsPmieducarFaltaAtrasoCompensado();
             $horas = $obj_comp->ServidorHorasCompensadas($this->ref_cod_servidor, $registro['ref_cod_escola'], $registro['ref_ref_cod_instituicao']);
             if ($horas) {
                 $horas_aux = $horas['hora'];
                 $minutos_aux = $horas['min'];
             }
             $horas_aux = $horas_aux - $registro['qtd_horas'];
             $minutos_aux = $minutos_aux - $registro['qtd_min'];
             if ($horas_aux > 0 && $minutos_aux < 0) {
                 $horas_aux--;
                 $minutos_aux += 60;
             }
             if ($horas_aux < 0 && $minutos_aux > 0) {
                 $horas_aux--;
                 $minutos_aux -= 60;
             }
             if ($horas_aux < 0) {
                 $horas_aux = '(' . $horas_aux * -1 . ')';
             }
             if ($minutos_aux < 0) {
                 $minutos_aux = '(' . $minutos_aux * -1 . ')';
             }
             $tipo = $registro['tipo'] == 1 ? 'Atraso' : 'Falta';
             $urlHelper = CoreExt_View_Helper_UrlHelper::getInstance();
             $url = 'educar_falta_atraso_det.php';
             $options = array('query' => array('cod_falta_atraso' => $registro['cod_falta_atraso'], 'ref_cod_servidor' => $registro['ref_cod_servidor'], 'ref_cod_escola' => $registro['ref_cod_escola'], 'ref_cod_instituicao' => $registro['ref_ref_cod_instituicao']));
             $this->addLinhas(array($urlHelper->l($registro['nm_escola'], $url, $options), $urlHelper->l($det_ins['nm_instituicao'], $url, $options), $urlHelper->l($tipo, $url, $options), $urlHelper->l($horas_aux, $url, $options), $urlHelper->l($minutos_aux, $url, $options)));
         }
     }
     $this->addPaginador2('educar_falta_atraso_lst.php', $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) {
         $this->array_botao[] = 'Novo';
         $this->array_botao_url[] = sprintf('educar_falta_atraso_cad.php?ref_cod_servidor=%d&ref_cod_instituicao=%d', $this->ref_cod_servidor, $this->ref_ref_cod_instituicao);
     }
     $this->array_botao[] = 'Voltar';
     $this->array_botao_url[] = sprintf('educar_servidor_det.php?cod_servidor=%d&ref_cod_instituicao=%d', $this->ref_cod_servidor, $this->ref_cod_instituicao);
     $this->largura = '100%';
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de faltas/atrasos do servidor"));
     $this->enviaLocalizacao($localizacao->montar());
 }
Ejemplo n.º 2
0
 * @since     Arquivo disponível desde a versão 1.1.0
 * @version   $Id$
 */
require_once '../includes/bootstrap.php';
require_once 'include/clsBanco.inc.php';
require_once 'App/Model/IedFinder.php';
require_once 'CoreExt/View/Helper/UrlHelper.php';
require_once 'CoreExt/Controller/Request.php';
require_once 'CoreExt/Controller/Front.php';
require_once 'CoreExt/DataMapper.php';
require_once 'modules/Error/Mailers/NotificationMailer.php';
try {
    // Objeto de requisição
    $request = new CoreExt_Controller_Request();
    // Helper de URL. Auxilia para criar uma URL no formato http://www.example.org/module
    $url = CoreExt_View_Helper_UrlHelper::getInstance();
    $url = $url->url($request->get('REQUEST_URI'), array('components' => CoreExt_View_Helper_UrlHelper::URL_HOST));
    // Configura o baseurl da request
    $request->setBaseurl(sprintf('%s/module', $url));
    // Configura o DataMapper para usar uma instância de clsBanco com fetch de resultados
    // usando o tipo FETCH_ASSOC
    CoreExt_DataMapper::setDefaultDbAdapter(new clsBanco(array('fetchMode' => clsBanco::FETCH_ASSOC)));
    // Inicia o Front Controller
    $frontController = CoreExt_Controller_Front::getInstance();
    $frontController->setRequest($request);
    // Configura o caminho aonde os módulos estão instalados
    $frontController->setOptions(array('basepath' => PROJECT_ROOT . DS . 'modules'));
    $frontController->dispatch();
    // Resultado
    print $frontController->getViewContents();
} catch (Exception $e) {
Ejemplo n.º 3
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Servidor - Listagem';
     // passa todos os valores obtidos no GET para atributos do objeto
     foreach ($_GET as $var => $val) {
         $this->{$var} = $val === '' ? NULL : $val;
     }
     $this->addCabecalhos(array('Nome do Servidor', 'Matrícula', 'Instituição'));
     $get_escola = TRUE;
     $obrigatorio = TRUE;
     $exibe_nm_escola = TRUE;
     include 'include/pmieducar/educar_campo_lista.php';
     $opcoes = array('' => 'Pesquise o funcionario clicando na lupa ao lado');
     if ($this->cod_servidor) {
         $objTemp = new clsFuncionario($this->cod_servidor);
         $detalhe = $objTemp->detalhe();
         $detalhe = $detalhe['idpes']->detalhe();
         $opcoes[$detalhe['idpes']] = $detalhe['nome'];
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect('cod_servidor', 'ref_cod_pessoa_fj', 'nome');
     $this->campoListaPesq('cod_servidor', 'Servidor', $opcoes, $this->cod_servidor, 'pesquisa_funcionario_lst.php', '', FALSE, '', '', NULL, NULL, '', FALSE, $parametros->serializaCampos() . '&com_matricula=false', TRUE);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_servidor = new clsPmieducarServidor();
     $obj_servidor->setOrderby('carga_horaria ASC');
     $obj_servidor->setLimite($this->limite, $this->offset);
     $lista = $obj_servidor->lista($this->cod_servidor, $this->ref_cod_deficiencia, $this->ref_idesco, $this->carga_horaria, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao, NULL, NULL, NULL, NULL, NULL, NULL, TRUE, NULL, NULL, NULL, NULL, !isset($_GET['busca']) ? $this->ref_cod_escola : NULL, NULL, NULL, NULL, NULL, !isset($_GET['busca']) ? 1 : NULL);
     $total = $obj_servidor->_total;
     // UrlHelper
     $url = CoreExt_View_Helper_UrlHelper::getInstance();
     // Monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // Pega detalhes de foreign_keys
             if (class_exists('clsPmieducarInstituicao')) {
                 $obj_ref_cod_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']);
                 $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
                 $registro['ref_cod_instituicao'] = $det_ref_cod_instituicao['nm_instituicao'];
             } else {
                 $registro['ref_cod_instituicao'] = 'Erro na geração';
             }
             if (class_exists('clsFuncionario')) {
                 $obj_cod_servidor = new clsFuncionario($registro['cod_servidor']);
                 $det_cod_servidor = $obj_cod_servidor->detalhe();
                 $registro['matricula'] = $det_cod_servidor['matricula'];
                 $det_cod_servidor = $det_cod_servidor['idpes']->detalhe();
                 $registro['nome'] = $det_cod_servidor['nome'];
             } else {
                 $registro['cod_servidor'] = 'Erro na geracao';
             }
             $path = 'educar_servidor_det.php';
             $options = array('query' => array('cod_servidor' => $registro['cod_servidor'], 'ref_cod_instituicao' => $det_ref_cod_instituicao['cod_instituicao']));
             $this->addLinhas(array($url->l($registro['nome'], $path, $options), $url->l($registro['matricula'], $path, $options), $url->l($registro['ref_cod_instituicao'], $path, $options)));
         }
     }
     $this->addPaginador2('educar_servidor_lst.php', $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) {
         $this->acao = 'go("educar_servidor_cad.php")';
         $this->nome_acao = 'Novo';
     }
     $this->largura = '100%';
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de servidores"));
     $this->enviaLocalizacao($localizacao->montar());
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Faltas/Notas Aluno - Listagem";
     // Passa todos os valores obtidos no GET para atributos do objeto
     foreach ($_GET as $var => $val) {
         $this->{$var} = $val === '' ? NULL : $val;
     }
     $lista_busca = array('Aluno', 'Matrícula', 'Turma', 'Série', 'Curso');
     $obj_permissao = new clsPermissoes();
     $nivel_usuario = $obj_permissao->nivel_acesso($this->pessoa_logada);
     if ($nivel_usuario == 1) {
         $lista_busca[] = 'Escola';
         $lista_busca[] = 'Institui&ccedil;&atilde;o';
     } else {
         if ($nivel_usuario == 2) {
             $lista_busca[] = 'Escola';
         }
     }
     $this->addCabecalhos($lista_busca);
     $this->campoTexto('nm_aluno', 'Aluno', $this->nm_aluno, 30, 255, FALSE, FALSE, FALSE, '', "<img border=\"0\" onclick=\"pesquisa_aluno();\" id=\"ref_cod_aluno_lupa\" name=\"ref_cod_aluno_lupa\" src=\"imagens/lupa.png\"\\/>", '', '', TRUE);
     $this->campoOculto('ref_cod_aluno', $this->ref_cod_aluno);
     $get_escola = TRUE;
     $get_curso = TRUE;
     $sem_padrao = TRUE;
     $get_escola_curso_serie = TRUE;
     $get_turma = TRUE;
     include 'include/pmieducar/educar_campo_lista.php';
     if ($this->ref_cod_escola) {
         $this->ref_ref_cod_escola = $this->ref_cod_escola;
     }
     $opcoes = array('' => 'Selecione', 1 => 'Aprovado', 2 => 'Reprovado', 3 => 'Em Andamento');
     $this->campoLista('aprovado', 'Situa&ccedil;&atilde;o', $opcoes, $this->aprovado, '', '', '', '', FALSE, FALSE);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_nota_aluno = new clsPmieducarMatriculaTurma();
     $obj_nota_aluno->setOrderby('ref_cod_matricula ASC');
     $obj_nota_aluno->setLimite($this->limite, $this->offset);
     $aparece = TRUE;
     $lista = $obj_nota_aluno->lista($this->ref_cod_matricula, $this->ref_cod_turma, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_ref_cod_serie, $this->ref_cod_curso, $this->ref_ref_cod_escola, $this->ref_cod_instituicao, $this->ref_cod_aluno, NULL, $this->aprovado, NULL, NULL, NULL, TRUE, FALSE, NULL, 1, TRUE, TRUE, NULL, NULL, NULL, NULL, $aparece);
     $total = $obj_nota_aluno->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         $ref_cod_serie = '';
         $nm_serie = '';
         $ref_cod_escola = '';
         $nm_escola = '';
         foreach ($lista as $registro) {
             if ($registro['ref_ref_cod_serie'] != '' && $ref_cod_serie != $registro['ref_ref_cod_serie']) {
                 $obj_ref_cod_serie = new clsPmieducarSerie($registro['ref_ref_cod_serie']);
                 $det_ref_cod_serie = $obj_ref_cod_serie->detalhe();
                 $ref_cod_serie = $registro['ref_ref_cod_serie'];
                 $nm_serie = $det_ref_cod_serie['nm_serie'];
             } elseif ($registro['ref_ref_cod_serie'] == '') {
                 $ref_cod_serie = '';
                 $nm_serie = '';
             }
             if ($registro['ref_ref_cod_escola'] != '' && $ref_cod_escola != $registro['ref_ref_cod_escola']) {
                 $obj_ref_cod_escola = new clsPmieducarEscola($registro['ref_ref_cod_escola']);
                 $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
                 $ref_cod_escola = $registro['ref_ref_cod_escola'];
                 $nm_escola = $det_ref_cod_escola['nome'];
             } elseif ($registro['ref_ref_cod_escola'] == '') {
                 $ref_cod_escola = '';
                 $nm_escola = '';
             }
             // Itens a mostrar na listagem de alunos
             $lista_busca = array();
             // Variáveis para a geração do link
             $path = '/module/Avaliacao/boletim';
             $params = array('query' => array('matricula' => $registro['ref_cod_matricula']));
             // Instância de UrlHelper
             $url = CoreExt_View_Helper_UrlHelper::getInstance();
             $lista_busca[] = $url->l($registro['nome'], $path, $params);
             $lista_busca[] = $url->l($registro['ref_cod_matricula'], $path, $params);
             $lista_busca[] = $url->l($registro['nm_turma'], $path, $params);
             $lista_busca[] = $url->l($registro['ref_ref_cod_serie'] ? $registro['ref_ref_cod_serie'] : '', $path, $params);
             $lista_busca[] = $url->l($registro['nm_curso'], $path, $params);
             if ($nivel_usuario == 1) {
                 $lista_busca[] = $url->l($registro['ref_ref_cod_escola'] ? $nm_escola : '-', $path, $params);
                 $lista_busca[] = $url->l($registro['nm_instituicao'], $path, $params);
             } elseif ($nivel_usuario == 2) {
                 $lista_busca[] = $url->l($registro['ref_ref_cod_escola'] ? $registro['ref_ref_cod_escola'] : '-', $path, $params);
             }
             $this->addLinhas($lista_busca);
         }
     }
     $this->addPaginador2('educar_falta_nota_aluno_lst.php', $total, $_GET, $this->nome, $this->limite);
     $this->largura = '100%';
 }
Ejemplo n.º 5
0
 /**
  * @see clsCadastro#Gerar()
  */
 public function Gerar()
 {
     // Dados da matrícula
     $matricula = $this->_service->getOption('matriculaData');
     // Nome do aluno
     $nome = $matricula['nome'];
     // Nome da escola
     $escola = new clsPmieducarEscola($matricula['ref_ref_cod_escola']);
     $escola = $escola->detalhe();
     $escola = ucwords(strtolower($escola['nome']));
     // Nome do curso
     $curso = $matricula['curso_nome'];
     // Nome da série
     $serie = $matricula['serie_nome'];
     // Nome da turma
     $turma = $matricula['turma_nome'];
     // Situação da matrícula
     $situacao = App_Model_MatriculaSituacao::getInstance();
     $situacao = $situacao->getValue($matricula['aprovado']);
     // Dados da matrícula
     $this->addDetalhe(array('Aluno', $nome));
     $this->addDetalhe(array('Escola', $escola));
     $this->addDetalhe(array('Curso', $curso));
     $this->addDetalhe(array('Série/Turma', $serie . ' / ' . $turma));
     $this->addDetalhe(array('Situação', $situacao));
     // Booleano para saber se o tipo de nota é nenhum.
     $nenhumaNota = $this->_service->getRegra()->get('tipoNota') == RegraAvaliacao_Model_Nota_TipoValor::NENHUM;
     // Booleano para saber o tipo de presença em que ocorre apuração
     $porComponente = $this->_service->getRegra()->get('tipoPresenca') == RegraAvaliacao_Model_TipoPresenca::POR_COMPONENTE;
     // Dados da regra de avaliação
     $this->addDetalhe(array('Regra avaliação', $this->_service->getRegra()));
     $this->addDetalhe(array('Apuração de falta', $this->_service->getRegra()->tipoPresenca));
     $this->addDetalhe(array('Parecer descritivo', $this->_service->getRegra()->parecerDescritivo));
     $this->addDetalhe(array('Progressão', $this->_service->getRegra()->tipoProgressao));
     if ($nenhumaNota) {
         $media = 'Não usa nota';
     } else {
         $media = $this->_service->getRegra()->media;
     }
     $this->addDetalhe(array('Média', $media));
     // Cria um array com a quantidade de etapas de 1 a n
     $etapas = range(1, $this->_service->getOption('etapas'), 1);
     // Atributos para a tabela
     $attributes = array('style' => 'background-color: #A1B3BD; padding: 5px; text-align: center');
     // Atributos para a tabela de notas/faltas
     $zebra = array(0 => array('style' => 'background-color: #E4E9ED'), 1 => array('style' => 'background-color: #FFFFFF'));
     // Helper para criar links e urls
     $url = CoreExt_View_Helper_UrlHelper::getInstance();
     // Usa helper de tabela para criar a tabela de notas/faltas
     $table = CoreExt_View_Helper_TableHelper::getInstance();
     // Enum para situação de matrícula
     $situacao = App_Model_MatriculaSituacao::getInstance();
     // Situação do boletim do aluno
     $sit = $this->_situacao;
     // Títulos da tabela
     $labels = array();
     $labels[] = array('data' => 'Disciplinas', 'attributes' => $attributes);
     foreach ($etapas as $etapa) {
         $data = array('data' => sprintf('Etapa %d', $etapa));
         if ($nenhumaNota) {
             $data['colspan'] = 1;
         } else {
             $data['colspan'] = $porComponente ? 2 : 1;
         }
         $data['attributes'] = $attributes;
         $labels[] = $data;
     }
     // Flag para auxiliar na composição da tabela em casos onde o parecer
     // descritivo é lançado anualmente e por componente
     $parecerComponenteAnual = FALSE;
     $colspan = 0;
     if ($this->_service->getRegra()->get('parecerDescritivo') == RegraAvaliacao_Model_TipoParecerDescritivo::ANUAL_COMPONENTE) {
         if (TRUE == $this->_componenteEncerrado($sit->nota->componentesCurriculares)) {
             $parecerComponenteAnual = TRUE;
             $colspan++;
         }
     }
     // Colspan para tabela com labels e sublabels
     $colspan += $porComponente && $sit->recuperacao ? 4 : 3;
     if ($nenhumaNota) {
         $colspan--;
     }
     if (!$nenhumaNota) {
         $labels[] = array('data' => $porComponente ? '' : 'Média', 'attributes' => $attributes, 'colspan' => $porComponente ? $colspan : 1);
     }
     // Inclui coluna para % de presença geral.
     if (!$porComponente) {
         if ($sit->recuperacao) {
             $labels[] = array('data' => 'Exame', 'attributes' => $attributes);
         }
         if ($parecerComponenteAnual) {
             $labels[] = array('data' => 'Parecer', 'attributes' => $attributes);
         }
         $labels[] = array('data' => 'Presença', 'attributes' => $attributes);
         $labels[] = array('data' => 'Situação', 'attributes' => $attributes);
     }
     $table->addHeaderRow($labels);
     // Cria sub-header caso tenha faltas lançadas por componentes
     if ($porComponente) {
         $subLabels = array();
         $subLabels[] = array('attributes' => $attributes);
         for ($i = 0, $loop = count($etapas); $i < $loop; $i++) {
             if (!$nenhumaNota) {
                 $subLabels[] = array('data' => 'Nota', 'attributes' => $attributes);
             }
             $subLabels[] = array('data' => 'Falta', 'attributes' => $attributes);
         }
         if (!$nenhumaNota) {
             $subLabels[] = array('data' => 'Média', 'attributes' => $attributes);
         }
         if ($sit->recuperacao) {
             $subLabels[] = array('data' => 'Exame', 'attributes' => $attributes);
         }
         if ($porComponente) {
             if ($parecerComponenteAnual) {
                 $subLabels[] = array('data' => 'Parecer', 'attributes' => $attributes);
             }
             $subLabels[] = array('data' => 'Presença', 'attributes' => $attributes);
             $subLabels[] = array('data' => 'Situação', 'attributes' => $attributes);
         }
         $table->addHeaderRow($subLabels);
     }
     // Atributos usados pelos itens de dados
     $attributes = array('style' => 'padding: 5px; text-align: center');
     // Notas
     $componentes = $this->_service->getComponentes();
     $notasComponentes = $this->_service->getNotasComponentes();
     $mediasSituacoes = $this->_situacao->nota;
     $mediasComponentes = $this->_service->getMediasComponentes();
     $faltasComponentes = $this->_service->getFaltasComponentes();
     // Calcula as porcentagens de presença
     $faltasStats = $this->_service->getSituacaoFaltas();
     // Texto do link
     if ($nenhumaNota) {
         $linkText = 'falta';
         $linkPath = 'falta';
     } else {
         $linkText = $porComponente ? 'nota/falta' : 'nota';
         $linkPath = 'nota';
     }
     // Parâmetros para o link de nota/falta nova
     $newLink = array('text' => 'Lançar ' . $linkText, 'path' => $linkPath, 'query' => array('matricula' => $matricula['cod_matricula'], 'componenteCurricular' => 0));
     $iteration = 0;
     foreach ($componentes as $id => $componente) {
         $data = array();
         // Nome do componente curricular
         $data[] = array('data' => $componente, 'attributes' => array('style' => 'padding: 5px; text-align: left'));
         $notas = $notasComponentes[$id];
         $mediaSituacao = $mediasSituacoes->componentesCurriculares[$id];
         $medias = $mediasComponentes[$id];
         $faltas = $faltasComponentes[$id];
         $faltaStats = $faltasStats->componentesCurriculares[$id];
         $parecer = NULL;
         // Caso os pareceres sejam por componente e anuais, recupera a instância
         if ($parecerComponenteAnual) {
             $parecer = $this->_service->getPareceresComponentes();
             $parecer = $parecer[$id];
         }
         if ($porComponente == TRUE) {
             $new = $url->l('Lançar nota', 'nota', array('query' => array('matricula' => $matricula['cod_matricula'], 'componenteCurricular' => $id)));
         }
         $newLink['query']['componenteCurricular'] = $id;
         $new = $url->l($newLink['text'], $newLink['path'], array('query' => $newLink['query']));
         $update = array('query' => array('matricula' => $matricula['cod_matricula'], 'componenteCurricular' => $id, 'etapa' => 0));
         // Lista as notas do componente por etapa
         for ($i = 0, $loop = count($etapas); $i < $loop; $i++) {
             $nota = $falta = NULL;
             if (isset($notas[$i])) {
                 $update['query']['etapa'] = $notas[$i]->etapa;
                 $nota = $url->l($notas[$i]->notaArredondada, 'nota', $update);
             }
             if (isset($faltas[$i])) {
                 $update['query']['etapa'] = $faltas[$i]->etapa;
                 $linkPath = $nenhumaNota ? 'falta' : 'nota';
                 $falta = $url->l($faltas[$i]->quantidade, $linkPath, $update);
             }
             /*
              * Exibição muito dinâmica. Em resumo, os casos são:
              *
              * 1. nota & falta componente
              * 2. nota
              * 3. falta componente
              * 4. falta geral
              */
             if ($nenhumaNota) {
                 $colspan = 1;
             } elseif (!$nenhumaNota && $porComponente && is_null($falta)) {
                 $colspan = 2;
             } else {
                 $colspan = 1;
             }
             // Caso 1.
             if (!$nenhumaNota) {
                 if ($nota) {
                     // Caso 2: resolvido com colspan.
                     $data[] = array('data' => $nota, 'attributes' => $attributes, 'colspan' => $colspan);
                     if ($porComponente) {
                         $data[] = array('data' => $falta, 'attributes' => $attributes);
                     }
                 } else {
                     $data[] = array('data' => $new, 'attributes' => $attributes, 'colspan' => $colspan);
                     $new = '';
                 }
             } elseif ($nenhumaNota && $porComponente) {
                 if ($falta) {
                     $data[] = array('data' => $falta, 'attributes' => $attributes, 'colspan' => $colspan);
                 } else {
                     $data[] = array('data' => $new, 'attributes' => $attributes, 'colspan' => $colspan);
                     $new = '';
                 }
             } else {
                 $data[] = array('data' => '', 'attributes' => $attributes);
             }
         }
         // Média no componente curricular
         if (!$nenhumaNota) {
             $media = $medias[0]->mediaArredondada . ($medias[0]->etapa == 'Rc' ? ' (Rc)' : '');
             $data[] = array('data' => $media, 'attributes' => $attributes);
         }
         // Adiciona uma coluna extra caso aluno esteja em exame em alguma componente curricular
         if ($sit->recuperacao) {
             if ($mediaSituacao->situacao == App_Model_MatriculaSituacao::EM_EXAME || $mediaSituacao->situacao == App_Model_MatriculaSituacao::APROVADO_APOS_EXAME || $mediaSituacao->situacao == App_Model_MatriculaSituacao::REPROVADO) {
                 $link = $newLink;
                 $link['query']['componenteCurricular'] = $id;
                 $link['query']['etapa'] = 'Rc';
                 $notaRec = $i;
                 if (isset($notas[$notaRec]) && $notas[$notaRec]->etapa == 'Rc') {
                     $link['text'] = $notas[$notaRec]->notaArredondada;
                 }
                 $recuperacaoLink = $url->l($link['text'], $link['path'], array('query' => $link['query']));
                 $data[] = array('data' => $recuperacaoLink, 'attributes' => $attributes);
             } else {
                 $data[] = array('data' => '', 'attributes' => $attributes);
             }
         }
         // Adiciona uma coluna extra caso o parecer seja por componente ao final do ano
         if ($parecerComponenteAnual) {
             $link = array('text' => '', 'path' => 'parecer', 'query' => array('matricula' => $this->getRequest()->matricula));
             if (0 == count($parecer)) {
                 $text = 'Lançar';
             } else {
                 $text = 'Editar';
             }
             $link['query']['componenteCurricular'] = $id;
             // @todo Constante ou CoreExt_Enum
             $link['query']['etapa'] = 'An';
             $link = $url->l($text, $link['path'], array('query' => $link['query']));
             if (isset($mediaSituacao->situacao) && $mediaSituacao->situacao != App_Model_MatriculaSituacao::EM_ANDAMENTO) {
                 $data[] = array('data' => $link, 'attributes' => $attributes);
             } else {
                 $data[] = array('data' => '', 'attributes' => $attributes);
             }
         }
         // Informações extras como porcentagem de presença e situação do aluno
         if ($porComponente) {
             $data[] = array('data' => sprintf('%.2f%%', $faltaStats->porcentagemPresenca), 'attributes' => $attributes);
         } else {
             $data[] = array('data' => '', 'attributes' => $attributes);
         }
         $data[] = array('data' => $situacao->getValue($mediaSituacao->situacao), 'attributes' => $attributes);
         $iteration++;
         $class = $iteration % 2;
         $table->addBodyRow($data, $zebra[$class]);
     }
     $newLink = array('text' => 'Lançar falta', 'path' => 'falta', 'query' => array('matricula' => $matricula['cod_matricula']));
     // Situação geral das faltas
     $data = array(0 => array('data' => 'Faltas', 'attributes' => array('style' => 'padding: 5px; text-align: left')));
     $faltas = $this->_service->getFaltasGerais();
     $new = $url->l($newLink['text'], $newLink['path'], array('query' => $newLink['query']));
     // Listas faltas (para faltas no geral)
     for ($i = 1, $loop = count($etapas); $i <= $loop; $i++) {
         if (isset($faltas[$i])) {
             $link = $newLink;
             $link['query']['etapa'] = $faltas[$i]->etapa;
             $link = $porComponente ? '' : $url->l($faltas[$i]->quantidade, $link['path'], array('query' => $link['query']));
             $data[] = array('data' => $link, 'attributes' => $attributes);
             if ($porComponente) {
                 $data[] = array('data' => '', 'attributes' => $attributes);
             }
         } else {
             $new = $porComponente ? '' : $new;
             $data[] = array('data' => $new, 'attributes' => $attributes);
             $new = '';
             if ($porComponente && !$nenhumaNota) {
                 $data[] = array('data' => '', 'attributes' => $attributes);
             }
         }
     }
     if (!$nenhumaNota) {
         $data[] = array();
     }
     if ($sit->recuperacao) {
         $data[] = array('data' => '', 'attributes' => $attributes);
     }
     if ($parecerComponenteAnual) {
         $data[] = array('data' => '', 'attributes' => $attributes);
     }
     // Porcentagem presença
     $data[] = array('data' => sprintf('%.2f%%', $faltasStats->porcentagemPresenca), 'attributes' => $attributes);
     $data[] = array('data' => $situacao->getValue($sit->falta->situacao), 'attributes' => $attributes);
     $table->addFooterRow($data, $zebra[$class ^ 1]);
     // Adiciona linha com links para lançamento de parecer descritivo geral por etapa
     if ($this->_service->getRegra()->get('parecerDescritivo') == RegraAvaliacao_Model_TipoParecerDescritivo::ETAPA_GERAL) {
         $newLink = array('text' => 'Lançar parecer', 'path' => 'parecer', 'query' => array('matricula' => $matricula['cod_matricula']));
         $data = array(0 => array('data' => 'Pareceres', 'attributes' => array('style' => 'padding: 5px; text-align: left')));
         $pareceres = $this->_service->getPareceresGerais();
         for ($i = 1, $loop = count($etapas); $i <= $loop; $i++) {
             if (isset($pareceres[$i])) {
                 $link = $newLink;
                 $link['text'] = 'Editar parecer';
                 $link['query']['etapa'] = $i;
                 $data[] = array('data' => $url->l($link['text'], $link['path'], array('query' => $link['query'])), 'attributes' => $attributes);
             } else {
                 if ('' == $newLink) {
                     $link = '';
                 } else {
                     $link = $url->l($newLink['text'], $newLink['path'], array('query' => $newLink['query']));
                 }
                 $data[] = array('data' => $link, 'attributes' => $attributes);
                 $newLink = '';
             }
         }
         if ($sit->recuperacao) {
             $data[] = array('data' => '', 'attributes' => $attributes);
         }
         $data[] = array('data' => '', 'attributes' => $attributes);
         $data[] = array('data' => '', 'attributes' => $attributes);
         $table->addFooterRow($data);
     }
     // Adiciona tabela na página
     $this->addDetalhe(array('Disciplinas', '<div id="disciplinas">' . $table . '</div>'));
     // Adiciona link para lançamento de parecer descritivo anual geral
     if (FALSE == $sit->andamento && $this->_service->getRegra()->get('parecerDescritivo') == RegraAvaliacao_Model_TipoParecerDescritivo::ANUAL_GERAL) {
         if (0 == count($this->_service->getPareceresGerais())) {
             $label = 'Lançar';
         } else {
             $label = 'Editar';
         }
         $link = array('text' => $label . ' parecer descritivo do aluno', 'path' => 'parecer', 'query' => array('matricula' => $this->getRequest()->matricula));
         $this->addDetalhe(array('Parecer descritivo anual', $url->l($link['text'], $link['path'], array('query' => $link['query']))));
     }
     // Caso o tipo de progressão seja manual, a situação das notas/faltas não
     // esteja mais em "andamento" e a matrícula esteja em andamento, exibe
     // botões de ação
     if ($this->_service->getRegra()->get('tipoProgressao') == RegraAvaliacao_Model_TipoProgressao::NAO_CONTINUADA_MANUAL && FALSE == $sit->andamento && $matricula['aprovado'] == App_Model_MatriculaSituacao::EM_ANDAMENTO) {
         $link = array('text' => 'sim', 'path' => 'boletim', 'query' => array('matricula' => $this->getRequest()->matricula, 'promove' => 1));
         $sim = '<span class="confirm yes">' . $url->l($link['text'], $link['path'], array('query' => $link['query'])) . '</span>';
         $link['text'] = 'não (retém o aluno)';
         $link['query']['promove'] = 0;
         $nao = '<span class="confirm no">' . $url->l($link['text'], $link['path'], array('query' => $link['query'])) . '</span>';
         $links = '<div style="padding: 5px 0 5px 0">' . $sim . $nao . '</div>';
         $this->addDetalhe(array('Promover aluno?', $links));
     }
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     // Helper para url
     $urlHelper = CoreExt_View_Helper_UrlHelper::getInstance();
     $this->titulo = 'Dispensa Componente Curricular - Listagem';
     // passa todos os valores obtidos no GET para atributos do objeto
     foreach ($_GET as $var => $val) {
         $this->{$var} = $val === '' ? NULL : $val;
     }
     if (!$_GET['ref_cod_matricula']) {
         header('Location: educar_matricula_lst.php');
         die;
     }
     $this->ref_cod_matricula = $_GET['ref_cod_matricula'];
     $obj_matricula = new clsPmieducarMatricula();
     $lst_matricula = $obj_matricula->lista($this->ref_cod_matricula);
     if (is_array($lst_matricula)) {
         $det_matricula = array_shift($lst_matricula);
         $this->ref_cod_instituicao = $det_matricula['ref_cod_instituicao'];
         $this->ref_cod_escola = $det_matricula['ref_ref_cod_escola'];
         $this->ref_cod_serie = $det_matricula['ref_ref_cod_serie'];
         $obj_matricula_turma = new clsPmieducarMatriculaTurma();
         $lst_matricula_turma = $obj_matricula_turma->lista($this->ref_cod_matricula, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie, NULL, $this->ref_cod_escola);
         if (is_array($lst_matricula_turma)) {
             $det = array_shift($lst_matricula_turma);
             $this->ref_cod_turma = $det['ref_cod_turma'];
             $this->ref_sequencial = $det['sequencial'];
         }
     }
     $this->campoOculto('ref_cod_turma', $this->ref_cod_turma);
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $this->addCabecalhos(array('Disciplina', 'Tipo Dispensa', 'Data Dispensa'));
     // Filtros de Foreign Keys
     $opcoes = array('' => 'Selecione');
     $objTemp = new clsPmieducarTipoDispensa();
     if ($this->ref_cod_instituicao) {
         $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);
     } else {
         $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     }
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $opcoes[$registro['cod_tipo_dispensa']] = $registro['nm_tipo'];
         }
     }
     $this->campoLista('ref_cod_tipo_dispensa', 'Motivo', $opcoes, $this->ref_cod_tipo_dispensa, '', FALSE, '', '', FALSE, FALSE);
     $this->campoOculto('ref_cod_matricula', $this->ref_cod_matricula);
     // outros Filtros
     $opcoes = array('' => 'Selecione');
     // Escola série disciplina
     $componentes = App_Model_IedFinder::getComponentesTurma($this->ref_cod_serie, $this->ref_cod_escola, $this->ref_cod_turma);
     foreach ($componentes as $componente) {
         $opcoes[$componente->id] = $componente->nome;
     }
     $this->campoLista('ref_cod_disciplina', 'Disciplina', $opcoes, $this->ref_cod_disciplina, '', FALSE, '', '', FALSE, FALSE);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_dispensa_disciplina = new clsPmieducarDispensaDisciplina();
     $obj_dispensa_disciplina->setOrderby('data_cadastro ASC');
     $obj_dispensa_disciplina->setLimite($this->limite, $this->offset);
     $lista = $obj_dispensa_disciplina->lista($this->ref_cod_matricula, NULL, NULL, $this->ref_cod_disciplina, NULL, NULL, $this->ref_cod_tipo_dispensa, NULL, NULL, NULL, NULL, 1);
     $total = $obj_dispensa_disciplina->_total;
     // Mapper de componente curricular
     $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
     // 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', $registro['data_cadastro_time']);
             // Tipo da dispensa
             $obj_ref_cod_tipo_dispensa = new clsPmieducarTipoDispensa($registro['ref_cod_tipo_dispensa']);
             $det_ref_cod_tipo_dispensa = $obj_ref_cod_tipo_dispensa->detalhe();
             $registro['ref_cod_tipo_dispensa'] = $det_ref_cod_tipo_dispensa['nm_tipo'];
             // Componente curricular
             $componente = $componenteMapper->find($registro['ref_cod_disciplina']);
             // Dados para a url
             $url = 'educar_dispensa_disciplina_det.php';
             $options = array('query' => array('ref_cod_matricula' => $registro['ref_cod_matricula'], 'ref_cod_serie' => $registro['ref_cod_serie'], 'ref_cod_escola' => $registro['ref_cod_escola'], 'ref_cod_disciplina' => $registro['ref_cod_disciplina']));
             $this->addLinhas(array($urlHelper->l($componente->nome, $url, $options), $urlHelper->l($registro['ref_cod_tipo_dispensa'], $url, $options), $urlHelper->l($registro['data_cadastro_br'], $url, $options)));
         }
     }
     $this->addPaginador2('educar_dispensa_disciplina_lst.php', $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(578, $this->pessoa_logada, 7)) {
         $this->array_botao_url[] = 'educar_dispensa_disciplina_cad.php?ref_cod_matricula=' . $this->ref_cod_matricula;
         $this->array_botao[] = 'Novo';
     }
     $this->array_botao_url[] = 'educar_matricula_det.php?cod_matricula=' . $this->ref_cod_matricula;
     $this->array_botao[] = 'Voltar';
     $this->largura = '100%';
 }
Ejemplo n.º 7
0
 function Gerar()
 {
     @session_start();
     $this->__pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->__titulo = 'Bairro - 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', 'Zona Localização', 'Município', 'Estado', 'Pais'));
     // Filtros de Foreign Keys
     $opcoes = array('' => 'Selecione');
     if (class_exists('clsPais')) {
         $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'];
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPais nao encontrada\n-->";
         $opcoes = array('' => 'Erro na geração');
     }
     $this->campoLista('idpais', 'Pais', $opcoes, $this->idpais, '', FALSE, '', '', FALSE, FALSE);
     $opcoes = array('' => 'Selecione');
     if (class_exists('clsUf')) {
         if ($this->idpais) {
             $objTemp = new clsUf();
             $lista = $objTemp->lista(FALSE, FALSE, $this->idpais, FALSE, FALSE, 'nome ASC');
             if (is_array($lista) && count($lista)) {
                 foreach ($lista as $registro) {
                     $opcoes[$registro['sigla_uf']] = $registro['nome'];
                 }
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsUf nao encontrada\n-->";
         $opcoes = array('' => 'Erro na geração');
     }
     $this->campoLista('sigla_uf', 'Estado', $opcoes, $this->sigla_uf, '', FALSE, '', '', FALSE, FALSE);
     $opcoes = array('' => 'Selecione');
     if (class_exists('clsMunicipio')) {
         if ($this->sigla_uf) {
             $objTemp = new clsMunicipio();
             $lista = $objTemp->lista(FALSE, $this->sigla_uf, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 'nome ASC');
             if (is_array($lista) && count($lista)) {
                 foreach ($lista as $registro) {
                     $opcoes[$registro['idmun']] = $registro['nome'];
                 }
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsMunicipio nao encontrada\n-->";
         $opcoes = array('' => 'Erro na geração');
     }
     $this->campoLista('idmun', 'Município', $opcoes, $this->idmun, '', FALSE, '', '', FALSE, FALSE);
     // Outros filtros
     $this->campoTexto('nome', 'Nome', $this->nome, 30, 255, FALSE);
     // Paginador
     $this->__limite = 20;
     $this->__offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->__limite - $this->__limite : 0;
     $obj_bairro = new clsPublicBairro();
     $obj_bairro->setOrderby('nome ASC');
     $obj_bairro->setLimite($this->__limite, $this->__offset);
     $lista = $obj_bairro->lista($this->idmun, NULL, $this->nome, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->idpais, $this->sigla_uf);
     $total = $obj_bairro->_total;
     // Zona Localização.
     $zona = App_Model_ZonaLocalizacao::getInstance();
     // UrlHelper.
     $url = CoreExt_View_Helper_UrlHelper::getInstance();
     $options = array('query' => array('idbai' => NULL));
     // Monta a lista.
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $zl = $zona->getValue($registro['zona_localizacao']);
             $options['query']['idbai'] = $registro['idbai'];
             $this->addLinhas(array($url->l($registro['nome'], 'public_bairro_det.php', $options), $url->l($zl, 'public_bairro_det.php', $options), $url->l($registro['nm_municipio'], 'public_bairro_det.php', $options), $url->l($registro['nm_estado'], 'public_bairro_det.php', $options), $url->l($registro['nm_pais'], 'public_bairro_det.php', $options)));
         }
     }
     $this->addPaginador2('public_bairro_lst.php', $total, $_GET, $this->nome, $this->__limite);
     $this->acao = 'go("public_bairro_cad.php")';
     $this->nome_acao = 'Novo';
     $this->largura = '100%';
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->ref_cod_servidor = $_GET['ref_cod_servidor'];
     $this->ref_cod_instituicao = $_GET['ref_cod_instituicao'];
     $this->titulo = 'Servidor Formacao - 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 Formação', 'Tipo'));
     $this->campoOculto('ref_cod_servidor', $this->ref_cod_servidor);
     $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao);
     // Filtros
     $this->campoTexto('nm_formacao', 'Nome da Formação', $this->nm_formacao, 30, 255, FALSE);
     $opcoes = array('' => 'Selecione', 'C' => 'Cursos', 'T' => 'Títulos', 'O' => 'Concursos');
     $this->campoLista('tipo', 'Tipo de Formação', $opcoes, $this->tipo);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_servidor_formacao = new clsPmieducarServidorFormacao();
     $obj_servidor_formacao->setOrderby('nm_formacao ASC');
     $obj_servidor_formacao->setLimite($this->limite, $this->offset);
     if (!isset($this->tipo)) {
         $this->tipo = NULL;
     }
     $lista = $obj_servidor_formacao->lista(NULL, NULL, NULL, $this->ref_cod_servidor, $this->nm_formacao, $this->tipo, NULL, NULL, NULL, 1);
     $total = $obj_servidor_formacao->_total;
     // UrlHelper
     $url = CoreExt_View_Helper_UrlHelper::getInstance();
     $path = 'educar_servidor_formacao_det.php';
     // Monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // Pega detalhes de foreign_keys
             if (class_exists('clsPmieducarUsuario')) {
                 $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'];
             } else {
                 $registro['ref_usuario_exc'] = 'Erro na geracao';
             }
             if (class_exists('clsPmieducarServidor')) {
                 $obj_ref_cod_servidor = new clsPmieducarServidor($registro['ref_cod_servidor']);
                 $det_ref_cod_servidor = $obj_ref_cod_servidor->detalhe();
                 $registro['ref_cod_servidor'] = $det_ref_cod_servidor['cod_servidor'];
             } else {
                 $registro['ref_cod_servidor'] = 'Erro na geracao';
             }
             if ($registro['tipo'] == 'C') {
                 $registro['tipo'] = 'Curso';
             } elseif ($registro['tipo'] == 'T') {
                 $registro['tipo'] = 'Título';
             } else {
                 $registro['tipo'] = 'Concurso';
             }
             $options = array('query' => array('cod_formacao' => $registro['cod_formacao']));
             $this->addLinhas(array($url->l($registro['nm_formacao'], $path, $options), $url->l($registro['tipo'], $path, $options)));
             $this->tipo = '';
         }
     }
     $this->addPaginador2('educar_servidor_formacao_lst.php', $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) {
         $this->array_botao[] = 'Novo';
         $this->array_botao_url[] = sprintf('educar_servidor_formacao_cad.php?ref_cod_servidor=%d&ref_cod_instituicao=%d', $this->ref_cod_servidor, $this->ref_cod_instituicao);
     }
     $this->array_botao[] = 'Voltar';
     $this->array_botao_url[] = sprintf('educar_servidor_det.php?cod_servidor=%d&ref_cod_instituicao=%d', $this->ref_cod_servidor, $this->ref_cod_instituicao);
     $this->largura = '100%';
 }