1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| <?
$year=2004;
print("<table border='0' width='200'>n");
for($month=1;$month<13;$month++) {
printf("<tr>n<th colspan='7'>%s</th></tr>n",date("F",mktime(0,0,0,$month,1,$year)));
printf("<tr><th>Su</th><th>Mo</th><th>Tue</th><th>Wed</th>
<th>Thu</th><th>Fr</th><th>Sa</th></tr>");
$fdom=date("w",mktime(0,0,0,$month,1,$year));
$ct=0;
for($row=1;$row<7;$row++)
{
print("n<tr>");
for($week=1;$week<8;$week++)
{
$ct++;
$value=mktime(0,0,0,$month,$ct-$fdom,$year);
if (date("m",$value)==$month)
{
printf ("<th>%s</th>",date("d",$value));
}
else { print("<td></td>"); }
}
print("</tr>n");
}
print("<tr><td colspan='7'><br><br></td></tr>");
}
print("</table>");
?> |