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
Please advice!!
Moderator: General Moderators
Re: Please advice!!
Which bit are you having difficulty with?Annmary wrote:How could I implement this?
Re: Please advice!!
I am having the difficulty with the database design.
Re: Please advice!!
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:
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 ... ).
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
To see how many downloads this customer had, you just count the rows based on the report date (of this month / day / year ... ).
Re: Please advice!!
[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.