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

· 12년 전 · 1141 · 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"));}
감사합니다.

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기
🐛 버그신고