게시판관리 그룹아이디 자동입력 기능 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

게시판관리 그룹아이디 자동입력 기능 정보

게시판관리 그룹아이디 자동입력 기능

본문

게시판관리에서 검색시 셀렉트 박스 그룹 아이디 선택시 그룹아이디가 기억안날때가 많은대요..
그부분을 셀렉트 박스로 처리하여 선택시 자동 입력 할수있게 바꿔봤습니다.

adm/board_list.php 파일

html 부분

<!-- 수정전 -->
<form name=fsearch method=get>
<tr>
    <td width=50% align=left><?=$listall?> (게시판수 : <?=number_format($total_count)?>개)</td>
    <td width=50% align=right>
        <select name=sfl>
            <option value='bo_table'>TABLE</option>
            <option value='bo_subject'>제목</option>
            <option value='a.gr_id'>그룹ID</option>
        </select>
        <input type=text name=stx required itemname='검색어' value='<?=$stx?>'>
        <input type=image src='<?=$g4[admin_path]?>/img/btn_search.gif' align=absmiddle></td>
</tr>
</form>

<!-- 수정후 -->
<form name=fsearch method=get>
<tr>
    <td width=50% align=left><?=$listall?> (게시판수 : <?=number_format($total_count)?>개)</td>
    <td width=50% align=right>
        <select name=sfl onchange="gr_select_visibility(this.value);">
            <option value='bo_table'>TABLE</option>
            <option value='bo_subject'>제목</option>
            <option value='a.gr_id'>그룹ID</option>
        </select>
  <?=get_group_select("sca",$sca," id=\"sca\" onchange=\"gr_input_get(this.value);\"");?>
        <input type=text id=stx name=stx required itemname='검색어' value='<?=$stx?>'>
        <input type=image src='<?=$g4[admin_path]?>/img/btn_search.gif' align=absmiddle></td>
</tr>
</form>




하단 scr<!- XSS Filter -->ipt 부분

// 수정전

function board_copy(bo_table) {
    window.open("./board_copy.php?bo_table="+bo_table, "BoardCopy", "left=10,top=10,width=500,height=200");
}

// 수정후

if(document.getElementById('sfl').value != "a.gr_id"){
 document.getElementById('sca').disabled = "disabled";
}
function gr_select_visibility(v){
 if(v == "a.gr_id"){
  document.getElementById('sca').disabled = "";
  document.getElementById('stx').value = document.getElementById('sca').options[0].value;
  document.getElementById('sca').options[0].selected = true;
 }else{
  document.getElementById('sca').disabled = "disabled";
  document.getElementById('stx').value = "";
 }
}
function gr_input_get(v){
 document.getElementById('stx').value = v;
}
function board_copy(bo_table) {
    window.open("./board_copy.php?bo_table="+bo_table, "BoardCopy", "left=10,top=10,width=500,height=200");
}

추천
0

댓글 1개

전체 15 |RSS
그누4 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT