<?php
require_once '../config.php';
require_once '../../includes/Shop.php';

$shop = new Shop();
$searchTerm = $_GET['search'] ?? null;

try {
    $shops = $shop->getActiveShops($searchTerm);
    
    jsonResponse([
        'success' => true,
        'shops' => $shops
    ]);
} catch (Exception $e) {
    jsonResponse([
        'success' => false,
        'message' => $e->getMessage()
    ], 500);
}
?>