밤

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

· 2013-03-10 (일) 09:48:02 · 1258 · 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 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
13-03-11 조회 1,815
13-03-11 조회 1,141
13-03-11 조회 1,294
13-03-11 조회 1,282
13-03-11 조회 1,033
13-03-11 조회 920
13-03-11 조회 889
13-03-11 조회 1,616
13-03-11 조회 2,973
13-03-11 조회 1,085
13-03-11 조회 2,036
13-03-10 조회 1,758
13-03-10 조회 3,117
13-03-10 조회 1,634
13-03-10 조회 4,049
13-03-10 조회 970
13-03-10 조회 1,960
13-03-10 조회 1,259
13-03-10 조회 914
13-03-10 조회 894