public function validaPrograma($id, $idOpc) { $sql = 'SELECT P.codigo, P.nombre FROM h2h_programaOpc PO JOIN h2h_programa P ON (PO.IdProg=P.Id) WHERE P.Id=' . $id . ' AND PO.IdOpc=' . $idOpc; $datos = $this->_db->consulta($sql); if ($this->_db->numRows($datos) > 0) { $objetosPack = array(); $arrayPackages = $this->_db->fetchAll($datos); $objPackages = new bloqueoDTO(); $objPackages->setCodigo(trim($arrayPackages[0]['codigo'])); $objPackages->setNombre(trim($arrayPackages[0]['nombre'])); $objetosPack[] = $objPackages; return $objetosPack; } else { return false; } }
public function TS_GET_BLOQUEOS_PROG($sql, $inc = false) { //echo $sql; exit; $datos = $this->_db->consulta($sql); if ($this->_db->numRows($datos) > 0) { $objetosPack = array(); $arrayPackages = $this->_db->fetchAll($datos); foreach ($arrayPackages as $packDB) { $hotel = array(); $codHotel = array(); $PA = array(); $TH = array(); $codTH = array(); $cat = array(); $ciudad = array(); $incluye = array(); $valorHab = array(); $tipoHab = array(); $objPackages = new bloqueoDTO(); /*echo "ERROR: " . $packDB['Error']; echo "<br>"; echo "Linea: " . $packDB['Linea'];echo "<br>"; echo "Mensaje: " . $packDB['Mensaje']; exit;*/ if (trim(isset($packDB['Error']))) { $objPackages->setERROR(trim($packDB['Error'])); $objPackages->setLINEA(trim($packDB['Linea'])); $objPackages->setMSG(trim($packDB['Mensaje'])); } else { $objPackages->setId(trim($packDB['idPRG'])); $objPackages->setNombre(trim($packDB['nombrePRG'])); $objPackages->setNota(trim($packDB['notaPRG'])); $objPackages->setIdOpc(trim($packDB['idOpcion'])); $objPackages->setDesde(trim($packDB['desde'])); $objPackages->setTramo(trim($packDB['Tramo'])); $objPackages->setNotaOpc(trim($packDB['notaOPC'])); $objPackages->setMoneda(trim($packDB['moneda'])); //echo$packDB['itinerarioVuelo'];exit; $objPackages->setItiVuelo(trim($packDB['itinerarioVuelo'])); $objPackages->setPrecioDesde(trim($packDB['precio_desde'])); /* VALOR HABITACION */ for ($i = 1; $i <= 3; $i++) { $valorHab[] = trim($packDB['vHab_' . $i]); if (trim($packDB['tipoHab_' . $i]) == '01TPL') { $tipoHab[] = '01 TRIPLE'; } if (trim($packDB['tipoHab_' . $i]) == '01DBL') { $tipoHab[] = '01 DOBLE'; } if (trim($packDB['tipoHab_' . $i]) == '01SGL') { $tipoHab[] = '01 SINGLE'; } } $objPackages->setValorHab($valorHab); $objPackages->setTipoHab($tipoHab); /* VALOR HABITACION */ /* HOTELES */ for ($i = 1; $i <= 5; $i++) { if (trim($packDB['hotel_' . $i])) { $hotel[] = trim($packDB['hotel_' . $i]); $codHotel[] = trim($packDB['codHotel_' . $i]); $PA[] = trim($packDB['PlanAlimenticio_' . $i]); $TH[] = trim($packDB['TipoHabitacion_' . $i]); $codTH[] = trim($packDB['codTipoHabitacion_' . $i]); $cat[] = trim($packDB['cat_' . $i]); $ciudad[] = trim($packDB['ciudad_' . $i]); } } $objPackages->setHoteles($hotel); $objPackages->setCodHoteles($codHotel); $objPackages->setPA($PA); $objPackages->setTH($TH); $objPackages->setCodTH($codTH); $objPackages->setCat($cat); $objPackages->setCiudad($ciudad); /* HOTELES */ if ($inc) { $incluye[] = $this->getIncluye(trim($packDB['idPRG'])); $objPackages->setIncluye($incluye); } //$objPackages->setXXXX(trim($packDB['xxxxx'])); } $objetosPack[] = $objPackages; //sleep(1); } return $objetosPack; } else { return false; } }
public function codigosProg($idProg, $idBloq) { $sql = 'SELECT TOP 1 P.codigo, PO.record_c FROM h2h_programaOpc PO JOIN h2h_programa P ON (P.Id = ' . $idProg . ') WHERE PO.IdOpc = ' . $idBloq; $datos = $this->_db->consulta($sql); if ($this->_db->numRows($datos) > 0) { $objetosBloqueos = array(); $arrayCod = $this->_db->fetchAll($datos); $objBloq = new bloqueoDTO(); foreach ($arrayCod as $bloq) { $objBloq->setCodigo(trim($bloq['codigo'])); $objBloq->setRecordC(trim($bloq['record_c'])); $objetosBloqueos[] = $objBloq; } return $objetosBloqueos; } return false; }