Ok, this is just to post the solution in case someone searches on this topic.
Here is the code for where the button is placed:
<?php
if (Date('d M Y', $mon) < Date('d M Y'))
echo "Sorry no more orders for today";
elseif (Date('d M Y', $mon) > Date('d M Y'))
echo '<input type="image" src="WA_eCart/Images/Pacifica/Btn3_EN_addtocart.gif" border="0" value="Add to Cart" name="teacherslunchbox_21_ATC" >';
elseif (Date('d M Y', $mon) == Date('d M Y'))
if (Date("Hi") + 300 < "900")
echo '<input type="image" src="WA_eCart/Images/Pacifica/Btn3_EN_addtocart.gif" border="0" value="Add to Cart" name="teacherslunchbox_21_ATC" >';
else
echo "Sorry no more orders for today";
?>
The page has two weeks worth of possible orders fed by a database.
$mon holds a date that could be in the future or the past. I get this date from script at the beginning of the page by using this script (repeating and tweaking it to get each day's date for the two week period so I have a $mon, $mon2, $tues, $tues2, etc)
<?php
$tod=date("N")-1;
$mon=strtotime('-'.$tod.' days');
?>
So for example, if today is Wed, it could be Mon previous to today, or the Mon coming up. So first I see if Monday is before today (which means they can't order on a past date) so I echo "sorry, blah blah"
Then if that date is in the future, I place the button.
If the date happens to be TODAY, and it's before 9am, then place the button
If it's TODAY but past 9am, echo "sorry, blah blah" since it's too late to order and get it in time for lunch (it's a sandwich shop)
I'm a beginner PHP person, so if this is hokey, I'd appreciate any tweaks. However, it seems to work fine and I wanted to get it out there in the forum in case someone else can use it.
Thanks all,
Rich