Exemplo n.º 1
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $this->nm_aluno = $_GET["nm_aluno"];
     $this->cod_aluno = $_GET["cod_aluno"];
     $this->ref_cod_escola = $_GET['ref_cod_escola'];
     if (!$this->ref_cod_escola) {
         $this->ref_cod_escola = $_POST['ref_cod_escola'];
     }
     $this->campoOculto("ref_cod_escola", $this->ref_cod_escola);
     $this->titulo = "Aluno - Listagem";
     $this->addCabecalhos(array("Aluno"));
     $this->campoNumero("cod_aluno", "Código Aluno", $this->nm_aluno, 8, 20, false);
     $this->campoTexto("nm_aluno", "Nome Aluno", $this->nm_aluno, 30, 255, false);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_aluno = new clsPmieducarAluno();
     $obj_aluno->setOrderby("nome_aluno ASC");
     $obj_aluno->setLimite($this->limite, $this->offset);
     $lista = $obj_aluno->lista($this->cod_aluno, null, null, null, null, null, null, null, null, null, 1, null, $this->nm_aluno, null, null, null, null, null);
     $total = $obj_aluno->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         //			echo "<pre>";print_r($lista);die;
         foreach ($lista as $registro) {
             $registro["nome_aluno"] = str_replace("'", "", $registro['nome_aluno']);
             $script = " onclick=\"addVal1('ref_cod_aluno','{$registro['cod_aluno']}'); addVal1('nm_aluno','{$registro['nome_aluno']}'); addVal1('nm_aluno_','{$registro['nome_aluno']}');fecha();\"";
             $this->addLinhas(array("<a href=\"javascript:void(0);\" {$script}>{$registro["nome_aluno"]}</a>"));
         }
     }
     $this->addPaginador2("educar_pesquisa_aluno.php", $total, $_GET, $this->nome, $this->limite);
     $this->largura = "100%";
 }