rendered paste body<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title></title><script type="text/javascript" src="cal.js"></script><style type="text/css"><!-- div#calendar { position:absolute; top:120px; left:250px; background-color:#f7f7f7; border:1px blue solid; border-top:5px blue solid; padding:10px; } div#disable { position:absolute; display:none; background:url(disabled_bg.gif) top left repeat; background-color:red; width:1024px; height:768px; z-index:1; } div#input_prompt { display:none; position:absolute; width:350px; height:300px; border:1px blue solid; background-color:#a9a9e8; z-index:2; } .blank { background-color:#CCE0FF; color:blue; border:1px blue solid; border-top:none; text-align:left; } .dn { background-color:blue; color:white; height:20px; } .dy { background-color:white; color:blue; border:1px blue solid; border-top:none; text-align:left; } .over { background-color:#99B8FF; border:1px blue solid; border-top:none; text-align:left; cursor:default; } .out { background-color:white; color:blue; border:1px blue solid; border-top:none; text-align:left; } td { width:50px; height:50px; font-size:xx-large font-family:tahoma; font-weight:bold; padding-left:25px; } td.title { text-align:center; font-weight:bold; font-size:xx-large; padding-left: 5px; height:20px; } table#cal { padding:0px; margin:0; } .left { text-align:left; padding:0px; } .right { text-align:right; }--></style></head><body><? if($_GET['m'] && $_GET['y']){ $m = $_GET['m']; $y = $_GET['y']; $total = date("t",mktime(0,0,0,$m,1,$y)); } else { $total = date("t",mktime(0,0,0,date("m",time()),1,date("Y",time()))); $m = date("m",time()); $y = date("Y",time()); } $sd=1; $dc=0; if($_GET['m'] && $_GET['y']){ $m = $_GET['m']; $y = $_GET['y']; $fd = date("D",mktime(0,0,0,$m,1,$y)); } else { $fd = date("D",mktime(0,0,0,date("m",time()),1,date("Y",time()))); $m = date("m",time()); $y = date("Y",time()); } $cm = mktime(0,0,0,$m,1,$y); $prev = mktime(0,0,0,$m-1,1,$y); $prev_m = date("m",$prev); $prev_y = date("Y",$prev); $next = mktime(0,0,0,$m+1,1,$y); $next_m = date("m",$next); $next_y = date("Y",$next); $cnt=1;?><div id="disable"><div id="calendar"><table id="cal" cellspacing="0" cellpadding="0"><tr><td colspan="7" class="title"><? echo date("F Y",$cm); ?></td></tr><tr><td class="dn">Sun</td><td class="dn">Mon</td><td class="dn">Tue</td><td class="dn">Wed</td><td class="dn">Thu</td><td class="dn">Fri</td><td class="dn">Sat</td></tr><tr><?php $days = array("Sun"=>1,"Mon"=>2,"Tue"=>3,"Wed"=>4,"Thu"=>5,"Fri"=>6,"Sat"=>7); $begin = $days[$fd]; for($i=1;$i<=$begin; $i++) { ++$dc; echo ($i==$begin) ? "<td class=\"dy\" onmouseover=\"this.setAttribute('class','over');\" onmouseout=\"this.setAttribute('class','out');\">1</td >" : "<td class=\"blank\"> </td >"; } while($dc<=6) { ++$dc; ++$sd; echo "<td class=\"dy\" onmouseover=\"this.setAttribute('class','over');\" onmouseout=\"this.setAttribute('class','out');\">".$sd."</td >"; } $tl = $total - $sd; $tr = ceil($tl/7); echo "</tr>\n<tr>"; for($i=1;$i<=$tr; $i++){ $dc=0; ++$cnt; for($j=1; $j<=7; $j++){ ++$sd; ++$dc; echo ($sd<=$total) ? "<td class=\"dy\" onmouseover=\"this.setAttribute('class','over');\" onmouseout=\"this.setAttribute('class','out');\">".$sd."</td >" : "<td class=\"blank\"> </td >"; } echo ($cnt <= $tr) ? "</tr>\n<tr>" : ""; }?></tr><tr> <td colspan="3" class="left"> <a href="cal.php?m=<? echo $prev_m; ?>&y=<? echo $prev_y; ?>"><< Previous Month</a></td><td colspan="4" class="right"><a href="cal.php?m=<? echo $next_m; ?>&y=<? echo $next_y; ?>"> Next Month >></a> </td ></tr ></table></div></div></body></html>