I have this piece of codr that works perfectly for printing the days from sunday to saturday. The only problem is that I need to print the days monday through friday only and then monday through sunday.
Here is the code... Lemme know what you think!
// Loop for the number of days in a given month
while( $x < date("t",$ts) ) {
// First iteration of $x to find the day of the week that the 1st starts on
if( $x == 0 ) {
while( $colcount < 7 ) {
if( $colcount == $tsinfo['wday'] ) {
// Darken Saturday and Sunday
if( date("d") == ($x+1) && date("m") == $current_month )
$html .= "<td width=\"". $cal_column_width ."\" height=\"80\" valign=\"top\" class=\"cal_today\">". cal_day_events($x+1,$current_month_str,$current_year,$sector) ."</td>\n";
elseif( $colcount == 0 || $colcount == 6 )
$html .= "<td width=\"". $cal_column_width ."\" height=\"80\" valign=\"top\" class=\"cal_weekend_box\">". cal_day_events($x+1,$current_month_str,$current_year,$sector) ."</td>\n";
else
$html .= "<td width=\"". $cal_column_width ."\" height=\"80\" valign=\"top\" class=\"cal_weekday_box\">". cal_day_events($x+1,$current_month_str,$current_year,$sector) ."</td>\n";
if( $colcount == 6 ) {
$html .= "</tr><tr>";
$colcount = 0;
} else {
$colcount++;
}
break;
}
if( $colcount == 6 ) {
$html .= "</tr><tr>";
$colcount = 0;
} else {
$html .= "<td width=\"". $cal_column_width ."\" class=\"cal_blank_day\"><img src=\"". IMG_URL ."spacer.gif\" width=\"". $cal_column_width ."\" height=\"80\"></td>\n";
$colcount++;
}
} // END while( $colcount < 7 )
} else {
// Darken Saturday and Sunday
if( date("d") == ($x+1) && date("m") == $current_month )
$html .= "<td width=\"". $cal_column_width ."\" height=\"80\" valign=\"top\" class=\"cal_today\">". cal_day_events($x+1,$current_month_str,$current_year,$sector) ."</td>\n";
elseif( $colcount == 0 || $colcount == 6 )
$html .= "<td width=\"". $cal_column_width ."\" height=\"80\" valign=\"top\" class=\"cal_weekend_box\">". cal_day_events($x+1,$current_month_str,$current_year,$sector) ."</td>\n";
else
$html .= "<td width=\"". $cal_column_width ."\" height=\"80\" valign=\"top\" class=\"cal_weekday_box\">". cal_day_events($x+1,$current_month_str,$current_year,$sector) ."</td>\n";
$colcount++;
if( $colcount == 7 ) {
$html .= "</tr><tr>";
$colcount = 0;
}
}
$x++;
}