조회 검색부분 날짜 설정.. ^^

· 12년 전 · 1180 · 2
조회부분이 1년정도로 기본 검색되게 하고 싶습니다. (현재는 당일 날짜만 표시되서 불편해서요)
현재는 주문날짜 : 20130310 ~ 20130310 검색 이런식으로 나오거든요.
근데 이걸 주문날짜 : 20120310 ~ 20130310 검색 이렇게 바꾸고 싶습니다.
아래는 소스입니다.
$tmp_startDate = substr($startDate,0,4)."-".substr($startDate,4,2)."-".substr($startDate,6,2);
이부분을 고쳐야 적용될것 같은데 좀 알려주세요.


<?
if(!$startDate || $startDate == ""){$startDate = date("Ymd");}
if(!$endDate || $endDate == ""){$endDate = date("Ymd");}

$tmp_startDate = substr($startDate,0,4)."-".substr($startDate,4,2)."-".substr($startDate,6,2);
$tmp_endDate = substr($endDate,0,4)."-".substr($endDate,4,2)."-".substr($endDate,6,2);

$beTween = " and (buy_datetime >= '".$tmp_startDate." 00:00:00' and buy_datetime <= '".$tmp_endDate." 23:59:59') ";
?>

주문날짜 :
<input type="text" class="ed" style="width:65px" name="startDate" readonly value="<?=$startDate?>" id="mb_start" onclick="win_calendar('mb_start', document.getElementById('mb_start').value, '');">
|

댓글 2개

<?
if(!$startDate || $startDate == ""){$startDate = date("Ymd",strtotime("-1 year"));}
감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12년 전 조회 2,892
12년 전 조회 1,005
12년 전 조회 1,968
12년 전 조회 1,678
12년 전 조회 3,036
12년 전 조회 1,548
12년 전 조회 3,956
12년 전 조회 901
12년 전 조회 1,893
12년 전 조회 1,181
12년 전 조회 840
12년 전 조회 827
12년 전 조회 1,351
12년 전 조회 1,515
12년 전 조회 1,009
12년 전 조회 1,730
12년 전 조회 1,031
12년 전 조회 906
12년 전 조회 1,585
12년 전 조회 1,566