[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Need programmable timer from php

Posted on 2006-10-25
8
Medium Priority
?
252 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 375 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:
Mark Gilbert earned 375 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:Mark Gilbert
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
 
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:Mark Gilbert
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month20 days, 2 hours left to enroll

873 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