/giftChain

A script for match people with each other to get gift to each other.

Primary LanguagePHP

giftChain

A script for match people with each other to get gift to each other.

Purpose

It is a known tradition to get presents on New Year's Eve and for schools and work places it is another tradition to have a draw to match persons. For example in a 3 person group draw results may be

1 -> 3

2 -> 1

3 -> 2

The points in this draws are:

  1. Everybody gets a present
  2. Nobody gets himsel/herself as a match
  3. No body knows the whole draw results until the present giving time.

It is easy to do it when peaople can get in one place, but it is hard to have a draw like that when people are away from each other. One can make the draw and release the results one by one but the s/he knows all the results. So I wrote a small script. It handles the draw and mails the results, nobody sees the list, surprise did not broken.

Constraints

  1. $alici and $verici arrays should be in same order.
  2. We had a problem with hotmail, our friend did not get the e-mail.

I've parameterized some hardcoded values and did not try the code after, there may be some syntax errors.