위토즈님의 캘린더형 스킨 변경 응용해서 사용중인데요
본문
스킨게시판에서 https://sir.kr/g5_skin/13501?sfl=wr_name%2C1&stx=%EC%9C%84%ED%86%A0%EC%A6%88&page=4 이것을 받아 사용중입니다.
너무나도 잘 쓰고 있는 와중에 문제가 생겼는데 해당 스킨에 2022년 이후의 년도는 나오지가 않네요....
http://care-res.com/bbs/board.php?bo_table=reservation&sch_year=2023&sch_month=09
게시판 주소에 년도와 달을 직접 써서 검색하면 맞는 달력이 나오는데
상단에 년월 선택하는 셀렉트박스에는 출력이 안되니 ㅠㅠㅠ
어디서 무엇을 수정해야할까요...
관련있는것 같은 코드만 추려서 글 남겨봅니다.
<?php
$sch_year = clean_xss_tags($_GET['sch_year']);
$sch_year = preg_match("/([0-9]{4})/", $sch_year) ? $sch_year : substr(G5_TIME_YMD,0,4);
$sch_month = clean_xss_tags($_GET['sch_month']);
$sch_month = preg_match("/([0-9]{2})/", $sch_month) ? $sch_month : substr(G5_TIME_YMD,5,2);
$vew_month = $sch_year.'-'.$sch_month;
?>
.
.
.
.
<div class="cal_navi">
<h4><?php echo substr($vew_month, 0, 4)?> 년 <?php echo substr($vew_month, 5, 2)?> 월</h4>
<!-- search -->
<form name="frmSel" method="get" onsubmit="return frmSelChk(this);" action="<?php echo G5_BBS_URL;?>/board.php">
<input type="hidden" name="bo_table" id="bo_table" value="<?php echo $bo_table;?>" />
<fieldset class="search3">
<legend>검색</legend>
<select name="sch_year" style="width:70px;" title="검색 옵션 선택" onchange="this.form.submit();">
<?php
for($i=2017 ; $i<(substr(G5_TIME_YMD, 0, 4)+1) ; $i++) {
if($i==$sch_year) {
echo '<option value="'.$i.'" selected>'.$i.'</option>';
}
else {
echo '<option value="'.$i.'">'.$i.'</option>';
}
}
?>
</select>
<select name="sch_month" style="width:70px;" title="검색 옵션 선택" onchange="this.form.submit();">
<?php
for ($i=1 ; $i<=12 ; $i++) {
if (strlen($i) == "1") {
$tempI = "0".$i;
}
else {
$tempI = $i;
}
if ($tempI==$sch_month) {
echo '<option value="'.$tempI.'" selected>'.$i.'월</option>';
}
else {
echo '<option value="'.$tempI.'">'.$i.'월</option>';
}
}
?>
</select>
</fieldset>
</div>
셀렉드 박스 내에 i=2017로 되어있는 부분을 2021로 수정하니 딱 2021년만 선택 가능할 수 있게 나요네요..
!-->
답변 1
for($i=2017 ; $i<(substr(G5_TIME_YMD, 0, 4)+1) ; $i++) {
이부분에서
(substr(G5_TIME_YMD, 0, 4)+1) -> +1 를 더늘려주시면됩니다
ex ) for($i=2017 ; $i<(substr(G5_TIME_YMD, 0, 4)+100) ; $i++) {
답변을 작성하시기 전에 로그인 해주세요.