Employee Working Hours Calculation on Page

I have created a page for managing employee check-ins, which includes two buttons: Check In and Check Out. When an employee clicks the Check In button, their details—such as Employee ID, Employee Name, and Log Type (Check In)—are displayed in a table. Similarly, when they click the Check Out button, the same details are logged with the Log Type as Check Out.

Now, I want to enhance the functionality by calculating the total working hours for each employee based on the corresponding Check In and Check Out records. This calculated total should be displayed in the table or a designated field to provide a clear summary of the employee’s working hours for the day.