게시판 리스트에서 날짜검색 만들기 > 그누보드5 팁자료실

그누보드5 팁자료실

게시판 리스트에서 날짜검색 만들기 정보

게시판 리스트에서 날짜검색 만들기

본문

list.skin.php 상단에 아래 코드를 넣으시면 리스트 상단 오른쪽에

노출이 됩니다.

 

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;

if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
?>

<!-- ////////날짜 검색 시작 { -->

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<script>
  $.datepicker.setDefaults({
    dateFormat: 'yy-mm',
    prevText: '이전 달',
    nextText: '다음 달',
    monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
    monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
    dayNames: ['일', '월', '화', '수', '목', '금', '토'],
    dayNamesShort: ['일', '월', '화', '수', '목', '금', '토'],
    dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
    showMonthAfterYear: true,
    yearSuffix: '년'
  });

     $(function() {
        $("#stx2, #e_Date").datepicker({
            dateFormat: 'yy-mm-dd'
        });
    });

</script>
        <div style="width:<?php echo $width; ?>; text-align:right;">


       <!-- 날짜 검색 시작 { -->

            <form name="fsearch" method="get">
            <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
            <input type="hidden" name="sca" value="<?php echo $sca ?>">
            <input type="hidden" name="sop" value="and">
            <input type="hidden" name="sfl" value="wr_datetime"<?php echo get_selected($sfl, 'wr_datetime'); ?>>
            <i class="fa fa-calendar" aria-hidden="true"></i> <input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx2" class="sch_input" size="25" maxlength="20" placeholder="날짜검색">
            <button type="submit" value="검색" class="sch_btn"><i class="fa fa-search" aria-hidden="true"></i><span class="sound_only">검색</span></button>
            </form>
    <!-- } 날짜검색 끝 -->   

        </div>

 

<!-- 날짜 검색 시작////// { -->

추천
3
  • 복사

댓글 3개

© SIRSOFT
현재 페이지 제일 처음으로