예약을 3일후에 신청 할수 있게 바꾸고 싶습니다. 채택완료
신청되는 날짜가 현재날짜 기준으로 다음날부터 신청이 가능한데요..
이 신청할수 있는 날짜를 현재기준으로 내일이 아닌 3일후 신청으로 수정하고 싶습니다.
도와주세요~
//////// 현재 소스 //////////////
if(!$year) $year=date('Y'); if(!$month) $month=date('n');
if($month==1) { $year1 = $year-1; $month1 = 12; } else { $year1 = $year; $month1 = $month-1; } if($month==12) { $year2 = $year+1; $month2 = 1; } else { $year2 = $year; $month2 = $month+1; } $s_date = date('Y-m-d',strtotime("$year-$month-01")); $e_date = date('Y-m-t',strtotime("$year-$month-01"));
// 휴무일 설정 달력 표기 $holidata = array(); $hque = "SELECT * from dj_holiday where hd_date>='$s_date' and hd_date<='$e_date' and hd_type=2"; $hsql = sql_query($hque); while($hrow = sql_fetch_array($hsql)) { $holidata[date('j',strtotime($hrow['hd_date']))] = $hrow['hd_name']; }
$data = array();
$que = "SELECT * from dj_space_request where sr_date>='$s_date' and sr_date<='$e_date' order by sr_date, sr_hour1, sr_hour2, sr_space";
$sql = sql_query($que);
while($row = sql_fetch_array($sql)) {
$data[date('j',strtotime($row['sr_date']))] .= '
//이름에 별표 추가 function name_to_star($name){ if(!trim($name)) return ''; $length = mb_strlen($name); $first = mb_substr($name, 0, 1); $tails = mb_substr($name, 2, $length-2); return $first.'*'.$tails; } //전화번호에 뒷자리만 추출 function get_last_num($ph){ if(!trim($ph)) return ''; $arr = explode('-', $ph); if(count($arr) < 1) return ''; $phone = $arr[count($arr)-1]; $first = substr($phone, 0, 1); $tails = substr($phone, 2, strlen($phone)-2); return '('.$first.'*'.$tails.')'; }
/*function plus_day($day) { return mktime(0,0,0,date("m"),date("d")+$day,date("Y")); }*/ ?>
- 하단 공간안내 내용을 꼭 숙지하시고, 대관신청을 해주시기 바랍니다.
- 행사명에 공간 사용 내용을 자세히 적어 주세요(행사명, 스터디 내용, 세미나명, 모임 주제 등)
대관 신청
- 승인대기 상태
- 승인완료 상태
- 승인취소 상태
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| '.$day1.' | '; $day1++; }||||||
echo $i?> echo $holidata[$i] ?>
|
} ?>
$week2 = date('w',strtotime("$year2-$month2-01"));
if($week2>0) {
$day2 = 1;
for($i=$week2; $i<7; $i++) {
echo ''.$day2.' | '; $day2++; } } ?>
답변 2개
이걸 한번 참고해 보세요~
if(!$year) $year=date('Y'); if(!$month) $month=date('n');
if($month==1) { $year1 = $year-1; $month1 = 12; } else { $year1 = $year; $month1 = $month-1; } if($month==12) { $year2 = $year+1; $month2 = 1; } else { $year2 = $year; $month2 = $month+1; } $s_date = date('Y-m-d',strtotime("$year-$month-01")); $e_date = date('Y-m-t',strtotime("$year-$month-01"));
// 휴무일 설정 달력 표기 $holidata = array(); $hque = "SELECT * from dj_holiday where hd_date>='$s_date' and hd_date<='$e_date' and hd_type=2"; $hsql = sql_query($hque); while($hrow = sql_fetch_array($hsql)) { $holidata[date('j',strtotime($hrow['hd_date']))] = $hrow['hd_name']; }
$data = array();
$que = "SELECT * from dj_space_request where sr_date>='$s_date' and sr_date<='$e_date' order by sr_date, sr_hour1, sr_hour2, sr_space";
$sql = sql_query($que);
while($row = sql_fetch_array($sql)) {
$data[date('j',strtotime($row['sr_date']))] .= '
//이름에 별표 추가 function name_to_star($name){ if(!trim($name)) return ''; $length = mb_strlen($name); $first = mb_substr($name, 0, 1); $tails = mb_substr($name, 2, $length-2); return $first.'*'.$tails; } //전화번호에 뒷자리만 추출 function get_last_num($ph){ if(!trim($ph)) return ''; $arr = explode('-', $ph); if(count($arr) < 1) return ''; $phone = $arr[count($arr)-1]; $first = substr($phone, 0, 1); $tails = substr($phone, 2, strlen($phone)-2); return '('.$first.'*'.$tails.')'; }
// 현재 날짜로부터 3일 후의 날짜 계산 $next_available_date = date('Y-m-d', strtotime('+3 days'));
// 신청 가능한 날짜를 3일 후로 변경 $s_date = $next_available_date; $e_date = date('Y-m-t', strtotime($next_available_date));
?>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인