public function passagens() { $this->pDAO = null; $eDAO = new EstadoDAO(); $estados = $eDAO->listar(); $eDAO = null; $vDAO = new VooDAO(); $voos = $vDAO->listar(); $this->views->assign("estados", $estados); $this->views->assign("voos", $voos); $this->views->render("painel_passagens", "painel"); }
public function search() { $opcIdaVolta = isset($_POST['opcIdaVolta']) ? $_POST['opcIdaVolta'] : null; $origem = isset($_POST['origem']) ? $_POST['origem'] : null; $destino = isset($_POST['destino']) ? $_POST['destino'] : null; $dataIda = isset($_POST['dataIda']) ? $_POST['dataIda'] : null; $dataVolta = isset($_POST['dataVolta']) ? $_POST['dataVolta'] : null; require_once "model/vooDAO.php"; require_once "library/data.php"; require_once "model/estadoDAO.php"; $eDAO = new EstadoDAO(); $estados = $eDAO->listar(); $this->views->assign("estados", $estados); $dataIda = Data::data_USA_BR($dataIda); // Converte a data para o padrao americano (banco de dados) $dataVolta = Data::data_USA_BR($dataVolta); // Converte a data para o padrao americano (banco de dados) if ($opcIdaVolta == "ida-volta" || $opcIdaVolta == "" || $opcIdaVolta == null) { $vDAO = new VooDAO(); $ida = $vDAO->getVooODD($origem, $destino, $dataIda); $volta = $vDAO->getVooODD($origem, $destino, $dataVolta); $aux = array(); $aux['ida'] = $ida; $aux['volta'] = $volta; $this->views->assign("resultado", $aux); $this->views->render("home_header", "home", true); $this->views->render("home_passagens", "home", true); $this->views->render("home_resultado", "home", true); $this->views->render("home_footer", "home", true); } else { $aux = array(); $aux['ida'] = $ida; $this->views->assign("resultado", $aux); $this->views->render("home_header", "home", true); $this->views->render("home_passagens", "home", true); $this->views->render("home_resultado", "home", true); $this->views->render("home_footer", "home", true); } }