tj.baker Posted September 29, 2006 Share Posted September 29, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/22456-total-noob-help-please/ Share on other sites More sharing options...
vbnullchar Posted September 29, 2006 Share Posted September 29, 2006 what is it? Quote Link to comment https://forums.phpfreaks.com/topic/22456-total-noob-help-please/#findComment-100689 Share on other sites More sharing options...
extrovertive Posted September 29, 2006 Share Posted September 29, 2006 Create an array from Sunday to Saturday.Outut them in as a list (going through each day element)If the day element is today (i.e. date("l")) then highlight that list. Quote Link to comment https://forums.phpfreaks.com/topic/22456-total-noob-help-please/#findComment-100693 Share on other sites More sharing options...
chris9902 Posted September 29, 2006 Share Posted September 29, 2006 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 Link to comment https://forums.phpfreaks.com/topic/22456-total-noob-help-please/#findComment-100774 Share on other sites More sharing options...
tj.baker Posted September 29, 2006 Author Share Posted September 29, 2006 [quote author=vbnullchar link=topic=109923.msg443515#msg443515 date=1159510709]what is it?[/quote]Mon 8:00am-3:00pmTue 8:00am-3:00pmWed 8:00am-4:00pmThu 9:00am-4:00pmFri 9:00am-2:00pmAll of that in a table, with the current day highlighted.Thanks for the input!!!peace,tj Quote Link to comment https://forums.phpfreaks.com/topic/22456-total-noob-help-please/#findComment-100991 Share on other sites More sharing options...
tj.baker Posted September 29, 2006 Author Share Posted September 29, 2006 [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 Quote Link to comment https://forums.phpfreaks.com/topic/22456-total-noob-help-please/#findComment-100994 Share on other sites More sharing options...
True`Logic Posted September 29, 2006 Share Posted September 29, 2006 have all the dates like <span>Monday</span> etc; and have your html file parsed into a varriable ($htmlReturn?)[code]$htmlReturn = str_replace("<span>" . date("D"), "<span bgcolor=green>" . date("D"), $htmlReturn);[/code]ive used that one successfully before :) Quote Link to comment https://forums.phpfreaks.com/topic/22456-total-noob-help-please/#findComment-101032 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.