function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->titulo = "Idioma - Detalhe"; $this->cod_acervo_idioma = $_GET["cod_acervo_idioma"]; $tmp_obj = new clsPmieducarAcervoIdioma($this->cod_acervo_idioma); $registro = $tmp_obj->detalhe(); if (!$registro) { header("location: educar_acervo_idioma_lst.php"); die; } if ($registro["cod_acervo_idioma"]) { $this->addDetalhe(array("Código Idioma", "{$registro["cod_acervo_idioma"]}")); } if ($registro["nm_idioma"]) { $this->addDetalhe(array("Idioma", "{$registro["nm_idioma"]}")); } $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_cadastra(590, $this->pessoa_logada, 11)) { $this->url_novo = "educar_acervo_idioma_cad.php"; $this->url_editar = "educar_acervo_idioma_cad.php?cod_acervo_idioma={$registro["cod_acervo_idioma"]}"; } $this->url_cancelar = "educar_acervo_idioma_lst.php"; $this->largura = "100%"; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_biblioteca_index.php" => "i-Educar - Biblioteca", "" => "Detalhe do idioma")); $this->enviaLocalizacao($localizacao->montar()); }
function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->titulo = "Idioma - Detalhe"; $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet"); $this->cod_acervo_idioma = $_GET["cod_acervo_idioma"]; $tmp_obj = new clsPmieducarAcervoIdioma($this->cod_acervo_idioma); $registro = $tmp_obj->detalhe(); if (!$registro) { header("location: educar_acervo_idioma_lst.php"); die; } if ($registro["cod_acervo_idioma"]) { $this->addDetalhe(array("Código Idioma", "{$registro["cod_acervo_idioma"]}")); } if ($registro["nm_idioma"]) { $this->addDetalhe(array("Idioma", "{$registro["nm_idioma"]}")); } $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_cadastra(590, $this->pessoa_logada, 11)) { $this->url_novo = "educar_acervo_idioma_cad.php"; $this->url_editar = "educar_acervo_idioma_cad.php?cod_acervo_idioma={$registro["cod_acervo_idioma"]}"; } $this->url_cancelar = "educar_acervo_idioma_lst.php"; $this->largura = "100%"; }
function Novo() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $obj_permissoes = new clsPermissoes(); $obj_permissoes->permissao_cadastra(590, $this->pessoa_logada, 11, "educar_acervo_idioma_lst.php"); $obj = new clsPmieducarAcervoIdioma($this->cod_acervo_idioma, $this->pessoa_logada, $this->pessoa_logada, $this->nm_idioma, $this->data_cadastro, $this->data_exclusao, $this->ativo, $this->ref_cod_biblioteca); $cadastrou = $obj->cadastra(); if ($cadastrou) { $this->mensagem .= "Cadastro efetuado com sucesso.<br>"; echo "<script>\n\t\t\t\t\tparent.document.getElementById('idioma').value = '{$cadastrou}';\n\t\t\t\t\tparent.document.getElementById('tipoacao').value = '';\n\t\t\t\t\tparent.document.getElementById('formcadastro').submit();\n\t\t\t </script>"; die; return true; } $this->mensagem = "Cadastro não realizado.<br>"; echo "<!--\nErro ao cadastrar clsPmieducarAcervoIdioma\nvalores obrigatorios\nis_numeric( {$this->ref_usuario_cad} ) && is_string( {$this->nm_idioma} )\n-->"; return false; }
function Gerar() { if ($_POST) { foreach ($_POST as $campo => $val) { $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val; } } if (is_numeric($this->colecao)) { $this->ref_cod_acervo_colecao = $this->colecao; } if (is_numeric($this->editora)) { $this->ref_cod_acervo_editora = $this->editora; } if (is_numeric($this->idioma)) { $this->ref_cod_acervo_idioma = $this->idioma; } if (is_numeric($this->autor)) { $this->ref_cod_acervo_autor = $this->autor; } // primary keys $this->campoOculto("cod_acervo", $this->cod_acervo); $this->campoOculto("colecao", ""); $this->campoOculto("editora", ""); $this->campoOculto("idioma", ""); $this->campoOculto("autor", ""); $this->inputsHelper()->dynamic(array('instituicao', 'escola', 'biblioteca', 'bibliotecaTipoExemplar')); // Obra referência $opcoes = array("NULL" => "Selecione"); if ($this->ref_cod_acervo && $this->ref_cod_acervo != "NULL") { $objTemp = new clsPmieducarAcervo($this->ref_cod_acervo); $detalhe = $objTemp->detalhe(); if ($detalhe) { $opcoes["{$detalhe['cod_acervo']}"] = "{$detalhe['titulo']}"; } } $this->campoLista("ref_cod_acervo", "Obra Referência", $opcoes, $this->ref_cod_acervo, "", false, "", "<img border=\"0\" onclick=\"pesquisa();\" id=\"ref_cod_acervo_lupa\" name=\"ref_cod_acervo_lupa\" src=\"imagens/lupa.png\"\\/>", false, false); // Coleção $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarAcervoColecao")) { $objTemp = new clsPmieducarAcervoColecao(); $lista = $objTemp->lista(); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_acervo_colecao']}"] = "{$registro['nm_colecao']}"; } } } else { echo "<!--\nErro\nClasse clsPmieducarAcervoColecao nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_acervo_colecao", "Coleção", $opcoes, $this->ref_cod_acervo_colecao, "", false, "", "<img id='img_colecao' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(500, 200,'educar_acervo_colecao_cad_pop.php',[], 'Coleção')\" />", false, false); // Idioma $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarAcervoIdioma")) { $objTemp = new clsPmieducarAcervoIdioma(); $lista = $objTemp->lista(); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_acervo_idioma']}"] = "{$registro['nm_idioma']}"; } } } else { echo "<!--\nErro\nClasse clsPmieducarAcervoIdioma nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_acervo_idioma", "Idioma", $opcoes, $this->ref_cod_acervo_idioma, "", false, "", "<img id='img_idioma' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(400, 150,'educar_acervo_idioma_cad_pop.php',[], 'Idioma')\" />"); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarAcervoEditora")) { $objTemp = new clsPmieducarAcervoEditora(); $lista = $objTemp->lista(); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_acervo_editora']}"] = "{$registro['nm_editora']}"; } } } else { echo "<!--\nErro\nClasse clsPmieducarAcervoEditora nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_acervo_editora", "Editora", $opcoes, $this->ref_cod_acervo_editora, "", false, "", "<img id='img_editora' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(400, 320,'educar_acervo_editora_cad_pop.php',[], 'Editora')\" />"); //-----------------------INCLUI AUTOR------------------------// $this->campoQuebra(); if ($_POST["acervo_autor"]) { $this->acervo_autor = unserialize(urldecode($_POST["acervo_autor"])); } if (is_numeric($this->cod_acervo) && !$_POST) { $obj = new clsPmieducarAcervoAcervoAutor(); $registros = $obj->lista(null, $this->cod_acervo); if ($registros) { foreach ($registros as $campo) { $aux["ref_cod_acervo_autor_"] = $campo["ref_cod_acervo_autor"]; $aux["principal_"] = $campo["principal"]; $this->acervo_autor[] = $aux; } // verifica se ja existe um autor principal if (is_array($this->acervo_autor)) { foreach ($this->acervo_autor as $autores) { if ($autores["principal_"] == 1) { $this->checked = 1; $this->campoOculto("checked", $this->checked); } } } } } unset($aux); if ($_POST["ref_cod_acervo_autor"]) { if ($_POST["principal"]) { $this->checked = 1; $this->campoOculto("checked", $this->checked); } $aux["ref_cod_acervo_autor_"] = $_POST["ref_cod_acervo_autor"]; $aux["principal_"] = $_POST["principal"]; $this->acervo_autor[] = $aux; // echo "<pre>";print_r($this->acervo_autor); // verifica se ja existe um autor principal if (is_array($this->acervo_autor)) { foreach ($this->acervo_autor as $autores) { if ($autores["principal_"] == 'on') { $this->checked = 1; $this->campoOculto("checked", $this->checked); } } } unset($this->ref_cod_acervo_autor); unset($this->principal); } $this->campoOculto("excluir_autor", ""); unset($aux); if ($this->acervo_autor) { foreach ($this->acervo_autor as $key => $autor) { if ($this->excluir_autor == $autor["ref_cod_acervo_autor_"]) { unset($this->acervo_autor[$key]); unset($this->excluir_autor); } else { $obj_acervo_autor = new clsPmieducarAcervoAutor($autor["ref_cod_acervo_autor_"]); $det_acervo_autor = $obj_acervo_autor->detalhe(); $nm_autor = $det_acervo_autor["nm_autor"]; $this->campoTextoInv("ref_cod_exemplar_tipo_{$autor["ref_cod_acervo_autor_"]}", "", $nm_autor, 30, 255, false, false, true); $this->campoCheck("principal_{$autor["ref_cod_acervo_autor_"]}", "", $autor['principal_'], "<a href='#' onclick=\"getElementById('excluir_autor').value = '{$autor["ref_cod_acervo_autor_"]}'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bola_xis.gif' title='Excluir' border=0></a>", false, false, false); $aux["ref_cod_acervo_autor_"] = $autor["ref_cod_acervo_autor_"]; $aux["principal_"] = $autor['principal_']; } } } $this->campoOculto("acervo_autor", serialize($this->acervo_autor)); if (class_exists("clsPmieducarAcervoAutor")) { $opcoes = array("" => "Selecione"); $objTemp = new clsPmieducarAcervoAutor(); $objTemp->setOrderby("nm_autor ASC"); $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_acervo_autor']}"] = "{$registro['nm_autor']}"; } } } else { echo "<!--\nErro\nClasse clsPmieducarAcervoAutor não encontrada\n-->"; $opcoes = array("" => "Erro na geração"); } if (is_array($this->acervo_autor)) { $qtd_autor = count($this->acervo_autor); } // não existe um autor principal nem autor if ($this->checked != 1 && (!$qtd_autor || $qtd_autor == 0)) { // die("1"); $this->campoLista("ref_cod_acervo_autor", "Autor", $opcoes, $this->ref_cod_acervo_autor, null, true, "", "", false, true); $this->campoCheck("principal", " <img id='img_autor' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(500, 250,'educar_acervo_autor_cad_pop.php',[], 'Autor')\" />", $this->principal, "<a href='#' onclick=\"getElementById('incluir_autor').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>"); } else { if ($this->checked != 1 && $qtd_autor > 0) { $this->campoLista("ref_cod_acervo_autor", "Autor", $opcoes, $this->ref_cod_acervo_autor, null, true, null, null, null, false); $this->campoCheck("principal", " <img src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"pesquisa_valores_popless( 'educar_acervo_autor_cad_pop.php' )\" />", $this->principal, "<a href='#' onclick=\"getElementById('incluir_autor').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>"); } else { // die("3"); $this->campoLista("ref_cod_acervo_autor", "Autor", $opcoes, $this->ref_cod_acervo_autor, "", false, "", "<img src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"pesquisa_valores_popless( 'educar_acervo_autor_cad_pop.php' )\" /> <a href='#' onclick=\"getElementById('incluir_autor').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>", false, false); } } $this->campoOculto("incluir_autor", ""); $this->campoQuebra(); //-----------------------FIM AUTOR------------------------// // text $this->campoTexto("titulo", "Título", $this->titulo, 40, 255, true); $this->campoTexto("sub_titulo", "Subtítulo", $this->sub_titulo, 40, 255, false); $this->campoTexto("estante", "Estante", $this->estante, 20, 15, false); $helperOptions = array('objectName' => 'assuntos'); $options = array('label' => 'Assuntos', 'size' => 50, 'required' => false, 'options' => array('value' => null)); $this->inputsHelper()->multipleSearchAssuntos('', $options, $helperOptions); $this->campoTexto("cdd", "CDD", $this->cdd, 20, 15, false); $this->campoTexto("cdu", "CDU", $this->cdu, 20, 15, false); $this->campoTexto("cutter", "Cutter", $this->cutter, 20, 15, false); $this->campoNumero("volume", "Volume", $this->volume, 20, 255, true); $this->campoNumero("num_edicao", "Número Edicão", $this->num_edicao, 20, 255, true); $this->campoNumero("ano", "Ano", $this->ano, 5, 4, true); $this->campoNumero("num_paginas", "Número Páginas", $this->num_paginas, 5, 255, true); $this->campoNumero("isbn", "ISBN", $this->isbn, 20, 13, false); }
function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->titulo = "Obras - Detalhe"; $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet"); $this->cod_acervo = $_GET["cod_acervo"]; $tmp_obj = new clsPmieducarAcervo($this->cod_acervo); $registro = $tmp_obj->detalhe(); if (!$registro) { header("location: educar_acervo_lst.php"); die; } if (class_exists("clsPmieducarBiblioteca")) { $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca($registro["ref_cod_biblioteca"]); $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe(); $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"]; if (class_exists("clsPmieducarInstituicao")) { $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"]; $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 geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; } if (class_exists("clsPmieducarEscola")) { $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"]; $obj_ref_cod_escola = new clsPmieducarEscola($registro["ref_cod_escola"]); $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); $idpes = $det_ref_cod_escola["ref_idpes"]; if ($idpes) { $obj_escola = new clsPessoaJuridica($idpes); $obj_escola_det = $obj_escola->detalhe(); $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; } else { $obj_escola = new clsPmieducarEscolaComplemento($registro["ref_cod_escola"]); $obj_escola_det = $obj_escola->detalhe(); $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; } } } else { $registro["ref_cod_biblioteca"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarBiblioteca\n-->"; } if (class_exists("clsPmieducarExemplarTipo")) { $obj_ref_cod_exemplar_tipo = new clsPmieducarExemplarTipo($registro["ref_cod_exemplar_tipo"]); $det_ref_cod_exemplar_tipo = $obj_ref_cod_exemplar_tipo->detalhe(); $registro["ref_cod_exemplar_tipo"] = $det_ref_cod_exemplar_tipo["nm_tipo"]; } else { $registro["ref_cod_exemplar_tipo"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarExemplarTipo\n-->"; } if (class_exists("clsPmieducarAcervo")) { $obj_ref_cod_acervo = new clsPmieducarAcervo($registro["ref_cod_acervo"]); $det_ref_cod_acervo = $obj_ref_cod_acervo->detalhe(); $registro["ref_cod_acervo"] = $det_ref_cod_acervo["titulo"]; } else { $registro["ref_cod_acervo"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervo\n-->"; } if (class_exists("clsPmieducarAcervoColecao")) { $obj_ref_cod_acervo_colecao = new clsPmieducarAcervoColecao($registro["ref_cod_acervo_colecao"]); $det_ref_cod_acervo_colecao = $obj_ref_cod_acervo_colecao->detalhe(); $registro["ref_cod_acervo_colecao"] = $det_ref_cod_acervo_colecao["nm_colecao"]; } else { $registro["ref_cod_acervo_colecao"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoColecao\n-->"; } if (class_exists("clsPmieducarAcervoIdioma")) { $obj_ref_cod_acervo_idioma = new clsPmieducarAcervoIdioma($registro["ref_cod_acervo_idioma"]); $det_ref_cod_acervo_idioma = $obj_ref_cod_acervo_idioma->detalhe(); $registro["ref_cod_acervo_idioma"] = $det_ref_cod_acervo_idioma["nm_idioma"]; } else { $registro["ref_cod_acervo_idioma"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoIdioma\n-->"; } if (class_exists("clsPmieducarAcervoEditora")) { $obj_ref_cod_acervo_editora = new clsPmieducarAcervoEditora($registro["ref_cod_acervo_editora"]); $det_ref_cod_acervo_editora = $obj_ref_cod_acervo_editora->detalhe(); $registro["ref_cod_acervo_editora"] = $det_ref_cod_acervo_editora["nm_editora"]; } else { $registro["ref_cod_acervo_editora"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoEditora\n-->"; } $obj_permissoes = new clsPermissoes(); $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel_usuario == 1) { if ($registro["ref_cod_instituicao"]) { $this->addDetalhe(array("Instituição", "{$registro["ref_cod_instituicao"]}")); } } if ($nivel_usuario == 1 || $nivel_usuario == 2) { if ($registro["ref_cod_escola"]) { $this->addDetalhe(array("Escola", "{$registro["ref_cod_escola"]}")); } } if ($registro["ref_cod_biblioteca"]) { $this->addDetalhe(array("Biblioteca", "{$registro["ref_cod_biblioteca"]}")); } if ($registro["titulo"]) { $this->addDetalhe(array("Título", "{$registro["titulo"]}")); } if ($registro["sub_titulo"]) { $this->addDetalhe(array("Subtítulo", "{$registro["sub_titulo"]}")); } if ($registro["ref_cod_exemplar_tipo"]) { $this->addDetalhe(array("Tipo", "{$registro["ref_cod_exemplar_tipo"]}")); } if ($registro["ref_cod_acervo"]) { $this->addDetalhe(array("Obra Referência", "{$registro["ref_cod_acervo"]}")); } if ($registro["ref_cod_acervo_colecao"]) { $this->addDetalhe(array("Coleção", "{$registro["ref_cod_acervo_colecao"]}")); } if ($registro["ref_cod_acervo_idioma"]) { $this->addDetalhe(array("Idioma", "{$registro["ref_cod_acervo_idioma"]}")); } if ($registro["ref_cod_acervo_editora"]) { $this->addDetalhe(array("Editora", "{$registro["ref_cod_acervo_editora"]}")); } $obj = new clsPmieducarAcervoAcervoAutor(); $obj->setOrderby("principal DESC"); $lst = $obj->lista(null, $this->cod_acervo); if ($lst) { $tabela = "<TABLE>\n\t\t\t\t\t <TR align=center>\n\t\t\t\t\t <TD bgcolor=#A1B3BD><B>Nome</B></TD>\n\t\t\t\t\t <TD bgcolor=#A1B3BD><B>Principal</B></TD>\n\t\t\t\t\t </TR>"; $cont = 0; foreach ($lst as $valor) { if ($cont % 2 == 0) { $color = " bgcolor=#E4E9ED "; } else { $color = " bgcolor=#FFFFFF "; } $obj = new clsPmieducarAcervoAutor($valor["ref_cod_acervo_autor"]); $det = $obj->detalhe(); $nm_autor = $det["nm_autor"]; $principal = $valor["principal"]; if ($principal == 1) { $principal = "sim"; } else { $principal = "não"; } $tabela .= "<TR>\n\t\t\t\t\t\t\t <TD {$color} align=left>{$nm_autor}</TD>\n\t\t\t\t\t\t\t <TD {$color} align=left>{$principal}</TD>\n\t\t\t\t\t\t\t</TR>"; $cont++; } $tabela .= "</TABLE>"; } if ($tabela) { $this->addDetalhe(array("Autor", "{$tabela}")); } if ($registro["cdu"]) { $this->addDetalhe(array("Cdu", "{$registro["cdu"]}")); } if ($registro["cutter"]) { $this->addDetalhe(array("Cutter", "{$registro["cutter"]}")); } if ($registro["volume"]) { $this->addDetalhe(array("Volume", "{$registro["volume"]}")); } if ($registro["num_edicao"]) { $this->addDetalhe(array("Número Edicão", "{$registro["num_edicao"]}")); } if ($registro["ano"]) { $this->addDetalhe(array("Ano", "{$registro["ano"]}")); } if ($registro["num_paginas"]) { $this->addDetalhe(array("Número Páginas", "{$registro["num_paginas"]}")); } if ($registro["isbn"]) { $this->addDetalhe(array("ISBN", "{$registro["isbn"]}")); } $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_cadastra(598, $this->pessoa_logada, 11)) { $this->url_novo = "educar_acervo_cad.php"; $this->url_editar = "educar_acervo_cad.php?cod_acervo={$registro["cod_acervo"]}"; } $this->url_cancelar = "educar_acervo_lst.php"; $this->largura = "100%"; }
function Gerar() { if ($_POST) { foreach ($_POST as $campo => $val) { $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val; } } if (is_numeric($this->colecao)) { $this->ref_cod_acervo_colecao = $this->colecao; } if (is_numeric($this->editora)) { $this->ref_cod_acervo_editora = $this->editora; } if (is_numeric($this->idioma)) { $this->ref_cod_acervo_idioma = $this->idioma; } if (is_numeric($this->autor)) { $this->ref_cod_acervo_autor = $this->autor; } // primary keys $this->campoOculto("cod_acervo", $this->cod_acervo); $this->campoOculto("colecao", ""); $this->campoOculto("editora", ""); $this->campoOculto("idioma", ""); $this->campoOculto("autor", ""); $get_escola = 1; $escola_obrigatorio = false; $get_biblioteca = 1; $instituicao_obrigatorio = true; $biblioteca_obrigatorio = true; include "include/pmieducar/educar_campo_lista.php"; // foreign keys /*$opcoes = array( "" => "Selecione" ); if( class_exists( "clsPmieducarExemplarTipo" ) ) { $objTemp = new clsPmieducarExemplarTipo(); $lista = $objTemp->lista(null,null); if ( is_array( $lista ) && count( $lista ) ) { $tipos = "tipos = new Array();\n"; foreach ( $lista as $registro ) { $tipos .= "tipos[tipos.length] = new Array( {$registro["cod_exemplar_tipo"]}, '{$registro['nm_tipo']}', {$registro['ref_cod_biblioteca']});\n"; } echo "<script>{$tipos}</script>"; } } else { echo "<!--\nErro\nClasse clsPmieducarExemplarTipo nao encontrada\n-->"; }*/ $opcoes = array("NULL" => "Selecione"); if ($this->ref_cod_biblioteca) { $objTemp = new clsPmieducarExemplarTipo(); $lista = $objTemp->lista(null, $this->ref_cod_biblioteca); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_exemplar_tipo']}"] = "{$registro['nm_tipo']}"; } } } $this->campoLista("ref_cod_exemplar_tipo", "Exemplar Tipo", $opcoes, $this->ref_cod_exemplar_tipo); $opcoes = array("NULL" => "Selecione"); if ($this->ref_cod_acervo && $this->ref_cod_acervo != "NULL") { $objTemp = new clsPmieducarAcervo($this->ref_cod_acervo); $detalhe = $objTemp->detalhe(); if ($detalhe) { $opcoes["{$detalhe['cod_acervo']}"] = "{$detalhe['titulo']}"; } } //campoListaPesq( $nome, $campo, $valor, $default, $caminho="", $acao = "" , $duplo=false, $descricao="", $descricao2="", $flag=null, $pag_cadastro = null, $disabled = "", $div = false, $serializedcampos = false, $obrigatorio = false ) // $this->campoListaPesq( "ref_cod_acervo", "Obra Referência", $opcoes, $this->ref_cod_acervo,"educar_pesquisa_acervo_lst.php?campo1=ref_cod_acervo","","","","","","","",true ); $this->campoLista("ref_cod_acervo", "Obra Referência", $opcoes, $this->ref_cod_acervo, "", false, "", "<img border=\"0\" onclick=\"pesquisa();\" id=\"ref_cod_acervo_lupa\" name=\"ref_cod_acervo_lupa\" src=\"imagens/lupa.png\"\\/>", false, false); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarAcervoColecao")) { $objTemp = new clsPmieducarAcervoColecao(); $lista = $objTemp->lista(); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_acervo_colecao']}"] = "{$registro['nm_colecao']}"; } } } else { echo "<!--\nErro\nClasse clsPmieducarAcervoColecao nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_acervo_colecao", "Coleção", $opcoes, $this->ref_cod_acervo_colecao, "", false, "", "<img id='img_colecao' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(500, 200,'educar_acervo_colecao_cad_pop.php',[], 'Coleção')\" />", false, false); //"<img id='imgLupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless( 'pesquisa_funcionario_lst.php?campos=".$parametros->serializaCampos()."&importa_cpf=true&chave_campo='+/[0-9]+/.exec(this.previousSibling.previousSibling.id)[0], this.previousSibling.previousSibling.id ); \" /> $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarAcervoIdioma")) { $objTemp = new clsPmieducarAcervoIdioma(); $lista = $objTemp->lista(); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_acervo_idioma']}"] = "{$registro['nm_idioma']}"; } } } else { echo "<!--\nErro\nClasse clsPmieducarAcervoIdioma nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_acervo_idioma", "Idioma", $opcoes, $this->ref_cod_acervo_idioma, "", false, "", "<img id='img_idioma' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(400, 150,'educar_acervo_idioma_cad_pop.php',[], 'Idioma')\" />"); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarAcervoEditora")) { $objTemp = new clsPmieducarAcervoEditora(); $lista = $objTemp->lista(); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_acervo_editora']}"] = "{$registro['nm_editora']}"; } } } else { echo "<!--\nErro\nClasse clsPmieducarAcervoEditora nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_acervo_editora", "Editora", $opcoes, $this->ref_cod_acervo_editora, "", false, "", "<img id='img_editora' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(400, 320,'educar_acervo_editora_cad_pop.php',[], 'Editora')\" />"); //-----------------------INCLUI AUTOR------------------------// $this->campoQuebra(); if ($_POST["acervo_autor"]) { $this->acervo_autor = unserialize(urldecode($_POST["acervo_autor"])); } if (is_numeric($this->cod_acervo) && !$_POST) { $obj = new clsPmieducarAcervoAcervoAutor(); $registros = $obj->lista(null, $this->cod_acervo); if ($registros) { foreach ($registros as $campo) { $aux["ref_cod_acervo_autor_"] = $campo["ref_cod_acervo_autor"]; $aux["principal_"] = $campo["principal"]; $this->acervo_autor[] = $aux; } // verifica se ja existe um autor principal if (is_array($this->acervo_autor)) { foreach ($this->acervo_autor as $autores) { if ($autores["principal_"] == 1) { $this->checked = 1; $this->campoOculto("checked", $this->checked); } } } } } unset($aux); if ($_POST["ref_cod_acervo_autor"]) { if ($_POST["principal"]) { $this->checked = 1; $this->campoOculto("checked", $this->checked); } $aux["ref_cod_acervo_autor_"] = $_POST["ref_cod_acervo_autor"]; $aux["principal_"] = $_POST["principal"]; $this->acervo_autor[] = $aux; // echo "<pre>";print_r($this->acervo_autor); // verifica se ja existe um autor principal if (is_array($this->acervo_autor)) { foreach ($this->acervo_autor as $autores) { if ($autores["principal_"] == 'on') { $this->checked = 1; $this->campoOculto("checked", $this->checked); } } } unset($this->ref_cod_acervo_autor); unset($this->principal); } $this->campoOculto("excluir_autor", ""); unset($aux); if ($this->acervo_autor) { foreach ($this->acervo_autor as $key => $autor) { if ($this->excluir_autor == $autor["ref_cod_acervo_autor_"]) { unset($this->acervo_autor[$key]); unset($this->excluir_autor); } else { $obj_acervo_autor = new clsPmieducarAcervoAutor($autor["ref_cod_acervo_autor_"]); $det_acervo_autor = $obj_acervo_autor->detalhe(); $nm_autor = $det_acervo_autor["nm_autor"]; $this->campoTextoInv("ref_cod_exemplar_tipo_{$autor["ref_cod_acervo_autor_"]}", "", $nm_autor, 30, 255, false, false, true); $this->campoCheck("principal_{$autor["ref_cod_acervo_autor_"]}", "", $autor['principal_'], "<a href='#' onclick=\"getElementById('excluir_autor').value = '{$autor["ref_cod_acervo_autor_"]}'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bola_xis.gif' title='Excluir' border=0></a>", false, false, true); $aux["ref_cod_acervo_autor_"] = $autor["ref_cod_acervo_autor_"]; $aux["principal_"] = $autor['principal_']; } } } $this->campoOculto("acervo_autor", serialize($this->acervo_autor)); if (class_exists("clsPmieducarAcervoAutor")) { $opcoes = array("" => "Selecione"); $objTemp = new clsPmieducarAcervoAutor(); $objTemp->setOrderby("nm_autor ASC"); $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_acervo_autor']}"] = "{$registro['nm_autor']}"; } } } else { echo "<!--\nErro\nClasse clsPmieducarAcervoAutor não encontrada\n-->"; $opcoes = array("" => "Erro na geração"); } if (is_array($this->acervo_autor)) { $qtd_autor = count($this->acervo_autor); } // não existe um autor principal nem autor if ($this->checked != 1 && (!$qtd_autor || $qtd_autor == 0)) { // die("1"); $this->campoLista("ref_cod_acervo_autor", "Autor", $opcoes, $this->ref_cod_acervo_autor, null, true, "", "", false, true); $this->campoCheck("principal", " <img id='img_autor' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(500, 250,'educar_acervo_autor_cad_pop.php',[], 'Autor')\" /> Principal", $this->principal, "<a href='#' onclick=\"getElementById('incluir_autor').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>"); } else { if ($this->checked != 1 && $qtd_autor > 0) { // echo "principal ".$this->checked; // echo "is_array($this->acervo_autor)"; // print_r($this->acervo_autor); // // die("2"); $this->campoLista("ref_cod_acervo_autor", "Autor", $opcoes, $this->ref_cod_acervo_autor, null, true, null, null, null, false); $this->campoCheck("principal", " <img src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"pesquisa_valores_popless( 'educar_acervo_autor_cad_pop.php' )\" /> Principal", $this->principal, "<a href='#' onclick=\"getElementById('incluir_autor').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>"); } else { // die("3"); $this->campoLista("ref_cod_acervo_autor", "Autor", $opcoes, $this->ref_cod_acervo_autor, "", false, "", "<img src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"pesquisa_valores_popless( 'educar_acervo_autor_cad_pop.php' )\" /> <a href='#' onclick=\"getElementById('incluir_autor').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>", false, false); } } $this->campoOculto("incluir_autor", ""); // $this->campoRotulo( "bt_incluir_autor", "Autor", "<a href='#' onclick=\"getElementById('incluir_autor').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_incluir2.gif' title='Incluir' border=0></a>" ); $this->campoQuebra(); //-----------------------FIM AUTOR------------------------// // text $this->campoTexto("titulo", "Título", $this->titulo, 40, 255, true); $this->campoTexto("sub_titulo", "Subtítulo", $this->sub_titulo, 40, 255, false); $this->campoTexto("cdu", "Cdu", $this->cdu, 20, 15, false); $this->campoTexto("cutter", "Cutter", $this->cutter, 20, 15, false); $this->campoNumero("volume", "Volume", $this->volume, 20, 255, true); $this->campoNumero("num_edicao", "Número Edicão", $this->num_edicao, 20, 255, true); $this->campoNumero("ano", "Ano", $this->ano, 5, 4, true); $this->campoNumero("num_paginas", "Número Páginas", $this->num_paginas, 5, 255, true); $this->campoNumero("isbn", "ISBN", $this->isbn, 20, 255, true); }
function Excluir() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $obj_permissoes = new clsPermissoes(); $obj_permissoes->permissao_excluir(590, $this->pessoa_logada, 11, "educar_acervo_idioma_lst.php"); $obj = new clsPmieducarAcervoIdioma($this->cod_acervo_idioma, $this->pessoa_logada, $this->pessoa_logada, $this->nm_idioma, $this->data_cadastro, $this->data_exclusao, 0); $excluiu = $obj->excluir(); if ($excluiu) { $this->mensagem .= "Exclusão efetuada com sucesso.<br>"; header("Location: educar_acervo_idioma_lst.php"); die; return true; } $this->mensagem = "Exclusão não realizada.<br>"; echo "<!--\nErro ao excluir clsPmieducarAcervoIdioma\nvalores obrigatorios\nif( is_numeric( {$this->cod_acervo_idioma} ) && is_numeric( {$this->ref_usuario_exc} ) )\n-->"; return false; }
function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->titulo = "Idioma - Listagem"; foreach ($_GET as $var => $val) { // passa todos os valores obtidos no GET para atributos do objeto $this->{$var} = $val === "" ? null : $val; } $this->addCabecalhos(array("Idioma", "Biblioteca")); // Filtros de Foreign Keys $get_escola = true; $get_biblioteca = true; $get_cabecalho = "lista_busca"; include "include/pmieducar/educar_campo_lista.php"; // outros Filtros $this->campoTexto("nm_idioma", "Idioma", $this->nm_idioma, 30, 255, false); // Paginador $this->limite = 20; $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0; if (!is_numeric($this->ref_cod_biblioteca)) { $obj_bib_user = new clsPmieducarBibliotecaUsuario(); $this->ref_cod_biblioteca = $obj_bib_user->listaBibliotecas($this->pessoa_logada); } $obj_acervo_idioma = new clsPmieducarAcervoIdioma(); $obj_acervo_idioma->setOrderby("nm_idioma ASC"); $obj_acervo_idioma->setLimite($this->limite, $this->offset); $lista = $obj_acervo_idioma->lista(null, null, null, $this->nm_idioma, null, null, null, null, 1, $this->ref_cod_biblioteca); $total = $obj_acervo_idioma->_total; // monta a lista if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $obj_biblioteca = new clsPmieducarBiblioteca($registro['ref_cod_biblioteca']); $det_biblioteca = $obj_biblioteca->detalhe(); $registro['ref_cod_biblioteca'] = $det_biblioteca['nm_biblioteca']; $this->addLinhas(array("<a href=\"educar_acervo_idioma_det.php?cod_acervo_idioma={$registro["cod_acervo_idioma"]}\">{$registro["nm_idioma"]}</a>", "<a href=\"educar_acervo_idioma_det.php?cod_acervo_idioma={$registro["cod_acervo_idioma"]}\">{$registro["ref_cod_biblioteca"]}</a>")); } } $this->addPaginador2("educar_acervo_idioma_lst.php", $total, $_GET, $this->nome, $this->limite); $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_cadastra(590, $this->pessoa_logada, 11)) { $this->acao = "go(\"educar_acervo_idioma_cad.php\")"; $this->nome_acao = "Novo"; } $this->largura = "100%"; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_biblioteca_index.php" => "i-Educar - Biblioteca", "" => "Listagem de idiomas")); $this->enviaLocalizacao($localizacao->montar()); }
function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->titulo = "Obras - Detalhe"; $this->cod_acervo = $_GET["cod_acervo"]; $tmp_obj = new clsPmieducarAcervo($this->cod_acervo); $registro = $tmp_obj->detalhe(); if (!$registro) { header("location: educar_acervo_lst.php"); die; } if (class_exists("clsPmieducarBiblioteca")) { $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca($registro["ref_cod_biblioteca"]); $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe(); $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"]; if (class_exists("clsPmieducarInstituicao")) { $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"]; $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 geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; } if (class_exists("clsPmieducarEscola")) { $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"]; $obj_ref_cod_escola = new clsPmieducarEscola($registro["ref_cod_escola"]); $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); $idpes = $det_ref_cod_escola["ref_idpes"]; if ($idpes) { $obj_escola = new clsPessoaJuridica($idpes); $obj_escola_det = $obj_escola->detalhe(); $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; } else { $obj_escola = new clsPmieducarEscolaComplemento($registro["ref_cod_escola"]); $obj_escola_det = $obj_escola->detalhe(); $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; } } } else { $registro["ref_cod_biblioteca"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarBiblioteca\n-->"; } if (class_exists("clsPmieducarExemplarTipo")) { $obj_ref_cod_exemplar_tipo = new clsPmieducarExemplarTipo($registro["ref_cod_exemplar_tipo"]); $det_ref_cod_exemplar_tipo = $obj_ref_cod_exemplar_tipo->detalhe(); $registro["ref_cod_exemplar_tipo"] = $det_ref_cod_exemplar_tipo["nm_tipo"]; } else { $registro["ref_cod_exemplar_tipo"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarExemplarTipo\n-->"; } if (class_exists("clsPmieducarAcervo")) { $obj_ref_cod_acervo = new clsPmieducarAcervo($registro["ref_cod_acervo"]); $det_ref_cod_acervo = $obj_ref_cod_acervo->detalhe(); $registro["ref_cod_acervo"] = $det_ref_cod_acervo["titulo"]; } else { $registro["ref_cod_acervo"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervo\n-->"; } if (class_exists("clsPmieducarAcervoColecao")) { $obj_ref_cod_acervo_colecao = new clsPmieducarAcervoColecao($registro["ref_cod_acervo_colecao"]); $det_ref_cod_acervo_colecao = $obj_ref_cod_acervo_colecao->detalhe(); $registro["ref_cod_acervo_colecao"] = $det_ref_cod_acervo_colecao["nm_colecao"]; } else { $registro["ref_cod_acervo_colecao"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoColecao\n-->"; } if (class_exists("clsPmieducarAcervoIdioma")) { $obj_ref_cod_acervo_idioma = new clsPmieducarAcervoIdioma($registro["ref_cod_acervo_idioma"]); $det_ref_cod_acervo_idioma = $obj_ref_cod_acervo_idioma->detalhe(); $registro["ref_cod_acervo_idioma"] = $det_ref_cod_acervo_idioma["nm_idioma"]; } else { $registro["ref_cod_acervo_idioma"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoIdioma\n-->"; } if (class_exists("clsPmieducarAcervoEditora")) { $obj_ref_cod_acervo_editora = new clsPmieducarAcervoEditora($registro["ref_cod_acervo_editora"]); $det_ref_cod_acervo_editora = $obj_ref_cod_acervo_editora->detalhe(); $registro["ref_cod_acervo_editora"] = $det_ref_cod_acervo_editora["nm_editora"]; } else { $registro["ref_cod_acervo_editora"] = "Erro na geracao"; echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoEditora\n-->"; } $obj_permissoes = new clsPermissoes(); $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel_usuario == 1) { if ($registro["ref_cod_instituicao"]) { $this->addDetalhe(array("Instituição", "{$registro["ref_cod_instituicao"]}")); } } if ($nivel_usuario == 1 || $nivel_usuario == 2) { if ($registro["ref_cod_escola"]) { $this->addDetalhe(array("Escola", "{$registro["ref_cod_escola"]}")); } } if ($registro["ref_cod_biblioteca"]) { $this->addDetalhe(array("Biblioteca", "{$registro["ref_cod_biblioteca"]}")); } if ($registro["titulo"]) { $this->addDetalhe(array("Título", "{$registro["titulo"]}")); } if ($registro["sub_titulo"]) { $this->addDetalhe(array("Subtítulo", "{$registro["sub_titulo"]}")); } if ($registro["ref_cod_exemplar_tipo"]) { $this->addDetalhe(array("Tipo", "{$registro["ref_cod_exemplar_tipo"]}")); } if ($registro["ref_cod_acervo"]) { $this->addDetalhe(array("Obra Referência", "{$registro["ref_cod_acervo"]}")); } if ($registro["ref_cod_acervo_colecao"]) { $this->addDetalhe(array("Coleção", "{$registro["ref_cod_acervo_colecao"]}")); } if ($registro["ref_cod_acervo_idioma"]) { $this->addDetalhe(array("Idioma", "{$registro["ref_cod_acervo_idioma"]}")); } if ($registro["ref_cod_acervo_editora"]) { $this->addDetalhe(array("Editora", "{$registro["ref_cod_acervo_editora"]}")); } $obj = new clsPmieducarAcervoAcervoAutor(); $obj->setOrderby("principal DESC"); $lst = $obj->lista(null, $this->cod_acervo); if ($lst) { $tabela = "<TABLE>\n\t\t\t\t\t <TR align=center>\n\t\t\t\t\t <TD bgcolor=#A1B3BD><B>Nome</B></TD>\n\t\t\t\t\t <TD bgcolor=#A1B3BD><B>Principal</B></TD>\n\t\t\t\t\t </TR>"; $cont = 0; foreach ($lst as $valor) { if ($cont % 2 == 0) { $color = " bgcolor=#E4E9ED "; } else { $color = " bgcolor=#FFFFFF "; } $obj = new clsPmieducarAcervoAutor($valor["ref_cod_acervo_autor"]); $det = $obj->detalhe(); $nm_autor = $det["nm_autor"]; $principal = $valor["principal"]; if ($principal == 1) { $principal = "sim"; } else { $principal = "não"; } $tabela .= "<TR>\n\t\t\t\t\t\t\t <TD {$color} align=left>{$nm_autor}</TD>\n\t\t\t\t\t\t\t <TD {$color} align=left>{$principal}</TD>\n\t\t\t\t\t\t\t</TR>"; $cont++; } $tabela .= "</TABLE>"; } if ($tabela) { $this->addDetalhe(array("Autor", "{$tabela}")); } if ($registro["estante"]) { $this->addDetalhe(array("Estante", "{$registro["estante"]}")); } if ($registro["cdd"]) { $this->addDetalhe(array("Cdd", "{$registro["cdd"]}")); } if ($registro["cdu"]) { $this->addDetalhe(array("Cdu", "{$registro["cdu"]}")); } if ($registro["cutter"]) { $this->addDetalhe(array("Cutter", "{$registro["cutter"]}")); } if ($registro["volume"]) { $this->addDetalhe(array("Volume", "{$registro["volume"]}")); } if ($registro["num_edicao"]) { $this->addDetalhe(array("Número Edicão", "{$registro["num_edicao"]}")); } if ($registro["ano"]) { $this->addDetalhe(array("Ano", "{$registro["ano"]}")); } if ($registro["num_paginas"]) { $this->addDetalhe(array("Número Páginas", "{$registro["num_paginas"]}")); } if ($registro["isbn"]) { $this->addDetalhe(array("ISBN", "{$registro["isbn"]}")); } $obj = new clsPmieducarAcervoAssunto(); $obj = $obj->listaAssuntosPorObra($this->cod_acervo); if (count($obj)) { foreach ($obj as $reg) { $assuntos .= '<span style="background-color: #A1B3BD; padding: 2px;"><b>' . $reg['nome'] . '</b></span> '; } if (!empty($assuntos)) { $this->addDetalhe(array("Assuntos", "{$assuntos}")); } } $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_cadastra(598, $this->pessoa_logada, 11)) { $this->url_novo = "educar_acervo_cad.php"; $this->url_editar = "educar_acervo_cad.php?cod_acervo={$registro["cod_acervo"]}"; } $this->url_cancelar = "educar_acervo_lst.php"; $this->largura = "100%"; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_biblioteca_index.php" => "i-Educar - Biblioteca", "" => "Detalhe da obra")); $this->enviaLocalizacao($localizacao->montar()); }