<?php
require_once 'config.php';

// AJAX 获取交友详情
if (isset($_GET['id'])) {
    $id = (int)$_GET['id'];
    $stmt = $pdo->prepare("SELECT * FROM dating_profiles WHERE id = ? AND is_active = 1");
    $stmt->execute([$id]);
    $profile = $stmt->fetch(PDO::FETCH_ASSOC);
    
    header('Content-Type: application/json');
    if ($profile) {
        echo json_encode($profile);
    } else {
        echo json_encode(['error' => '未找到']);
    }
    exit;
}
?>