$sql = " insert into t_vat_reg_employee ( " . " t_vat_reg_employee_id,t_vat_registration_id,p_job_position_id,employee_qty," . " employee_salery,description,creation_date,created_by,updated_date,updated_by )" . " values ( " . " generate_id('sikp','t_vat_reg_employee','t_vat_reg_employee_id')," . $record['o_vat_reg_id'] . "," . $items_potensi['p_job_position_id2'] . "," . $items_potensi['num_worker2'] . "," . $items_potensi['salary2'] . "," . "'" . $items_potensi['job_description2'] . "'," . "sysdate," . "'ADMIN'," . "sysdate," . "'ADMIN')"; if ($dbConn->query($sql)) { } else { throw new Exception($dbConn->Errors->Errors[0]); } } $idx_hotel = 1; while ($idx_hotel <= 5) { if ($idx_hotel == 1) { $idx = ''; } else { $idx = $idx_hotel; } if (!empty($items_potensi['p_room_type_id' . $idx])) { $array_insert_potensi = array("p_room_type_id" => $items_potensi['p_room_type_id' . $idx], "room_qty" => $items_potensi['room_qty' . $idx], "service_qty" => $items_potensi['frk_pengguna_layanan' . $idx], "service_charge_wd" => $items_potensi['service_charge_wd' . $idx], "service_charge_we" => $items_potensi['service_charge_we' . $idx], "room_description" => $items_potensi['room_description' . $idx]); insertHotel($record['o_vat_reg_id'], $array_insert_potensi); } $idx_hotel++; } $idx_parkir = 1; while ($idx_parkir <= 3) { if ($idx_parkir == 1) { $idx = ''; } else { $idx = $idx_parkir; } if (!empty($items_potensi['parking_size' . $idx]) && $items_potensi['parking_size' . $idx] != '') { $array_insert_potensi = array("parking_size" => $items_potensi['parking_size' . $idx], "max_load_qty" => $items_potensi['max_load_qty' . $idx], "avg_subscription_qty" => $items_potensi['avg_subscription_qty' . $idx], "first_service_charge" => $items_potensi['first_service_charge' . $idx], "next_service_charge" => $items_potensi['next_service_charge' . $idx], "var_description" => $items_potensi['parking_description' . $idx]); insertParkir($record['o_vat_reg_id'], $array_insert_potensi); } $idx_parkir++;
$data['inicioContrato'] = $campania->inicio; $data['finContrato'] = $campania->fin; } } $data_blacklist = array(); if (isset($_POST['blacklist'])) { $data_blacklist = $_POST['blacklist']; } if (isset($_POST['idHotel'])) { $idHotel = $_POST['idHotel']; $hotel = updateHotel($idHotel, $data, $data_direccion, $idiomas, $monedas, $fechas, $condiciones, $dominios, $promociones, $data_blacklist, $precios); } else { if (isset($_POST['clave'])) { $data['clave'] = $_POST['clave']; } $hotel = insertHotel($data, $data_direccion, $idiomas, $monedas, $fechas, $condiciones, $dominios, $promociones, $data_blacklist, $precios); } if ($hotel) { if ($campania->subdominio != $data['dominioCampania']) { updateDominioCampania($campania->id, $data['dominioCampania']); } updateAdwordHotel($_POST['idAdword'], $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, 'eliminar') == '0') { if (isset($_POST['id'])) {
deleteHotelImages($h->id); deleteHotel($h->id); } } $descripcion = $html('#summary'); $descripcion_larga = trim($descripcion[0]->getInnerText()); $nombre = $html('#hp_hotel_name'); $nombre = trim($nombre[0]->getInnerText()); $rating = $html('#wrap-hotelpage-top h1 span.use_sprites'); if (isset($rating[0]) && strlen($rating[0]->getAttribute('title')) > 0) { $rating = filter_var($rating[0]->getAttribute('title'), FILTER_SANITIZE_NUMBER_INT); } else { $rating = 0; } $hotel = array('descripcionLarga' => $descripcion_larga, 'url' => $hotel_url, 'estado' => 'activo', 'visitas' => 0, 'nombre' => $nombre, 'calidad' => (int) $rating); $hotel_id = insertHotel($hotel); foreach ($imagenes as $imagen) { insertHotelImage($imagen, $hotel_id); } //Servicios! $servicios = $html('.nha_single_unit_facilities .description'); $servicios_array = array(); foreach ($servicios as $servicio) { $servicio_t = $servicio('h3'); $servicio_t = $servicio_t[0]->getPlainText(); $servicio_p = $servicio('p'); $servicio_p = $servicio_p[0]->getPlainText(); $servicios_text = split(',', trim($servicio_p)); foreach ($servicios_text as $servicio_text) { inserHotelServicio(array('categoria' => trim($servicio_t), 'servicio' => trim($servicio_text)), $hotel_id); }