$output = ''; if($_GET["month"] == '' && $_GET["year"] == '') { $time = time(); $month = date('n',$time); $year = date('Y',$time); } else { $month=$_GET["month"]; $year=$_GET["year"]; } $date = getdate(mktime(0,0,0,$month,1,$year)); $today = getdate(); $hours = $today["hours"]; $mins = $today["minutes"]; $secs = $today["seconds"]; if(strlen($hours)<2) $hours="0".$hours; if(strlen($mins)<2) $mins="0".$mins; if(strlen($secs)<2) $secs="0".$secs; $days=date("t",mktime(0,0,0,$month,1,$year)); $start = $date["wday"]+1; echo $start."start--"; $name = $date["month"]; $year2 = $date["year"]; $offset = $days + $start - 1; if($month==12) { $next=1; $nexty=$year + 1; } else { $next=$month + 1; $nexty=$year; } if($month==1) { $prev=12; $prevy=$year - 1; } else { $prev=$month - 1; $prevy=$year; } if($offset <= 28) $weeks=28; elseif($offset > 35) $weeks = 42; else $weeks = 35; $output = "