diff --git a/public/assets/js/app.js b/public/assets/js/app.js index d11fb1d..9a69b16 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -189,12 +189,9 @@ document.addEventListener('DOMContentLoaded', () => { if (el.btnSearch) { el.btnSearch.addEventListener('click', () => { - state.region = (el.locInput?.value || '').trim().toLowerCase(); - state.topic = el.topicSelect?.value || 'all'; - state.age = el.ageSelect?.value || ''; - state.query = state.region; // keep simple search for now - searchState.active = true; - renderEvents(); + const q = (el.locInput?.value || '').trim(); + const url = '/search' + (q ? ('?q=' + encodeURIComponent(q)) : ''); + window.location.href = url; }); } diff --git a/public/page/search.php b/public/page/search.php index 524ac7e..3734a59 100644 --- a/public/page/search.php +++ b/public/page/search.php @@ -17,7 +17,7 @@ if ($q !== '' && $pdo) { ORDER BY starts_at ASC LIMIT 100' ); - $stmt->execute([':q' => $like]); + $stmt->execute(['q' => $like]); $results = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: []; } ?>