%'//*************************************************************************************%>
<%'//*************************************************************************************%>
<%
Dim sql, table, idx_field, oreder_filed, Query_Fields, search_str, search_str2, Query_OrderBy
Dim ct_idx, ct_code, ct_name, ct_ref, ct_depth, ct_chk, ct_wdate, ct_codeno, ct_url
'//쓰기권한체크*************************************************************************************
if is_write <> "Y" Then
back_back "쓰기권한이 없습니다."
End if
'//**************************************************************************************************
'//파라미터정보 *************************************************************************************
ct_idx = Inputvalue(request("ct_idx"))
'//용도 : 등록/수정시 현재 상위pk(idx)값, 현재단계
If ct_idx = "" then '//없으면 1단계
ct_ref = "0"
ct_depth = "1"
ct_codeno_ref = "C0;"
Else
sql = "select ct_depth,ct_codeno from member_div where ct_idx=" & ct_idx '//상위idx값을 구한당
Set rs_2 = dbcon.execute( sql )
ref_depth = rs_2("ct_depth")
ref_codeno = rs_2("ct_codeno")
ct_ref = ct_idx
ct_depth = ref_depth + 1 '//상위단계 + 1
ct_codeno_ref = ref_codeno
Set rs_2 = nothing
End if
'//echo "
현재단계 : " . $ct_depth . "단계";
'//쓰기권한체크*************************************************************************************
if CInt( ct_depth ) > CInt( max_depth_option ) then
back_back "최대 " & max_depth_option & " 단계 까지 가능합니다.."
End if
'//**************************************************************************************************
'//테이블 기본 환경설정 ********************************************************************************
table = "member_div" '//테이블명
idx_field = "ct_idx" '//기본키
oreder_filed = "ct_code ASC" '//정렬기준 필드
Query_Fields = "ct_idx, ct_code, ct_name, ct_ref, ct_depth, ct_chk, ct_wdate, ct_codeno, ct_url" '//불러올 필드
'//****************************************************************************************************
'//---------------조합 쿼리문------------------------------------
If v_keyword <> "" then
search_str = " AND " & v_search & " like '%" & v_keyword & "%'"
End if
If ct_idx <> "" then
search_str2 = " AND ct_ref = '" & ct_idx & "'"
else
search_str2 = " AND ct_ref = '0'"
End if
Query_OrderBy = " ORDER BY " & oreder_filed
'//---------------------------------------------------------------
'//-----------------------------리스트 출력 쿼리문 생성-----------------------------
sql = "select " & Query_Fields & " from " & table & " WHERE ct_idx <> '0'"
sql = sql & search_str & search_str2 & Query_OrderBy
'response.write sql
Set col = dbcon.execute( sql )
If col.bof Or col.eof Then
list_data = null
Else
list_data = col.getrows
End if
Set col = nothing
'//---------------------------------------------------------------------------------
%>