prepare( "SELECT t.id, t.title, t.description, t.due_date, ta.status, ta.id as assignment_id FROM tasks t JOIN task_assignments ta ON t.id = ta.task_id WHERE ta.assigned_to_user_id = ? ORDER BY t.due_date ASC" ); $stmt->execute([$user_id]); $tasks = $stmt->fetchAll(); $dashboard_content = '
Belum ada tugas untuk Anda. Selamat beristirahat!
'; } else { $dashboard_content .= '' . htmlspecialchars($task['description']) . '
Tenggat: ' . $due_date . '| Judul | Tenggat Waktu | Dibuat pada | Aksi |
|---|---|---|---|
| Anda belum membuat tugas apapun. | |||
| ' . htmlspecialchars($task['title']) . ' | ' . ($task['due_date'] ? date('d M Y', strtotime($task['due_date'])) : '-') . ' | ' . date('d M Y', strtotime($task['created_at'])) . ' | |
| ID | Username | Peran | Bergabung pada | Aksi |
|---|---|---|---|---|
| Tidak ada pengguna yang ditemukan. | ||||
| ' . htmlspecialchars($user['id']) . ' | ' . htmlspecialchars($user['username']) . ' | ' . htmlspecialchars($user['role']) . ' | ' . date('d M Y', strtotime($user['created_at'])) . ' | |
Dashboard Anda sudah siap.
'; break; } } catch (PDOException $e) { $dashboard_content = 'Gagal memuat data. Silakan coba lagi nanti.
'; } ?>