Exemple #1
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Turma - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $lista_busca = array("Ano", "Turma", "Turno", "Série", "Curso");
     $obj_permissao = new clsPermissoes();
     $nivel_usuario = $obj_permissao->nivel_acesso($this->pessoa_logada);
     if ($nivel_usuario == 1) {
         $lista_busca[] = "Escola";
         //$lista_busca[] = "Instituição";
     } else {
         if ($nivel_usuario == 2) {
             $lista_busca[] = "Escola";
         }
     }
     $lista_busca[] = "Situação";
     $this->addCabecalhos($lista_busca);
     $get_escola = true;
     //		$get_escola_curso = true;
     $get_escola_curso_serie = true;
     $sem_padrao = true;
     $get_curso = true;
     include "include/pmieducar/educar_campo_lista.php";
     if ($this->ref_cod_escola) {
         $this->ref_ref_cod_escola = $this->ref_cod_escola;
     }
     $helperOptions = array();
     $this->inputsHelper()->dynamic('anoLetivo', array(), $helperOptions);
     $this->campoTexto("nm_turma", "Turma", $this->nm_turma, 30, 255, false);
     $this->campoLista("visivel", "Situação", array("" => "Selecione", "1" => "Ativo", "2" => "Inativo"), $this->visivel);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_turma = new clsPmieducarTurma();
     $obj_turma->setOrderby("nm_turma ASC");
     $obj_turma->setLimite($this->limite, $this->offset);
     if ($this->visivel == 1) {
         $visivel = true;
     } elseif ($this->visivel == 2) {
         $visivel = false;
     } else {
         $visivel = array("true", "false");
     }
     $lista = $obj_turma->lista2(null, null, null, $this->ref_ref_cod_serie, $this->ref_ref_cod_escola, null, $this->nm_turma, null, null, null, null, null, null, null, 1, null, null, null, null, null, null, null, null, null, $this->ref_cod_curso, $this->ref_cod_instituicao, null, null, null, null, null, $visivel, null, null, $this->ano);
     $total = $obj_turma->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         $ref_cod_escola = "";
         $nm_escola = "";
         foreach ($lista as $registro) {
             // pega detalhes de foreign_keys
             /*	if( class_exists( "clsPmieducarEscolaSerie" ) )
             			{
             				$obj_ref_ref_cod_serie = new clsPmieducarEscolaSerie( $registro["ref_ref_cod_escola"], $registro["ref_ref_cod_serie"] );
             				$det_ref_ref_cod_serie = $obj_ref_ref_cod_serie->detalhe();
             				$registro["ref_ref_cod_serie"] = $det_ref_ref_cod_serie["ref_cod_serie"];
             			}
             			else
             			{
             				$registro["ref_ref_cod_serie"] = "Erro na geracao";
             				echo "<!--\nErro\nClasse nao existente: clsPmieducarEscolaSerie\n-->";
             			}*/
             /*if( class_exists( "clsPmieducarCurso" ) )
             		{
             			$obj_ref_cod_curso = new clsPmieducarCurso( $registro["ref_cod_curso"] );
             			$det_ref_cod_curso = $obj_ref_cod_curso->detalhe();
             			$registro["ref_cod_curso"] = $det_ref_cod_curso["nm_curso"];
             		}
             		else
             		{
             			$registro["ref_cod_curso"] = "Erro na geracao";
             			echo "<!--\nErro\nClasse nao existente: clsPmieducarCurso\n-->";
             		}
             		if( class_exists( "clsPmieducarInstituicao" ) )
             		{
             			$obj_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
             			$obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
             			$registro["ref_cod_instituicao"] = $obj_cod_instituicao_det["nm_instituicao"];
             		}
             		else
             		{
             			$registro["ref_cod_instituicao"] = "Erro na gera&ccedil;&atilde;o";
             			echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
             		}*/
             if (class_exists("clsPmieducarEscola") && $registro["ref_ref_cod_escola"] != $ref_cod_escola) {
                 $ref_cod_escola = $registro["ref_ref_cod_escola"];
                 $obj_ref_cod_escola = new clsPmieducarEscola($registro["ref_ref_cod_escola"]);
                 $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
                 $ref_cod_escola = $registro["ref_ref_cod_escola"];
                 $nm_escola = $det_ref_cod_escola["nome"];
             }
             /*$obj_ser = new clsPmieducarSerie( $registro["ref_ref_cod_serie"], null, null, $this->ref_cod_curso );
             		$det_ser = $obj_ser->detalhe();
             		$obj_cur = new clsPmieducarCurso( $det_ser["ref_cod_curso"] );
             		$det_cur = $obj_cur->detalhe();*/
             $lista_busca = array("<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">{$registro["ano"]}</a>", "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">{$registro["nm_turma"]}</a>");
             if ($registro["turma_turno_id"]) {
                 $options = array('params' => $registro["turma_turno_id"], 'return_only' => 'first-field');
                 $turno = Portabilis_Utils_Database::fetchPreparedQuery("select nome from pmieducar.turma_turno where id = \$1", $options);
                 $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">{$turno}</a>";
             } else {
                 $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\"></a>";
             }
             if ($registro["nm_serie"]) {
                 $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">{$registro["nm_serie"]}</a>";
             } else {
                 $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">-</a>";
             }
             $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">{$registro["nm_curso"]}</a>";
             if ($nivel_usuario == 1) {
                 if ($nm_escola) {
                     $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">{$nm_escola}</a>";
                 } else {
                     $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">-</a>";
                 }
                 //$lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">{$registro["nm_instituicao"]}</a>";
             } else {
                 if ($nivel_usuario == 2) {
                     if ($nm_escola) {
                         $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">{$nm_escola}</a>";
                     } else {
                         $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">-</a>";
                     }
                 }
             }
             if (dbBool($registro["visivel"])) {
                 $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">Ativo</a>";
             } else {
                 $lista_busca[] = "<a href=\"educar_turma_det.php?cod_turma={$registro["cod_turma"]}\">Inativo</a>";
             }
             $this->addLinhas($lista_busca);
         }
     }
     $this->addPaginador2("educar_turma_lst.php", $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(586, $this->pessoa_logada, 7)) {
         $this->acao = "go(\"educar_turma_cad.php\")";
         $this->nome_acao = "Novo";
     }
     $this->largura = "100%";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "i-Educar", "educar_index.php" => "Escola", "" => "Lista de Turmas"));
     $this->enviaLocalizacao($localizacao->montar());
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Matr&iacute;culas Turma - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $lista_busca = array("Turma", "S&eacute;rie", "Curso");
     $obj_permissao = new clsPermissoes();
     $nivel_usuario = $obj_permissao->nivel_acesso($this->pessoa_logada);
     if ($nivel_usuario == 1) {
         $lista_busca[] = "Escola";
         $lista_busca[] = "Institui&ccedil;&atilde;o";
     } else {
         if ($nivel_usuario == 2) {
             $lista_busca[] = "Escola";
         }
     }
     $this->addCabecalhos($lista_busca);
     $get_escola = true;
     $get_curso = true;
     //		$get_escola_curso = true;
     $get_escola_curso_serie = true;
     $get_turma = true;
     $sem_padrao = true;
     include "include/pmieducar/educar_campo_lista.php";
     if ($this->ref_cod_escola) {
         $this->ref_ref_cod_escola = $this->ref_cod_escola;
     }
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_turma = new clsPmieducarTurma();
     $obj_turma->setOrderby("nm_turma ASC");
     $obj_turma->setLimite($this->limite, $this->offset);
     $lista = $obj_turma->lista2($this->ref_cod_turma, null, null, $this->ref_ref_cod_serie, $this->ref_ref_cod_escola, null, null, null, null, null, null, null, null, null, 1, null, null, null, null, null, null, null, null, null, $this->ref_cod_curso, $this->ref_cod_instituicao);
     $total = $obj_turma->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             /*if( class_exists( "clsPmieducarTurma" ) )
             		{
             			$obj_ref_ref_cod_turma = new clsPmieducarTurma( $registro["cod_turma"] );
             			$det_ref_ref_cod_turma = $obj_ref_ref_cod_turma->detalhe();
             			$nm_turma = $det_ref_ref_cod_turma["nm_turma"];
             		}
             		else
             		{
             			$registro["ref_cod_turma"] = "Erro na geracao";
             			echo "<!--\nErro\nClasse nao existente: clsPmieducarTurma\n-->";
             		}
             		if( class_exists( "clsPmieducarSerie" ) )
             		{
             			$obj_ref_cod_serie = new clsPmieducarSerie( $registro["ref_ref_cod_serie"] );
             			$det_ref_cod_serie = $obj_ref_cod_serie->detalhe();
             			$registro["ref_ref_cod_serie"] = $det_ref_cod_serie["nm_serie"];
             		}
             		else
             		{
             			$registro["ref_cod_serie"] = "Erro na geracao";
             			echo "<!--\nErro\nClasse nao existente: clsPmieducarSerie\n-->";
             		}
             		if( class_exists( "clsPmieducarCurso" ) )
             		{
             			$obj_ref_cod_curso = new clsPmieducarCurso( $registro["ref_cod_curso"] );
             			$det_ref_cod_curso = $obj_ref_cod_curso->detalhe();
             			$registro["ref_cod_curso"] = $det_ref_cod_curso["nm_curso"];
             		}
             		else
             		{
             			$registro["ref_cod_curso"] = "Erro na geracao";
             			echo "<!--\nErro\nClasse nao existente: clsPmieducarCurso\n-->";
             		}
             		if( class_exists( "clsPmieducarInstituicao" ) )
             		{
             			$obj_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
             			$obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
             			$registro["ref_cod_instituicao"] = $obj_cod_instituicao_det["nm_instituicao"];
             		}
             		else
             		{
             			$registro["ref_cod_instituicao"] = "Erro na gera&ccedil;&atilde;o";
             			echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
             		}*/
             if (class_exists("clsPmieducarEscola")) {
                 $obj_ref_cod_escola = new clsPmieducarEscola($registro["ref_ref_cod_escola"]);
                 $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
                 $registro["nm_escola"] = $det_ref_cod_escola["nome"];
             } else {
                 $registro["ref_ref_cod_escola"] = "Erro na gera&ccedil;&atilde;o";
                 echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarEscola\n-->";
             }
             $lista_busca = array("<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">{$registro["nm_turma"]}</a>");
             if ($registro["ref_ref_cod_serie"]) {
                 $lista_busca[] = "<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">{$registro["nm_serie"]}</a>";
             } else {
                 $lista_busca[] = "<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">-</a>";
             }
             $lista_busca[] = "<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">{$registro["nm_curso"]}</a>";
             if ($nivel_usuario == 1) {
                 if ($registro["ref_ref_cod_escola"]) {
                     $lista_busca[] = "<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">{$registro["nm_escola"]}</a>";
                 } else {
                     $lista_busca[] = "<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">-</a>";
                 }
                 $lista_busca[] = "<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">{$registro["nm_instituicao"]}</a>";
             } else {
                 if ($nivel_usuario == 2) {
                     if ($registro["ref_ref_cod_escola"]) {
                         $lista_busca[] = "<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">{$registro["nm_escola"]}</a>";
                     } else {
                         $lista_busca[] = "<a href=\"educar_matriculas_turma_det.php?ref_cod_turma={$registro["cod_turma"]}\">-</a>";
                     }
                 }
             }
             $this->addLinhas($lista_busca);
         }
     }
     $this->addPaginador2("educar_matriculas_turma_lst.php", $total, $_GET, $this->nome, $this->limite);
     $this->largura = "100%";
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Listagem - Selecione a turma para realizar a transferência';
     $this->ref_cod_matricula = $_GET['ref_cod_matricula'];
     if (!$this->ref_cod_matricula) {
         header('Location: educar_matricula_lst.php');
         die;
     }
     $obj_matricula = new clsPmieducarMatricula($this->ref_cod_matricula);
     $det_matricula = $obj_matricula->detalhe();
     $this->ref_cod_curso = $det_matricula['ref_cod_curso'];
     $this->ref_cod_serie = $det_matricula['ref_ref_cod_serie'];
     $this->ref_cod_escola = $det_matricula['ref_ref_cod_escola'];
     $this->ref_cod_turma = $_GET['ref_cod_turma'];
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $this->addCabecalhos(array('Turma'));
     // Busca dados da matricula
     $obj_ref_cod_matricula = new clsPmieducarMatricula();
     $detalhe_aluno = array_shift($obj_ref_cod_matricula->lista($this->ref_cod_matricula));
     $obj_aluno = new clsPmieducarAluno();
     $det_aluno = array_shift($obj_aluno->lista($detalhe_aluno['ref_cod_aluno'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1));
     $obj_escola = new clsPmieducarEscola($this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     $det_escola = $obj_escola->detalhe();
     if ($det_escola['nome']) {
         $this->campoRotulo('nm_escola', 'Escola', $det_escola['nome']);
     }
     $this->campoRotulo('nm_pessoa', 'Nome do Aluno', $det_aluno['nome_aluno']);
     // Filtros de foreign keys
     $opcoes = array('' => 'Selecione');
     // Opções de turma
     $objTemp = new clsPmieducarTurma();
     $lista = $objTemp->lista(NULL, NULL, NULL, $this->ref_cod_serie, $this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_curso);
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $opcoes[$registro['cod_turma']] = $registro['nm_turma'];
         }
     }
     $this->campoLista('ref_cod_turma_', 'Turma', $opcoes, $this->ref_cod_turma);
     // outros filtros
     $this->campoOculto('ref_cod_matricula', $this->ref_cod_matricula);
     $this->campoOculto('ref_cod_serie', '');
     $this->campoOculto('ref_cod_turma', '');
     $this->campoOculto('ref_cod_escola', '');
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_matricula_turma = new clsPmieducarTurma();
     $obj_matricula_turma->setOrderby('data_cadastro ASC');
     $obj_matricula_turma->setLimite($this->limite, $this->offset);
     $lista = $obj_matricula_turma->lista($this->ref_cod_turma, NULL, NULL, $this->ref_cod_serie, $this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_curso, NULL, NULL, NULL, NULL, NULL, NULL, TRUE);
     if (is_numeric($this->ref_cod_serie) && is_numeric($this->ref_cod_curso) && is_numeric($this->ref_cod_escola)) {
         $sql = "\nSELECT\n  t.cod_turma, t.ref_usuario_exc, t.ref_usuario_cad, t.ref_ref_cod_serie,\n  t.ref_ref_cod_escola, t.ref_cod_infra_predio_comodo, t.nm_turma, t.sgl_turma,\n  t.max_aluno, t.multiseriada, t.data_cadastro, t.data_exclusao, t.ativo,\n  t.ref_cod_turma_tipo, t.hora_inicial, t.hora_final, t.hora_inicio_intervalo,\n  t.hora_fim_intervalo, t.ref_cod_regente, t.ref_cod_instituicao_regente,\n  t.ref_cod_instituicao, t.ref_cod_curso, t.ref_ref_cod_serie_mult,\n  t.ref_ref_cod_escola_mult\nFROM\n  pmieducar.turma t\nWHERE\n  t.ref_ref_cod_serie_mult = {$this->ref_cod_serie}\n  AND t.ref_ref_cod_escola={$this->ref_cod_escola}\n  AND t.ativo = '1'\n  AND t.ref_ref_cod_escola = '{$this->ref_cod_escola}'";
         $db = new clsBanco();
         $db->Consulta($sql);
         $lista_aux = array();
         while ($db->ProximoRegistro()) {
             $lista_aux[] = $db->Tupla();
         }
         if (is_array($lista_aux) && count($lista_aux)) {
             if (is_array($lista) && count($lista)) {
                 $lista = array_merge($lista, $lista_aux);
             } else {
                 $lista = $lista_aux;
             }
         }
         $total = count($lista);
     } else {
         $total = $obj_matricula_turma->_total;
     }
     $tmp_obj = new clsPmieducarMatriculaTurma();
     $det_obj = $tmp_obj->lista($this->ref_cod_matricula, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     if ($det_obj) {
         $det_obj = array_shift($det_obj);
     }
     // Monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             if ($registro['cod_turma'] != $det_obj['ref_cod_turma']) {
                 $script = sprintf('onclick="enturmar(\'%s\',\'%s\',\'%s\',\'%s\');"', $this->ref_cod_escola, $registro['ref_ref_cod_serie'], $this->ref_cod_matricula, $registro['cod_turma']);
                 $this->addLinhas(array(sprintf('<a href="#" %s>%s</a>', $script, $registro['nm_turma'])));
             }
         }
     }
     $this->addPaginador2("educar_matricula_turma_lst.php", $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     $this->array_botao[] = 'Voltar';
     $this->array_botao_url[] = "educar_matricula_det.php?cod_matricula={$this->ref_cod_matricula}";
     $this->largura = '100%';
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Selecione uma turma para enturmar ou remover a enturmação';
     $this->ref_cod_matricula = $_GET['ref_cod_matricula'];
     if (!$this->ref_cod_matricula) {
         header('Location: educar_matricula_lst.php');
         die;
     }
     $obj_matricula = new clsPmieducarMatricula($this->ref_cod_matricula);
     $det_matricula = $obj_matricula->detalhe();
     $this->ref_cod_curso = $det_matricula['ref_cod_curso'];
     $this->ref_cod_serie = $det_matricula['ref_ref_cod_serie'];
     $this->ref_cod_escola = $det_matricula['ref_ref_cod_escola'];
     $this->ref_cod_turma = $_GET['ref_cod_turma'];
     $this->addCabecalhos(array('Turma', 'Enturmado'));
     // Busca dados da matricula
     $obj_ref_cod_matricula = new clsPmieducarMatricula();
     $detalhe_aluno = array_shift($obj_ref_cod_matricula->lista($this->ref_cod_matricula));
     $obj_aluno = new clsPmieducarAluno();
     $det_aluno = array_shift($obj_aluno->lista($detalhe_aluno['ref_cod_aluno'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1));
     $obj_escola = new clsPmieducarEscola($this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     $det_escola = $obj_escola->detalhe();
     if ($det_escola['nome']) {
         $this->campoRotulo('nm_escola', 'Escola', $det_escola['nome']);
     }
     $this->campoRotulo('nm_pessoa', 'Nome do Aluno', $det_aluno['nome_aluno']);
     // Filtros de foreign keys
     $opcoes = array('' => 'Selecione');
     // Opções de turma
     $objTemp = new clsPmieducarTurma();
     $lista = $objTemp->lista3(NULL, NULL, NULL, $this->ref_cod_serie, $this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_curso);
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $opcoes[$registro['cod_turma']] = $registro['nm_turma'];
         }
         $this->exibirBotaoSubmit = false;
     }
     #$this->campoLista('ref_cod_turma_', 'Turma', $opcoes, $this->ref_cod_turma);
     // outros filtros
     $this->campoOculto('ref_cod_matricula', $this->ref_cod_matricula);
     $this->campoOculto('ref_cod_serie', '');
     $this->campoOculto('ref_cod_turma', '');
     $this->campoOculto('ref_cod_escola', '');
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_matricula_turma = new clsPmieducarTurma();
     $obj_matricula_turma->setOrderby('data_cadastro ASC');
     $obj_matricula_turma->setLimite($this->limite, $this->offset);
     $lista = $obj_matricula_turma->lista3($this->ref_cod_turma, NULL, NULL, $this->ref_cod_serie, $this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_curso, NULL, NULL, NULL, NULL, NULL, NULL, TRUE);
     if (is_numeric($this->ref_cod_serie) && is_numeric($this->ref_cod_curso) && is_numeric($this->ref_cod_escola)) {
         $sql = "\nSELECT\n  t.cod_turma, t.ref_usuario_exc, t.ref_usuario_cad, t.ref_ref_cod_serie,\n  t.ref_ref_cod_escola, t.ref_cod_infra_predio_comodo, t.nm_turma, t.sgl_turma,\n  t.max_aluno, t.multiseriada, t.data_cadastro, t.data_exclusao, t.ativo,\n  t.ref_cod_turma_tipo, t.hora_inicial, t.hora_final, t.hora_inicio_intervalo,\n  t.hora_fim_intervalo, t.ref_cod_regente, t.ref_cod_instituicao_regente,\n  t.ref_cod_instituicao, t.ref_cod_curso, t.ref_ref_cod_serie_mult,\n  t.ref_ref_cod_escola_mult\nFROM\n  pmieducar.turma t\nWHERE\n  t.ref_ref_cod_serie_mult = {$this->ref_cod_serie}\n  AND t.ref_ref_cod_escola={$this->ref_cod_escola}\n  AND t.ativo = '1'\n  AND t.ref_ref_cod_escola = '{$this->ref_cod_escola}'";
         $db = new clsBanco();
         $db->Consulta($sql);
         $lista_aux = array();
         while ($db->ProximoRegistro()) {
             $lista_aux[] = $db->Tupla();
         }
         if (is_array($lista_aux) && count($lista_aux)) {
             if (is_array($lista) && count($lista)) {
                 $lista = array_merge($lista, $lista_aux);
             } else {
                 $lista = $lista_aux;
             }
         }
         $total = count($lista);
     } else {
         $total = $obj_matricula_turma->_total;
     }
     $enturmacoesMatricula = new clsPmieducarMatriculaTurma();
     $enturmacoesMatricula = $enturmacoesMatricula->lista3($this->ref_cod_matricula, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     $turmasThisSerie = $lista;
     // lista turmas disponiveis para enturmacao, somente lista as turmas sem enturmacao
     foreach ($turmasThisSerie as $turma) {
         $turmaHasEnturmacao = false;
         foreach ($enturmacoesMatricula as $enturmacao) {
             if (!$turmaHasEnturmacao && $turma['cod_turma'] == $enturmacao['ref_cod_turma']) {
                 $turmaHasEnturmacao = true;
             }
         }
         if ($turmaHasEnturmacao) {
             $enturmado = "Sim";
         } else {
             $enturmado = "Não";
         }
         $script = sprintf('onclick="enturmar(\'%s\',\'%s\',\'%s\',\'%s\');"', $this->ref_cod_escola, $turma['ref_ref_cod_serie'], $this->ref_cod_matricula, $turma['cod_turma']);
         $this->addLinhas(array(sprintf('<a href="#" %s>%s</a>', $script, $turma['nm_turma']), $enturmado));
     }
     $this->addPaginador2("educar_matricula_turma_lst.php", $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     $this->array_botao[] = 'Voltar';
     $this->array_botao_url[] = "educar_matricula_det.php?cod_matricula={$this->ref_cod_matricula}";
     $this->largura = '100%';
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de enturma&ccedil;&otilde;es da matr&iacute;cula"));
     $this->enviaLocalizacao($localizacao->montar());
 }