Solved

Need programmable timer from php

Posted on 2006-10-25
8
239 Views
Last Modified: 2011-10-03
Hi, I have a web-based php/mysql booking system.  I need to include alarms/timers that can handle intervals of between one to two hours between being set, and firing. For example, an appointment is initiated, and I need a notifcation to pop up 70mins later regardless of what else the user does with the application in the meantime.  

Can I use the chron daemon on the server, somehow?

The server is linux, and users are  on windows laptops running firefox.

Looking for either third party solutions or coding suggestions
Thanks.
0
Comment
Question by:febone
8 Comments
 
LVL 16

Assisted Solution

by:ellandrd
ellandrd earned 125 total points
ID: 17806893
>>coding suggestions

i would add a field called TimeBooked to the table where you insert bookings. when inserting new records, give this field a timestamp value - say for example, the current time of insertion into the database.  then based on the system clock of the server or client machine, check this timestamp and if it has overlapped 70 mins, show the popup window notification to your user.

you would need some script to be running in the background to trigger this, but im not sure if this is good for the server processor to have a constant scripting 24/7 using resources...

haveyou heard of cron jobs?  these might be useful to what you wan to do also...

For help on cron jobs, see http://www.superscripts.com/tutorial/crontab.html.

and since your on a linux server, should be able to use cron jobs so i think this is a good choice/option too.

can you not set scheduled task?  im not sure if this can be done on a linux server though...

thats my advise!

good luck

ellandrd
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 17806907
sorry just noticed that the link i provided didnt work so try these instead:

http://www.unixgeeks.org/security/newbie/unix/cron-1.html
http://www.adminschoice.com/docs/crontab.htm

you will find more on google if you search...

ellandrd
0
 
LVL 18

Accepted Solution

by:
ingwa earned 125 total points
ID: 17808038
I'm sure that in each of your pages you are looking for a require, or an include which calls for the same page.  In that page, insert a query into it which checks whether a variable in your database equals or is greater than x (the time you wish the popup to appear).  If so, use a php echo of a javascript popup which notifies the user that they have to take action on the x item.  If they close the window, and the closed time is not within a certain amount of time (each action should be audited by the system, with an action date or time which is updated if something is successful -- i.e step 2 of 4 has been completed, but step 3 hasn't on the saturday) then it is queued in the system with the query script running each time header.php is run.

Other than that, what could be possible is that every queued item that the user performs (which is within your internal network), if the next job item checks for an outstanding or equals to situation then to move on to the next item.  This sort of system could work within a 24 hour CRM basis, or an ad-hoc basis of CRM.  Either way you have some basis on setting the programatic rules.

Hope this helps.
0
 
LVL 18

Expert Comment

by:ingwa
ID: 17808052
"if the next job item checks for an outstanding or equals to situation then to move on to the next item." should read "if the next job item checks for an outstanding or equals to situation then open that work item or if not either of the above, move on to the next item."
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 17

Expert Comment

by:CSecurity
ID: 17808495
YOu can use cron jobs or AJAX
0
 

Author Comment

by:febone
ID: 17853298
Hi folks...thanks for the tips and guides; definately pointed me in the right direction. I ended up going with an ajax soln using bits and pieces of all the answers.
0
 
LVL 18

Expert Comment

by:ingwa
ID: 17854663
Thanks for the points and the grade febone, pleased I was able to help you a bit.
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 17856244
thank you
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now