update to use single html with dynamic div

This commit is contained in:
2025-04-16 09:31:36 +02:00
parent 0dcdfa7e76
commit 1d3febeec1
21 changed files with 794 additions and 179 deletions
+21
View File
@@ -0,0 +1,21 @@
<h2>Restaurant Overview</h2>
<div id="restaurant-list">
</div>
<script>
// This script might be moved to the main index.html or a separate JS file
function loadRestaurantOverview() {
const restaurantListDiv = document.getElementById('restaurant-list');
fetch('php/get_restaurant_overview.php')
.then(response => response.text())
.then(data => {
restaurantListDiv.innerHTML = data;
})
.catch(error => {
console.error('Error loading restaurant overview:', error);
restaurantListDiv.innerHTML = '<p class="error">Failed to load restaurant overview.</p>';
});
}
// Call this function when overview.html is loaded
loadRestaurantOverview();
</script>