public function Gerar()
 {
     $this->url_cancelar = '/intranet/transporte_pessoa_lst.php';
     // Código do vinculo
     $options = array('label' => $this->_getLabel('id'), 'disabled' => true, 'required' => false, 'size' => 25);
     $this->inputsHelper()->integer('id', $options);
     // Pessoa
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('pessoa')), 'required' => true);
     $this->inputsHelper()->simpleSearchPessoa('nome', $options);
     // Montar o inputsHelper->select \/
     // Cria lista de rotas
     $obj_rota = new clsModulesRotaTransporteEscolar();
     $obj_rota->setOrderBy(' descricao asc ');
     $lista_rota = $obj_rota->lista();
     $rota_resources = array("" => "Selecione uma rota");
     foreach ($lista_rota as $reg) {
         $rota_resources["{$reg['cod_rota_transporte_escolar']}"] = "{$reg['descricao']}";
     }
     // Rota
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('rota')), 'required' => true, 'resources' => $rota_resources);
     $this->inputsHelper()->select('rota', $options);
     // Ponto de Embarque
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('ponto')), 'required' => false, 'resources' => array("" => "Selecione uma rota acima"));
     $this->inputsHelper()->select('ponto', $options);
     // Destino
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('destino')), 'required' => false);
     $this->inputsHelper()->simpleSearchPessoaj('destino', $options);
     // observacoes
     $options = array('label' => Portabilis_String_Utils::toLatin1($this->_getLabel('observacao')), 'required' => false, 'size' => 50, 'max_length' => 255);
     $this->inputsHelper()->textArea('observacao', $options);
     $this->loadResourceAssets($this->getDispatcher());
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Usuário de transporte - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     // Cria lista de rotas
     $obj_rota = new clsModulesRotaTransporteEscolar();
     $obj_rota->setOrderBy(' descricao asc ');
     $lista_rota = $obj_rota->lista();
     $select_rota = array("" => "Selecione uma rota");
     foreach ($lista_rota as $reg) {
         $select_rota["{$reg['cod_rota_transporte_escolar']}"] = "{$reg['descricao']}";
     }
     $this->campoNumero("cod_pessoa_transporte", "Código", $this->cod_pessoa_transporte, 20, 255, false);
     $this->campoTexto("nome_pessoa", "Nome da pessoa", $this->nome_pessoa, 50, 255, false);
     $this->campoTexto("nome_destino", "Nome do destino", $this->nome_destino, 70, 255, false);
     $this->campoLista("ref_cod_rota_transporte_escolar", "Rota", $select_rota, $this->ref_cod_rota_transporte_escolar, "", false, "", "", false, false);
     $obj_permissoes = new clsPermissoes();
     $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
     $this->addCabecalhos(array("Código", "Nome da pessoa", "Rota", "Destino", "Ponto de embarque"));
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj = new clsModulesPessoaTransporte();
     $obj->setLimite($this->limite, $this->offset);
     $lista = $obj->lista($this->cod_pessoa_transporte, null, $this->ref_cod_rota_transporte_escolar, null, null, $this->nome_pessoa, $this->nome_destino);
     $total = $lista->_total;
     foreach ($lista as $registro) {
         $this->addLinhas(array("<a href=\"transporte_pessoa_det.php?cod_pt={$registro["cod_pessoa_transporte"]}\">{$registro["cod_pessoa_transporte"]}</a>", "<a href=\"transporte_pessoa_det.php?cod_pt={$registro["cod_pessoa_transporte"]}\">{$registro["nome_pessoa"]}</a>", "<a href=\"transporte_pessoa_det.php?cod_pt={$registro["cod_pessoa_transporte"]}\">{$registro["nome_rota"]}</a>", "<a href=\"transporte_pessoa_det.php?cod_pt={$registro["cod_pessoa_transporte"]}\">" . (trim($registro["nome_destino"]) == '' ? $registro["nome_destino2"] : $registro["nome_destino"]) . "</a>", "<a href=\"transporte_pessoa_det.php?cod_pt={$registro["cod_pessoa_transporte"]}\">{$registro["nome_ponto"]}</a>"));
     }
     $this->addPaginador2("transporte_pessoa_lst.php", $total, $_GET, $this->nome, $this->limite);
     $this->acao = "go(\"../module/TransporteEscolar/Pessoatransporte\")";
     $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 usu&aacute;rios de tranposrte"));
     $this->enviaLocalizacao($localizacao->montar());
 }