public function enviar()
 {
     Session::acceso('Usuario');
     //Cargando libs
     $this->getLibrary('class.phpmailer');
     $mail = new PHPMailer();
     $mail->IsSMTP();
     $mail->SMTPAuth = true;
     //$mail->Port = 25;
     $mail->Host = "mail.oristravel.com";
     $mail->Username = "******";
     $mail->Password = "******";
     $mail->From = '*****@*****.**';
     $mail->FromName = 'Solicitud de Contacto WEB-ORIS';
     $mail->CharSet = CHARSET;
     $mail->Subject = 'Confirmacion de reserva online: ';
     $body = "<html><body>Un mensaje HTML</body></html>";
     $mail->MsgHTML($body);
     $mail->AddAddress('*****@*****.**', "");
     //$mail->AddAddress('*****@*****.**', "");
     if (!$mail->Send()) {
         echo "Error al enviar: " . $mail->ErrorInfo;
     } else {
         echo "Mensaje enviado!";
     }
 }
 public function validaForm()
 {
     $form = $this->_view->getArgumentos();
     if (!$form) {
         $form[0] = 'a';
     }
     if ($form[0] != 'form') {
         Session::acceso('Usuario');
     }
 }
 public function index($form = '')
 {
     $this->_view->form = $form;
     Session::acceso('Usuario');
     $agencia = $this->loadModel('agencia');
     $this->_view->objCiudades = $this->_ciudad->getCiudadesBloq();
     $this->_view->objCiudadesPRG = $this->_ciudad->getCiudadesPRG();
     $this->_view->objAgencias = $agencia->getAgencias();
     $this->_view->currentMenu = 4;
     $this->_view->titulo = 'ORISTRAVEL';
     $this->_view->renderingSystem('imagenes');
 }
 public function verPDF($id = false)
 {
     Session::acceso('Usuario');
     //$this->getLibrary('fpdf');
     $this->getLibrary('pdf_html');
     $pdf = new PDF('P', 'mm', 'letter');
     $ruta_img = ROOT . 'public' . DS . 'img' . DS;
     require_once ROOT . 'views' . DS . 'sistema' . DS . 'pdf' . DS . 'voucherPDF.php';
     //$this->_pdf= new FPDF();
     //$this->_pdf->AddPage();
     //$this->_pdf->SetFont('Arial','B',16);
     //$this->_pdf->Cell(40,10, utf8_decode('¡Hola, Mundo!'));
     //$this->_pdf->Cell(40,10,'¡Hola, Mundo!');
     //$this->_pdf->Output();
 }
 public function modificar($id)
 {
     Session::acceso('admin');
     $this->view->setEncabezado("Modificar configuracion");
     $this->view->setTitulo("Configuracion");
     if (isset($_POST['params'])) {
         $this->check_csrf('post');
         $this->actualizar_csrf();
         $configuracionModif = Configuracion::nuevo($_POST['params']['configuracion']);
         $this->validarCampos($configuracionModif);
         $modif = $_POST['params']['configuracion'];
         $configuracion = Configuracion::getById($id);
         if (count($configuracionModif->getErrores()) == 0) {
             $repetido = Configuracion::buscarPor('clave', $modif['clave']);
             if (sizeof($repetido) == 0 || $repetido[0]['id'] == $id) {
                 $configuracion->setClave($modif['clave']);
                 $configuracion->setValor($modif['valor']);
                 if (!$configuracion->actualizar()) {
                     $this->view->setError("no puedo actualizarse la configuracion.");
                 }
             } else {
                 $this->view->setError("la clave ya existe");
             }
             if ($this->view->getError() != null) {
                 $this->view->renderizar("formulario", array("configuracion" => $configuracion, "accion" => "modificar", "token" => $this->token, "token_id" => $this->token_id));
             } else {
                 $this->redireccionar('configuracion/listado/&m=c');
             }
         } else {
             $this->view->setError("Modifique los campos indicados.");
             $configuracionModif->setId($id);
             $this->view->renderizar("formulario", array("configuracion" => $configuracionModif, "accion" => "modificar", "token" => $this->token, "token_id" => $this->token_id));
         }
     } else {
         $configuracion = Configuracion::getById($id);
         if ($configuracion->getId() != null) {
             $this->view->renderizar("formulario", array("configuracion" => $configuracion, "accion" => "modificar", "token" => $this->token, "token_id" => $this->token_id));
         } else {
             $this->redireccionar('configuracion/listado&m=c');
         }
     }
 }
 public function buscar()
 {
     Session::acceso('Usuario');
     Session::set('sess_CR_fechaDesde', $this->getTexto('txtFechaDesde-ConsRes'));
     Session::set('sess_CR_fechaHasta', $this->getTexto('txtFechaHasta-ConsRes'));
     Session::set('sess_CR_tipoFecha', $this->getInt('rdbFecha'));
     $this->redireccionar('booking');
 }
 public function modificar()
 {
     if (strtolower($this->getServer('HTTP_X_REQUESTED_WITH')) == 'xmlhttprequest' || Session::get('sess_browser') == 'IE9') {
         Session::acceso('Usuario');
         $MH_nombreHotel = $this->getTexto('txtEH_nombreHotel');
         $MH_direc = $this->getTexto('txtEH_direc');
         $MH_cate = $this->getTexto('cmbEH_categoria');
         $MH_lat = $this->getTexto('txtEH_latitud');
         $MH_lon = $this->getTexto('txtEH_longitud');
         $MH_sitWeb = $this->getTexto('txtEH_sitioWeb');
         $MH_areaDescrip = $this->getPostClave('areaDescrip');
         if (!$MH_nombreHotel) {
             echo 'Debe ingresar un nombre de hotel';
             exit;
         } else {
             if (!$MH_cate) {
                 echo 'El hotel debe tener una categor&iacute;a';
                 exit;
             } else {
                 if (!$MH_direc) {
                     echo 'Debe ingresar una direcci&oacute;n para el hotel';
                     exit;
                 }
             }
         }
         $MH_Hotel = $this->loadModel('hotel');
         //$this->getLibrary('upload' . DS . 'class.upload');
         $rutaImg = ROOT . 'public' . DS . 'img' . DS . 'hoteles' . DS;
         for ($i = 1; $i <= 5; $i++) {
             if (isset($_FILES['flImagen' . $i]['name'])) {
                 if ($_FILES['flImagen' . $i]['name']) {
                     if (Functions::validaFoto($_FILES['flImagen' . $i]['type']) == false) {
                         echo 'La Imagen ' . $i . ' debe ser formato [.JPG] [.GIF] [.PNG]';
                         exit;
                     }
                     if ($_FILES['flImagen' . $i]['size'] > 524288) {
                         //512KB
                         echo 'La Imagen ' . $i . ' debe ser menor a <b>500kb</b>';
                         exit;
                     }
                 }
             }
         }
         //Servicios Hotel
         $MH_chkRest = Functions::validaChk($this->getTexto('chkEH_rest'));
         $MH_chkLavan = Functions::validaChk($this->getTexto('chkEH_lavan'));
         $MH_chkPisDesc = Functions::validaChk($this->getTexto('chkEH_pisDesc'));
         $MH_chkCanTenis = Functions::validaChk($this->getTexto('chkEH_cTenis'));
         $MH_chkBar = Functions::validaChk($this->getTexto('chkEH_bar'));
         $MH_chkBusCen = Functions::validaChk($this->getTexto('chkEH_busCen'));
         $MH_chkSpa = Functions::validaChk($this->getTexto('chkEH_spa'));
         $MH_chkGuard = Functions::validaChk($this->getTexto('chkEH_guarderia'));
         $MH_chkCafe = Functions::validaChk($this->getTexto('chkEH_cafe'));
         $MH_chkInterHot = Functions::validaChk($this->getTexto('chkEH_interHot'));
         $MH_chkGym = Functions::validaChk($this->getTexto('chkEH_gym'));
         $MH_chkSaReu = Functions::validaChk($this->getTexto('chkEH_sReu'));
         $MH_chkServHab = Functions::validaChk($this->getTexto('chkEH_servHab'));
         $MH_chkEst = Functions::validaChk($this->getTexto('chkEH_estaciona'));
         $MH_chkPisCub = Functions::validaChk($this->getTexto('chkEH_pisCub'));
         $MH_chkJar = Functions::validaChk($this->getTexto('chkEH_jardin'));
         $MH_chkDisca = Functions::validaChk($this->getTexto('chkEH_disca'));
         $MH_chkBou = Functions::validaChk($this->getTexto('chkEH_bou'));
         //Servicios Habitacion
         $MH_chkAirAcond = Functions::validaChk($this->getTexto('chkEH_airAcond'));
         $MH_chkCaFuerte = Functions::validaChk($this->getTexto('chkEH_cFuerte'));
         $MH_chkTvCable = Functions::validaChk($this->getTexto('chkEH_tvCable'));
         $MH_chkSecPelo = Functions::validaChk($this->getTexto('chkEH_sPelo'));
         $MH_chkCalef = Functions::validaChk($this->getTexto('chkEH_calefac'));
         $MH_chkMinBar = Functions::validaChk($this->getTexto('chkEH_mBar'));
         $MH_chkFono = Functions::validaChk($this->getTexto('chkEH_fono'));
         $MH_chkBarraSeg = Functions::validaChk($this->getTexto('chkEH_barraSeg'));
         $MH_chkNoFumar = Functions::validaChk($this->getTexto('chkEH_noFumar'));
         $MH_chkTV = Functions::validaChk($this->getTexto('chkEH_tv'));
         $MH_chkInterHab = Functions::validaChk($this->getTexto('chkEH_interHab'));
         $MH_sql = 'UPDATE hotel 
                 SET hotel="' . mb_convert_encoding($MH_nombreHotel, "ISO-8859-1", "UTF-8") . '", direc="' . mb_convert_encoding($MH_direc, "ISO-8859-1", "UTF-8") . '", cat="' . $MH_cate . '", descripcion="' . str_replace('\\', '', htmlentities($MH_areaDescrip)) . '", SWEB="' . $MH_sitWeb . '", estado="", 
                 lat="' . $MH_lat . '", lon="' . $MH_lon . '", restaurante=' . $MH_chkRest . ', bar=' . $MH_chkBar . ', cafeteria=' . $MH_chkCafe . ', 
                 s_habitacion=' . $MH_chkServHab . ', busness_center=' . $MH_chkBusCen . ', internet_hotel=' . $MH_chkInterHot . ', estacionamiento=' . $MH_chkEst . ', 
                 piscina_cub=' . $MH_chkPisCub . ', piscina_des=' . $MH_chkPisDesc . ', gym=' . $MH_chkGym . ', spa=' . $MH_chkSpa . ', tenis=' . $MH_chkCanTenis . ', 
                 guarderia=' . $MH_chkGuard . ', salas_reunion=' . $MH_chkSaReu . ', jardin=' . $MH_chkJar . ', discapacitados=' . $MH_chkDisca . ', 
                 bautique=' . $MH_chkBou . ', acondicionado=' . $MH_chkAirAcond . ', calefaccion=' . $MH_chkCalef . ', no_fuma=' . $MH_chkNoFumar . ', 
                 caja_fuerte=' . $MH_chkCaFuerte . ', mini_bar=' . $MH_chkMinBar . ', television=' . $MH_chkTV . ', tv_cable=' . $MH_chkTvCable . ', 
                 inter_hab=' . $MH_chkInterHab . ',	secador_pelo=' . $MH_chkSecPelo . ', barra_seguridad=' . $MH_chkBarraSeg . ', 
                 lavanderia=' . $MH_chkLavan . ', telefono=' . $MH_chkFono;
         for ($i = 1; $i <= 5; $i++) {
             if (isset($_FILES['flImagen' . $i]['name'])) {
                 if ($_FILES['flImagen' . $i]['name']) {
                     $upload = new upload($_FILES['flImagen' . $i], 'es_ES');
                     $upload->allowed = array('image/jpg', 'image/jpeg', 'image/png', 'image/gif');
                     $upload->file_max_size = '524288';
                     // 512KB
                     $upload->file_new_name_body = sha1(uniqid());
                     $upload->process($rutaImg);
                     if ($upload->processed) {
                         //THUMBNAILS
                         $imagen = $upload->file_dst_name;
                         //nombre de la imagen
                         //$MH_sql.= ', foto' . $i . '= "' . $imagen . '" ';
                         $thumb = new upload($upload->file_dst_pathname);
                         $thumb->image_resize = true;
                         $thumb->image_x = 150;
                         $thumb->image_y = 150;
                         $thumb->file_name_body_pre = 'thumb_';
                         $thumb->process($rutaImg . 'thumb' . DS);
                         if ($i == 1) {
                             $MH_sql .= ', img_encabezado = "' . $imagen . '", mini_img_encabezado = "' . $imagen . '" ';
                         } else {
                             if ($i == 2) {
                                 $MH_sql .= ', img_contenido = "' . $imagen . '", mini_img_contenido = "' . $imagen . '" ';
                             } else {
                                 $MH_sql .= ', img_contenido' . ($i - 1) . ' = "' . $imagen . '", mini_img_contenido' . ($i - 1) . ' = "' . $imagen . '" ';
                             }
                         }
                     } else {
                         echo '(Imagen ' . $i . ')' . $upload->error . '<br>';
                     }
                 }
             } else {
                 if ($i == 1) {
                     if ($this->getTexto('chkEH_flImagen' . $i) == 'on') {
                         Functions::eliminaFile($rutaImg . Session::get('sessMOD_DTH_img' . $i));
                         Functions::eliminaFile($rutaImg . 'thumb' . DS . 'thumb_' . Session::get('sessMOD_DTH_img' . $i));
                         $MH_sql .= ', img_encabezado = "", mini_img_encabezado = "" ';
                         Session::destroy('sessMOD_DTH_img' . $i);
                     }
                 } else {
                     if ($i == 2) {
                         if ($this->getTexto('chkEH_flImagen' . $i) == 'on') {
                             Functions::eliminaFile($rutaImg . Session::get('sessMOD_DTH_img' . $i));
                             Functions::eliminaFile($rutaImg . 'thumb' . DS . 'thumb_' . Session::get('sessMOD_DTH_img' . $i));
                             $MH_sql .= ', img_contenido = "", mini_img_contenido = "" ';
                             Session::destroy('sessMOD_DTH_img' . $i);
                         }
                     } else {
                         if ($this->getTexto('chkEH_flImagen' . $i) == 'on') {
                             Functions::eliminaFile($rutaImg . Session::get('sessMOD_DTH_img' . $i));
                             Functions::eliminaFile($rutaImg . 'thumb' . DS . 'thumb_' . Session::get('sessMOD_DTH_img' . $i));
                             //echo Session::get('sessMOD_DTH_img' . $i); exit;
                             $MH_sql .= ', img_contenido' . ($i - 1) . ' = "", mini_img_contenido' . ($i - 1) . ' = "" ';
                             Session::destroy('sessMOD_DTH_img' . $i);
                         }
                     }
                 }
             }
         }
         $MH_sql .= ' WHERE codigo=' . $_SESSION['sessMOD_EH_codHotel'];
         //echo $MH_sql; exit;
         $MH_Hotel->exeSQL($MH_sql);
         echo 'OK';
     } else {
         throw new Exception('Error inesperado, intente nuevamente. Si el error persiste comuniquese con el administrador.');
     }
 }
 /**
  * Metodo procesador: Modifica lo que incluye un programa.
  * <PRE>
  * -.Creado: 20/10/2015
  * -.Modificado: 01/01/1900
  * </PRE>
  * @return String OK
  * @author Jonathan Estay
  */
 public function agregarIncluye()
 {
     Session::acceso('Usuario');
     if (strtolower($this->getServer('HTTP_X_REQUESTED_WITH')) == 'xmlhttprequest' || Session::get('sess_browser') == 'IE9') {
         $hotel = Functions::validaChk($this->getTexto('chkHotel'));
         $traslado = Functions::validaChk($this->getTexto('chkTraslado'));
         $tkt_aereo = Functions::validaChk($this->getTexto('chkTKT_Aereo'));
         $seguro_viaje = Functions::validaChk($this->getTexto('chkSeguroViajes'));
         $plan_alim_chk = Functions::validaChk($this->getTexto('chkPlanAlimento'));
         $plan_alim_cmb = $this->getTexto('cmbPlanAlimento');
         if (!$plan_alim_chk) {
             $plan_alim_cmb = 0;
         }
         //echo 'PA: ' . $plan_alim_cmb;            exit;
         $programa = $this->loadModel('programa');
         $objPrograma = $programa->getPrograma(Session::get('sessMOD_EP_codPRG'));
         $st = true;
         if ($objPrograma) {
             $st = false;
         }
         $programa->addServiciosIncluidos(Session::get('sessMOD_EP_codPRG'), $hotel, $traslado, $tkt_aereo, $seguro_viaje, $plan_alim_cmb, $st);
         echo 'OK';
     } else {
         throw new Exception('Error inesperado, intente nuevamente. Si el error persiste comuniquese con el administrador');
     }
 }
 public function eliminar($id)
 {
     Session::acceso('admin');
     if (!$this->filtrarInt($id)) {
         $this->redireccionar('post');
     }
     if (!$this->_post->getPost($this->filtrarInt($id))) {
         $this->redireccionar('post');
     }
     $this->_post->eliminarPost($this->filtrarInt($id));
     $this->redireccionar('post');
 }
Example #10
0
 public function eliminar($id)
 {
     Session::acceso('admin');
     //Restringe el acceso.
     //Comprobamos si '$id' no es un entero.
     if (!$this->filtrarInt($id)) {
         //Si no es un entero redirigimos a 'post'.
         $this->redireccionar('post');
     }
     //Comprobamos si no existe un post con este '$id'
     if (!$this->_post->getPost($this->filtrarInt($id))) {
         //Si no exite el post con el '$id' redirigimos a 'post'.
         $this->redireccionar('post');
     }
     //Si pasa las validaciones eliminamos el post.
     $this->_post->removePost($this->filtrarInt($id));
     $this->redireccionar('post');
 }
 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);
 }
 public function detalle($id)
 {
     Session::acceso('admin');
     $this->view->setEncabezado("Detalle de usuario");
     $usuario = Usuario::getById($id);
     if ($usuario) {
         $this->view->renderizar("detalle", array("usuario" => $usuario));
     } else {
         $this->redireccionar('usuario/listado');
     }
 }
 public function eliminarDetalle($id = null)
 {
     Session::acceso('eliminar_detalle');
     $this->check_csrf('get');
     $this->actualizar_csrf();
     $alimento = Detalle::getById($id);
     if ($alimento->getId() != null) {
         if ($alimento->borrar()) {
             $this->redireccionar('alimento/listado&m=b');
         } else {
             $this->view->setError("No se pudo eliminar el alimento");
         }
     } else {
         $this->redireccionar('alimento/listado');
     }
 }