/** * Metodo procesador: Procesa los datos de la busqueda de programas. * <PRE> * -.Creado: 19/05/2015 * </PRE> * @author Jonathan Estay */ public function buscar($form = '', $url = '') { Buscador::buscar($url); $BP_cntHab = $this->getInt('mL_cmbHab_PRG'); $BP_ciudadDes = $this->getTexto('mL_txtCiudadDestino_PRG'); $BP_fechaIn = $this->getTexto('mL_txtFechaIn_PRG'); $BP_fechaOut = $this->getTexto('mL_txtFechaOut_PRG'); $BP_hotel = $this->getTexto('mL_txtHotel_PRG'); if ($BP_ciudadDes) { Session::set('sess_BP_ciudadDes_PRG', $BP_ciudadDes); } Session::set('sess_BP_cntHab_PRG', $BP_cntHab); Session::set('sess_BP_fechaIn_PRG', $BP_fechaIn); Session::set('sess_BP_fechaOut_PRG', $BP_fechaOut); Session::set('sess_BP_hotel_PRG', $BP_hotel); Session::set('sess_BP_cntPas', 0); Session::set('sess_BP_cntAdl', 0); Session::set('sess_BP_cntChd', 0); Session::set('sess_BP_cntInf', 0); for ($i = 1; $i <= 3; $i++) { if ($i <= $BP_cntHab) { Session::set('sess_BP_Adl_' . $i, $this->getInt('mL_cmbAdultos_' . $i)); Session::set('sess_BP_Chd_' . $i, $this->getInt('mL_child_' . $i)); Session::set('sess_BP_Inf_' . $i, $this->getInt('mL_inf_' . $i)); if (Session::get('sess_BP_Adl_' . $i) > 0) { Session::set('sess_BP_cntAdl', Session::get('sess_BP_cntAdl') + 1); } if (Session::get('sess_BP_Chd_' . $i) > 0) { Session::set('sess_BP_cntChd', Session::get('sess_BP_cntChd') + 1); } if (Session::get('sess_BP_Inf_' . $i) > 0) { Session::set('sess_BP_cntInf', Session::get('sess_BP_cntInf') + 1); } for ($x = 1; $x <= 2; $x++) { Session::set('sess_BP_edadChd_' . $x . '_' . $i, $this->getInt('mL_edadChild_' . $x . '_' . $i)); } Session::set('sess_BP_cntPas', Session::get('sess_BP_cntPas') + Session::get('sess_BP_Adl_' . $i) + Session::get('sess_BP_Chd_' . $i)); } else { Session::set('sess_BP_Adl_' . $i, 0); Session::set('sess_BP_Chd_' . $i, 0); Session::set('sess_BP_Inf_' . $i, 0); Session::set('sess_BP_edadChd_1_' . $i, 0); Session::set('sess_BP_edadChd_2_' . $i, 0); } } $this->redireccionar('programas/index/' . $form); }
public function buscar($form = '', $url = '') { Buscador::buscar($url); if ($form === 'a') { Session::acceso('Usuario'); } $BP_cntHab = $this->getInt('mL_cmbHab'); $BP_ciudadDes = $this->getTexto('mL_txtCiudadDestino'); $BP_fechaIn = $this->getTexto('mL_txtFechaIn'); $BP_fechaOut = $this->getTexto('mL_txtFechaOut'); $BP_hotel = $this->getTexto('mL_txtHotel'); if ($BP_ciudadDes) { Session::set('sess_BP_ciudadDes', $BP_ciudadDes); } Session::set('sess_BP_cntHab', $BP_cntHab); Session::set('sess_BP_fechaIn', $BP_fechaIn); Session::set('sess_BP_fechaOut', $BP_fechaOut); if ($BP_hotel == 'Nombre del hotel') { $BP_hotel = ''; } Session::set('sess_BP_hotel', $BP_hotel); Session::set('sess_BP_cntAdl', 0); Session::set('sess_BP_cntChd', 0); Session::set('sess_BP_cntInf', 0); for ($i = 1; $i <= 3; $i++) { if ($i <= $BP_cntHab) { Session::set('sess_BP_Adl_' . $i, $this->getInt('mL_cmbAdultos_' . $i)); Session::set('sess_BP_Chd_' . $i, $this->getInt('mL_child_' . $i)); Session::set('sess_BP_Inf_' . $i, $this->getInt('mL_inf_' . $i)); if (Session::get('sess_BP_Adl_' . $i) > 0) { Session::set('sess_BP_cntAdl', Session::get('sess_BP_cntAdl') + 1); } if (Session::get('sess_BP_Chd_' . $i) > 0) { Session::set('sess_BP_cntChd', Session::get('sess_BP_cntChd') + 1); } if (Session::get('sess_BP_Inf_' . $i) > 0) { Session::set('sess_BP_cntInf', Session::get('sess_BP_cntInf') + 1); } for ($x = 1; $x <= 2; $x++) { if ($x <= Session::get('sess_BP_Chd_' . $i) && !$this->getInt('mL_edadChild_' . $x . '_' . $i)) { Session::set('sess_BP_edadChd_' . $x . '_' . $i, 2); } else { Session::set('sess_BP_edadChd_' . $x . '_' . $i, $this->getInt('mL_edadChild_' . $x . '_' . $i)); } } } else { Session::set('sess_BP_Adl_' . $i, 0); Session::set('sess_BP_Chd_' . $i, 0); Session::set('sess_BP_Inf_' . $i, 0); Session::set('sess_BP_edadChd_1_' . $i, 0); Session::set('sess_BP_edadChd_2_' . $i, 0); } } $this->redireccionar('bloqueos/index/' . $form); }