コード例 #1
0
 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;
     }
 }