added functions email and flag

This commit is contained in:
2026-06-11 10:20:46 +02:00
parent 33b627f328
commit fdde16b113
5 changed files with 213 additions and 25 deletions
@@ -10,6 +10,7 @@ try {
$id = isset($_POST['id']) && is_numeric($_POST['id']) ? (int)$_POST['id'] : null;
$subject_id = isset($_POST['subject_id']) && is_numeric($_POST['subject_id']) && (int)$_POST['subject_id'] > 0 ? (int)$_POST['subject_id'] : null;
$function_id = isset($_POST['function_id']) && is_numeric($_POST['function_id']) && (int)$_POST['function_id'] > 0 ? (int)$_POST['function_id'] : null;
$notify_function = isset($_POST['notify_function']) && (int)$_POST['notify_function'] === 1 ? 1 : 0;
$topic = trim($_POST['topic'] ?? '');
$law_regulation = trim($_POST['law_regulation'] ?? '') ?: null;
$recurrence_type = $_POST['recurrence_type'] ?? 'once';
@@ -53,7 +54,7 @@ try {
if ($id) {
$stmt = $pdo->prepare("
UPDATE scad_deadlines SET
subject_id = ?, function_id = ?, topic = ?, law_regulation = ?, recurrence_type = ?,
subject_id = ?, function_id = ?, notify_function = ?, topic = ?, law_regulation = ?, recurrence_type = ?,
due_date = ?, check_date = ?, document_date = ?, notification_days = ?,
storage_location = ?, notes = ?, departments = ?
WHERE id = ?
@@ -61,6 +62,7 @@ try {
$stmt->execute([
$subject_id,
$function_id,
$notify_function,
$topic,
$law_regulation,
$recurrence_type,
@@ -86,13 +88,14 @@ try {
// INSERT
$stmt = $pdo->prepare("
INSERT INTO scad_deadlines
(subject_id, function_id, topic, law_regulation, recurrence_type, due_date, check_date,
(subject_id, function_id, notify_function, topic, law_regulation, recurrence_type, due_date, check_date,
document_date, notification_days, storage_location, notes, created_by, departments)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
");
$stmt->execute([
$subject_id,
$function_id,
$notify_function,
$topic,
$law_regulation,
$recurrence_type,