Solved

Need programmable timer from php

Posted on 2006-10-25
8
249 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
Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

695 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