This commit is contained in:
2025-12-29 01:49:54 +01:00
parent da82fe679f
commit f730c20082
2 changed files with 4 additions and 7 deletions

View File

@@ -189,12 +189,9 @@ document.addEventListener('DOMContentLoaded', () => {
if (el.btnSearch) { if (el.btnSearch) {
el.btnSearch.addEventListener('click', () => { el.btnSearch.addEventListener('click', () => {
state.region = (el.locInput?.value || '').trim().toLowerCase(); const q = (el.locInput?.value || '').trim();
state.topic = el.topicSelect?.value || 'all'; const url = '/search' + (q ? ('?q=' + encodeURIComponent(q)) : '');
state.age = el.ageSelect?.value || ''; window.location.href = url;
state.query = state.region; // keep simple search for now
searchState.active = true;
renderEvents();
}); });
} }

View File

@@ -17,7 +17,7 @@ if ($q !== '' && $pdo) {
ORDER BY starts_at ASC ORDER BY starts_at ASC
LIMIT 100' LIMIT 100'
); );
$stmt->execute([':q' => $like]); $stmt->execute(['q' => $like]);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: []; $results = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: [];
} }
?> ?>