Please advice!!

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Annmary
Forum Newbie
Posts: 2
Joined: Mon Mar 17, 2008 4:31 am

Please advice!!

Post by Annmary »

Hello,

I want to implement a website which has many subscription levels. Free, Base, premium, corporate A. And it has many features link blog, shopping cart, downloading reports, news section etc.. Free subscribers can access only the blog and news section. Base subscribers have access to blog, news section and downloading reports is limited to 10/yr. Premium have access to blog, news section, reports download (50/yr) and shopping cart. And the corporate can access all the features and report downloading limit to 250/yr.

I have to give alerts if users exceeds the downloading reports limit.

How could I implement this? Could you please help me?

Thanks,

Ann Mary
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Please advice!!

Post by onion2k »

Annmary wrote:How could I implement this?
Which bit are you having difficulty with?
Annmary
Forum Newbie
Posts: 2
Joined: Mon Mar 17, 2008 4:31 am

Re: Please advice!!

Post by Annmary »

I am having the difficulty with the database design.
scriptah
Forum Commoner
Posts: 27
Joined: Sat Mar 15, 2008 8:58 pm
Location: Long Island, NY

Re: Please advice!!

Post by scriptah »

I don't see where is the difficulty really.
I would create an enum field on the client table that specifies his
subscription level.

From there is up to you how you want to implement the logic of this system.
You could for example on the controller of the blog, check if the
client has permissions to enter the page or not, based on his subscription level.

About keeping track of the reports downloads, you could create a helper table
"client_reports".

For example:

Code: Select all

 
client_id    report_date
 
Whenever the client downloads something, you add a new row to this table.
To see how many downloads this customer had, you just count the rows based on the report date (of this month / day / year ... ).
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Please advice!!

Post by pickle »

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply