473,383 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

billing based on usage concept

Hi guys,

I want to implement this logic in my application 'payment based on usage once in every month'.First let me explain my application running PHP & MySQL.

User will access my application for creating ads(image,flash,movie).There is no limit for ad creation.At end of each month we will bill them based on total no of ads created by that user.

I am planned to implement like this:

I will set a crontab that will run once in 15th of each month and calculate the total ads and recorded in DB.I will bill them on 30 th of that month using the details from DB.


Drawback(issue's) :

1) If user is creating ads after 15th.We can't able to bill them at the current month
2) If user is creating an ad on 2nd and he deleted that ad on 14.we can't able to bill that ad also
3) I thought we can set one autoincrement field in the DB.That will be incremented by 1 once user creates an ad.(This logic is not so efficient).


I Like to implement this logic in efficient manner.Any one can give some idea's or suggesstions.

I am looking for some help from you guys.

A.suresh
May 27 '07 #1
1 1148
pbmods
5,821 Expert 4TB
Since Users are probably going to want to be able to look at ads they've been charged for (e.g, billing history), you'll need to keep ads around after you've charged for them.

On the other hand, though, you only want to charge for an ad once (well, at least you're only ethically allowed to charge for an ad once :P).

The easiest thing I can think of would be to add a `billed` or similarly-named field to your ads table. On the 15th, the script would compile a list of all ads that don't have a value for this field. Then it would assign NOW() to those fields.

That way, a User could keep track of not only which ads he was charged for, but also which billing cycle the charge occurred during.

You'll probably also want to create an index for this field.
May 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Hung Jung Lu | last post by:
Hi, Description of PBP (Prototype-based programming) can be found at: http://en.wikipedia.org/wiki/Prototype_based http://www.dekorte.com/Proto/Chart.html ("Self" is an example of a PBP...
2
by: Scott | last post by:
Not sure if this is the right place to post this or not, but I am in the process of trying to find a Web Hosting/Isp Billing system that is reasonable in price and uses Access or SQL Server for a...
5
by: Derek Cooper | last post by:
I hope you can help me. I posted this in the microsoft sql server newsgroup a few days ago and got no response so I thought I'd try here. If I can provide any clarification I'll be glad to do so....
1
by: ML | last post by:
hello i need to write an sql which calculates # of billing cycles for an order for which ive order start and end date. the first invoice will be cut on the order start date. Also if i apply a...
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
1
by: Frantic3d | last post by:
Hello all, Newbie to MS Access. I started using the Time and Billing template a couple of days ago. Now for the fun part, changing what I have to what I can use. Ok, On the screen I have two...
0
by: Denon | last post by:
Hello, Currently, I'm finding a way to build a system that is billing to any web access end-user. If they new a session to web server, then start to charge, and if they close the browser, then...
1
by: SRK | last post by:
I'm looking for a book on business modeling that is focused on designing billing systems and other cyclical business processes. I have experience in design and I have an architecture already but...
4
by: sara | last post by:
i am studying a computer engineering and i started taking programming using C++ since month i have question i think it`s easy for you all *prof.programmer* but it`s bit diffecult for me plzz i...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.