Hvor ligger fejlen :S I min kalender?
HejsaJeg får den her fejl:
Parse error: parse error in c:\programmer\php\www\kalendertest.php on line 97
I den her kode:
<?
$date = date("m-Y");
$show_month = date("m");
$show_year = date("Y");
$mktime = mktime( 0, 0, 0, $show_month, 1, $show_year );
$total_days = date( "t", $mktime );
if( $show_month == 12 ) {
$show_month = "01";
$show_year++;
} else {
$show_month++;
if( $show_month < 10 ) {
$show_month = 0 . $show_month;
}
}
$next_date = $show_month . "-" . $show_year;
if( $show_month == "01" ) {
$show_month = "12";
$show_year--;
} else {
$show_month--;
if( $show_month < 10 ) {
$show_month = 0 . $show_month;
}
}
$previous_date = $show_month . "-" . $show_year;
$QUERY_STRING = ereg_replace("&date=".$show_month."-".$show_year,"",$_SERVER['QUERY_STRING']);
echo '<table><tr>';
echo '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?'.$QUERY_STRING.'&date='.$previous_date.'">«</a></td>';
echo '<td align="center" colspan="5">'.date( "M Y", $mktime ).'</td>';
echo '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?'.$QUERY_STRING.'&date='.$next_date.'>»</a></td>';
echo '</tr><tr>';
echo '<td align="center">Mandag</td>';
echo '<td align="center">Tirsdag</td>';
echo '<td align="center">Onsdag</td>';
echo '<td align="center">Torsdag</td>';
echo '<td align="center">Fredag</td>';
echo '<td align="center">Lørdag</td>';
echo '<td align="center">Søndag</td>';
echo '</tr><tr>';
$cell_counter = 0;
for( $i = 1 ; $i <= 31 ; $i++ ) {
$cell_counter++;
$day_track = $cell_counter;
if( $cell_counter == 7 ) {
$day_track = 0;
}
$week_day = date("w", mktime (0,0,0,$show_month+1,$i,$show_year) );
echo '<td align="center">';
if( $day_track == $week_day ){
$this_bold = "";
$this_bold_end = "";
if( $i."-".$show_month."-".$show_year == date("j-m-Y") ) {
$this_bold = "<strong>";
$this_bold_end = "</strong>";
}
echo $this_bold.$i.$this_bold_end;
} else {
$i--;
echo ' ';
}
echo '</td>';
if($cell_counter == 7) {
echo '</tr><tr>';
$cell_counter = 0;
}
if( $i == $total_days ) {
if( $cell_counter != 0 ) {
for( $cell_counter; $cell_counter <= 6; $cell_counter++) {
echo '<td align="center"> </td>';
}
break;
}
}
echo '</tr></table>';
?>
