Manage your dietary preferences, saved locations, and order history
We'll use these to recommend meals that match your needs
No animal products
No meat or fish
Islamic dietary laws
No wheat products
Reduced salt intake
Minimal carbohydrates
${loc.address}
`).join('') || 'No saved locations yet. Add one below!
'; } function deleteLocation(index) { let locations = JSON.parse(localStorage.getItem('roadbite_locations') || '[]'); locations.splice(index, 1); localStorage.setItem('roadbite_locations', JSON.stringify(locations)); loadLocations(); } document.getElementById('add-location-btn').addEventListener('click', function() { const name = prompt('Location name (e.g., "Livingstone Rest Stop"):'); if (!name) return; const address = prompt('Address:'); if (!address) return; let locations = JSON.parse(localStorage.getItem('roadbite_locations') || '[]'); locations.push({name, address}); localStorage.setItem('roadbite_locations', JSON.stringify(locations)); loadLocations(); }); // Order history function loadOrderHistory() { const orders = JSON.parse(localStorage.getItem('roadbite_orders') || '[]'); const list = document.getElementById('orders-list'); list.innerHTML = orders.map((order, i) => `${order.restaurant}
${new Date(order.date).toLocaleDateString()}
Total: K${order.total}
No orders yet. Place your first order!
'; } function reorderItems(index) { const orders = JSON.parse(localStorage.getItem('roadbite_orders') || '[]'); alert('Reordering: ' + orders[index].items.join(', ')); // In a real app, this would populate the cart } // Initialize loadDietaryPreferences(); loadLocations(); loadOrderHistory();