System incydentów IT
Aplikacja do zarządzania incydentami technicznymi w szkole lub firmie: zgłaszanie problemów (np. brak internetu, awaria drukarki), śledzenie statusu rozwiązania, przypisywanie do technika i pełna historia.
This content is not available in your language yet.
System incydentów IT
Aplikacja do zarządzania incydentami technicznymi w szkole lub firmie: zgłaszanie problemów (np. brak internetu, awaria drukarki), śledzenie statusu rozwiązania, przypisywanie do technika i pełna historia.
{ "incidents": [ { "id": 1, "title": "Brak dostępu do internetu w sali B14", "description": "Od rana brak sieci, uczniowie nie mogą pracować", "category": "siec", "priority": "critical", "location": "Sala B14", "status": "open", "assignee": "mgr Kowalski", "reported_by": "mgr Nowak", "created_at": "2026-02-10 08:30:00", "resolved_at": null, "resolution_note": null, "history": [ {"status": "open", "note": "Zgłoszono", "changed_at": "2026-02-10 08:30:00"} ] } ]}Wymagane funkcje:
Wszystko z A, plus:
Wszystko z B, plus:
Sortowanie po priorytecie:
$priorityOrder = ['critical' => 0, 'high' => 1, 'medium' => 2, 'low' => 3];
usort($incidents, function ($a, $b) use ($priorityOrder) { $pA = $priorityOrder[$a['priority']] ?? 99; $pB = $priorityOrder[$b['priority']] ?? 99; if ($pA !== $pB) return $pA <=> $pB; return strcmp($a['created_at'], $b['created_at']);});Czas od zgłoszenia:
function timeAgo(string $datetime): string { $seconds = time() - strtotime($datetime); if ($seconds < 3600) return floor($seconds / 60) . ' min temu'; if ($seconds < 86400) return floor($seconds / 3600) . ' godz. temu'; return floor($seconds / 86400) . ' dni temu';}Czas rozwiązania:
function getResolutionTime(string $createdAt, ?string $resolvedAt): ?string { if ($resolvedAt === null) return null; $seconds = strtotime($resolvedAt) - strtotime($createdAt); $hours = floor($seconds / 3600); $minutes = floor(($seconds % 3600) / 60); return "{$hours}h {$minutes}min";}