コード例 #1
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Reserva Vaga - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === '' ? NULL : $val;
     }
     $lista_busca = array("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';
     } elseif ($nivel_usuario == 2) {
         $lista_busca[] = "Escola";
     }
     $this->addCabecalhos($lista_busca);
     $get_escola = TRUE;
     $get_curso = TRUE;
     $get_escola_curso_serie = TRUE;
     include 'include/pmieducar/educar_campo_lista.php';
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_escola_serie = new clsPmieducarEscolaSerie();
     $obj_escola_serie->setLimite($this->limite, $this->offset);
     $lista = $obj_escola_serie->lista($this->ref_cod_escola, $this->ref_ref_cod_serie, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao, $this->ref_cod_curso);
     $total = $obj_escola_serie->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             if (class_exists('clsPmieducarSerie')) {
                 $obj_ref_cod_serie = new clsPmieducarSerie($registro['ref_cod_serie']);
                 $det_ref_cod_serie = $obj_ref_cod_serie->detalhe();
                 $nm_serie = $det_ref_cod_serie['nm_serie'];
             } else {
                 $registro['ref_cod_serie'] = "Erro na geração";
                 echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarSerie\n-->";
             }
             if (class_exists('clsPmieducarCurso')) {
                 $obj_curso = new clsPmieducarCurso($registro["ref_cod_curso"]);
                 $det_curso = $obj_curso->detalhe();
                 $registro["ref_cod_curso"] = $det_curso["nm_curso"];
             } else {
                 $registro["ref_cod_serie"] = "Erro na gera&ccedil;&atilde;o";
                 echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarSerie\n-->";
             }
             if (class_exists('clsPmieducarEscola')) {
                 $obj_ref_cod_escola = new clsPmieducarEscola($registro["ref_cod_escola"]);
                 $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
                 $nm_escola = $det_ref_cod_escola["nome"];
             } else {
                 $registro["ref_cod_escola"] = "Erro na gera&ccedil;&atilde;o";
                 echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarEscola\n-->";
             }
             if (class_exists('clsPmieducarInstituicao')) {
                 $obj_ref_cod_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
                 $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
                 $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
             } else {
                 $registro["ref_cod_escola"] = "Erro na gera&ccedil;&atilde;o";
                 echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarEscola\n-->";
             }
             $lista_busca = array("<a href=\"educar_reserva_vaga_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$nm_serie}</a>", "<a href=\"educar_reserva_vaga_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$registro["ref_cod_curso"]}</a>");
             if ($nivel_usuario == 1) {
                 $lista_busca[] = "<a href=\"educar_reserva_vaga_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$nm_escola}</a>";
                 $lista_busca[] = "<a href=\"educar_reserva_vaga_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$registro["ref_cod_instituicao"]}</a>";
             } else {
                 if ($nivel_usuario == 2) {
                     $lista_busca[] = "<a href=\"educar_reserva_vaga_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$nm_escola}</a>";
                 }
             }
             $this->addLinhas($lista_busca);
         }
     }
     $this->addPaginador2('educar_reserva_vaga_lst.php', $total, $_GET, $this->nome, $this->limite);
     $this->largura = "100%";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de reservas de vaga"));
     $this->enviaLocalizacao($localizacao->montar());
 }
コード例 #2
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Escola S&eacute;rie - 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('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_escola_curso = true;
     $get_curso = true;
     $get_escola_curso_serie = true;
     include 'include/pmieducar/educar_campo_lista.php';
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_escola_serie = new clsPmieducarEscolaSerie();
     $obj_escola_serie->setOrderby('nm_serie ASC');
     $obj_escola_serie->setLimite($this->limite, $this->offset);
     $lista = $obj_escola_serie->lista($this->ref_cod_escola, $this->ref_ref_cod_serie, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao, $this->ref_cod_curso);
     $total = $obj_escola_serie->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $obj_ref_cod_serie = new clsPmieducarSerie($registro['ref_cod_serie']);
             $det_ref_cod_serie = $obj_ref_cod_serie->detalhe();
             $nm_serie = $det_ref_cod_serie['nm_serie'];
             $obj_curso = new clsPmieducarCurso($registro['ref_cod_curso']);
             $det_curso = $obj_curso->detalhe();
             $registro['ref_cod_curso'] = $det_curso['nm_curso'];
             $obj_ref_cod_escola = new clsPmieducarEscola($registro['ref_cod_escola']);
             $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
             $nm_escola = $det_ref_cod_escola['nome'];
             $obj_ref_cod_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']);
             $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
             $registro['ref_cod_instituicao'] = $det_ref_cod_instituicao['nm_instituicao'];
             $lista_busca = array("<a href=\"educar_escola_serie_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$nm_serie}</a>", "<a href=\"educar_escola_serie_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$registro["ref_cod_curso"]}</a>");
             if ($nivel_usuario == 1) {
                 $lista_busca[] = "<a href=\"educar_escola_serie_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$nm_escola}</a>";
                 $lista_busca[] = "<a href=\"educar_escola_serie_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$registro["ref_cod_instituicao"]}</a>";
             } elseif ($nivel_usuario == 2) {
                 $lista_busca[] = "<a href=\"educar_escola_serie_det.php?ref_cod_escola={$registro["ref_cod_escola"]}&ref_cod_serie={$registro["ref_cod_serie"]}\">{$nm_escola}</a>";
             }
             $this->addLinhas($lista_busca);
         }
     }
     $this->addPaginador2("educar_escola_serie_lst.php", $total, $_GET, $this->nome, $this->limite);
     if ($obj_permissao->permissao_cadastra(585, $this->pessoa_logada, 7)) {
         $this->acao = "go(\"educar_escola_serie_cad.php\")";
         $this->nome_acao = "Novo";
     }
     $this->largura = "100%";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de v&iacute;nculos entre escolas e s&eacute;ries"));
     $this->enviaLocalizacao($localizacao->montar());
 }