I’m trying to create a 12 month calenar but have run into a problem.
I have the calender showing ok but instead of the dates being in weekly format they are monthly. Here the code you’ll see what I mean
[php]
<?php $cur_year = date('Y'); for ($i=1; $i <= 12;$i++) { ?><table cellpadding="1" cellspacing="1" bgcolor="#666666">
<tr><td colspan="7" align="center" valign="top" bgcolor="#99CCCC" style="color:#FF3300; font-weight:bold; font-size:16px"><?php echo date('F Y', mktime(0,0,0,$i,1,$cur_year)) ?></td>
</tr>
<tr>
<?php for($day_title = 5; $day_title <= 11; $day_title++) { ?><td valign="top" bgcolor="#99CCCC" style="color:#000066; font-weight:bold; font-size:10px"><?php echo date('D', mktime(0,0,0,0,$day_title,0)) ?></td><?php } ?></tr>
<?php
$start_day = date('d', mktime(0,0,0,$i,1,$cur_year));
$end_day = date('t', mktime(0,0,0,$i,1,$cur_year));
?>
<tr><?php foreach(range($start_day, $end_day) as $week_days) { ?>
<td align="center" style="color:#FF0000"><?php echo $week_days; ?></td><?php
}
?></tr>
[/php]
Does anyone have any suggestions.
Have tried $trs = $end_day /7; for($rows=0; $rows < $trs; $rows++) { and so on.
It gives extra rows but puts all the months dates in 1 cell