🇧🇬 ЭкспертТур
Туры в Болгарию 2026 | Вылет из Варшавы
🚐 Трансфер включён
let hotelsData = [ { "name": "NIMFA - RUSALKA", "stars": 2, "resort": "Русалка", "board": "BB", "rooms": [ { "name": "DBL без кондиционера", "view": "стандартный", "adults": 2, "children": 0, "prices": {"season1": 260, "season2": 274, "season3": 260} }, { "name": "DBL с кондиционером", "view": "стандартный", "adults": 2, "children": 0, "prices": {"season1": 264, "season2": 278, "season3": 264} }, { "name": "DBL без кондиционера", "view": "семейный", "adults": 2, "children": 1, "prices": {"season1": 296, "season2": 310, "season3": 296} }, { "name": "SGL без кондиционера", "view": "стандартный", "adults": 1, "children": 0, "prices": {"season1": 214, "season2": 226, "season3": 214} } ] }
// ========== КАК ДОБАВИТЬ НОВЫЙ ОТЕЛЬ ========== // Скопируйте блок ниже, вставьте его после последнего отеля (перед закрывающей скобкой ]) // и отредактируйте поля /* , { "name": "НАЗВАНИЕ ОТЕЛЯ", "stars": 3, "resort": "Солнечный берег", "board": "HB", "rooms": [ { "name": "Standard Double", "view": "сад", "adults": 2, "children": 0, "prices": {"season1": 380, "season2": 450, "season3": 380} }, { "name": "Family Room", "view": "бассейн", "adults": 2, "children": 2, "prices": {"season1": 520, "season2": 600, "season3": 520} } ] } */ ];
// ДАТЫ ВЫЛЕТОВ (НЕ МЕНЯТЬ) const FLIGHT_DATES = [ { start: "06.07", end: "15.07", fullStart: "06.07.2026", fullEnd: "15.07.2026", seasonKey: "season2" }, { start: "13.07", end: "22.07", fullStart: "13.07.2026", fullEnd: "22.07.2026", seasonKey: "season2" }, { start: "20.07", end: "29.07", fullStart: "20.07.2026", fullEnd: "29.07.2026", seasonKey: "season2" }, { start: "27.07", end: "05.08", fullStart: "27.07.2026", fullEnd: "05.08.2026", seasonKey: "season2" }, { start: "03.08", end: "12.08", fullStart: "03.08.2026", fullEnd: "12.08.2026", seasonKey: "season2" }, { start: "10.08", end: "19.08", fullStart: "10.08.2026", fullEnd: "19.08.2026", seasonKey: "season2" }, { start: "17.08", end: "26.08", fullStart: "17.08.2026", fullEnd: "26.08.2026", seasonKey: "season2" }, { start: "24.08", end: "02.09", fullStart: "24.08.2026", fullEnd: "02.09.2026", seasonKey: "season3" }, { start: "31.08", end: "09.09", fullStart: "31.08.2026", fullEnd: "09.09.2026", seasonKey: "season3" } ];
let selectedDateIndex = 0;
// ========== ФУНКЦИИ (НЕ МЕНЯТЬ) ========== function renderDateButtons() { const container = document.getElementById('dateButtons'); if (!container) return; container.innerHTML = ''; FLIGHT_DATES.forEach((date, idx) => { const btn = document.createElement('button'); btn.className = `date-btn ${idx === selectedDateIndex ? 'active' : ''}`; btn.innerText = `${date.start} → ${date.end}`; btn.onclick = () => { selectedDateIndex = idx; renderDateButtons(); renderHotels(); }; container.appendChild(btn); }); }
function getStarsHtml(stars) { return '★'.repeat(stars) + '☆'.repeat(5 - stars); }
function getBoardName(boardCode) { const map = { 'BB': 'Завтрак', 'HB': 'Полупансион', 'FB': 'Полный пансион', 'AI': 'Всё включено' }; return map[boardCode] || boardCode; }
function getGuestLabel(adults, children) { if (children === 0) return `${adults} взрослых`; return `${adults} взрослых + ${children} ${children === 1 ? 'ребенок' : 'детей'}`; }
function filterHotels() { const resort = document.getElementById('filterResort')?.value || 'all'; const stars = document.getElementById('filterStars')?.value || 'all'; const board = document.getElementById('filterBoard')?.value || 'all'; const guests = document.getElementById('filterGuests')?.value || 'all'; const seasonKey = FLIGHT_DATES[selectedDateIndex].seasonKey;
return hotelsData.filter(hotel => { if (resort !== 'all' && hotel.resort !== resort) return false; if (stars !== 'all' && hotel.stars != stars) return false; if (board !== 'all' && hotel.board !== board) return false;
const availableRooms = hotel.rooms.filter(room => { let guestKey = room.children === 0 ? `${room.adults}` : `${room.adults}+${room.children}`; if (guests !== 'all' && guestKey !== guests) return false; return room.prices[seasonKey] > 0; }).map(room => ({ ...room, price: room.prices[seasonKey] }));
if (availableRooms.length === 0) return false; hotel._availableRooms = availableRooms; return true; }); }
function renderHotels() { const filtered = filterHotels(); const activeDate = FLIGHT_DATES[selectedDateIndex]; const container = document.getElementById('hotelsGrid'); const countSpan = document.getElementById('resultsCount');
if (!container) return; countSpan.innerText = `${filtered.length} ${filtered.length % 10 === 1 && filtered.length % 100 !== 11 ? 'отель' : (filtered.length % 10 >= 2 && filtered.length % 10 <= 4 && (filtered.length % 100 < 10 || filtered.length % 100 >= 20) ? 'отеля' : 'отелей')}`;
if (filtered.length === 0) { container.innerHTML = '
'; return; }
let html = ''; for (let hotel of filtered) { let roomsHtml = ''; for (let room of hotel._availableRooms) { roomsHtml += `
`; } html += `
✈️ Прямой перелёт + трансфер
${roomsHtml}
`; } container.innerHTML = html; }
function escapeHtml(text) { if (!text) return ''; const div = document.createElement('div'); div.textContent = text; return div.innerHTML; }
window.bookTour = function(hotelName, roomName, adults, children, dateStart, dateEnd, price) { const message = `🏖️ ЗАЯВКА НА ТУР В БОЛГАРИЮ
🏨 Отель: ${hotelName} 🛏️ Номер: ${roomName} 👥 Гости: ${adults} взрослых${children > 0 ? ` + ${children} детей` : ''} 📅 Даты: ${dateStart} — ${dateEnd} 💰 Цена: ${price} € за 9 ночей ✈️ Вылет из Варшавы, трансфер включён
👤 Имя: 📞 Телефон:
Пожалуйста, свяжитесь со мной!`; window.open(`https://wa.me/375297821472?text=${encodeURIComponent(message)}`, '_blank'); };
window.resetFilters = function() { const resort = document.getElementById('filterResort'); const stars = document.getElementById('filterStars'); const board = document.getElementById('filterBoard'); const guests = document.getElementById('filterGuests'); if (resort) resort.value = 'all'; if (stars) stars.value = 'all'; if (board) board.value = 'all'; if (guests) guests.value = 'all'; renderHotels(); };
function initFilters() { const resorts = [...new Set(hotelsData.map(h => h.resort).filter(r => r))]; const resortSelect = document.getElementById('filterResort'); if (resortSelect) { resorts.forEach(resort => { const option = document.createElement('option'); option.value = resort; option.textContent = resort; resortSelect.appendChild(option); }); } document.getElementById('filterResort')?.addEventListener('change', renderHotels); document.getElementById('filterStars')?.addEventListener('change', renderHotels); document.getElementById('filterBoard')?.addEventListener('change', renderHotels); document.getElementById('filterGuests')?.addEventListener('change', renderHotels); }
renderDateButtons(); initFilters(); renderHotels();
