Explore Cuisines

onchange="this.form.submit()">
Clear Filters

All Restaurants

= ? AND r.days_open LIKE ?"; $params[] = $current_time; $params[] = $current_time; $params[] = '%' . $current_day . '%'; } if (!empty($where_clauses)) { $sql .= " WHERE " . implode(' AND ', $where_clauses); } $sql .= " GROUP BY r.id, r.name, r.image_url, r.opening_time, r.closing_time, r.days_open"; // Add rating filter (HAVING clause) $selected_min_rating = isset($_GET['min_rating']) && is_numeric($_GET['min_rating']) ? (int)$_GET['min_rating'] : 0; if ($selected_min_rating > 0) { $sql .= " HAVING AVG(rt.rating) >= ?"; $params[] = $selected_min_rating; } $sql .= " ORDER BY r.name"; $stmt = db()->prepare($sql); $stmt->execute($params); $restaurants = $stmt->fetchAll(); if (empty($restaurants)) { echo '

No restaurants found matching your criteria.

'; } else { foreach ($restaurants as $restaurant) { // Get cuisines for this restaurant $cuisine_sql = "SELECT c.name FROM cuisines c JOIN restaurant_cuisines rc ON c.id = rc.cuisine_id WHERE rc.restaurant_id = ?"; $cuisine_stmt = db()->prepare($cuisine_sql); $cuisine_stmt->execute([$restaurant['id']]); $restaurant_cuisines_list = $cuisine_stmt->fetchAll(PDO::FETCH_COLUMN); echo ''; echo '' . htmlspecialchars($restaurant['name']) . ''; echo '
'; echo '

' . htmlspecialchars($restaurant['name']) . '

'; echo '

' . htmlspecialchars(implode(', ', $restaurant_cuisines_list)) . '

'; echo '
'; if ($restaurant['rating_count'] > 0) { echo '
'; echo ''; echo '' . htmlspecialchars(number_format($restaurant['average_rating'], 1)) . ''; echo '
'; } else { echo '
No ratings yet
'; } echo '
'; echo '
'; echo '
'; } } ?>