<?php
setlocale(LC_ALL, 'deu', 'de_DE');
define("EINTAG", (60*60*24) );
if ( ! checkdate( $monat, 1, $jahr ) )
{
$heuteArr = getdate();
$monat = $heuteArr[mon];
$jahr = $heuteArr[year];
}
$start = mktime ( 10, 10, 0, $monat, 1, $jahr );
$ersterArr = getdate(strftime($start));
?>
<html>
<head>
<title><?php /*print "Kalendar: $ersterArr[month] $ersterArr[year]" */?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="100%" border="0">
<tr>
<td>
<form action="<? print $PHP_SELF ?>" method="post">
<center><select name="monat">
<?php
$monate = Array("Januar", "Februar", "März", "April",
"Mai", "Juni", "Juli", "August", "September",
"Oktober", "November", "Dezember");
for ( $x=1; $x <= count( $monate ); $x++ )
{
print "\t<option value=\"$x\"";
print ($x == $monat)?" SELECTED":"";
print ">".$monate[$x-1]."\n";
}
?>
</select>
<select name="jahr">
<?php
for ( $x=2010; $x<2016; $x++ )
{
print "\t<option";
print ($x == $jahr)?" SELECTED":"";
print ">$x\n";
}
?>
</select>
<input type="submit" value="wechseln">
</center>
</form>
<p><center>
<?php
$days = Array("Montag", "Dienstag", "Mitwoch",
"Donnerstag", "Freitag", "Samstag", "Sonntag");
$monStart = $ersterArr[wday]-1;
if ($monStart < 0) { $monStart = 6; }
print "<TABLE border=\"0\" cellspacing=\"1\" cellpadding=\"15\" bordercolor=\"#000000\" style=\"border:1px solid; bordercolor:#000000; -moz-border-radius:8px; -khtml-border-radius:8px;\">\n";
foreach ( $days as $day )
print "\t<td bgcolor=\"#cccccc\"><center><b>$day</b></center></td>\n";
for ( $zaehler=0; $zaehler < (6*7); $zaehler++ )
{
$tagArr = getdate( $start );
if ( (($zaehler) % 7) == 0 )
{
if ( $tagArr[mon] != $monat )
break;
print "</tr><tr bgcolor=\"#cccccc\">\n";
}
/*
if ( $zaehler < $monStart || $tagArr[mon] != $monat )
{
print "\t<td><br></td>\n";
}
*/
if ( $zaehler < $monStart)
{
$vorMonArr = getdate(mktime ( 0, 0, 0, $monat, 1, $jahr ) - (($monStart-$zaehler)*60*60*24));
print "\t<td width=\"80\" heigth=\"30\" onClick=\"linkme('index.php?set=details&datum=$vorMonArr[mday].$vorMonArr[mon].$tagArr[year]')\" onMouseOver=\"over05(this)\" onMouseOut=\"out02(this)\"><center><a href=\"index.php?set=details&datum=$vorMonArr[mday].$vorMonArr[mon].$tagArr[year]\"><font color=\"#666666\">$vorMonArr[mday]</font></a></center></td>\n";
}
elseif ($tagArr[mon] != $monat)
{
print "\t<td width=\"80\" heigth=\"30\" onClick=\"linkme('index.php?set=details&datum=$tagArr[mday].$tagArr[mon].$tagArr[year]')\" onMouseOver=\"over05(this)\" onMouseOut=\"out02(this)\"><center><a href=\"index.php?set=details&datum=$tagArr[mday].$tagArr[mon].$tagArr[year]\"><font color=\"#666666\">$tagArr[mday]</font></a></center></td>\n";
$start += EINTAG;
}
else
{
print "\t<td width=\"80\" heigth=\"30\" onClick=\"linkme('index.php?set=details&datum=$tagArr[mday].$tagArr[mon].$tagArr[year]')\" onMouseOver=\"over05(this)\" onMouseOut=\"out02(this)\"><center><a href=\"index.php?set=details&datum=$tagArr[mday].$tagArr[mon].$tagArr[year]\"><font color=\"#000000\">$tagArr[mday]</font></a></center></td>\n";
$start += EINTAG;
}
}
print "</tr></table>";
?></center>
</td>
</tr>
</table>
</body>
</html>