Customer Incentive

One of my clients came to me today, saying he wants sort of a game integrated in his website as an incentive for his customers (members area).

What he would like is the following. On a page are about 500 squares in different colors. 20 of those squares should hold discount coupons. 10%, 15%, 20%, 25% etc. A price should be only awarded after a certain number of clicks (lets say 20 clicks). A member/customer has only 2 clicks a day. I have the customers table and I can think of a way to restrict a customers to 2 clicks a day. I’m only wondering how to set up the coupons table.

Any Ideas for this are more than welcome!

why do you need a coupons table? :slight_smile:

Where should I store those coupons Rudy? What would you do?

what columns do you need to store? this is what i was getting at :slight_smile:

I know what you mean. These discounts are static values which I later only need to give those discounts. Maybe this question is better. Where I should store the number of clicks per square, before a discount is awarded! The squares will probably appear in a random positions.

Maybe I just think to difficult now?

depends on whether you are storing each square, or only those squares which actually have a discount in them, and also depends on how you are accomplishing this –

I have the customers table and I can think of a way to restrict a customers to 2 clicks a day.

That is my greatest dilemma. I am thinking about the first option. To have a table with all squares in it and just twenty that will hold an actual value:


CREATE TABLE IF NOT EXISTS `tblSqares` (
  `square_id` int(3) NOT NULL auto_increment,
  `square` varchar(12) default NULL,
  `value` varchar(32) default NULL,
  `clicks` int(2) NOT NULL default '20',
  PRIMARY KEY  (`square_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

That way I can decrease the click value for the squares that hold a value as well! I’m not sure how I would do that If I would output the squares dynamically.

What would be the most practical way in your opinion?

no idea, i’m still trying to understand what you’re doing

why would a square have a clicks counter?

and how are you going to track a single customer’s clicks and limit them to 2?

btw, you probably don’t need an autoincrement here… what values would you have in the square column?

A discount is only rewarded after a square, holding a value is clicked 20 times!

I was/am thinking about a datetime field and allow them 2 clicks per 24 hours or something similar

I was thinking that. The value would probably be the name of the squares