コード例 #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) {
             $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->setCodigo(trim($packDB['codigoPRG']));
                 $objPackages->setNoches(trim($packDB['nochesPRG']));
                 $objPackages->setCiudad(trim($packDB['ciudadPRG']));
                 $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']));
                 $ext = Funciones::getExtensionImagen('../public/img/programas/upl_' . str_replace(' ', '_', trim($packDB['codigoPRG'])));
                 if ($ext) {
                     $objPackages->setImagen(BASE_URL . 'public/img/programas/upl_' . str_replace(' ', '_', trim($packDB['codigoPRG'])) . $ext);
                 } else {
                     $objPackages->setImagen('');
                 }
                 if (file_exists('../public/pdf/upl_' . str_replace(' ', '_', trim($packDB['codigoPRG'])) . '.pdf')) {
                     $objPackages->setItiVuelo(BASE_URL . 'public/pdf/upl_' . str_replace(' ', '_', trim($packDB['codigoPRG'])) . '.pdf');
                 } else {
                     $objPackages->setItiVuelo('');
                 }
                 /* 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 */
                 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;
     }
 }
コード例 #2
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;
     }
 }
コード例 #3
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']));
                 $objPackages->setNoches(trim($packDB['nochesPRG']));
                 $objPackages->setItiVuelo(trim($packDB['itinerarioVuelo']));
                 $objPackages->setPrecioDesde(trim($packDB['precio_desde']));
                 $objPackages->setPdhotel(trim($packDB['pdhotel']));
                 //
                 $objPackages->setPdtraslados(trim($packDB['pdtraslados']));
                 //
                 $objPackages->setPdtkt_aereo(trim($packDB['pdtkt_aereo']));
                 //
                 $objPackages->setPdseguro(trim($packDB['pdseguro_viaje']));
                 //
                 $plan = trim(trim($packDB['pdplan_alim']));
                 if ($plan === '1') {
                     $plan = 'All Inclusive';
                 }
                 if ($plan === '2') {
                     $plan = 'Media Pension';
                 }
                 if ($plan === '3') {
                     $plan = 'Desayuno';
                 }
                 if ($plan === '4') {
                     $plan = 'Pension Completa';
                 }
                 $objPackages->setPdplan($plan);
                 $ext = Functions::getExtensionImagen(ROOT . 'public' . DS . 'img' . DS . 'programas' . DS . 'upl_' . str_replace(' ', '_', trim($packDB['codigoPRG'])));
                 if ($ext) {
                     $objPackages->setImagen('upl_' . str_replace(' ', '_', trim($packDB['codigoPRG'])) . $ext);
                 } else {
                     $objPackages->setImagen('sin_foto.png');
                 }
                 /* VALOR HABITACION */
                 for ($i = 1; $i <= 3; $i++) {
                     $valorHab[] = trim($packDB['vHab_' . $i]);
                     if (trim($packDB['tipoHab_' . $i]) != '') {
                         $tipoHab[] = str_replace('SGL', ' SINGLE ', str_replace('DBL', ' DOBLE ', str_replace('TPL', ' TRIPLE ', str_replace('QUA', ' CUADRUPLE ', str_replace('DEP', ' DEPARTAMENTO ', str_replace('CHD', ' CHILD ', str_replace('CH2', ' CHILD ', trim($packDB['tipoHab_' . $i]))))))));
                     }
                 }
                 $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;
     }
 }