PDA

View Full Version : Hourly Changing Table


ba_feitl
05-29-2006, 10:35 PM
I got some great help before so I am back with another similar question.

Throughout any given day at my club there are a couple of M.O.D.'s (managers on duty). On the display screen (big tv) I want to have one of the tables show the current MOD depending on the day of week and hour of the day.

ie... we open at 5am so from 5:00am to 10:59am I want a picture of Bob to show up in one <td> with his name under it in another <td> (could be in the same <td> too with a
). Then at 11:00am it would switch to Jane until 3:00pm and so on.. There are four MOD's per day and the people would be different each day of the week, but each week would be the same. So in total there are 7 days with 4 MOD's = only 28 possible display options.

Wasn't sure if linking to a database would be easiest or if it would be easier for the machine to determine the time and day of week and compare to the preset table options.

Thanks a lot ! :D
Brad

HeadAche
05-31-2006, 10:40 AM
Im not sure mate, but I think you have to shedual the task for something like this.

If you are using a linux server then you have to shedual with CRON (i think) and if your site is on windows server then you have to do it with ... something else...

I have to do something similar for a guy who wants a system like what ebay does when it sends out emails to people when items are ending or what have you.

So hopefully someone will reply. If I figure out how to do this then I'll let you know...

HeadAche
06-07-2006, 10:28 AM
Ok, I seem to have figured this out now, but you might need some good support or documentation for your server provider.

Just make the function in PHP so that when you load the page in a web browser it will do the task you want without you having to press any buttons or anything like that. Also in the PHP script I had to use direct links to the includes like the Connections include ect...

On our Linux server I had to SSH into it and used the command 'crontab -e' to open and edit CRON, and typed this.

45 3 * * 1 /dir/on_my_server/to_the_page/I_want_to_open.php

this means that my code will be ran at 3.45 every monday (so 15 * * * * will just run every 15 minutes past the hour, for example).

Exit and save the file.

Bit complicated, so thats why you will probably need some support. This is for linux servers only. If your on windows server then you'll have to figure something else out, but I believe there are free cron programs for windows servers.