Everyone needs to assign tasks to a variable number of participants. EX: Through a select I get 49 tasks to be executed and I have to distribute to 4 employees. In other words, the division would be 1st employee would have 12 tasks the 2nd employee would have 12 tasks the 3rd employee would have 12 tasks and the 4th employee would have 13 tasks that would be the rest. Both the amount of tasks and how many employees come from a select can vary and each task and employee has a unique code. Employee 1 task 1 Employee 1 task 2 and so by completing 12 days, I would switch to another with 12 more ...
I'm using PHP PDO Mysql and I need to do a loop that does this distribution the way I explained but I do not know how to do it. if anyone can help me I will be very grateful.