<?php
include 'db.php';
include 'auth_check.php';

$data = json_decode(file_get_contents('php://input'), true);

if (!isset($data['id'])) {
    echo json_encode(['success'=>false,'error'=>'ID missing']);
    exit;
}

$id = intval($data['id']);

$stmt = $conn->prepare("DELETE FROM outward_stock WHERE id=?");
$stmt->bind_param("i", $id);

if($stmt->execute()){
    echo json_encode(['success'=>true]);
} else {
    echo json_encode(['success'=>false,'error'=>$conn->error]);
}
?>
