Solved

Need programmable timer from php

Posted on 2006-10-25
8
242 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to count occurrences of each item in an array.

895 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

13 Experts available now in Live!

Get 1:1 Help Now