$nm_escola = $det_escola['nome'];
            $this->campoRotulo("nm_escola", "Escola", $nm_escola);
        }
        if ($get_biblioteca) {
            $obj_per = new clsPermissoes();
            $ref_cod_biblioteca_ = $obj_per->getBiblioteca($pessoa_logada);
        }
    }
}
//                    administrador          institucional - CPD
if ($get_escola && ($nivel_usuario == 1 || $nivel_usuario == 2 || $cad_usuario)) {
    $opcoes_escola = array("" => "Selecione uma escola");
    // EDITAR
    if ($this->ref_cod_instituicao) {
        $obj_escola = new clsPmieducarEscola();
        $obj_escola->setOrderby("nome ASC");
        $lista = $obj_escola->lista(null, null, null, $this->ref_cod_instituicao, null, null, null, null, null, null, 1);
        if (is_array($lista) && count($lista)) {
            foreach ($lista as $registro) {
                $opcoes_escola["{$registro["cod_escola"]}"] = "{$registro['nome']}";
            }
        }
    }
    if ($get_biblioteca) {
        $this->campoLista("ref_cod_escola", "Escola", $opcoes_escola, $this->ref_cod_escola, "getBiblioteca(2);", null, null, null, $escola_desabilitado, $escola_obrigatorio);
    } else {
        $this->campoLista("ref_cod_escola", "Escola", $opcoes_escola, $this->ref_cod_escola, null, null, null, null, $escola_desabilitado, $escola_obrigatorio);
    }
}
if ($get_curso) {
    $opcoes_curso = array("" => "Selecione");
    function renderHTML()
    {
        if ($_POST) {
            foreach ($_POST as $key => $value) {
                $this->{$key} = $value;
            }
        }
        if (!$_POST) {
            echo '<script>
	     			alert("Erro ao gerar relatório!\\nNão existem dados!");
	     			window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1));
	     		</script>';
            return true;
        }
        $obj_instituicao = new clsPmieducarInstituicao($this->ref_cod_instituicao);
        $det_instituicao = $obj_instituicao->detalhe();
        $this->nm_instituicao = $det_instituicao["nm_instituicao"];
        $obj_curso2 = new clsPmieducarCurso($this->ref_cod_curso);
        $det_curso2 = $obj_curso2->detalhe();
        $this->nm_curso = $det_curso2["nm_curso"];
        if ($this->escola_sem_avaliacao == 1) {
            $this->escola_sem_avaliacao = true;
        } elseif ($this->escola_sem_avaliacao == 2) {
            $this->escola_sem_avaliacao = false;
        } else {
            $this->escola_sem_avaliacao = null;
        }
        $obj_escolas = new clsPmieducarEscola();
        $obj_escolas->setOrderby("ref_cod_escola_localizacao, nome");
        $this->lst_escola = $obj_escolas->lista($this->ref_cod_escola, null, null, $this->ref_cod_instituicao, null, null, null, null, null, null, 1, null, $this->escola_sem_avaliacao);
        $lst_curso = array();
        if (is_numeric($this->ref_cod_escola)) {
            $obj_escola_curso = new clsPmieducarEscolaCurso();
            $lst_escola_curso = $obj_escola_curso->lista($this->ref_cod_escola, $this->ref_cod_curso, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao, true);
            foreach ($lst_escola_curso as $escola_curso) {
                $obj_curso = new clsPmieducarCurso($escola_curso["ref_cod_curso"]);
                $lst_curso[] = $obj_curso->detalhe();
            }
        } else {
            if (is_numeric($this->ref_cod_curso)) {
                $obj_curso = new clsPmieducarCurso($this->ref_cod_curso);
                $lst_curso[] = $obj_curso->detalhe();
            } else {
                $obj_curso = new clsPmieducarCurso();
                $lst_curso = $obj_curso->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao);
            }
        }
        $this->pdf = new clsPDF("Levantamento Turma por Período e Aluno - {$this->ano}", "Levantamento Turma por Período e Aluno - {$this->ano}", "A4", "", false, false);
        $this->pdf->largura = 842.0;
        $this->pdf->altura = 595.0;
        $fonte = 'arial';
        $corTexto = '#000000';
        $altura_linha = 23;
        $inicio_escrita_y = 175;
        $this->pdf->OpenPage();
        $this->addCabecalho();
        foreach ($lst_curso as $curso) {
            $this->escreveEscolas($curso);
        }
        $this->pdf->CloseFile();
        $this->get_link = $this->pdf->GetLink();
        echo "<script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=" . $this->get_link . "'}</script>";
        echo "<html><center>Se o download não iniciar automaticamente <br /><a target='blank' href='" . $this->get_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>";
    }