Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tackling a new problem. automatically creat events every other Friday

Status
Not open for further replies.

sd0t1

IS-IT--Management
Mar 14, 2007
131
0
0
US
I'm building a custom financial budgetting application. The part I'm stuck on is I want the system to automatically insert my pay every other Friday, plus my wife's on the 15th and 31st of each month.

I don't know the best way to tackle this problem. Any help would be appreciated.

I created a table that has the following fields:
id
earner_first
earner_last
source
gross_amount
net_amount
day
comment

Thanks and Blessings.
 
there are a number of approaches:

1. enter a full years transactions now and customise your retrieval queries to select dates actually passed.

2. create a 'cron' type job (as you describe) to enter the information. since you've asked, the easiest way to achieve this is to call a file such as cron.php as the first line of any script. the script looks to see whether it has cron jobs set to execute and does the necessary. in your application you would probably create a duplicate of your cash entries table and use the cron app to search for any dates falling on today's date. if there are any you would do an insert into table (select from table) and then a delete from table transaction.

if you do not have an easy hook to run a script on every page then consider editing php.ini to add a file name (containing the script) in to the auto_prepend_file directive.

3. create a *nix cron job to run every day that calls a script that does something similar to item 2.

there are lots of variations on the above.
 
Out of interest what do you do in months that don't have 31 days?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top