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

$shop_id = $_GET['id'] ?? null;

if (!$shop_id) {
    jsonResponse(['success' => false, 'message' => 'Shop ID required'], 400);
}

$shop = new Shop();

try {
    $shop_data = $shop->getShopById($shop_id);
    
    if ($shop_data) {
        jsonResponse([
            'success' => true,
            'shop' => $shop_data
        ]);
    } else {
        jsonResponse([
            'success' => false,
            'message' => 'Shop not found'
        ], 404);
    }
} catch (Exception $e) {
    jsonResponse([
        'success' => false,
        'message' => $e->getMessage()
    ], 500);
}
?>