<?php
session_start();
header('Content-Type: application/json');
include '../config/database.php';
$db = new Database(); $conn = $db->getConnection();
$stmt = $conn->prepare("SELECT * FROM inventaris WHERE id=?");
$stmt->execute([$_GET['id']]);
echo json_encode(['data'=>$stmt->fetch(PDO::FETCH_ASSOC)]);
?>