function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Software - Detalhe";
     $this->addBanner("http://ieducar.dccobra.com.br/intranet/imagens/nvp_top_intranet.jpg", "http://ieducar.dccobra.com.br/intranet/imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->cod_software = $_GET["cod_software"];
     $tmp_obj = new clsPmicontrolesisSoftware($this->cod_software);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header("location: controlesis_software_lst.php");
         die;
     }
     if ($registro["cod_software"]) {
         $this->addDetalhe(array("Software", "{$registro["cod_software"]}"));
     }
     if ($registro["nm_software"]) {
         $this->addDetalhe(array("Nome Software", "{$registro["nm_software"]}"));
     }
     $this->url_novo = "controlesis_software_cad.php";
     $this->url_editar = "controlesis_software_cad.php?cod_software={$registro["cod_software"]}";
     $this->url_cancelar = "controlesis_software_lst.php";
     $this->largura = "100%";
 }
 function renderHTML()
 {
     $relatorio = new relatorios("Relatório de Patch de Software", 210, false, "Patch de Software", "A4", "Prefeitura de Itajaí\nServidores\nRua Tijucas, 511 - Centro\nCEP. 88304-020 - Itajaí - SC");
     //tamanho do retangulo, tamanho das linhas.
     $relatorio->novaPagina();
     $this->cod_software_patch = $_GET['cod_software_patch'];
     $obj_patch = new clsPmicontrolesisSoftwarePatch($this->cod_software_patch);
     $det_patch = $obj_patch->detalhe();
     if (!$det_patch) {
         die("<center>Não foi possível encontrar o Patch solicitado</center>");
     }
     $obj_soft = new clsPmicontrolesisSoftware($det_patch['ref_cod_software']);
     $det_soft = $obj_soft->detalhe();
     $data_patch = dataFromPgToBr($det_patch['data_patch'], 'Y-d-m');
     $data_patch_ = dataFromPgToBr($det_patch['data_patch'], 'd/m/Y');
     $db = new clsBanco();
     $consulta = " SELECT data_patch\n\t\t\t\t        FROM pmicontrolesis.software_patch\n\t\t\t   \t       WHERE ativo = true\n\t\t\t\t         AND ref_cod_software = 1\n\t\t\t\t\t\tORDER BY data_patch DESC\n\t\t\t\t\t\t      OFFSET 1\n\t\t\t\t\t\t      LIMIT 1";
     $data_patch_anterior = $db->CampoUnico($consulta);
     $data_patch_anterior_ = dataFromPgToBr($data_patch_anterior, 'm/d/Y');
     $data_patch_anterior = dataFromPgToBr($data_patch_anterior, 'Y-d-m');
     $where_and = "";
     if ($data_patch_anterior) {
         $where_and = "  AND ( to_char(data_cadastro,'yyyy-mm-dd') > '{$data_patch_anterior}'\n\t\t\t\t\t         OR to_char(data_exclusao,'yyyy-mm-dd')   > '{$data_patch_anterior}'\n\t\t\t\t\t\t    )";
     }
     $consulta = "SELECT *\n\t\t\t\t\t   FROM pmicontrolesis.software_alteracao\n\t\t\t\t\t  WHERE ativo = true\n\t\t\t\t\t    AND ( to_char(data_cadastro,'yyyy-mm-dd')    <= '{$data_patch}'\n\t\t\t\t\t          OR to_char(data_exclusao,'yyyy-mm-dd') <= '{$data_patch}'\n\t\t\t\t\t\t    )\n\t\t\t\t\t\t{$where_and}";
     $db->Consulta($consulta);
     $periodo = $data_patch_ ? "      ALTERAÇÕES:{$data_patch_anterior_}-{$data_patch_}" : "";
     $opcoes_motivo = array('i' => 'Inserção', 'a' => 'Alteração', 'e' => 'Exclusão');
     $opcoes_tipo = array('s' => 'Script', 'b' => 'Banco');
     if ($db->Num_Linhas()) {
         $i = 0;
         $total = $db->Num_Linhas();
         $relatorio->novalinha(array("SISTEMA:  {$det_soft['nm_software']}{$periodo}        DATA PATCH:  {$data_patch_}"), 0, 13, true, "arial", false, "#d3d3d3", "#d3d3d3", "#000000");
         while ($db->ProximoRegistro()) {
             $registro = $db->Tupla();
             $registro['motivo'] = $opcoes_motivo[$registro['motivo']];
             $registro['tipo'] = $opcoes_tipo[$registro['tipo']];
             $num_linhas = 6 + (int) strlen($registro['descricao']) / 85;
             $data = $registro['data_exclusao'] ? dataFromPgToBr($registro['data_exclusao']) : dataFromPgToBr($registro['data_cadastro']);
             $relatorio->novalinha(array("Descrição de alterações:  {$registro['descricao']}\nMotivo Alteração: {$registro['motivo']}\nTipo Alteração:{$registro['tipo']}\nScript/Banco:{$registro['script_banco']}\nData: {$data}"), 0, $num_linhas * 10, false, "arial", false, "#ffffff", "#ffffff", "#ffffff", false, false, null, null, 'justify');
             $i++;
             if ($i < $total) {
                 $relatorio->novalinha(array(""), 0, 5, false, false, false, false, false, false, true);
             }
         }
         $link = $relatorio->fechaPdf();
     } else {
         $this->campoRotulo("aviso", "Aviso", "Nenhuma Registro neste relat&oacute;rio.");
     }
     echo "<script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=" . $link . "'}</script>";
     echo "<html><center>Se o download não iniciar automaticamente <br /><a target='_blank' href='" . $link . "' style='font-size: 16px; color: #000000; text-decoration: underline;'>clique aqui!</a><br><br>\n\t\t\t<span style='font-size: 10px;'>Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br>\n\n\t\t\tClique na Imagem para Baixar o instalador<br><br>\n\t\t\t<a href=\"http://www.adobe.com.br/products/acrobat/readstep2.html\" target=\"new\"><br><img src=\"imagens/acrobat.gif\" width=\"88\" height=\"31\" border=\"0\"></a>\n\t\t\t</span>\n\t\t\t</center>";
 }
 function Excluir()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $obj = new clsPmicontrolesisSoftware($this->cod_software, $this->pessoa_logada, $this->pessoa_logada, $this->nm_software, $this->data_cadastro, $this->data_exclusao, 0);
     $excluiu = $obj->excluir();
     if ($excluiu) {
         $this->mensagem .= "Exclus&atilde;o efetuada com sucesso.<br>";
         header("Location: controlesis_software_lst.php");
         die;
         return true;
     }
     $this->mensagem = "Exclus&atilde;o n&atilde;o realizada.<br>";
     echo "<!--\nErro ao excluir clsPmicontrolesisSoftware\nvalores obrigatorios\nif( is_numeric( {$this->cod_software} ) && is_numeric( {$this->ref_funcionario_exc} ) )\n-->";
     return false;
 }
 function Gerar()
 {
     @session_start();
     $this->__pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->__titulo = "Software - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addBanner("http://ieducar.dccobra.com.br/intranet/imagens/nvp_top_intranet.jpg", "http://ieducar.dccobra.com.br/intranet/imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->addCabecalhos(array("Nome Software"));
     // Filtros de Foreign Keys
     // outros Filtros
     $this->campoTexto("nm_software", "Nome Software", $this->nm_software, 30, 255, false);
     // Paginador
     $this->__limite = 20;
     $this->__offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->__limite - $this->__limite : 0;
     $obj_software = new clsPmicontrolesisSoftware();
     $obj_software->setOrderby("nm_software ASC");
     $obj_software->setLimite($this->__limite, $this->__offset);
     $lista = $obj_software->lista(null, null, $this->nm_software, null, null, 1);
     $total = $obj_software->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $this->addLinhas(array("<a href=\"controlesis_software_det.php?cod_software={$registro["cod_software"]}\">{$registro["nm_software"]}</a>"));
         }
     }
     $this->addPaginador2("controlesis_software_lst.php", $total, $_GET, $this->nome, $this->__limite);
     $this->acao = "go(\"controlesis_software_cad.php\")";
     $this->nome_acao = "Novo";
     $this->largura = "100%";
 }
 function Gerar()
 {
     // primary keys
     $this->campoOculto("cod_software_alteracao", $this->cod_software_alteracao);
     // foreign keys
     $opcoes = array("" => "Selecione");
     if (class_exists("clsPmicontrolesisSoftware")) {
         $objTemp = new clsPmicontrolesisSoftware();
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_software']}"] = "{$registro['nm_software']}";
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmicontrolesisSoftware nao encontrada\n-->";
         $opcoes = array("" => "Erro na geracao");
     }
     $this->campoLista("ref_cod_software", "Software", $opcoes, $this->ref_cod_software);
     $this->campoLista("motivo", "Motivo", array('' => 'Selecione', 'i' => 'Inserção', 'a' => 'Alteração', 'e' => 'Exclusão'), $this->motivo);
     $this->campoLista("tipo", "Tipo", array('' => 'Selecione', 's' => 'Script', 'b' => 'Banco'), $this->tipo);
     $this->campoTexto("script_banco", "Nome do Script/Banco", $this->script_banco, 30, 100, true);
     $this->campoMemo("descricao", "Descric&atilde;o", $this->descricao, 60, 10, true);
 }
 function Gerar()
 {
     @session_start();
     $this->__pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->__titulo = "Software Alteracao - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addBanner("/intranet/imagens/nvp_top_intranet.jpg", "/intranet/imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->addCabecalhos(array("Software", "Motivo", "Tipo", "Descric&atilde;o"));
     // Filtros de Foreign Keys
     $opcoes = array("" => "Selecione");
     if (class_exists("clsPmicontrolesisSoftware")) {
         $objTemp = new clsPmicontrolesisSoftware();
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_software']}"] = "{$registro['nm_software']}";
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmicontrolesisSoftware nao encontrada\n-->";
         $opcoes = array("" => "Erro na geracao");
     }
     $this->campoLista("ref_cod_software", "Software", $opcoes, $this->ref_cod_software);
     // outros Filtros
     $this->campoLista("motivo", "Motivo", array('' => 'Selecione', 'i' => 'Inserção', 'a' => 'Alteração', 'e' => 'Exclusão'), $this->motivo);
     $this->campoLista("tipo", "Tipo", array('' => 'Selecione', 's' => 'Script', 'b' => 'Banco'), $this->tipo);
     // Paginador
     $this->__limite = 20;
     $this->__offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->__limite - $this->__limite : 0;
     $obj_software_alteracao = new clsPmicontrolesisSoftwareAlteracao();
     $obj_software_alteracao->setOrderby("motivo ASC");
     $obj_software_alteracao->setLimite($this->__limite, $this->__offset);
     $lista = $obj_software_alteracao->lista(null, null, $this->ref_cod_software, $this->motivo, $this->tipo, $this->descricao, null, null, 1);
     $total = $obj_software_alteracao->_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("clsFuncionario")) {
                 $obj_ref_funcionario_exc = new clsFuncionario($registro["ref_funcionario_exc"]);
                 $det_ref_funcionario_exc = $obj_ref_funcionario_exc->detalhe();
                 if (is_object($det_ref_funcionario_exc["idpes"])) {
                     $det_ref_funcionario_exc = $det_ref_funcionario_exc["idpes"]->detalhe();
                     $registro["ref_funcionario_exc"] = $det_ref_funcionario_exc["nome"];
                 } else {
                     $pessoa = new clsPessoa_($det_ref_funcionario_exc["idpes"]);
                     $det_ref_funcionario_exc = $pessoa->detalhe();
                     $registro["ref_funcionario_exc"] = $det_ref_funcionario_exc["nome"];
                 }
             } else {
                 $registro["ref_funcionario_exc"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsFuncionario\n-->";
             }
             if (class_exists("clsFuncionario")) {
                 $obj_ref_funcionario_cad = new clsFuncionario($registro["ref_funcionario_cad"]);
                 $det_ref_funcionario_cad = $obj_ref_funcionario_cad->detalhe();
                 if (is_object($det_ref_funcionario_cad["idpes"])) {
                     $det_ref_funcionario_cad = $det_ref_funcionario_cad["idpes"]->detalhe();
                     $registro["ref_funcionario_cad"] = $det_ref_funcionario_cad["nome"];
                 } else {
                     $pessoa = new clsPessoa_($det_ref_funcionario_cad["idpes"]);
                     $det_ref_funcionario_cad = $pessoa->detalhe();
                     $registro["ref_funcionario_cad"] = $det_ref_funcionario_cad["nome"];
                 }
             } else {
                 $registro["ref_funcionario_cad"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsFuncionario\n-->";
             }
             if (class_exists("clsPmicontrolesisSoftware")) {
                 $obj_ref_cod_software = new clsPmicontrolesisSoftware($registro["ref_cod_software"]);
                 $det_ref_cod_software = $obj_ref_cod_software->detalhe();
                 $registro["ref_cod_software"] = $det_ref_cod_software["nm_software"];
             } else {
                 $registro["ref_cod_software"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsPmicontrolesisSoftware\n-->";
             }
             $opcoes = array('i' => 'Inserção', 'a' => 'Alteração', 'e' => 'Exclusão');
             $registro["motivo"] = $opcoes[$registro["motivo"]];
             $opcoes = array('s' => 'Script', 'b' => 'Banco');
             $registro["tipo"] = $opcoes[$registro["tipo"]];
             $this->addLinhas(array("<a href=\"controlesis_software_alteracao_det.php?cod_software_alteracao={$registro["cod_software_alteracao"]}\">{$registro["ref_cod_software"]}</a>", "<a href=\"controlesis_software_alteracao_det.php?cod_software_alteracao={$registro["cod_software_alteracao"]}\">{$registro["motivo"]}</a>", "<a href=\"controlesis_software_alteracao_det.php?cod_software_alteracao={$registro["cod_software_alteracao"]}\">{$registro["tipo"]}</a>", "<a href=\"controlesis_software_alteracao_det.php?cod_software_alteracao={$registro["cod_software_alteracao"]}\">" . truncate($registro["descricao"], 30) . "</a>"));
         }
     }
     $this->addPaginador2("controlesis_software_alteracao_lst.php", $total, $_GET, $this->nome, $this->__limite);
     $this->acao = "go(\"controlesis_software_alteracao_cad.php\")";
     $this->nome_acao = "Novo";
     $this->largura = "100%";
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Software Alteracao - Detalhe";
     $this->addBanner("http://ieducar.dccobra.com.br/intranet/imagens/nvp_top_intranet.jpg", "http://ieducar.dccobra.com.br/intranet/imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->cod_software_alteracao = $_GET["cod_software_alteracao"];
     $tmp_obj = new clsPmicontrolesisSoftwareAlteracao($this->cod_software_alteracao);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header("location: controlesis_software_alteracao_lst.php");
         die;
     }
     if (class_exists("clsFuncionario")) {
         $obj_ref_funcionario_exc = new clsFuncionario($registro["ref_funcionario_exc"]);
         $det_ref_funcionario_exc = $obj_ref_funcionario_exc->detalhe();
         if (is_object($det_ref_funcionario_exc["idpes"])) {
             $det_ref_funcionario_exc = $det_ref_funcionario_exc["idpes"]->detalhe();
             $registro["ref_funcionario_exc"] = $det_ref_funcionario_exc["nome"];
         } else {
             $pessoa = new clsPessoa_($det_ref_funcionario_exc["idpes"]);
             $det_ref_funcionario_exc = $pessoa->detalhe();
             $registro["ref_funcionario_exc"] = $det_ref_funcionario_exc["nome"];
         }
     } else {
         $registro["ref_funcionario_exc"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsFuncionario\n-->";
     }
     if (class_exists("clsFuncionario")) {
         $obj_ref_funcionario_cad = new clsFuncionario($registro["ref_funcionario_cad"]);
         $det_ref_funcionario_cad = $obj_ref_funcionario_cad->detalhe();
         if (is_object($det_ref_funcionario_cad["idpes"])) {
             $det_ref_funcionario_cad = $det_ref_funcionario_cad["idpes"]->detalhe();
             $registro["ref_funcionario_cad"] = $det_ref_funcionario_cad["nome"];
         } else {
             $pessoa = new clsPessoa_($det_ref_funcionario_cad["idpes"]);
             $det_ref_funcionario_cad = $pessoa->detalhe();
             $registro["ref_funcionario_cad"] = $det_ref_funcionario_cad["nome"];
         }
     } else {
         $registro["ref_funcionario_cad"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsFuncionario\n-->";
     }
     if (class_exists("clsPmicontrolesisSoftware")) {
         $obj_ref_cod_software = new clsPmicontrolesisSoftware($registro["ref_cod_software"]);
         $det_ref_cod_software = $obj_ref_cod_software->detalhe();
         $registro["ref_cod_software"] = $det_ref_cod_software["nm_software"];
     } else {
         $registro["ref_cod_software"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmicontrolesisSoftware\n-->";
     }
     if ($registro["cod_software_alteracao"]) {
         $this->addDetalhe(array("Software Alterac&atilde;o", "{$registro["cod_software_alteracao"]}"));
     }
     if ($registro["ref_cod_software"]) {
         $this->addDetalhe(array("Software", "{$registro["ref_cod_software"]}"));
     }
     if ($registro["motivo"]) {
         $opcoes = array('' => 'Selecione', 'i' => 'Inserção', 'a' => 'Alteração', 'e' => 'Exclusão');
         $this->addDetalhe(array("Motivo", $opcoes["{$registro["motivo"]}"]));
     }
     if ($registro["tipo"]) {
         $opcoes = array('' => 'Selecione', 's' => 'Script', 'b' => 'Banco');
         $this->addDetalhe(array("Tipo", $opcoes["{$registro["tipo"]}"]));
     }
     if ($registro["script_banco"]) {
         $this->addDetalhe(array("Script/Banco", "{$registro["script_banco"]}"));
     }
     if ($registro["descricao"]) {
         $this->addDetalhe(array("Descric&atilde;o", "{$registro["descricao"]}"));
     }
     $this->url_novo = "controlesis_software_alteracao_cad.php";
     $this->url_editar = "controlesis_software_alteracao_cad.php?cod_software_alteracao={$registro["cod_software_alteracao"]}";
     $this->url_cancelar = "controlesis_software_alteracao_lst.php";
     $this->largura = "100%";
 }
 function Gerar()
 {
     @session_start();
     $this->__pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->__titulo = "Software Patch - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addBanner("http://ieducar.dccobra.com.br/intranet/imagens/nvp_top_intranet.jpg", "http://ieducar.dccobra.com.br/intranet/imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->addCabecalhos(array("Software", "Data Patch"));
     // Filtros de Foreign Keys
     $opcoes = array("" => "Selecione");
     if (class_exists("clsPmicontrolesisSoftware")) {
         $objTemp = new clsPmicontrolesisSoftware();
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_software']}"] = "{$registro['nm_software']}";
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmicontrolesisSoftware nao encontrada\n-->";
         $opcoes = array("" => "Erro na geracao");
     }
     $this->campoLista("ref_cod_software", "Software", $opcoes, $this->ref_cod_software);
     // outros Filtros
     $this->campoData("data_patch", "Data Patch", $this->data_patch, false);
     // Paginador
     $this->__limite = 20;
     $this->__offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->__limite - $this->__limite : 0;
     $obj_software_patch = new clsPmicontrolesisSoftwarePatch();
     $obj_software_patch->setOrderby("data_patch DESC");
     $obj_software_patch->setLimite($this->__limite, $this->__offset);
     $lista = $obj_software_patch->lista(null, null, $this->ref_cod_software, $this->data_patch_ini, $this->data_patch_fim, null, null, 1);
     $total = $obj_software_patch->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // muda os campos data
             $registro["data_patch_time"] = strtotime(substr($registro["data_patch"], 0, 16));
             $registro["data_patch_br"] = date("d/m/Y", $registro["data_patch_time"]);
             $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("clsFuncionario")) {
                 $obj_ref_funcionario_cad = new clsFuncionario($registro["ref_funcionario_cad"]);
                 $det_ref_funcionario_cad = $obj_ref_funcionario_cad->detalhe();
                 if (is_object($det_ref_funcionario_cad["idpes"])) {
                     $det_ref_funcionario_cad = $det_ref_funcionario_cad["idpes"]->detalhe();
                     $registro["ref_funcionario_cad"] = $det_ref_funcionario_cad["nome"];
                 } else {
                     $pessoa = new clsPessoa_($det_ref_funcionario_cad["idpes"]);
                     $det_ref_funcionario_cad = $pessoa->detalhe();
                     $registro["ref_funcionario_cad"] = $det_ref_funcionario_cad["nome"];
                 }
             } else {
                 $registro["ref_funcionario_cad"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsFuncionario\n-->";
             }
             if (class_exists("clsFuncionario")) {
                 $obj_ref_funcionario_exc = new clsFuncionario($registro["ref_funcionario_exc"]);
                 $det_ref_funcionario_exc = $obj_ref_funcionario_exc->detalhe();
                 if (is_object($det_ref_funcionario_exc["idpes"])) {
                     $det_ref_funcionario_exc = $det_ref_funcionario_exc["idpes"]->detalhe();
                     $registro["ref_funcionario_exc"] = $det_ref_funcionario_exc["nome"];
                 } else {
                     $pessoa = new clsPessoa_($det_ref_funcionario_exc["idpes"]);
                     $det_ref_funcionario_exc = $pessoa->detalhe();
                     $registro["ref_funcionario_exc"] = $det_ref_funcionario_exc["nome"];
                 }
             } else {
                 $registro["ref_funcionario_exc"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsFuncionario\n-->";
             }
             if (class_exists("clsPmicontrolesisSoftware")) {
                 $obj_ref_cod_software = new clsPmicontrolesisSoftware($registro["ref_cod_software"]);
                 $det_ref_cod_software = $obj_ref_cod_software->detalhe();
                 $registro["ref_cod_software"] = $det_ref_cod_software["nm_software"];
             } else {
                 $registro["ref_cod_software"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsPmicontrolesisSoftware\n-->";
             }
             $this->addLinhas(array("<a href=\"controlesis_software_patch_det.php?cod_software_patch={$registro["cod_software_patch"]}\">{$registro["ref_cod_software"]}</a>", "<a href=\"controlesis_software_patch_det.php?cod_software_patch={$registro["cod_software_patch"]}\">{$registro["data_patch_br"]}</a>"));
         }
     }
     $this->addPaginador2("controlesis_software_patch_lst.php", $total, $_GET, $this->nome, $this->__limite);
     $this->acao = "go(\"controlesis_software_patch_cad.php\")";
     $this->nome_acao = "Novo";
     $this->largura = "100%";
 }
 function Gerar()
 {
     // primary keys
     $this->campoOculto("cod_software_patch", $this->cod_software_patch);
     // foreign keys
     $opcoes = array("" => "Selecione");
     if (class_exists("clsPmicontrolesisSoftware")) {
         $objTemp = new clsPmicontrolesisSoftware();
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_software']}"] = "{$registro['nm_software']}";
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmicontrolesisSoftware nao encontrada\n-->";
         $opcoes = array("" => "Erro na geracao");
     }
     $this->campoLista("ref_cod_software", "Software", $opcoes, $this->ref_cod_software);
     // text
     // data
     $this->campoData("data_patch", "Data Patch", $this->data_patch, true);
     // time
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Software Patch - Detalhe";
     $this->addBanner("http://ieducar.dccobra.com.br/intranet/imagens/nvp_top_intranet.jpg", "http://ieducar.dccobra.com.br/intranet/imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->cod_software_patch = $_GET["cod_software_patch"];
     $tmp_obj = new clsPmicontrolesisSoftwarePatch($this->cod_software_patch);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header("location: controlesis_software_patch_lst.php");
         die;
     }
     if (class_exists("clsFuncionario")) {
         $obj_ref_funcionario_cad = new clsFuncionario($registro["ref_funcionario_cad"]);
         $det_ref_funcionario_cad = $obj_ref_funcionario_cad->detalhe();
         if (is_object($det_ref_funcionario_cad["idpes"])) {
             $det_ref_funcionario_cad = $det_ref_funcionario_cad["idpes"]->detalhe();
             $registro["ref_funcionario_cad"] = $det_ref_funcionario_cad["nome"];
         } else {
             $pessoa = new clsPessoa_($det_ref_funcionario_cad["idpes"]);
             $det_ref_funcionario_cad = $pessoa->detalhe();
             $registro["ref_funcionario_cad"] = $det_ref_funcionario_cad["nome"];
         }
     } else {
         $registro["ref_funcionario_cad"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsFuncionario\n-->";
     }
     if (class_exists("clsFuncionario")) {
         $obj_ref_funcionario_exc = new clsFuncionario($registro["ref_funcionario_exc"]);
         $det_ref_funcionario_exc = $obj_ref_funcionario_exc->detalhe();
         if (is_object($det_ref_funcionario_exc["idpes"])) {
             $det_ref_funcionario_exc = $det_ref_funcionario_exc["idpes"]->detalhe();
             $registro["ref_funcionario_exc"] = $det_ref_funcionario_exc["nome"];
         } else {
             $pessoa = new clsPessoa_($det_ref_funcionario_exc["idpes"]);
             $det_ref_funcionario_exc = $pessoa->detalhe();
             $registro["ref_funcionario_exc"] = $det_ref_funcionario_exc["nome"];
         }
     } else {
         $registro["ref_funcionario_exc"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsFuncionario\n-->";
     }
     if (class_exists("clsPmicontrolesisSoftware")) {
         $obj_ref_cod_software = new clsPmicontrolesisSoftware($registro["ref_cod_software"]);
         $det_ref_cod_software = $obj_ref_cod_software->detalhe();
         $registro["ref_cod_software"] = $det_ref_cod_software["nm_software"];
     } else {
         $registro["ref_cod_software"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmicontrolesisSoftware\n-->";
     }
     if ($registro["cod_software_patch"]) {
         $this->addDetalhe(array("Software Patch", "{$registro["cod_software_patch"]}"));
     }
     if ($registro["ref_cod_software"]) {
         $this->addDetalhe(array("Software", "{$registro["ref_cod_software"]}"));
     }
     if ($registro["data_patch"]) {
         $this->addDetalhe(array("Data Patch", dataFromPgToBr($registro["data_patch"], "d/m/Y")));
     }
     $this->url_novo = "controlesis_software_patch_cad.php";
     $this->url_editar = "controlesis_software_patch_cad.php?cod_software_patch={$registro["cod_software_patch"]}";
     $this->array_botao[] = 'Relatorio Alterações';
     $this->array_botao_url_script[] = "showExpansivelImprimir(400, 200,  \"controlesis_relatorio_software_patch.php?cod_software_patch={$this->cod_software_patch}\",[], \"Relatório i-Educar\" )";
     $this->url_cancelar = "controlesis_software_patch_lst.php";
     $this->largura = "100%";
 }