<?php
session_start();
header('Content-Type: application/json');
require_once '../config/auth.php';
include '../config/database.php';

$db = new Database();
$conn = $db->getConnection();

$id = $_GET['id'];
$stmt = $conn->prepare("SELECT * FROM struktur_organisasi WHERE id =?");
$stmt->execute([$id]);
$data = $stmt->fetch(PDO::FETCH_ASSOC);

echo json_encode(['status'=>'success','data'=>$data]);
?>