`; displayPlots(data.projectName); } function displayPlots(projectName) { const grid = document.getElementById('plots-grid'); const loadMoreBtn = document.getElementById('load-more-btn'); grid.innerHTML = ""; const toShow = allAvailablePlots.slice(0, currentlyVisible); toShow.forEach((plot, index) => { const extent = parseFloat(plot.extent) || 0; const facingType = plot.facing || "General"; const facingRate = CONFIG.getFacingRate(facingType); const basePlotCost = extent * CONFIG.PRICE_PER_SQYARD; const totalFacingCharges = extent * facingRate; const regFee = CONFIG.getRegistration(extent); const grandTotal = basePlotCost + totalFacingCharges + regFee + CONFIG.APP_FEE; const plotDiv = document.createElement('div'); plotDiv.className = 'plot-row'; plotDiv.innerHTML = `
Plot No: ${plot.plot_number} ${extent} SqYds • ${facingType} Facing
Price Details Plot Base Cost: ₹${basePlotCost.toLocaleString()}
Facing Surcharge (${facingRate}/SqYd): ₹${totalFacingCharges.toLocaleString()}
Registration Fee: ₹${regFee.toLocaleString()}
Application Processing: ₹${CONFIG.APP_FEE.toLocaleString()}
Estimated Total: ₹${grandTotal.toLocaleString()}
Includes free Sandalwood crop. Date palms extra.
Book via WhatsApp `; grid.appendChild(plotDiv); }); loadMoreBtn.style.display = (currentlyVisible < allAvailablePlots.length) ? "block" : "none"; } function showMore() { currentlyVisible += CONFIG.VISIBLE_INCREMENT; loadInventory(); // Refreshes UI with more plots } function togglePrice(id) { const el = document.getElementById(`details-${id}`); el.style.display = (el.style.display === 'block') ? 'none' : 'block'; } function sendWhatsApp(project, plot, ext, face, total) { const text = `*Booking Inquiry*\nProject: ${project}\nPlot: ${plot}\nExtent: ${ext} SqYds\nFacing: ${face}\nTotal: ₹${total.toLocaleString()}`; window.location.href = `https://wa.me/91${CONFIG.WHATSAPP}?text=${encodeURIComponent(text)}`; } loadInventory();
`; const grid = document.getElementById('plots-grid'); if (availablePlots.length === 0) { grid.innerHTML = "
No units currently available.
"; return; } availablePlots.forEach((plot, index) => { const extent = parseFloat(plot.extent) || 0; const facingType = plot.facing || "General"; const facingRate = CONFIG.getFacingRate(facingType); const basePlotCost = extent * CONFIG.PRICE_PER_SQYARD; const totalFacingCharges = extent * facingRate; const regFee = CONFIG.getRegistration(extent); const grandTotal = basePlotCost + totalFacingCharges + regFee + CONFIG.APP_FEE; const plotDiv = document.createElement('div'); plotDiv.className = 'plot-row'; plotDiv.innerHTML = `
Base Cost: ₹${basePlotCost.toLocaleString()}
Facing (${facingRate}/Yd): ₹${totalFacingCharges.toLocaleString()}
Registration: ₹${regFee.toLocaleString()}
Processing Fee: ₹${CONFIG.APP_FEE.toLocaleString()}
Total Cost: ₹${grandTotal.toLocaleString()}
Includes free Sandalwood crop plantation.
Book via WhatsApp `; grid.appendChild(plotDiv); }); } function togglePrice(id) { const el = document.getElementById(`details-${id}`); const isHidden = el.style.display === 'none' || el.style.display === ''; document.querySelectorAll('.price-details').forEach(d => d.style.display = 'none'); el.style.display = isHidden ? 'block' : 'none'; } function sendWhatsApp(project, plot, ext, face, total) { const text = `*NEW BOOKING INTEREST*\nProject: ${project}\nPlot No: ${plot}\nExtent: ${ext} SqYds\nFacing: ${face}\nTotal: ₹${total.toLocaleString()}`; window.location.href = `https://wa.me/91${CONFIG.WHATSAPP}?text=${encodeURIComponent(text)}`; } loadInventory();