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

· 12년 전 · 1184 · 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,893
12년 전 조회 1,009
12년 전 조회 1,975
12년 전 조회 1,681
12년 전 조회 3,039
12년 전 조회 1,550
12년 전 조회 3,959
12년 전 조회 901
12년 전 조회 1,895
12년 전 조회 1,185
12년 전 조회 842
12년 전 조회 831
12년 전 조회 1,353
13년 전 조회 1,515
13년 전 조회 1,015
13년 전 조회 1,731
13년 전 조회 1,034
13년 전 조회 910
13년 전 조회 1,587
13년 전 조회 1,570