markAttendance now retrieves records from the database.