Re: php calender
| From: | Torsten Roehr | Date: | Tue, 11 May 2004 19:15:05 +0000 |
| Subject: | Re: php calender | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185937@lists.php.net to get a copy of this message | ||
"Edward Peloke" <epeloke@echoman.com> wrote in message
news:NKEFLLFBJFIKEGAGKPCAOEOCDAAA.epeloke@echoman.com...
> I am currently working on a site for a vacation rental company. They
want
> the ability to show users the availability of certain properties. The
> availability will be held in a mysql db so I assume I will have to
> dynamically build a small javascript menu or something....I am just
looking
> for some good suggestions and examples from other's who have done this.
>
> I am not a fan of generating javascript from php.
>
> Thanks,
> Eddie
Hi Eddie,
there is a great calendar package in PEAR:
http://pear.php.net/package/Calendar
There is a good example of how to build an HTML calendar from it:
http://pear.php.net/manual/en/package.datetime.calendar.intro-inahurry.php
(scroll down to the middle of the page)
I don't know why you want to use javascript here. I would do it this way:
- select all dates of free vacation properties of the given/current month
- put the dates from the DB result into an array
- create the calendar with the example from above and check for every day if
there is an entry for the day in your array
- if so give the table cell a specific color and/or link to page containing
detailed information
- otherwise blank the cell out or whatever
Hope this helps!
Regards, Torsten