Some SQL Wizardy. Now don't have active in absences, just calculates the time and retrieves as needed. Absenties PHP done, absenties JS removed.