Page 1 of 1

Help Needed To Implement A Response System for Reps

Posted: Wed Oct 19, 2005 11:14 pm
by EsquireX
Hello all,

I am currently designing a web page for a friend that wants this to happen:

He has a business with 20 service reps and needs a way to automatically send the responses from the online form to the reps in round robin-fashion.

What this means is after filling out an online form and submitting it to the site, it will send that completed form information to a rep from a list of 20 reps. After every rep receives one completed form, the site will send the next completed form to the first rep on the list. But it needs to keep track of who already receieved one so no rep receives more forms than any other rep - like dealing out cards for poker.

I hope this is clear (and possible).

Thanks!

Re: Help Needed To Implement A Response System for Reps

Posted: Wed Oct 19, 2005 11:40 pm
by calguy1000
I'm working on a phpmailer module which will help with this.  Other than that it's a simple database issue if your table is structured like this:
    id, salesperson email, count
    1, fred@email.com, 0
      2 joe@email.com, 0
     
Then a SELECT * FROM mytable order by count,id LIMIT0,1  will grab the record with the lowest count
you then increment thec  count for that user, and he will be at the bottom of the list the next time the query is made.

at least I'm pretty sure that would do the trick.

Re: Help Needed To Implement A Response System for Reps

Posted: Thu Oct 20, 2005 4:40 pm
by EsquireX
I'll be sure to try that out. Thanks for such a fast response. I thought this one would take a while to get any answers!