This commit is contained in:
lizandrogd
2026-01-21 02:22:29 -05:00
parent 3fffb0d023
commit b1961f0116
35 changed files with 1006 additions and 122 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
require_once __DIR__ . '/../config/config_enhanced.php';
require_once __DIR__ . '/../config/config.php';
header('Content-Type: application/json; charset=utf-8');
if (function_exists('requireAuthentication')) requireAuthentication();
$input = json_decode(file_get_contents('php://input'), true) ?: $_POST;
$id = intval($input['id'] ?? 0);
if (!$id) {
http_response_code(400);
echo json_encode(['success' => false, 'error' => 'id is required']);
exit;
}
try {
$db = Database::getInstance();
$db->execute("DELETE FROM message_templates WHERE id = ?", [$id]);
echo json_encode(['success' => true]);
} catch (Exception $e) {
http_response_code(500);
echo json_encode(['success' => false, 'error' => $e->getMessage()]);
}