I would like to use a if statement to add a radio button to calendar days but I'm having problems with the logic. The logic in plain English would be:
IF TODAY ADD BUTTON TO TOMORROW
I can add radio buttons to all future Tuesdays but can't workout how to add the radio button to Tuesday in the same week if the day is Monday and the hour pre-noon (<12). I guess I would need a nested if statement for this but can't work out the logic.
Any help or pointers would be appreciated.
Code: Alles auswählen
<?php
// IF MONDAY & PRE-NOON (<12)
if ((date("Y-m-d",$GLOBALS["lv"]->calendar_struct["date"]) == $today) &&
(date("l",$GLOBALS["lv"]->calendar_struct["date"]) == 'Monday') &&
($hour < '12')) {
// --- ADD RADIO BUTTON FOR NEXT DAY (TUESDAY)
// if statement
echo '[radio button]';
// end if statement
} elseif (
// ADD RADIO BUTTON FOR FUTURE TUESDAYS
(date("Y-m-d",$GLOBALS["lv"]->calendar_struct["date"]) > $today) &&
(date("l",$GLOBALS["lv"]->calendar_struct["date"]) == 'Tuesday')
) {
echo '[radio button]';
};
?>