I have the following table which I get from another database of a clock checker.
idemployee fecha
1 '2018-09-10 8:56:00'
2 '2018-09-10 8:58:23'
1 '2018-09-10 14:00:23'
1 '2018-09-10 15:58:43'
2 '2018-09-10 14:04:23'
2 '2018-09-10 15:55:00'
1 '2018-09-10 18:58:00'
2 '2018-09-10 19:00:00'
What I want to do is sort the records in the following way per day in my front use PHP, each id "in theory" must have 4 checks per day, so I have each check to which column it belongs in my front (Input , Exit_distance, Return_distance or exit). I have a "schedule" table where I keep the time of ENTRY, EXIT_COMMENDER, RETURN_COMMUNITY and DEPARTURE in which to check.
Idemployee Entrada Salida_comedor Regreso_comedor Salia