Minikalender PHP

Hallo,
ich möchte bei diesem kleinen Kalender hier Termine eintragen können, bin damit jedoch ein bisschen überfordert…
Ich stelle mir die ganze Sache so vor, dass bei einem Mousover des Datums, der dazugehörige Termin per Hover erscheint, mir ist aber nicht ganz klar wo ich das hischreiben soll. Ich hoffe es kann mir jemand von euch helfen!

Danke im Voraus
Allmi02[PHP]

<?php echo ''; // Aktuelles Datum holen if(isset($_GET['m']) AND is_numeric($_GET['m']) AND $_GET['m'] >= 1 AND $_GET['m'] <= 12 AND isset($_GET['j']) AND is_numeric($_GET['j']) AND $_GET['j'] >= 1970) { $ak_datum = getdate(); if($_GET['m'] == $ak_datum['mon'] AND $_GET['j'] == $ak_datum['year']) { $ak_datum = getdate(); $notbig = false; }else { $ak_datum = getdate(mktime(0,0,0,$_GET['m'],1,$_GET['j'])); $notbig = true; } }else { $ak_datum = getdate(); $notbig = false; } // Auf Schaltjahr prüfen $februar = 28; if(checkdate(2,29,$ak_datum['year'])) $februar = 29; // Tagesstaffelung $monatstage = array(1=>31, 2=>$februar, 3=>31, 4=>30, 5=>31, 6=>30, 7=>31, 8=>31, 9=>30, 10=>31, 11=>30, 12=>31); // Tage zuweisen $tage = array(0=>"So", 1=>"Mo", 2=>"Di", 3=>"Mi", 4=>"Do", 5=>"Fr", 6=>"Sa", 7=>"So"); // Monate zuweisen $monate = array(0=>"Januar", 1=>"Februar", 2=>"März", 3=>"April", 4=>"Mai", 5=>"Juni", 6=>"Juli", 7=>"August", 8=>"September", 9=>"Oktober", 10=>"November", 11=>"Dezember"); // Erster Tag des Monats $erster_tag = getdate(mktime(0,0,0,$ak_datum['mon'],1,$ak_datum['year'])); $counter = 1; $wochentage = 1;?>
    <?php
    for($i=0;$i<=41;$i++) {
        if($counter == 1) echo '<tr style="background-color:#eeeeee;border:1px solid black;">';
        echo '<td align="center" valign="bottom" width="25px" height="25px" style="border:1px solid; border-color:#242C37; padding-left:5px;">';
            if($erster_tag['wday'] == $i) $show = true;
            if(isset($show)) {
                if($ak_datum['mday'] == $wochentage AND $notbig == false) {                        echo '<b><a href="?m='.$ak_datum['mon'].'&j='.$ak_datum['year'].'&t='.$wochentage.'">'.$wochentage.'</a></b>';                    }else {                        echo '<a href="?m='.$ak_datum['mon'].'&j='.$ak_datum['year'].'&t='.$wochentage.'">'.$wochentage.'</a>';                    }
                $wochentage++;
            }
            if(!checkdate($ak_datum['mon'],$wochentage,$ak_datum['year'])) unset($show);

        echo '</td>';
        if($counter == 7) { echo "</tr>"; $counter = 0; }
        $counter++;
    }
    ?>              <!--Kästchen mit Pfeilen -->    <tr style="background-color:#eeeeee;border:1px solid black;">        <td align="center" width="210px" colspan="7" style="border:1px solid; border-color:#242C37; padding-left:5px;">            <!--Kästchen mit Pfeilen -->    <?php
    $m_minus = $ak_datum['mon']-1;        $j_minus = $ak_datum['year'];
    if($m_minus < 1) {            $m_minus = 12;            $j_minus = $ak_datum['year']-1;        }
    $m_plus  = $ak_datum['mon']+1;        $j_plus  = $ak_datum['year'];
    if($m_plus > 12) {            $m_plus = 1;            $j_plus = $ak_datum['year']+1;        }
    echo '<a href="?m='.$m_minus.'&j='.$j_minus.'">&laquo;</a>&nbsp;|&nbsp;<a href="?m='.$m_plus.'&j='.$j_plus.'">&raquo;</a>';
?>        </td>    </tr>
</td></tr>
<?php echo '
<?php echo $monate[$ak_datum['mon']-1]." ".$ak_datum['year']; ?>
So Mo Di Mi Do Fr Sa
';?> [/PHP]

Wie sieht denn der erzeugte HTML-Code aus? Dann könnte man evtl. etwas mehr durchblicken was Du da geschrieben hast.

Tipp: EVA-Prinzip beachten, Code in Funktionen (oder noch besser Klassen) kapseln.

Dann klappt es auch mit dem Durchblick.