<style>
테이블{배경:#99ffcc;}
th{font-family:隶书;color:#0099ff;}
#tr1{배경:#00ccff;}
.td1{color:blue ;}
a{color:#ff9900;}
</style>
<?php
// error_reporting(E_ALL & ~E_NOTICE);
$mon = date("m");
$연도 = 날짜("Y");
$연도 = isset($_GET['y'])?$_GET['y']:$연도;
echo $_GET['y'];
echo $year;
$mon = isset($_GET['m'])?$_GET['m']:$mon;
$day = 날짜("t",mktime(0,0,0 ,$mon,1,$year));
$w = date("w",mktime(0,0,0,$mon,1,$year));
echo " <div align='center'><table border=0>";
echo "<h3><div>{$year}年{$mon}月</div></h3>";
echo "<tr>";
echo "<th class='td1'>日</th>";
echo "<th class=' td1'>一</th>";
echo "<th class='td1'>이</th>";
echo "<th class='td1'>三< ;/th>";
echo "<th class='td1'>4</th>";
echo "<th class='td1'>五</th>";
echo "<th class='td1'>六</th>";
echo "</tr>";
$d = 1;
while($d<=$day ){
echo "<tr>";
for ($i=1;$i<=7;$i++){
if(($d<=$day) && ($w<$i || $d!=1)){
echo "<th><a href='#'>{$d}</a></th>";
$d++;
}else{
echo "<일> </th>";
}
}
echo "</tr>";
}
$prem = $nextm = $mon;
$prey = $nexty = $ 연도;
if ($mon<=1){
$prem = 12;
$prey--;
}else {
$prem--;
}
if ($mon>= 12){
$nextm = 1;
$nexty++;
}else {
$nextm++;
}
$prey = $연도 - 1;
$nexty = $연도 + 1;
echo "<tr>";
echo "<td colspan=7 align='center'>";
echo "<a href='index.php?y={$prey}'> <<</a>";
echo "{$year}年";
echo "<a href='index.php?y={$nexty}'>>>< ;/a>";
echo " ";
echo "<a href='index.php?m={$prem}'><</a>";
echo "{$ mon}월";
echo "<a href='index.php?m={$nextm}'>></a>";
echo "</td>";
echo "</tr>";
echo "</table></div>";