diff --git a/Web/templates/main_admin.html b/Web/templates/main_admin.html
index 88d73d9..205bbd4 100755
--- a/Web/templates/main_admin.html
+++ b/Web/templates/main_admin.html
@@ -4315,6 +4315,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
hiddenInput.value = image;
editForm.appendChild(hiddenInput);
}
+
});
}
@@ -5632,6 +5633,61 @@ document.addEventListener('DOMContentLoaded', ()=>{
futureAppointments.sort((a, b) => new Date(a.date) - new Date(b.date));
return futureAppointments[0];
}
+
+ // Load location options
+ function loadLocationOptions() {
+ fetch('/get_predefined_locations')
+ .then(response => response.json())
+ .then(data => {
+ const ortSelect = document.getElementById('ort');
+ if (ortSelect) {
+ // Clear existing options except the first one
+ while (ortSelect.children.length > 1) {
+ ortSelect.removeChild(ortSelect.lastChild);
+ }
+
+ // Add new options - data.locations contains the array
+ data.locations.forEach(location => {
+ const option = document.createElement('option');
+ option.value = location;
+ option.textContent = location;
+ ortSelect.appendChild(option);
+ });
+ }
+ })
+ .catch(error => {
+ console.error('Error loading location options:', error);
+ });
+ }
+
+ // Function to add new location
+ function addNewLocation() {
+ const newLocationInput = document.getElementById('new-location-input');
+ const newLocation = newLocationInput.value.trim();
+
+ if (!newLocation) {
+ alert('Bitte geben Sie einen Ort ein.');
+ return;
+ }
+
+ // Add to dropdown
+ const ortSelect = document.getElementById('ort');
+ const option = document.createElement('option');
+ option.value = newLocation;
+ option.textContent = newLocation;
+ option.selected = true;
+ ortSelect.appendChild(option);
+
+ // Hide the input container
+ document.getElementById('new-location-container').style.display = 'none';
+ newLocationInput.value = '';
+ }
+
+ // Function to cancel adding new location
+ function cancelAddLocation() {
+ document.getElementById('new-location-container').style.display = 'none';
+ document.getElementById('new-location-input').value = '';
+ }