Jump to content

Archived

This topic is now archived and is closed to further replies.

binary_dreamer

algorithm of the program.

Recommended Posts

hi. i got a task to do, and i have to use [u][b]LAMP[/b][/u]. I am slightly confused on the way it has to get implemented. all i need is some guidance (not the code). here is the problem.
i got a database of 60 users with their contact details, and there is an extra column that is manually assigned a letter A, B, or C to the user. Depending on which area is coming from, it gets a letter. A for North, Bfor east, and C for south.
week 1:
Mon to Friday each day is gonna have one person from team A
Saturday and Sunday  each day is gonna have one person from team B and one from C.
week 2:
Mon to Friday each day is gonna have one person from team B
Saturday and Sunday  each day is gonna have one person from team A and one from C.
week 3
Mon to Friday each day is gonna have one person from team C
Saturday and Sunday  each day is gonna have one person from team A and one from B.
and the story continues. have in mind that i do not want a user from a team to appear twice, unless everybody from its team have done the job. for example user A1 cannot appear again unless all users A1-A20 have not done their job.

any ideas?  ???

Share this post


Link to post
Share on other sites
One option could be to create a 'count' field in your table. Every time a user is assigned to a 'job' increment their count, when selecting a user for a 'job', order the results by the 'count' field and select the user with the lowest count.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.