<?php $action = $_POST['action']; $result = array('msg' => 'error', 'data' => 'Acción no valida'); if (strcmp($action, 'update') == 0) { $data = array('descripcionCorta' => NULL, 'tituloSeo' => NULL, 'keywordsSeo' => NULL, 'claveGoogleAnalytics' => NULL, 'seo' => 0); foreach ($data as $key => $value) { if (isset($_POST[$key])) { $data[$key] = $_POST[$key]; } } if (isset($_POST['idHotel'])) { $idHotel = $_POST['idHotel']; $hotel = updateHotelData($idHotel, $data); } if ($hotel) { $result['msg'] = 'ok'; $result['data'] = 'Se guardaron los cambios correctamente'; $result['hotelId'] = $hotel; } else { $result['data'] = 'No se guardaron los cambios. Verifique sus datos y vuelva a intentarlo.'; } } else { if (strcmp($action, 'search') == 0) { $term = $_POST['term']; if ($usuario->usuarioGrupoId == 1) { $hoteles = buscarHoteles($term); } else { if ($usuario->usuarioGrupoId == 3) { $hoteles = buscarHoteles($term, $usuario->id); }
$nombre = $hotel_v->nombre; $body = "\n Hotel: {$nombre} <br>\n Para validar sus reservas haga click en el siguiente link o copie y pegue la dirección en su navegador:<br>\n <a href='{$vikahotel_url}/validar?login_code={$login_code}'>{$base_url}/validar?login_code={$login_code}</a><br>\n <i>Enviado desde " . $smarty->getConfigVariable('sistema_nombre') . "</i>\n "; try { $mail = new Core_Mailer(); $mail->send_email($hotel_v->distribuidor->emailReservas, 'Url de validación de reservas de ' . $nombre, $body); } catch (Exception $e) { print_r($e); } $result = array('msg' => 'ok', 'data' => 'Se le ha enviado un email al hotel con la url de validación de reservas'); } } else { if (strcmp($action, 'updatefields') == 0) { if (isset($_POST['edit'])) { $edit = $_POST['edit']; foreach ($edit as $idHotel => $data) { $updated = updateHotelData($idHotel, $data); } if ($updated) { $result = array('msg' => 'ok', 'data' => 'Los datos fueron actualizados correctamente'); } } } else { if ($_FILES) { if (is_uploaded_file($_FILES['file']['tmp_name'])) { $iWidth = 0; $iHeight = 0; $iJpgQuality = 90; $FileName = md5(time() . rand()); $sTempFileName = 'cache/' . $FileName; //$st = opendir('cache/teatros/'. $_POST['edificioId'], "a"); move_uploaded_file($_FILES['file']['tmp_name'], $sTempFileName);
foreach ($metas as $meta) { if ($meta->getAttribute('property') == 'booking_com:location:latitude') { $latitude = $meta->getAttribute('content'); } else { if ($meta->getAttribute('property') == 'booking_com:location:longitude') { $longitude = $meta->getAttribute('content'); } } } if (isset($longitude) && isset($latitude)) { updateDireccionByHotelId($hotel->id, array('lat' => $latitude, 'lon' => $longitude)); } } } $data_hotel = array('descripcionLarga' => json_encode($descripciones_largas_array), 'nombre' => $nombreHotel, 'calidad' => (int) $rating); updateHotelData($hotel->id, $data_hotel); foreach ($servicios_array as $servicio) { inserHotelServicio(array('categoria' => json_encode($servicio['categoria']), 'servicio' => json_encode($servicio['servicio'])), $hotel->id); } foreach ($condiciones_array as $servicio) { inserHotelCondicion(array('categoria' => json_encode($servicio['categoria']), 'servicio' => json_encode($servicio['servicio'])), $hotel->id); } inserHotelTenerEnCuenta(json_encode($tener_en_cuenta_array), $hotel->id); } else { deleteHotelImages($hotel->id); $url = $hotel_url; $contexto = stream_context_create($opciones); $content = file_get_contents($url, false, $contexto); $html = str_get_dom($content); $photos = $html('#photos_distinct a'); foreach ($photos as $e_k => $element) {