19 lines
522 B
PHP
19 lines
522 B
PHP
<?php
|
|
include('include/headscript.php');
|
|
header('Content-Type: application/json');
|
|
$db = DBHandlerSelect::getInstance();
|
|
$pdo = $db->getConnection();
|
|
|
|
if (empty($_POST['id'])) {
|
|
echo json_encode(['success' => false, 'msg' => 'ID mancante']);
|
|
exit;
|
|
}
|
|
|
|
try {
|
|
$stmt = $pdo->prepare("DELETE FROM productiondata WHERE id = :id");
|
|
$stmt->execute(['id' => $_POST['id']]);
|
|
echo json_encode(['success' => true]);
|
|
} catch (Exception $e) {
|
|
echo json_encode(['success' => false, 'msg' => $e->getMessage()]);
|
|
}
|