Commit c92f6c7896d776772fcceb25b4a1963ec22cc505
Committed by
Yago Regis Santos Rodrigues
1 parent
1266bf8b
Exists in
master
Padronização dos detalhes do módulo biblioteca
Showing
6 changed files
with
378 additions
and
2 deletions
Show diff stats
ieducar/intranet/educar_acervo_assunto_det.php
| @@ -70,12 +70,75 @@ class indice extends clsDetalhe | @@ -70,12 +70,75 @@ class indice extends clsDetalhe | ||
| 70 | 70 | ||
| 71 | $tmp_obj = new clsPmieducarAcervoAssunto( $this->cod_acervo_assunto ); | 71 | $tmp_obj = new clsPmieducarAcervoAssunto( $this->cod_acervo_assunto ); |
| 72 | $registro = $tmp_obj->detalhe(); | 72 | $registro = $tmp_obj->detalhe(); |
| 73 | + | ||
| 74 | + if( class_exists( "clsPmieducarBiblioteca" ) ) | ||
| 75 | + { | ||
| 76 | + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] ); | ||
| 77 | + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe(); | ||
| 78 | + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"]; | ||
| 79 | + if( class_exists( "clsPmieducarInstituicao" ) ) | ||
| 80 | + { | ||
| 81 | + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"]; | ||
| 82 | + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] ); | ||
| 83 | + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe(); | ||
| 84 | + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"]; | ||
| 85 | + } | ||
| 86 | + else | ||
| 87 | + { | ||
| 88 | + $registro["ref_cod_instituicao"] = "Erro na geracao"; | ||
| 89 | + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + if( class_exists( "clsPmieducarEscola" ) ) | ||
| 94 | + { | ||
| 95 | + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"]; | ||
| 96 | + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] ); | ||
| 97 | + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | ||
| 98 | + $idpes = $det_ref_cod_escola["ref_idpes"]; | ||
| 99 | + if ($idpes) | ||
| 100 | + { | ||
| 101 | + $obj_escola = new clsPessoaJuridica( $idpes ); | ||
| 102 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 103 | + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; | ||
| 104 | + } | ||
| 105 | + else | ||
| 106 | + { | ||
| 107 | + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] ); | ||
| 108 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 109 | + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; | ||
| 110 | + } | ||
| 111 | + } | ||
| 73 | 112 | ||
| 113 | + $obj_permissoes = new clsPermissoes(); | ||
| 114 | + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | ||
| 115 | + | ||
| 74 | if( ! $registro ) | 116 | if( ! $registro ) |
| 75 | { | 117 | { |
| 76 | header( "location: educar_acervo_assunto_lst.php" ); | 118 | header( "location: educar_acervo_assunto_lst.php" ); |
| 77 | die(); | 119 | die(); |
| 78 | } | 120 | } |
| 121 | + | ||
| 122 | + if ($nivel_usuario == 1) | ||
| 123 | + { | ||
| 124 | + if( $registro["ref_cod_instituicao"] ) | ||
| 125 | + { | ||
| 126 | + $this->addDetalhe( array( "Instituição", "{$registro["ref_cod_instituicao"]}") ); | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + if ($nivel_usuario == 1 || $nivel_usuario == 2) | ||
| 131 | + { | ||
| 132 | + if( $registro["ref_cod_escola"] ) | ||
| 133 | + { | ||
| 134 | + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") ); | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + if( $registro["ref_cod_biblioteca"] ) | ||
| 139 | + { | ||
| 140 | + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") ); | ||
| 141 | + } | ||
| 79 | 142 | ||
| 80 | if( $registro["nm_assunto"] ) | 143 | if( $registro["nm_assunto"] ) |
| 81 | { | 144 | { |
ieducar/intranet/educar_acervo_editora_det.php
| @@ -77,6 +77,49 @@ class indice extends clsDetalhe | @@ -77,6 +77,49 @@ class indice extends clsDetalhe | ||
| 77 | 77 | ||
| 78 | $tmp_obj = new clsPmieducarAcervoEditora( $this->cod_acervo_editora ); | 78 | $tmp_obj = new clsPmieducarAcervoEditora( $this->cod_acervo_editora ); |
| 79 | $registro = $tmp_obj->detalhe(); | 79 | $registro = $tmp_obj->detalhe(); |
| 80 | + | ||
| 81 | + if( class_exists( "clsPmieducarBiblioteca" ) ) | ||
| 82 | + { | ||
| 83 | + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] ); | ||
| 84 | + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe(); | ||
| 85 | + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"]; | ||
| 86 | + if( class_exists( "clsPmieducarInstituicao" ) ) | ||
| 87 | + { | ||
| 88 | + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"]; | ||
| 89 | + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] ); | ||
| 90 | + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe(); | ||
| 91 | + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"]; | ||
| 92 | + } | ||
| 93 | + else | ||
| 94 | + { | ||
| 95 | + $registro["ref_cod_instituicao"] = "Erro na geracao"; | ||
| 96 | + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + if( class_exists( "clsPmieducarEscola" ) ) | ||
| 101 | + { | ||
| 102 | + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"]; | ||
| 103 | + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] ); | ||
| 104 | + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | ||
| 105 | + $idpes = $det_ref_cod_escola["ref_idpes"]; | ||
| 106 | + if ($idpes) | ||
| 107 | + { | ||
| 108 | + $obj_escola = new clsPessoaJuridica( $idpes ); | ||
| 109 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 110 | + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; | ||
| 111 | + } | ||
| 112 | + else | ||
| 113 | + { | ||
| 114 | + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] ); | ||
| 115 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 116 | + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + $obj_permissoes = new clsPermissoes(); | ||
| 121 | + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | ||
| 122 | + | ||
| 80 | 123 | ||
| 81 | if( ! $registro ) | 124 | if( ! $registro ) |
| 82 | { | 125 | { |
| @@ -112,6 +155,28 @@ class indice extends clsDetalhe | @@ -112,6 +155,28 @@ class indice extends clsDetalhe | ||
| 112 | { | 155 | { |
| 113 | $this->addDetalhe( array( "Editora", "{$registro["nm_editora"]}") ); | 156 | $this->addDetalhe( array( "Editora", "{$registro["nm_editora"]}") ); |
| 114 | } | 157 | } |
| 158 | + | ||
| 159 | + if ($nivel_usuario == 1) | ||
| 160 | + { | ||
| 161 | + if( $registro["ref_cod_instituicao"] ) | ||
| 162 | + { | ||
| 163 | + $this->addDetalhe( array( "Instituição", "{$registro["ref_cod_instituicao"]}") ); | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + if ($nivel_usuario == 1 || $nivel_usuario == 2) | ||
| 168 | + { | ||
| 169 | + if( $registro["ref_cod_escola"] ) | ||
| 170 | + { | ||
| 171 | + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") ); | ||
| 172 | + } | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + if( $registro["ref_cod_biblioteca"] ) | ||
| 176 | + { | ||
| 177 | + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") ); | ||
| 178 | + } | ||
| 179 | + | ||
| 115 | if( $registro["cep"] ) | 180 | if( $registro["cep"] ) |
| 116 | { | 181 | { |
| 117 | $registro["cep"] = int2CEP($registro["cep"]); | 182 | $registro["cep"] = int2CEP($registro["cep"]); |
ieducar/intranet/educar_biblioteca_dados_det.php
| @@ -75,10 +75,49 @@ class indice extends clsDetalhe | @@ -75,10 +75,49 @@ class indice extends clsDetalhe | ||
| 75 | 75 | ||
| 76 | $tmp_obj = new clsPmieducarBiblioteca( $this->cod_biblioteca ); | 76 | $tmp_obj = new clsPmieducarBiblioteca( $this->cod_biblioteca ); |
| 77 | $registro = $tmp_obj->detalhe(); | 77 | $registro = $tmp_obj->detalhe(); |
| 78 | + | ||
| 79 | + if( class_exists( "clsPmieducarInstituicao" ) ) | ||
| 80 | + { | ||
| 81 | + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] ); | ||
| 82 | + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe(); | ||
| 83 | + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"]; | ||
| 84 | + } | ||
| 85 | + else | ||
| 86 | + { | ||
| 87 | + $registro["ref_cod_instituicao"] = "Erro na geracao"; | ||
| 88 | + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; | ||
| 89 | + } | ||
| 78 | 90 | ||
| 91 | + if( class_exists( "clsPmieducarEscola" ) ) | ||
| 92 | + { | ||
| 93 | + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] ); | ||
| 94 | + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | ||
| 95 | + $idpes = $det_ref_cod_escola["ref_idpes"]; | ||
| 96 | + if ($idpes) | ||
| 97 | + { | ||
| 98 | + $obj_escola = new clsPessoaJuridica( $idpes ); | ||
| 99 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 100 | + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; | ||
| 101 | + } | ||
| 102 | + else | ||
| 103 | + { | ||
| 104 | + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] ); | ||
| 105 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 106 | + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + else | ||
| 110 | + { | ||
| 111 | + $registro["ref_cod_escola"] = "Erro na geracao"; | ||
| 112 | + echo "<!--\nErro\nClasse nao existente: clsPmieducarEscola\n-->"; | ||
| 113 | + } | ||
| 114 | + | ||
| 79 | $obj_permissoes = new clsPermissoes(); | 115 | $obj_permissoes = new clsPermissoes(); |
| 80 | $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | 116 | $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); |
| 81 | - if($nivel_usuario <= 3) | 117 | + |
| 118 | + | ||
| 119 | + | ||
| 120 | + if($nivel_usuario <= 3) | ||
| 82 | $permitido = true; | 121 | $permitido = true; |
| 83 | else{ | 122 | else{ |
| 84 | $obj_usuario_bib = new clsPmieducarBibliotecaUsuario(); | 123 | $obj_usuario_bib = new clsPmieducarBibliotecaUsuario(); |
| @@ -100,6 +139,22 @@ class indice extends clsDetalhe | @@ -100,6 +139,22 @@ class indice extends clsDetalhe | ||
| 100 | header( "location: educar_biblioteca_dados_lst.php" ); | 139 | header( "location: educar_biblioteca_dados_lst.php" ); |
| 101 | die(); | 140 | die(); |
| 102 | } | 141 | } |
| 142 | + | ||
| 143 | + if ($nivel_usuario == 1) | ||
| 144 | + { | ||
| 145 | + if( $registro["ref_cod_instituicao"] ) | ||
| 146 | + { | ||
| 147 | + $this->addDetalhe( array( "Instituição", "{$registro["ref_cod_instituicao"]}") ); | ||
| 148 | + } | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + if ($nivel_usuario == 1 || $nivel_usuario == 2) | ||
| 152 | + { | ||
| 153 | + if( $registro["ref_cod_escola"] ) | ||
| 154 | + { | ||
| 155 | + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") ); | ||
| 156 | + } | ||
| 157 | + } | ||
| 103 | 158 | ||
| 104 | if( $registro["nm_biblioteca"] ) | 159 | if( $registro["nm_biblioteca"] ) |
| 105 | { | 160 | { |
ieducar/intranet/educar_fonte_det.php
| @@ -70,17 +70,83 @@ class indice extends clsDetalhe | @@ -70,17 +70,83 @@ class indice extends clsDetalhe | ||
| 70 | $tmp_obj = new clsPmieducarFonte( $this->cod_fonte ); | 70 | $tmp_obj = new clsPmieducarFonte( $this->cod_fonte ); |
| 71 | $registro = $tmp_obj->detalhe(); | 71 | $registro = $tmp_obj->detalhe(); |
| 72 | 72 | ||
| 73 | + if( class_exists( "clsPmieducarBiblioteca" ) ) | ||
| 74 | + { | ||
| 75 | + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] ); | ||
| 76 | + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe(); | ||
| 77 | + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"]; | ||
| 78 | + if( class_exists( "clsPmieducarInstituicao" ) ) | ||
| 79 | + { | ||
| 80 | + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"]; | ||
| 81 | + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] ); | ||
| 82 | + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe(); | ||
| 83 | + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"]; | ||
| 84 | + } | ||
| 85 | + else | ||
| 86 | + { | ||
| 87 | + $registro["ref_cod_instituicao"] = "Erro na geracao"; | ||
| 88 | + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + if( class_exists( "clsPmieducarEscola" ) ) | ||
| 93 | + { | ||
| 94 | + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"]; | ||
| 95 | + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] ); | ||
| 96 | + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | ||
| 97 | + $idpes = $det_ref_cod_escola["ref_idpes"]; | ||
| 98 | + if ($idpes) | ||
| 99 | + { | ||
| 100 | + $obj_escola = new clsPessoaJuridica( $idpes ); | ||
| 101 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 102 | + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; | ||
| 103 | + } | ||
| 104 | + else | ||
| 105 | + { | ||
| 106 | + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] ); | ||
| 107 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 108 | + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + $obj_permissoes = new clsPermissoes(); | ||
| 113 | + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | ||
| 114 | + | ||
| 115 | + | ||
| 116 | + if ($nivel_usuario == 1) | ||
| 117 | + { | ||
| 118 | + if( $registro["ref_cod_instituicao"] ) | ||
| 119 | + { | ||
| 120 | + $this->addDetalhe( array( "Instituição", "{$registro["ref_cod_instituicao"]}") ); | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + if ($nivel_usuario == 1 || $nivel_usuario == 2) | ||
| 125 | + { | ||
| 126 | + if( $registro["ref_cod_escola"] ) | ||
| 127 | + { | ||
| 128 | + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") ); | ||
| 129 | + } | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + if( $registro["ref_cod_biblioteca"] ) | ||
| 133 | + { | ||
| 134 | + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") ); | ||
| 135 | + } | ||
| 136 | + | ||
| 73 | if( ! $registro ) | 137 | if( ! $registro ) |
| 74 | { | 138 | { |
| 75 | header( "location: educar_fonte_lst.php" ); | 139 | header( "location: educar_fonte_lst.php" ); |
| 76 | die(); | 140 | die(); |
| 77 | } | 141 | } |
| 78 | 142 | ||
| 79 | - | 143 | + /* |
| 80 | if( $registro["cod_fonte"] ) | 144 | if( $registro["cod_fonte"] ) |
| 81 | { | 145 | { |
| 82 | $this->addDetalhe( array( "Código Fonte", "{$registro["cod_fonte"]}") ); | 146 | $this->addDetalhe( array( "Código Fonte", "{$registro["cod_fonte"]}") ); |
| 83 | } | 147 | } |
| 148 | + */ | ||
| 149 | + | ||
| 84 | if( $registro["nm_fonte"] ) | 150 | if( $registro["nm_fonte"] ) |
| 85 | { | 151 | { |
| 86 | $this->addDetalhe( array( "Fonte", "{$registro["nm_fonte"]}") ); | 152 | $this->addDetalhe( array( "Fonte", "{$registro["nm_fonte"]}") ); |
ieducar/intranet/educar_motivo_baixa_det.php
| @@ -70,11 +70,75 @@ class indice extends clsDetalhe | @@ -70,11 +70,75 @@ class indice extends clsDetalhe | ||
| 70 | $tmp_obj = new clsPmieducarMotivoBaixa( $this->cod_motivo_baixa ); | 70 | $tmp_obj = new clsPmieducarMotivoBaixa( $this->cod_motivo_baixa ); |
| 71 | $registro = $tmp_obj->detalhe(); | 71 | $registro = $tmp_obj->detalhe(); |
| 72 | 72 | ||
| 73 | + if( class_exists( "clsPmieducarBiblioteca" ) ) | ||
| 74 | + { | ||
| 75 | + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] ); | ||
| 76 | + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe(); | ||
| 77 | + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"]; | ||
| 78 | + if( class_exists( "clsPmieducarInstituicao" ) ) | ||
| 79 | + { | ||
| 80 | + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"]; | ||
| 81 | + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] ); | ||
| 82 | + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe(); | ||
| 83 | + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"]; | ||
| 84 | + } | ||
| 85 | + else | ||
| 86 | + { | ||
| 87 | + $registro["ref_cod_instituicao"] = "Erro na geracao"; | ||
| 88 | + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + if( class_exists( "clsPmieducarEscola" ) ) | ||
| 93 | + { | ||
| 94 | + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"]; | ||
| 95 | + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] ); | ||
| 96 | + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | ||
| 97 | + $idpes = $det_ref_cod_escola["ref_idpes"]; | ||
| 98 | + if ($idpes) | ||
| 99 | + { | ||
| 100 | + $obj_escola = new clsPessoaJuridica( $idpes ); | ||
| 101 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 102 | + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; | ||
| 103 | + } | ||
| 104 | + else | ||
| 105 | + { | ||
| 106 | + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] ); | ||
| 107 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 108 | + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + $obj_permissoes = new clsPermissoes(); | ||
| 113 | + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | ||
| 114 | + | ||
| 115 | + | ||
| 73 | if( ! $registro ) | 116 | if( ! $registro ) |
| 74 | { | 117 | { |
| 75 | header( "location: educar_motivo_baixa_lst.php" ); | 118 | header( "location: educar_motivo_baixa_lst.php" ); |
| 76 | die(); | 119 | die(); |
| 77 | } | 120 | } |
| 121 | + | ||
| 122 | + if ($nivel_usuario == 1) | ||
| 123 | + { | ||
| 124 | + if( $registro["ref_cod_instituicao"] ) | ||
| 125 | + { | ||
| 126 | + $this->addDetalhe( array( "Instituição", "{$registro["ref_cod_instituicao"]}") ); | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + if ($nivel_usuario == 1 || $nivel_usuario == 2) | ||
| 131 | + { | ||
| 132 | + if( $registro["ref_cod_escola"] ) | ||
| 133 | + { | ||
| 134 | + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") ); | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + if( $registro["ref_cod_biblioteca"] ) | ||
| 139 | + { | ||
| 140 | + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") ); | ||
| 141 | + } | ||
| 78 | 142 | ||
| 79 | if( $registro["nm_motivo_baixa"] ) | 143 | if( $registro["nm_motivo_baixa"] ) |
| 80 | { | 144 | { |
ieducar/intranet/educar_motivo_suspensao_det.php
| @@ -69,6 +69,69 @@ class indice extends clsDetalhe | @@ -69,6 +69,69 @@ class indice extends clsDetalhe | ||
| 69 | 69 | ||
| 70 | $tmp_obj = new clsPmieducarMotivoSuspensao( $this->cod_motivo_suspensao ); | 70 | $tmp_obj = new clsPmieducarMotivoSuspensao( $this->cod_motivo_suspensao ); |
| 71 | $registro = $tmp_obj->detalhe(); | 71 | $registro = $tmp_obj->detalhe(); |
| 72 | + | ||
| 73 | + if( class_exists( "clsPmieducarBiblioteca" ) ) | ||
| 74 | + { | ||
| 75 | + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] ); | ||
| 76 | + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe(); | ||
| 77 | + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"]; | ||
| 78 | + if( class_exists( "clsPmieducarInstituicao" ) ) | ||
| 79 | + { | ||
| 80 | + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"]; | ||
| 81 | + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] ); | ||
| 82 | + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe(); | ||
| 83 | + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"]; | ||
| 84 | + } | ||
| 85 | + else | ||
| 86 | + { | ||
| 87 | + $registro["ref_cod_instituicao"] = "Erro na geracao"; | ||
| 88 | + echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->"; | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + if( class_exists( "clsPmieducarEscola" ) ) | ||
| 93 | + { | ||
| 94 | + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"]; | ||
| 95 | + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] ); | ||
| 96 | + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | ||
| 97 | + $idpes = $det_ref_cod_escola["ref_idpes"]; | ||
| 98 | + if ($idpes) | ||
| 99 | + { | ||
| 100 | + $obj_escola = new clsPessoaJuridica( $idpes ); | ||
| 101 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 102 | + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"]; | ||
| 103 | + } | ||
| 104 | + else | ||
| 105 | + { | ||
| 106 | + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] ); | ||
| 107 | + $obj_escola_det = $obj_escola->detalhe(); | ||
| 108 | + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"]; | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + $obj_permissoes = new clsPermissoes(); | ||
| 113 | + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | ||
| 114 | + | ||
| 115 | + if ($nivel_usuario == 1) | ||
| 116 | + { | ||
| 117 | + if( $registro["ref_cod_instituicao"] ) | ||
| 118 | + { | ||
| 119 | + $this->addDetalhe( array( "Instituição", "{$registro["ref_cod_instituicao"]}") ); | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + if ($nivel_usuario == 1 || $nivel_usuario == 2) | ||
| 124 | + { | ||
| 125 | + if( $registro["ref_cod_escola"] ) | ||
| 126 | + { | ||
| 127 | + $this->addDetalhe( array( "Escola", "{$registro["ref_cod_escola"]}") ); | ||
| 128 | + } | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + if( $registro["ref_cod_biblioteca"] ) | ||
| 132 | + { | ||
| 133 | + $this->addDetalhe( array( "Biblioteca", "{$registro["ref_cod_biblioteca"]}") ); | ||
| 134 | + } | ||
| 72 | 135 | ||
| 73 | if( ! $registro ) | 136 | if( ! $registro ) |
| 74 | { | 137 | { |