Jump to content

PHP Statments(i think)


liquid79

Recommended Posts

Hi this is hard to explain but i will try and make it clear as possible.

 

I have made a calendar, which displays weeks that are booked/available and provisional and depending if they are booked etc It will display those dates in a colors such as for booked: red,  Green for available and grey for provisional. The weeks run from Sat to Sat.

 

The problem: The last day of the week booked, which will always be the Saturday needs to show bg picture of a split of 2 colors, the pic it shows depends on what the weeks in front state is, for an example.

 

Week 1 is available, which is green and week 2 is booked which is red so the last Saturday of week 1 will need to be split green/red.

 

This could always change so one week could be red and the next green so it would need to show the pic of split red/green or if it was provisional it would be grey/green.

 

My code i have at the moment is below but im not sure how i say if week before = show this

 

Any help or hints will be great!

 

     

$dec1 = $row->s_1st_8th;


// if the result is A the color of that week will be the one shown below etc in my calender when i call booked in the tr.

   switch ($dec1) {
            case 'A':
                $booked = 'bgcolor="#0A8F5E"';
                break;

            case 'B':
                $booked = 'bgcolor="#FF0000"';
                break;

            case 'P':
                $booked = 'bgcolor="#999999"';
                break;
        }

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.