function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->titulo = "Categoria Nivel - Detalhe"; $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet"); $this->cod_categoria_nivel = $_GET["cod_categoria_nivel"]; $tmp_obj = new clsPmieducarCategoriaNivel($this->cod_categoria_nivel); $registro = $tmp_obj->detalhe(); if (!$registro) { header("location: educar_categoria_nivel_lst.php"); die; } if ($registro["cod_categoria_nivel"]) { $this->addDetalhe(array("Categoria", "{$registro["cod_categoria_nivel"]}")); } if ($registro["nm_categoria_nivel"]) { $this->addDetalhe(array("Nome Categoria", "{$registro["nm_categoria_nivel"]}")); } $tab_niveis = null; $obj_nivel = new clsPmieducarNivel(); $lst_nivel = $obj_nivel->buscaSequenciaNivel($this->cod_categoria_nivel); if ($lst_nivel) { $tab_niveis .= "<table cellspacing='0' cellpadding='0' width='200' border='0' style='border:1px dotted #000000'>"; $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd"; $tab_niveis .= " <tr>\n\t\t\t\t\t\t\t\t<td bgcolor='#A1B3BD' align='center' colspan='2'>Níveis</td>\n\t\t\t\t\t\t\t</tr>"; foreach ($lst_nivel as $nivel) { $tab_niveis .= " <tr class='{$class2}' align='center'>\n\t\t\t\t\t\t\t\t\t<td align='left'>{$nivel['nm_nivel']}</td>\n\t\t\t\t\t\t\t\t\t<td align='left' width='30'><a href='javascript:popless(\"{$nivel['cod_nivel']}\")'><img src='imagens/nvp_bot_ad_sub.gif' border='0'></a></td>\n\t\t\t\t\t\t\t\t</tr>"; $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd"; } $tab_niveis .= "</table>"; $this->addDetalhe(array("Níveis", "{$tab_niveis}")); } $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_cadastra(829, $this->pessoa_logada, 3, null, true)) { $this->url_novo = "educar_categoria_nivel_cad.php"; $this->url_editar = "educar_categoria_nivel_cad.php?cod_categoria_nivel={$registro["cod_categoria_nivel"]}"; $this->array_botao[] = 'Adicionar Níveis'; $this->array_botao_url[] = "educar_nivel_cad.php?cod_categoria={$registro["cod_categoria_nivel"]}"; } $this->url_cancelar = "educar_categoria_nivel_lst.php"; $this->largura = "100%"; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe da categoria/nível")); $this->enviaLocalizacao($localizacao->montar()); }
function Inicializar() { $retorno = "Novo"; @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $this->ref_cod_categoria_nivel = $_GET["cod_categoria"]; $obj_permissoes = new clsPermissoes(); $obj_permissoes->permissao_cadastra(829, $this->pessoa_logada, 3, "educar_categoria_nivel_det.php?cod_categoria_nivel={$this->cod_nivel}", true); if (is_numeric($this->ref_cod_categoria_nivel)) { $obj = new clsPmieducarCategoriaNivel($this->ref_cod_categoria_nivel); $registro = $obj->detalhe(); if ($registro) { $this->nm_categoria = $registro['nm_categoria_nivel']; $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_excluir(829, $this->pessoa_logada, 3, null, true)) { $this->fexcluir = true; } $obj_niveis = new clsPmieducarNivel(); $obj_niveis->setOrderby("cod_nivel"); $lst_niveis = $obj_niveis->lista(nul, $this->ref_cod_categoria_nivel, null, null, null, null, null, null, null, null, null, 1); if ($lst_niveis) { foreach ($lst_niveis as $id => $nivel) { $id++; $nivel['salario_base'] = number_format($nivel['salario_base'], 2, ',', '.'); $this->cod_nivel[] = array($nivel['nm_nivel'], $nivel['salario_base'], $id, $nivel['cod_nivel']); } } else { $this->cod_nivel[] = array('', '', '1', ''); } $retorno = "Editar"; } } else { header("location:educar_categoria_nivel_lst.php"); die; } $this->url_cancelar = "educar_categoria_nivel_det.php?cod_categoria_nivel={$this->cod_nivel}"; $this->nome_url_cancelar = "Cancelar"; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "Adicionar níveis à categoria")); $this->enviaLocalizacao($localizacao->montar()); return $retorno; }
function Inicializar() { $retorno = "Novo"; @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $this->ref_cod_categoria_nivel = $_GET["cod_categoria"]; $obj_permissoes = new clsPermissoes(); $obj_permissoes->permissao_cadastra(829, $this->pessoa_logada, 3, "educar_categoria_nivel_det.php?cod_categoria_nivel={$this->cod_nivel}", true); if (is_numeric($this->ref_cod_categoria_nivel)) { $obj = new clsPmieducarCategoriaNivel($this->ref_cod_categoria_nivel); $registro = $obj->detalhe(); if ($registro) { $this->nm_categoria = $registro['nm_categoria_nivel']; $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_excluir(829, $this->pessoa_logada, 3, null, true)) { $this->fexcluir = true; } $obj_niveis = new clsPmieducarNivel(); $obj_niveis->setOrderby("cod_nivel"); $lst_niveis = $obj_niveis->lista(nul, $this->ref_cod_categoria_nivel, null, null, null, null, null, null, null, null, null, 1); if ($lst_niveis) { foreach ($lst_niveis as $id => $nivel) { $id++; $nivel['salario_base'] = number_format($nivel['salario_base'], 2, ',', '.'); $this->cod_nivel[] = array($nivel['nm_nivel'], $nivel['salario_base'], $id, $nivel['cod_nivel']); } } else { $this->cod_nivel[] = array('', '', '1', ''); } $retorno = "Editar"; } } else { header("location:educar_categoria_nivel_lst.php"); die; } $this->url_cancelar = "educar_categoria_nivel_det.php?cod_categoria_nivel={$this->cod_nivel}"; $this->nome_url_cancelar = "Cancelar"; return $retorno; }
function Gerar() { $this->campoOculto('cod_servidor', $this->cod_servidor); $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao); $obj_categoria = new clsPmieducarCategoriaNivel(); $lst_categoria = $obj_categoria->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); $opcoes = array('' => 'Selecione uma categoria'); if ($lst_categoria) { foreach ($lst_categoria as $categoria) { $opcoes[$categoria['cod_categoria_nivel']] = $categoria['nm_categoria_nivel']; } } $this->campoLista('ref_cod_categoria', 'Categoria', $opcoes, $this->ref_cod_categoria); $opcoes = array('' => 'Selecione uma categoria'); if ($this->ref_cod_categoria) { $obj_nivel = new clsPmieducarNivel(); $lst_nivel = $obj_nivel->buscaSequenciaNivel($this->ref_cod_categoria); if ($lst_nivel) { foreach ($lst_nivel as $nivel) { $opcoes[$nivel['cod_nivel']] = $nivel['nm_nivel']; } } } $this->campoLista('ref_cod_nivel', 'Nível', $opcoes, $this->ref_cod_nivel, '', TRUE); $opcoes = array('' => 'Selecione um nível'); if ($this->ref_cod_nivel) { $obj_nivel = new clsPmieducarSubnivel(); $lst_nivel = $obj_nivel->buscaSequenciaSubniveis($this->ref_cod_nivel); if ($lst_nivel) { foreach ($lst_nivel as $subnivel) { $opcoes[$subnivel['cod_subnivel']] = $subnivel['nm_subnivel']; } } } $this->campoLista('ref_cod_subnivel', 'Subnível', $opcoes, $this->ref_cod_subnivel, '', FALSE, '', '', FALSE, TRUE); }
public function Gerar() { session_start(); $this->__pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->__titulo = 'Categoria Nivel - Listagem'; // passa todos os valores obtidos no GET para atributos do objeto foreach ($_GET as $var => $val) { $this->{$var} = $val === "" ? NULL : $val; } $this->addBanner('imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg', 'Intranet'); $this->addCabecalhos(array('Nome Categoria Nivel')); // Filtros $this->campoTexto('nm_categoria_nivel', 'Nome Categoria Nivel', $this->nm_categoria_nivel, 30, 255, FALSE); // Paginador $this->__limite = 20; $this->__offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->__limite - $this->__limite : 0; $obj_categoria_nivel = new clsPmieducarCategoriaNivel(); $obj_categoria_nivel->setOrderby('nm_categoria_nivel ASC'); $obj_categoria_nivel->setLimite($this->__limite, $this->__offset); $lista = $obj_categoria_nivel->lista(NULL, NULL, $this->nm_categoria_nivel, NULL, NULL, NULL, NULL, NULL, 1); $total = $obj_categoria_nivel->_total; // Monta a lista if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { // muda os campos data $registro['data_cadastro_time'] = strtotime(substr($registro['data_cadastro'], 0, 16)); $registro['data_cadastro_br'] = date('d/m/Y H:i', $registro['data_cadastro_time']); $registro['data_exclusao_time'] = strtotime(substr($registro['data_exclusao'], 0, 16)); $registro['data_exclusao_br'] = date('d/m/Y H:i', $registro['data_exclusao_time']); // pega detalhes de foreign_keys if (class_exists('clsPmieducarUsuario')) { $obj_ref_usuario_cad = new clsPmieducarUsuario($registro['ref_usuario_cad']); $det_ref_usuario_cad = $obj_ref_usuario_cad->detalhe(); $registro['ref_usuario_cad'] = $det_ref_usuario_cad['data_cadastro']; } else { $registro['ref_usuario_cad'] = 'Erro na geracao'; } 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'; } $this->addLinhas(array(sprintf('<a href="educar_categoria_nivel_det.php?cod_categoria_nivel=%s">%s</a>', $registro['cod_categoria_nivel'], $registro['nm_categoria_nivel']))); } } $this->addPaginador2('educar_categoria_nivel_lst.php', $total, $_GET, $this->nome, $this->__limite); $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_cadastra(829, $this->__pessoa_logada, 3, NULL, TRUE)) { $this->acao = 'go("educar_categoria_nivel_cad.php")'; $this->nome_acao = 'Novo'; } $this->largura = '100%'; }
function Excluir() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $obj_permissoes = new clsPermissoes(); $obj_permissoes->permissao_excluir(829, $this->pessoa_logada, 3, "educar_categoria_nivel_lst.php", true); $obj = new clsPmieducarCategoriaNivel($this->cod_categoria_nivel, $this->pessoa_logada, $this->pessoa_logada, $this->nm_categoria_nivel, $this->data_cadastro, $this->data_exclusao, 0); $excluiu = $obj->excluir(); if ($excluiu) { $this->mensagem .= "Exclusão efetuada com sucesso.<br>"; header("Location: educar_categoria_nivel_lst.php"); die; return true; } $this->mensagem = "Exclusão não realizada.<br>"; echo "<!--\nErro ao excluir clsPmieducarCategoriaNivel\nvalores obrigatorios\nif( is_numeric( {$this->cod_categoria_nivel} ) && is_numeric( {$this->ref_usuario_exc} ) )\n-->"; return false; }
function Inicializar() { $retorno = "Novo"; @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $this->ref_cod_categoria = $_GET["ref_cod_categoria"]; $this->ref_cod_nivel = $_GET["ref_cod_nivel"]; $obj_permissoes = new clsPermissoes(); $permite_cadastrar = $obj_permissoes->permissao_cadastra(829, $this->pessoa_logada, 3, "", true); if (!$permite_cadastrar) { echo "<script>window.parent.fechaExpansivel( '{$_GET['div']}');</script>"; die; } if (is_numeric($this->ref_cod_categoria) && is_numeric($this->ref_cod_nivel)) { $obj_nivel_categoria = new clsPmieducarNivel(); $lst_nivel_categoria = $obj_nivel_categoria->lista($this->ref_cod_nivel, $this->ref_cod_categoria, null, null, null, null, null, null, null, null); if ($lst_nivel_categoria) { $lst_niveis = array_shift($lst_nivel_categoria); $obj = new clsPmieducarCategoriaNivel($this->ref_cod_categoria); $registro = $obj->detalhe(); $this->nm_categoria = $registro['nm_categoria_nivel']; $this->nm_nivel = $lst_niveis['nm_nivel']; $obj_niveis = new clsPmieducarSubnivel(); $obj_niveis->setOrderby("cod_subnivel"); $lst_niveis = $obj_niveis->lista(null, null, null, null, $this->ref_cod_nivel, null, null, null, null, null, 1); if ($lst_niveis) { foreach ($lst_niveis as $id => $nivel) { $id++; $nivel['salario'] = number_format($nivel['salario'], 2, ',', '.'); $this->cod_nivel[] = array($nivel['nm_subnivel'], $nivel['salario'], $id, $nivel['cod_subnivel']); } } else { $this->cod_nivel[] = array('', '', '1', ''); } $retorno = "Editar"; } } else { echo "<script>window.parent.fechaExpansivel( '{$_GET['div']}');</script>"; die; } $this->url_cancelar = false; return $retorno; }