Hvordan få jeg tabellen til at forsætte efter d. 31. Så jeg ikke få en stor firkant efter den. 31.
www.marina-leo.dk/Udvikleren/calendar01.php
<?
function show_calendar($year, $month)
{
if ($year == 0 || $month == 0)//hvis ingen dato er angivet, brug dags dato.
{
$year = date('Y');
$month = date('m');
}
$timestamp = mktime(0,0,0,$month,1,$year);
$daysinmonth = date('t',$timestamp);
$startday = date('w',$timestamp); //0 for søndag, 6 for lørdag
switch($startday)
{
case 0: $startday = 7;
}
$monthname = date('F',$timestamp);
$prevmonth = date('m',$timestamp) - 1;
$prevyear = date('Y',$timestamp);
if ($prevmonth <= 0)
{
$prevmonth = 12;
$prevyear -= 1;
}
$prevmonth = sprintf('%02d',$prevmonth);
$nextmonth = date('m',$timestamp) + 1;
$nextyear = date('Y',$timestamp);
if ($nextmonth >= 13)
{
$nextmonth = 1;
$nextyear += 1;
}
$nextmonth = sprintf('%02d',$nextmonth);
echo "
<table class=\\"calendar\\" border=\\"1\\" id=\\"table1\\" bordercolor=\\"#E5E5E5\\" cellspacing=\\"0\\" cellpadding=\\"3\\">
<tr>
<td><font face=\\"Tahoma\\" size=\\"2\\"><a class=\\"pagelink\\" href=\\"?date=$prevyear$prevmonth\\"><span style=\\"text-decoration: none\\"><<</td><td colspan=\\"5\\" align=center>$monthname</td><td align=right><a class=\\"pagelink\\" href=\\"?date=$nextyear$nextmonth\\"><span style=\\"text-decoration: none\\">>></td>
</tr>
<tr>
<td class=\\"dayname\\">Man</td><td class=\\"dayname\\">Tirs</td><td class=\\"dayname\\">Ons</td><td class=\\"dayname\\">Tors</td><td class=\\"dayname\\">Fre</td><td class=\\"dayname\\">Lør</td><td class=\\"dayname\\">Søn</td>
</tr>
<tr>
";
for($i = 1; $i <= $startday - 1; $i++)
{
echo "<td> </td>";
}
for($day = 1; $day <= $daysinmonth; $day++)
{
if(($day + $startday - 2) % 7 == 0)
{
echo "</tr><tr>";
}
$zeroday = sprintf('%02d',$day);
$unixtid = mktime(0, 0, 0, $month, $zeroday, $year);
echo "<td class=\\"linkday\\"><p align=\\"center\\"><a class=\\"daylink\\" href=\\"index08.php?unix=$unixtid\\"><span style=\\"text-decoration: none\\">$day</a></p></font></td>";
}
}
if (isset($_GET['date']))
{
$thisyear = substr($_GET['date'],0,4);
$thismonth = substr($_GET['date'],4,2);
}
else
{
$thisyear = 0;
$thismonth = 0;
}
show_calendar($thisyear,$thismonth);
?>