hab es genauso gemacht, aber trotzdem danke für die mühe.
die nächsten 7 tage
Einklappen
X
-
PHP-Code:<?
$link_url = "";
$selector = 1;
$highlight = 1;
// Get todays date if we didn't get one
if (($year == "") || ($month == "") || ($day == "")) {
$year = date("Y");
$month = date("n");
$day = date("d");
}
// Get info for Calendar generation
$daysmonth = date("t",mktime(0,0,0,$month,$day,$year));
$firstday = date("w",mktime(0,0,0,$month,1,$year));
$padmonth = date("m",mktime(0,0,0,$month,$day,$year));
$padday = date("d",mktime(0,0,0,$month,$day,$year));
// Customize according to $calendar_format
if ($firstday == 0) {
$firstday = 7;
}
$date = "$padday.$padmonth.$year";
$dayletter = array(1 => "Mo", 2 => "Di", 3 => "Mi", 4 => "Do", 5 => "Fr", 6 => "Sa", 7 => "So");
$daymod = 0;
?>
<table border="0" cellspacing="0" cellpadding="0" width="150">
<tr>
<td class=basic>
<table width="150" border="0" cellspacing="1" cellpadding="3">
<tr>
<th class=top colspan=7> <font color="#000000"><b><? echo $date;?></b></font></th>
</tr>
<tr>
<?
for($daynumber = 1; $daynumber < 8; $daynumber++) {
echo "<td><font size='1'>$dayletter[$daynumber]</font></td>";
}
?>
</tr>
<tr>
<?
for ($i = 1; $i < $daysmonth + $firstday + $daymod; $i++) {
$a = $i - $firstday + 1 - $daymod;
$day = $i - $firstday + 1 - $daymod;
if (strlen($a) == 1) {
$a = "0$a";
}
if (($i < $firstday) || ($a == "00")) {
$text = "";
$colour = "white";
$size = 10;
echo "<td class=white> </td>";
$k++;
} else {
if (($padday == $a) && ($highlight)) {
if (($i%7) == $daymod) {
$text = "$a";
$colour = "class=top";
} else {
$text = "$a";
$colour = "class=top";
$size = 12;
}
} else {
if (($i%7) == $daymod) {
$text = "$a";
$colour = "class=alt";
$size = 10;
} else {
$text = "$a";
$colour = "";
$size = 10;
}
}
echo "<td $colour><font size='1'>$text</font></td>";
}
if (($i%7) == 0) {
echo "</TR><TR>\n";
}
}
if (($i%7) != 1) {
echo "</TD>\n";
}
$colspan = 36 - $i;
if ($colspan < 1) {
$colspan = $colspan + 7;
}
for ($i = 0; $i < $colspan; $i++) {
echo "<td class=white> </td>";
}
echo "</tr><tr>";
// Print the selector
if ($selector) {
if ($month == 1) {
$pyear = $year - 1;
$pmonth = 12;
} else {
$pyear = $year;
$pmonth = $month - 1;
}
if ($month == 12) {
$nyear = $year + 1;
$nmonth = 1;
} else {
$nyear = $year;
$nmonth = $month + 1;
}
$year = date("Y");
$month = date("n");
$day = date("j");
echo "<TD colspan=7 class=white><center><FONT SIZE=-2><A HREF='$link_url?year=$pyear&month=$pmonth&day=1'>backw</A> | <A HREF='$link_url?year=$year&month=$month&day=$day'>today</A> | <A HREF='$link_url?year=$nyear&month=$nmonth&day=1'>forw</A></FONT></TD>\n";
}
?>
</tr>
</table>
</td>
</tr>
</table>
Kommentar
Kommentar