Jump to content

Total noob help please......


tj.baker

Recommended Posts

I'm not even entirely sure I need to use PHP exclusivly for what I want to accomplish.

All I want to do is have a seven day list with hours of operation, and have the current day be highlighted.

This sounds fairly simple to me to accomplish..... I just have no idea where to start!

I don't necessarily wish for anyone to completly write the code to do this.... I would at least like to be pointed in the right direction for this particular task (I know I need to get to the php newbies tutorials, and I will!  :))...........I would just like to get this one thing accomplished in a fairly quick timeframe.

Thanks for any input........

peace,

tj
Link to comment
Share on other sites

it's not the best way but this should work (i think)

[code]<table>
  <tr>
    <td <?php if (date("D") == "Mon") echo('class="highlight"')?>>Monday</td>
    <td <?php if (date("D") == "Tue") echo('class="highlight"')?>>Tuesday</td>
    <td <?php if (date("D") == "Wed") echo('class="highlight"')?>>Wednesday</td>
    <td <?php if (date("D") == "Thu") echo('class="highlight"')?>>Thursday</td>
    <td <?php if (date("D") == "Fri") echo('class="highlight"')?>>Friday</td>
    <td <?php if (date("D") == "Sat") echo('class="highlight"')?>>Saturday</td>
    <td <?php if (date("D") == "Sun") echo('class="highlight"')?>>Sunday</td>
  </tr>
</table>[/code]

it will add a class "highlight" to the <td> of the current day.
Link to comment
Share on other sites

[quote author=vbnullchar link=topic=109923.msg443515#msg443515 date=1159510709]
what is it?
[/quote]

Mon  8:00am-3:00pm
Tue  8:00am-3:00pm
Wed  8:00am-4:00pm
Thu    9:00am-4:00pm
Fri      9:00am-2:00pm

All of that in a table, with the current day highlighted.

Thanks for the input!!!

peace,

tj
Link to comment
Share on other sites

[quote author=chris9902 link=topic=109923.msg443601#msg443601 date=1159527550]
it's not the best way but this should work (i think)

[code]<table>
  <tr>
    <td <?php if (date("D") == "Mon") echo('class="highlight"')?>>Monday</td>
    <td <?php if (date("D") == "Tue") echo('class="highlight"')?>>Tuesday</td>
    <td <?php if (date("D") == "Wed") echo('class="highlight"')?>>Wednesday</td>
    <td <?php if (date("D") == "Thu") echo('class="highlight"')?>>Thursday</td>
    <td <?php if (date("D") == "Fri") echo('class="highlight"')?>>Friday</td>
    <td <?php if (date("D") == "Sat") echo('class="highlight"')?>>Saturday</td>
    <td <?php if (date("D") == "Sun") echo('class="highlight"')?>>Sunday</td>
  </tr>
</table>[/code]

it will add a class "highlight" to the <td> of the current day.
[/quote]

Imma give that one a try!  :)

Thank you very much!!!

peace,

tj
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.