added alert flag and variation flag

This commit is contained in:
2026-07-19 15:06:18 +02:00
parent 4e61426be7
commit 58af735082
10 changed files with 180 additions and 27 deletions
@@ -20,7 +20,8 @@ try {
$notification_days = isset($_POST['notification_days']) && is_numeric($_POST['notification_days']) ? (int)$_POST['notification_days'] : 7;
$storage_location = trim($_POST['storage_location'] ?? '') ?: null;
$notes = trim($_POST['notes'] ?? '') ?: null;
$variazioni = trim($_POST['variazioni'] ?? '') ?: null;
$variazioni = !empty($_POST['variazioni']) ? 1 : 0;
$attiva_alert = !empty($_POST['attiva_alert']) ? 1 : 0;
$employee_ids = $_POST['employee_ids'] ?? [];
$department_names = $_POST['department_names'] ?? [];
@@ -57,7 +58,7 @@ try {
UPDATE scad_deadlines SET
subject_id = ?, function_id = ?, notify_function = ?, topic = ?, law_regulation = ?, recurrence_type = ?,
due_date = ?, check_date = ?, document_date = ?, notification_days = ?,
storage_location = ?, notes = ?, variazioni = ?, departments = ?
storage_location = ?, notes = ?, variazioni = ?, attiva_alert = ?, departments = ?
WHERE id = ?
");
$stmt->execute([
@@ -74,6 +75,7 @@ try {
$storage_location,
$notes,
$variazioni,
$attiva_alert,
$departmentsStr,
$id
]);
@@ -91,8 +93,8 @@ try {
$stmt = $pdo->prepare("
INSERT INTO scad_deadlines
(subject_id, function_id, notify_function, topic, law_regulation, recurrence_type, due_date, check_date,
document_date, notification_days, storage_location, notes, variazioni, created_by, departments)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
document_date, notification_days, storage_location, notes, variazioni, attiva_alert, created_by, departments)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
");
$stmt->execute([
$subject_id,
@@ -108,6 +110,7 @@ try {
$storage_location,
$notes,
$variazioni,
$attiva_alert,
$currentUserId,
$departmentsStr
]);