<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');

require_once '../config/database.php';

try {
    $stmt = getDB()->query("SELECT * FROM team_members ORDER BY order_position ASC");
    $team = $stmt->fetchAll();
    
    echo json_encode([
        'success' => true,
        'data' => $team
    ]);
} catch (Exception $e) {
    http_response_code(500);
    echo json_encode(['success' => false, 'message' => $e->getMessage()]);
}
