<?php
require_once '../../includes/config.php';
requireAdmin();

$input = json_decode(file_get_contents('php://input'), true);
$ids   = $input['ids'] ?? [];

if (empty($ids)) jsonResponse(false, 'কোনো ID নেই!');

$db = getDB();
// Safe: only integers
$ids = array_map('intval', $ids);
$placeholders = implode(',', array_fill(0, count($ids), '?'));
$db->prepare("DELETE FROM packages WHERE id IN ($placeholders)")->execute($ids);

jsonResponse(true, count($ids) . ' টি প্যাকেজ মুছে দেওয়া হয়েছে।');
