I just want to know what logic..what syntax should i need to used to satisfied the conditions that I needed so that the rendered will have a correct output.
Because in rendered will depend the salary of an employee :(

Honestly, I always think what syntax should i need but still I really don't know how to do it..

I got a problem to get the rendered for 21:35:00 - 05:35:00 shift if the login <= 21:35:00 logout >= 05:35:00

when time_to_sec(time(LOGIN)) <= time_to_sec('21:35:00') AND time_to_sec(time(LOGOUT)) >= time_to_sec('05:35:00')
then sec_to_time(time_to_sec('08:00:00'))

when I used it all shifts will affected..Because I think it only check in time.

I have a lot of conditions needed per shift.

Like this:

//if the employee is early login from his shift and late logout from his shift the rendered will be 08:00:00
//if the employee is late to login the 08:00:00 will minus
//if the employee is undertime or early to logout 08:00:00 will minus
//if the employee is late to login and early to logout the the sum of late login and early logout will minus in 08:00:00