My system deals with the morning and afternoon check-ins and check-outs of employees.
The table where the inputs and outputs are being recorded is filled in automatically when importing an excel, the columns of my table are the id
, num_checador
, time (where the date and the day of registration go), and the estado
one that sees if it is input and output, it is assumed that per day there should be 4 check-ins, 2 inputs and 2 outputs.
My question is:
How can I separate the entrance and exit of the morning of a single person in a single arrangement to add them and get the total time? And the same other arrangement with the entry and exit in the afternoon but the same day and the same person. In this example, you would need to separate the information of the same employee with checkout number #8 on 07/21/2.
I clarify that I am programming in php
You can try something like this:
Starting from this dataset:
You'll get:
I hope it was what you were looking for. Leave me any questions in the comments to expand the answer in the direction in which you need clarification.