$ciudad_h = $_POST['ciudad' . $i]; $hotel_h = $_POST['nombreHotel' . $i]; $noches_h = $_POST['noches' . $i]; $f_llegada_h = $_POST['f_llegada' . $i]; $f_salida_h = $_POST['f_salida' . $i]; $no_reservacion_h = $_POST['no_reservacion' . $i]; $monto_noche_h = $_POST['monto_noche' . $i]; $hr_llegada_h = $_POST['hr_llegada' . $i]; $tipo_habitacion_h = $_POST['tipo_habitacion' . $i]; $hr_salida_h = $_POST['hr_salida' . $i]; $impuesto_cot_h = $_POST['impuesto_cotizacion' . $i]; $f_llegada_mysql = fecha_to_mysql($f_llegada_h); $f_salida_mysql = fecha_to_mysql($f_salida_h); $h_llegada = $f_llegada_mysql . ' ' . $hr_llegada_h; $h_regreso = $f_salida_mysql . ' ' . $hr_salida_h; $id_hospedaje = $cotizacion->add_hospedaje($hotel_h, $h_llegada, $h_regreso, $tipo_habitacion_h, $noches_h, $monto_noche_h, $impuesto_cot_h, $no_reservacion_h, $itinerario_id, $usuario_id); } } // Enviar notificación a los Viajeros $tramite = new Tramite(); $tramite->Load_Tramite($tramite_id); $iniciador = $tramite->Get_dato("t_iniciador"); $mensaje = '<a href="' . $RUTA_R . 'flujos/solicitudes/index.php?view=view&id=' . $tramite_id . '">Se ha realizado la cotización correspondiente al <strong>Hospedaje</strong> perteneciente a la solicitud <strong>' . $tramite_id . '</strong>.</a>'; $tramite->EnviaNotificacion($tramite_id, $mensaje, $usuario_id, $iniciador, "0"); $sql = "SELECT IF((sv_vuelo=1 AND sv_id_agencia=0) OR (sv_vuelo=0),1,0) as 'Falta_v', \t \n\t\t\t\t\t IF((sv_vuelo=1 AND sv_id_agencia=0) OR (sv_vuelo=0),(SELECT cd_pais FROM ciudad_destino, sv_itinerario sv WHERE sv.svi_ciudad_origen = cd_id AND sv.svi_solicitud = sv_id ORDER BY svi_fecha_salida ASC LIMIT 1),0) as 'Origen_1', \t \n\t\t\t\t\t IF(h_id_agencia=0,1,0) AS 'Falta_h',\n\t\t\t\t\t IF(t_tipo_traslado = 0 AND t_id_agencia=0,1,0) AS 'Falta_to',\n\t\t\t\t\t IF(t_tipo_traslado = 1 AND t_id_agencia=0,1,0) AS 'Falta_td',\t\t\t\t\t \n\t\t\t\t\t (SELECT cd_pais FROM ciudad_destino WHERE cd_id = svi_ciudad_origen) AS 'Origen',\n\t\t\t\t\t (SELECT cd_pais FROM ciudad_destino WHERE cd_id = svi_ciudad_destino) AS 'Destino'\n\t\t\t\tFROM tramites\n\t\t\t\tJOIN solicitud_viaje ON sv_tramite = t_id\n\t\t\t\tJOIN sv_itinerario ON svi_solicitud = sv_id\n\t\t\t\tLEFT JOIN hospedaje ON h_id_itinerario = svi_id\n\t\t\t\tLEFT JOIN traslados ON t_id_itinerario = svi_id\n\t\t\t\tWHERE sv_tramite = {$tramite_id}\n\t\t\t\tORDER BY svi_fecha_salida"; $res = @mysql_query($sql); $parametro = ''; while ($row = @mysql_fetch_assoc($res)) { if ($row['Falta_h'] == 1) { $parametro .= " OR ut_tipo = 10 AND p_pais_viaje = " . $row['Destino']; }