Jump to content

steelej

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

steelej's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm in a spot here.  I'm trying to troubleshoot an applicaton built by someone else.  It is a tutor appointment scheduler.  It is working fine except that it seems to think all month's have 30 days.  I'm trying to ferret out the error and I think it's in the code below, but I'm having trouble making sense of it: // print a week     $today = date("w"); //number of day of the week $month = date("m"); $day = date("d"); $year = date("y"); $times = array(1=>"8:00",2=>"8:30",3=>"9:00",4=>"9:30",5=>"10:00",6=>"10:30",7=>"11:00",8=>"11:30",9=>"12:00",10=>"12:30",11=>"1:00",12=>"1:30",13=>"2:00",14=>"2:30",15=>"3:00",16=>"3:30",17=>"4:00",18=>"4:30" ); $week = array(1=>"Monday",2=>"Tuesday",3=>"Wednesday",4=>"Thursday",5=>"Friday",6=>"Saturday",7=>"Sunday"); for ( $d=0; $d < 7; $d++) { if ($day<10) $day = sprintf( "%02d", $day); if ($month<10) $month = sprintf( "%02d", $month); echo '<table border="0">'."\n"; echo "<tr>\n"; echo "<td><u>".$week[(($today+$d)%7)]."</u></td>\n"; echo "</tr>\n"; echo "<tr>\n"; if ( date("l", mktime(0, 0, 0, $month, $day, $year)) != "Sunday") echo "<td>".$month.'/'.$day.'/'.$year."</td>\n"; echo "</tr>\n";
×
×
  • 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.