<!-- #include virtual ="/manager/common/file/board_top.asp"-->
<%'//*************************************************************************************%>
<script type="text/javascript" src="/common/js/02board.js"></script>
<%'//*************************************************************************************%>
<!-- #include file ="config.asp"-->
<%
Dim table, idx_field, orderby_str, Query_Fields
'//*****************테이블 기본 환경설정*******************
table			= "board_config"		'//테이블명
idx_field		= "a_num"				'//기본키

'orderby_str		= " ORDER BY a_date desc"		'//정렬기준 필드
orderby_str		= " ORDER BY a_bbsname ASC"		'//정렬기준 필드

Query_Fields	= "a_num, a_bbsname, a_level, a_type, a_tablename, a_imgline, a_imgwidth, a_imgheight, a_member, a_ad_cms_id, a_ad_cms, a_cate, a_email, a_phone, a_home, a_jumin, a_jumin_opt, a_ftemp1, a_ftemp1_str, a_ftemp2, a_ftemp2_str, a_ftemp3, a_ftemp3_str, a_ftemp4, a_ftemp4_str, a_new, a_upload, a_upload_len, a_nofilesize, a_nofile, a_reply, a_replyOpt, a_command, a_date_list, a_sdate, a_edate, a_noword, a_width, a_displaysu, a_viewType, a_lt_a, a_lt_b, a_lt_c, a_lt_e, a_lt_f, a_header, a_hd_file, a_detail, a_dt_file, a_writecontent, a_topinclude, a_btminclude, a_skin, a_date"	'//불러올 필드

'//*******************************************************

'//검색어가 잇따면
If v_keyword <> "" then
	search_str = " AND " & v_search & " like '%" & v_keyword & "%'"
End if

'/*추가 검색옵션
'If g_idx <> "" then
'	search_str2 = " AND ph_code = '" & g_idx & "'"
'End if
'*/

sql_t = "SELECT " & Query_Fields & " FROM " & table & " WHERE a_num <> 0"
sql_t = sql_t & search_str & search_str2
sql_t = sql_t & orderby_str

'response.write sql_t
'response.end
Set col = dbcon.execute( sql_t )

If col.bof Or col.eof Then
	list_data = Null
	totalcount = 0
Else
	list_data = col.getrows
	totalcount = UBound(list_data, 2)+1
End if

Set col = Nothing

'/////////////////////////////////////////////////////////////////
%>
<!-- 등록/수정UI -->
<div id="dialog" style="text-align:center;vertical-align:middle;">
	<p id="dialogContent"></p>
</div>
		<!-- 내용영역 -->
		<div id="contents">

			<div id="contents_head"> 
				<div id="contents_title">
					<img src="/manager/img/tit_ic01.gif" width="22" height="21" class="<%=skin%> center" alt="" /> <h1><span>게시판 리스트</span></h1>
				</div>
				<div id="location">
					<a href="/manager/" tabindex="<%=getTabIndex()%>">Home</a> &gt; <a href="list.asp" tabindex="<%=getTabIndex()%>">게시판관리</a> &gt; <a href="list.asp" class="now" tabindex="<%=getTabIndex()%>">게시판 리스트</a>
				</div>
			</div>

			<!-- 내용들어가는곳 -->
			<div id="contents_area">

				

					<h2 class="<%=skin%>">등록된 게시판 리스트</h2>


					<div class="write_info">

						<div class="write_form pt7">
							<form id="frm_sch" action="list.asp"  method="post">

							<ul>
							<li class="search"><label for="p_search">게시판검색</label> :</li>
							<li><select id="p_search" name="p_search" title="검색형태 선택" tabindex="<%=getTabIndex()%>">
								<option value="a_bbsname" <%=chkSelect(v_search, "a_bbsname")%>>게시판명</option>
								<option value="a_tablename" <%=chkSelect(v_search, "a_tablename")%>>테이블명</option>
								<option value="a_num" <%=chkSelect(v_search, "a_num")%>>일련번호</option>
							</select></li>
							<li><input type="text" size="60" title="검색어를 입력하세요" id="p_keyword" name="p_keyword" class="input_box input" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=v_keyword%>" tabindex="<%=getTabIndex()%>" /></li>
							<li><div id="<%=skin%>_bt"><span class="button"><input type="submit" value="검색" tabindex="<%=getTabIndex()%>"/></span></div></li>
							<li><div id="w01_bt"><span class="button"><input type="button" value="전체보기" onclick="page_go1('list.asp');" tabindex="<%=getTabIndex()%>"/></span></div></li>
							</ul>

							</form>
						</div>

					</div>


					<div class="list_count" style="height:20px">
						<div id="<%=skin%>_bt" class="list_left">
							<span class="button"><input type="button" value="게시판신규생성" onclick="dialog_open('게시판신규생성', 'write_ui.asp', '');" /></span>
						</div>
						전체 <strong><%=totalcount%></strong>개 <!-- (페이지 <strong class="orange">1</strong>/2) -->
					</div>

				<form id= "frm_list" action=""  method='post' >

					<div>
						<input type="hidden" name="status" /> <!-- 다중삭제할때 사용 -->
						<input type="hidden" id="chk_all" name="chk_all" /> <!-- 전체선택해제 사용 -->
					</div>

					<fieldset>
						<legend>코드관리 작성/수정</legend>
						<table cellspacing="0" class="bbs_<%=skin%>" summary="사이트에 사용하는 코드를 관리합니다.">
						<caption>코드관리 서식</caption>
						<colgroup>
						<col width="40" />
						<col />
						<col width="60" />
						<col width="50" />
						<col width="70" />
						<col width="50" />
						<col width="50" />
						<col width="50" />
						</colgroup>

						<thead>
						<tr>
							<th scope="col">선택</th>
							<th scope="col">게시판명</th>
							<th scope="col">테이블명</th>
							<th scope="col">파일</th>
							<th scope="col">전체/오늘</th>
							<th scope="col">수정</th>
							<th scope="col">삭제</th>
							<th scope="col">분류</th>
						</tr>
						</thead>

						

						<tbody>
						<%

						If IsNull( list_data ) Then
%>
						<tr>
							<td scope="row" class="center"></td>
							<td scope="row" class="left bold"></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
						</tr>
<%
						Else
						
							For i = 0 To UBound(list_data, 2)
								Call arr2Value(Query_Fields, "list_data", i)



								' 관리하는 사이트 인지 확인 -------------
								flag_view = false
								If SESSION("ss_g_num") = 1 Then
									flag_view = true
								Else
									
									is_ad_cms = ""
									sql = "select * from board_access  where g_num=" & SESSION("ss_g_num") & " and a_num=" & a_num
									Set rs_lev = dbcon.execute( sql )
									If Not rs_lev.eof Then
										is_ad_cms	= rs_lev("Bl_ad_cms")
									End If
									rs_lev.close : Set rs_lev = Nothing

									If is_ad_cms="Y" Then
										flag_view = true
									Else

										a_ad_cms_id = "|"&Replace(a_ad_cms_id,",","|,|")&"|"

										If InStr(a_ad_cms_id,"|"&SESSION("ss_m_id")&"|")>0 Then
											flag_view = True										
										End if
									End if
								End If
								' 관리하는 사이트 인지 확인 -------------




								If flag_view then

								
								if a_upload = "Y" then
									a_upload_str = "<img src='/manager/img/file_ic.gif' width='16' height='16' alt='파일업로드 기능 사용' title='파일업로드 기능 사용' />"
								else
									a_upload_str = ""
								End if

								sql = "select count(b_num) as b_num from " & a_tablename
								Set rsc1 = dbcon.execute( sql )
								tot_count = rsc1("b_num")
								Set rsc1 = nothing

								sql = "select count(b_num) as b_num from " & a_tablename & " where left(b_regdate,10) = '" & Date() & "'"
								Set rsc2 = dbcon.execute( sql )
								today_cnt = rsc2("b_num")

								sql = "alter table " & a_tablename
								sql = sql & " alter column b_file5 varchar(300) null"
								dbcon.execute sql

						%>
						<tr>
							<td scope="row" class="center"><input type="checkbox" name="chk" value="<%=a_num%>" title="해당 게시판 선택" tabindex="<%=getTabIndex()%>" /></td>
							<td scope="row" class="left bold"><a href="javascript:void(window.open('/content/board/list.asp?a_num=<%=a_num%>'));" tabindex="<%=getTabIndex()%>"><%=a_bbsname%></a></td>
							<td scope="row" class="center"><%=a_tablename%><br/><%=a_level%><br/><%=a_num%></td>
							<td scope="row" class="center"><%=a_upload_str%></td>
							<td scope="row" class="center"><%=tot_count%>/<%=today_cnt%></td>
							<td scope="row" class="center"><input type="button" value="수정" class="ct_bt01" onclick="dialog_open('게시판수정', 'write_ui.asp?a_num=<%=a_num%>','');" tabindex="<%=getTabIndex()%>"/></td>
							<td scope="row" class="center"><input type="button" value="삭제" class="ct_bt01" onclick="return d_chk('delete_ok.asp?a_num=<%=a_num%>');" tabindex="<%=getTabIndex()%>"/></td>
							<td scope="row" class="center">
								<% If a_cate = "Y" then%>
								<input type="button" value="보기" class="ct_bt01" onclick="dialogFrame_open('게시판분류관리', '/manager/content/02board_code/write_ui.asp?a_num=<%=a_num%>', '');" tabindex="<%=getTabIndex()%>"/>
								<% End if%>
							</td>
						</tr>
						<%		

								End If
								



							Next
							
						End if
						%>


						</tbody>
						</table>
					</fieldset>

					<div class="contoll_box2">
						<ul>
						<li><img src="/manager/img/line01.gif" width="36" height="21" alt="" /></li>
						<li class="pt7"><div class="bt01"><a href="javascript:checkAll();" tabindex="<%=getTabIndex()%>"><span>전체 선택/해제</span></a></div><div class="bt01"><a href="javascript:delete2();" tabindex="<%=getTabIndex()%>"><span>선택 게시판삭제</span></a></div></li>
						<li class="pt7 pl4"></li>
						</ul>
					</div>


				</form>

			</div>
			<!-- 내용들어가는곳 -->

		</div>
		<!-- //내용영역 -->

<!--#include virtual = "/manager/common/file/sub_bottom.asp"-->
