Subject CRUD

This commit is contained in:
2026-04-18 15:26:04 +03:00
parent d2e5cc8b2b
commit 0550ffe923
11 changed files with 557 additions and 36 deletions
@@ -31,8 +31,9 @@ $errors = 0;
// Get active deadlines that are approaching or overdue
$stmt = $pdo->query("
SELECT d.id, d.topic, d.category, d.due_date, d.notification_days
SELECT d.id, d.topic, s.name AS subject_name, d.due_date, d.notification_days
FROM scad_deadlines d
LEFT JOIN scad_subjects s ON s.id = d.subject_id
WHERE d.status = 'active'
AND d.due_date <= DATE_ADD(CURDATE(), INTERVAL d.notification_days DAY)
");
@@ -143,7 +144,7 @@ foreach ($deadlines as $dl) {
$mail->addAddress($emp['email'], trim($emp['first_name'] . ' ' . $emp['last_name']));
$detailUrl = $appUrl . '/userarea/scadenzario/detail.php?id=' . $dl['id'];
$topicText = ($dl['category'] ? $dl['category'] . ' — ' : '') . $dl['topic'];
$topicText = (!empty($dl['subject_name']) ? $dl['subject_name'] . ' — ' : '') . $dl['topic'];
if ($isOverdue) {
$mail->Subject = '⚠️ Scadenza superata: ' . $dl['topic'];