Jump to content

PHP Booking/Calendar help


annetttteeee

Recommended Posts

I use unorder lists and the anchor tag for the calendar I created:

    protected function currentMonth($date) {
        $this->isHoliday = new Holiday;

        /* Grab the current month DateTime */
        $this->current = new DateTime($date);

        $this->days = $this->current->format('t'); // Days in the current month:		
        /* Generate each day of the week's date */
        for ($x = 1; $x <= $this->days; $x++) {
            if ($x < 10) {
                $this->urlDate = $this->current->format('Y') . '-' . $this->current->format('m') . '-0' . $x;
            } else {
                $this->urlDate = $this->current->format('Y') . '-' . $this->current->format('m') . '-' . $x;
            }

            $this->memo = $this->checkForEntry();
            if ($this->isHoliday->checkForHoliday($this->urlDate)) {
                /* Grab the important date(s) of the month and put it into an array */
                $this->highlightHoliday = 'highlightHoliday';
            } else {
                $this->highlightHoliday = \NULL;
            }
            $this->sendDate = new DateTime($this->urlDate);
            /* Figure out if the month's day is today and highlight if it is */

            if ($this->today->format('Y-m-d') === ($this->urlDate)) {
                $this->highlightToday = 'highlightToday';
            } else {
                $this->highlightToday = \NULL;
            }
            /* The Actual Link of the day of the week for the current month */
            $this->calendar[] = '<li class="calday ' . $this->highlightHoliday . ' ' . $this->memo . '"><a class="mark ' . $this->highlightToday . '" href="calendar.php?urlDate=' . htmlspecialchars($this->sendDate->format('Y-m-d')) . '&page=' . htmlspecialchars($_SESSION['page']) . '">' . $x . '</a></li>' . "\n";
        }
    }

I actually find it using the get statement for the statement and the post statement (using a form) for the booking portion of the calendar. See my signature for the website with my calendar on it (you'll have to be logged in (registered) to use the scheduling portion of the calendar). 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.