nee, das ist schon richtig, das hat nur was mit der Farbe zu tun.
Dein Link wird ja richtig gebildet. Das muss schon an der termindetail liegen
Dein Link wird ja richtig gebildet. Das muss schon an der termindetail liegen
<?
// termindetail.php
mysql_connect("localhost", "", "") or die("could not connect"); // Connect zur DB
mysql_select_db("test") or die("db falsch"); // Datenbank auswählen
if (!isset($year) || !isset($month) || !isset($day)) {
die ("Variablen sind nicht gesetzt");
}
if (strlen($month) == 1) {
$month = "0".$month;
}
$varDat = "$year"."-"."$month"."-"."$day";
$select = "SELECT * FROM termine WHERE DATE_FORMAT(termStart,'%Y-%m-%d') = '$varDat' ORDER BY termStart";
$found = mysql_query($select);
while ($row = mysql_fetch_array($found)) {
print "Termin: $row[termStart] bis $row[termEnd]<br>\n";
print " <b>$row[termSubject]</b><br>\n";
print " $row[termDetail]<br>\n";
}
mysql_free_result($found);
?>
<style type="text/css">
TD, TH {
FONT-FAMILY: Arial, Verdana, Trebuchet MS, Helvetica;
FONT-SIZE: 8pt;
FONT-WEIGHT: none;
COLOR: black;
BACKGROUND-COLOR: #FBFBFD;
}
.alt {BACKGROUND-COLOR: #E7E7F1;}
.basic {COLOR: white; BACKGROUND-COLOR: #606096;}
.top {COLOR: black; BACKGROUND-COLOR: #A3A3CB;}
.white {BACKGROUND-COLOR: #FFFFFF;}
.blank {BACKGROUND-COLOR: white;}
A:link, A:visited, A:active {
COLOR: #000020;
TEXT-DECORATION: underline;
}
A:hover {COLOR: #FF4400;}
</style>
<?
// Get todays date if we didn't get one
$tag[] = "00";
$subj[] = "";
if (($year == "") || ($month == "") || ($day == "")) {
$year = date("Y");
$month = date("n");
$day = date("d");
}
mysql_connect("localhost", "", "") or die("could not connect"); // Connect zur DB
mysql_select_db("test"); // Datenbank auswählen
$select = "SELECT DATE_FORMAT(termStart,'%d') as SqlTag, termSubject
FROM termine
WHERE
DATE_FORMAT(termStart,'%Y') = $year AND
DATE_FORMAT(termStart,'%m') = $month
ORDER BY termStart
";
$found = mysql_query($select);
while ($row = mysql_fetch_array($found)) {
$tag[] = $row[SqlTag];
$subj[] = $row[termSubject];
}
mysql_free_result($found);
$link_url = "";
$selector = 1;
$highlight = 1;
// 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 {
$index = 0;
$title = "";
foreach ($tag as $padday) {
if (($padday == $a) && ($highlight)) {
$title = $subj[$index];
if (($i%7) == $daymod) {
$text = "$a";
$colour = "class=top";
break;
} else {
$text = "$a";
$colour = "class=top";
$size = 12;
break;
}
} else {
if (($i%7) == $daymod) {
$text = "$a";
$colour = "class=alt";
$size = 10;
} else {
$text = "$a";
$colour = "";
$size = 10;
}
}
$index++;
}
if (eregi("class=top",$colour)) {
echo "<td $colour><font size='1'><a href='termindetail.php?year=$year&month=$month&day=$text' title='$title'>$text</a></font></td>"; // Hier der Link
} else {
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 < 0) {
$colspan = $colspan + 7;
}
for ($i = 0; $i < $colspan; $i++) {
echo "<td class=white> </td>";
}
if ($colspan !=0 ) {
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'>zurück</A> | <A HREF='$link_url?year=$year&month=$month&day=$day'>heute</A> | <A HREF='$link_url?year=$nyear&month=$nmonth&day=1'>nächstes</A></FONT></TD>\n";
}
?>
</tr>
</table>
Kommentar