Sum of Time Attendance

Hi!

I created a payroll system, and now I don’t have any idea how can I sum the time of the employee in and out.

I need the Sum of Hours that the employee attendance.

I have table for the Attendance and table for the sum of hours, the data in attendance table is from the upload files .xml the format of time is 08:00:00

I attach the codes

Thank you.