Solved

Need programmable timer from php

Posted on 2006-10-25
8
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:
Mark Gilbert 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
Industry Leaders: 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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create animated movies for web page 18 165
Adding items to a C# list incrementally 5 82
Designing forms 3 70
Adding a countdown to HTA 12 113
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

734 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