Enter Password to View Foreclosures

function checkPassword() { const pass = document.getElementById("flipPassword").value; if (pass === "flipandzip") { document.getElementById("flipModal").style.display = "none"; document.getElementById("flipForeclosureUI").style.display = "block"; localStorage.setItem("flipAccess", "granted"); } else { document.getElementById("flipError").innerText = "❌ Incorrect password."; } } if (localStorage.getItem("flipAccess") === "granted") { document.getElementById("flipModal").style.display = "none"; document.getElementById("flipForeclosureUI").style.display = "block"; } async function loadForeclosures(town) { if (!town) return; const res = await fetch(`/api/foreclosures.php?town=${encodeURIComponent(town)}`); const data = await res.json(); const resultsBox = document.getElementById("flipResults"); resultsBox.innerHTML = "

📍 Foreclosures in " + town + ":

"; if (!data.length) { resultsBox.innerHTML += "

No properties found.

"; return; } data.forEach((item, i) => { const container = document.createElement("div"); container.className = "foreclosure-item"; const price = parseInt(item.starting_bid?.replace(/[$,]/g, "")) || 0; if (price >= 30000 && price <= 50000) { container.classList.add("highlight"); } container.innerHTML = ` ${i + 1}. ${item.docket_number || "N/A"}
🗓️ Sale: ${item.sale_date || "N/A"}
💵 Starting Bid: ${item.starting_bid || "N/A"}
🔍 Details `; resultsBox.appendChild(container); }); }
Welcome to Flip. Ask me anything!