<?php
include('../include/auth.php');
include('../include/lskfjwfe.php');
header('Content-Type: application/json');

$id = (int)$_POST['id'];

$del = $db2->query("DELETE FROM api_acriss_location_modifiers WHERE id = $id");

if ($del) {
  $details = mysqli_real_escape_string($db2, json_encode(['id' => $id]));
  $db2->query("INSERT INTO action_logs (action, details, user) VALUES ('delete_modifier', '$details', '$user')");
  echo json_encode(['success' => true]);
} else {
  echo json_encode(['success' => false, 'error' => mysqli_error($db2)]);
}
