Gathering ideas for project using dates

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
charp
Forum Commoner
Posts: 85
Joined: Sun Oct 26, 2003 3:00 pm
Location: Rancho Cucamonga, Calif. USA

Gathering ideas for project using dates

Post by charp »

I'm trying to gather some ideas about how best to build the following project for a high school web site:

Post the current day's bell schedule with the current period highlighted. The issues involved are 7 different bell schedules plus weekends and holidays with no bell schedules.

Using unix timestamps, date(), time(), and strtotime(), I can compare dates, check times, and that sort of thing. The two areas where I would like suggestions are as follows:

1. An efficient way to check the current date against the list of days for each type of bell schedule. I can picture a rather long if/elseif/else construction or a lengthy switch statement, but can anyone suggest something more efficient and/or elegant?

2. So far my thinking is to put all the times for the bell schedules into a mySQL database, but what about the dates for the various calendars? Should I hard code dates for each calendar in separate arrays, place them all in a multidimensional array (not even sure if this is possible), or place the dates in a database and pull them from there?

Most of this project is in the concept stage, so I don't have any time and effort invested in coding. I'm hoping to avoid hours of coding only to find that I've painted myself into a corner. All ideas and suggestions are welcome and appreciated.

Thanks!
Post Reply