<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>index7</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
setLocale(LC_ALL, "de_DE", "german");
$zeit=time();
$jahr=date("Y", $zeit); // ermitteln des Jahres
$mon=date("n", $zeit); // ermitteln des Monats
$akt=date("d", $zeit); // ermitteln des aktuellen Tages
$last=date("t", mktime(0,0,0,$mon,1,$jahr)); // ermitteln des letzten Tages des Monats
// Arrays für Monate und Wochentage
$mo = Array("", "Januar", "Februar", "März","April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
$wd = Array("So", "Mo", "Di", "Mi","Do", "Fr", "Sa", "So");
// ermitteln des Wochentages für den ersten Tages des Monats
$first_wd=date("w", mktime(0,0,0,$mon,1,$jahr));
if ($first_wd==0) $first_wd=7; // Korrektur für den Sonntag
###############
$jahr = date("Y"); // ermitteln des Jahres
$monat = date("n"); // ermitteln des Monats
$tage = date("t"); // ermitteln der Tage
$wtag = date("D"); // ermitteln des Wochentages
$kw = date("W"); // ermitteln der Kalenderwoche
$wochentage = array("Mo.","Di.","Mi.","Do.","Fr.","Sa.","So.","Mo.","Di.","Mi.","Do.","Fr.","Sa.","So.","Mo.","Di.","Mi.","Do.","Fr.","Sa.","So.","Mo.","Di.","Mi.","Do.","Fr.","Sa.","So.","Mo.","Di.","Mi.","Do.","Fr.","Sa.","So.");
echo "<table border=1>";
echo "<tr>";
echo "<td colspan=31 align=center>".$mo[$monat]. " $jahr</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=7 align=center>".$kw."</td>";
echo "<td colspan=7 align=center>".$kw."</td>";
echo "</tr>";
echo "<tr>";
for($j=0;$j<=$tage-1;$j++)
echo "<td align='center'><b>".$wochentage[$j]."</b></td>";
echo "</tr>";
echo "<tr>";
for($i=1;$i<=$tage;$i++)
echo "<td align='center'>".$i."</td>";
echo "</tr>";
echo "</table>";
###############
echo "<br><br>";
echo "<table border=\"1\" align=\"center\" style=\"font-size:8pt; font-family:Verdana\">";
echo "<tr>";
echo "<td align=center colspan=31><strong>JAHRESÜBERSICHT $jahr</strong></td>";
echo "</tr><tr>";
for ($monat = 1; $monat <= 12; $monat++) {
echo "<td></td></tr><tr>";
for ($tag = 1; $tag <= 31; $tag++) {
if (checkdate($monat, $tag, date("Y"))) {
echo "<td>" .strftime("%a<br>%d", mktime(0, 0, 0, $monat, $tag, date("Y"))) . "</td>";
}
}
}
echo "</tr>";
echo "</table>";
?>
</body>
</html>