Jump to content


Photo

algorithm of the program.


  • Please log in to reply
1 reply to this topic

#1 binary_dreamer

binary_dreamer
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 02 August 2006 - 09:16 AM

hi. i got a task to do, and i have to use LAMP. 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?  ???


#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 02 August 2006 - 06:52 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users