<?php
require_once '../db.php';

$id = (int)($_GET['id'] ?? 0);
$row = $conn->query("SELECT selling_price, gst_percent, mrp, available_qty FROM purchase_items WHERE id = $id")->fetch_assoc();

header('Content-Type: application/json');
echo json_encode($row);
