SetTitulo( "{$this->_instituicao} Setor" ); $this->processoAp = "375"; } } class indice extends clsDetalhe { var $cod_setor; function Gerar() { $this->titulo = "Detalhe do Setor"; $this->cod_setor = @$_GET['cod_setor']; $obj_setor = new clsSetor( $this->cod_setor); $detalhe = $obj_setor->detalhe(); if( ! $detalhe ) { $this->addDetalhe( array( "Erro", "Setor Inexistente" ) ); } else { $objSetor = new clsSetor( $detalhe["cod_setor"] ); $parentes = $objSetor->getNiveis( $detalhe["cod_setor"] ); $strParentes = ""; $gruda = ""; for ( $i = 0; $i < count( $parentes ); $i++ ) { $objSetor = new clsSetor( $parentes[$i] ); $detalheSetor = $objSetor->detalhe(); $strParentes = " {$detalheSetor["nm_setor"]} - {$detalheSetor["sgl_setor"]}"; //$gruda = " > "; $gruda .= "    "; if($i == 0) { $this->addDetalhe( array( "Setor", $strParentes ) ); } else { $this->addDetalhe( array( "Setor", "$gruda$strParentes" ) ); } } $ref_cod_pessoa_cad = $detalhe["ref_cod_pessoa_cad"]; $obj_pessoa_fj = new clsPessoaFj($ref_cod_pessoa_cad); $det = $obj_pessoa_fj->detalhe(); $this->addDetalhe( array( "Responsável pelo cadastro", $det["nome"] ) ); $ativo = $detalhe["ativo"] == 1 ? "Sim" : "Não"; $this->addDetalhe( array( "Ativo", $ativo ) ); $no_paco = $detalhe["no_paco"] ? "Sim" : "Não"; $this->addDetalhe( array( "No Paço", $no_paco ) ); if($detalhe["endereco"]) { $this->addDetalhe( array( "Endereço", $detalhe["endereco"] ) ); } if ($detalhe["tipo"]) { switch ($detalhe["tipo"]) { case "s": $this->addDetalhe( array( "Tipo", "Secretaria" ) ); break; case "a": $this->addDetalhe( array( "Tipo", "Altarquia" ) ); break; case "f": $this->addDetalhe( array( "Tipo", "Fundação" ) ); break; } } if($detalhe["refIdpesResp"]) { $obj_pessoa = new clsPessoa($detalhe["refIdpesResp"]); $det_pessoa = $obj_pessoa->detalhe(); $this->addDetalhe( array( "Secretario", $det_pessoa["nome"] ) ); } } if(!is_null($detalhe["ref_cod_setor"])) { $this->url_editar = "oprot_setor_cad.php?cod_setor={$this->cod_setor}&setor_atual=$detalhe[ref_cod_setor]"; } else { $this->url_editar = "oprot_setor_cad.php?cod_setor={$this->cod_setor}"; } $this->url_novo = "oprot_setor_cad.php"; $this->url_cancelar = "oprot_setor_lst.php"; $this->largura = "100%"; } } $pagina = new clsIndex(); $miolo = new indice(); $pagina->addForm( $miolo ); $pagina->MakeAll(); ?>