달력을 이용하여 날짜 입력 받기 정보
달력을 이용하여 날짜 입력 받기본문
php로 작성된 달력입니다. (다른 곳에 알게됐구요.)
그누보드의 여분필드 wr_1 wr_2 wr_3을 이용하여 년월일을 선택하여 입력받도록 하고 싶은데 잘 안되는군요.
날짜선택 이라는 문구 또는 특정 이미지를 클릭하면 작은 팝업창을 띄워 달력을 출력시키고,
특정 날짜를 선택하면 년=wr_1, 월=wr_2, 일=wr_3에 입력 받도록 하고 싶습니다.
유사한 스킨이나 팁, 질문 게시판 뒤져봐도 없는 듯 합니다.
다른 분들에게도 고급팁이 될 수 있을 것 같습니다.
고수님들 답변 부탁드립니다.
<?
if (!$year) $year = date("Y");
if (!$month) $month = date("m");
if (!$month) $month = date("m");
$month_prev = $month-1;
$month_next = $month+1;
$month_next = $month+1;
if (!$month_prev){
$month_prev=12;
$year--;
$year_gap=1;
}
$month_prev=12;
$year--;
$year_gap=1;
}
echo "
<table bgcolor='#f5f5f5' width=300>
<tr bgcolor='#ffffff'>
<td colspan=7 align=center>
<a href='$PHP_SELF?area=$area&ps_ctid=06010100&year=$year&month=$month_prev'>◀</a>
";
<table bgcolor='#f5f5f5' width=300>
<tr bgcolor='#ffffff'>
<td colspan=7 align=center>
<a href='$PHP_SELF?area=$area&ps_ctid=06010100&year=$year&month=$month_prev'>◀</a>
";
$year = $year + $year_gap ;
echo $year."년 ".$month."월";
if ($month_next==13){
$month_next=1;
$year_next = $year + 1;
}
else $year_next = $year;
$month_next=1;
$year_next = $year + 1;
}
else $year_next = $year;
echo "
<a href='$PHP_SELF?area=$area&ps_ctid=06010100&year=$year_next&month=$month_next'>▶</a>
</td>
</tr>
<tr>
";
<a href='$PHP_SELF?area=$area&ps_ctid=06010100&year=$year_next&month=$month_next'>▶</a>
</td>
</tr>
<tr>
";
$yoil = array("일","월","화","수","목","금","토");
for ($i=0;$i<7;$i++) echo "<td align=center>$yoil[$i]</td>";
echo"
</tr>
<tr bgcolor='#ffffff'>
";
</tr>
<tr bgcolor='#ffffff'>
";
$start = date("w",mktime(0,0,0,$month,1,$year));
$last = date("t",mktime(0,0,0,$month,1,$year));
$last = date("t",mktime(0,0,0,$month,1,$year));
for ($i=00;$i<$start;$i++) echo"<td></td>";
for ($j=1;$j<=$last;$j++){
$i++;
if ($year==date("Y") && $month==date("m") && $j==date("d")) $color="blue";
else if (date("w",mktime(0,0,0,$month,$j,$year))==0) $color="red";
else $color="black";
else if (date("w",mktime(0,0,0,$month,$j,$year))==0) $color="red";
else $color="black";
echo"<td align=center bgcolor=#FDFCF0><a href='$PHP_SELF?year=$year&month=$month&day=$j'><font color=$color>$j</font></a></td>";
if ($i%7==0) echo"</tr><tr bgcolor='#ffffff'>";
}
echo "</tr></table>";
?>
댓글 전체

유사한 스킨이 있었군요. ;;;;;
덕분에 잘 적용했습니다. 감사합니다.
덕분에 잘 적용했습니다. 감사합니다.