<!-- #include virtual="/manager/common/file/other_top.asp" -->
<script type="text/javascript" src="/common/js/04banner.js"></script>

<!-- 권한 체크 -->
<!-- #include file="config.asp" -->
<%


' 테이블 기본 환경설정 ********************************************************************************

table			= "banner"			' 테이블명
idx_field		= "b_l_num"			' 기본키
Query_OrderBy	= "b_l_code ASC"	' 정렬기준 필드
Query_Fields	= "b_l_num, info_url, b_l_code, b_l_img, b_l_url, b_l_chk, b_l_sdate, b_l_edate, b_l_subject, b_l_memo, b_l_wdate, b_l_mdate"				' 불러올 필드

' ****************************************************************************************************

v_keyword = request("v_keyword")
v_search = request("v_search")

' 검색어가 있다면
if v_keyword <> "" and v_search <> "" then
	search_str = " AND "&v_search&" like '%"& replace(v_keyword,"'","''")&"%'"
End if

' -----------------------------리스트 출력 쿼리문 생성-----------------------------
sql = "select "&Query_Fields&" from "&table&" WHERE "&idx_field&" <> '0'"
sql = sql & search_str &" ORDER BY " & Query_OrderBy
Set Rs = Dbcon.Execute (sql)
If rs.eof Then
	vCnt = -1
Else
	vData = rs.getrows()
	vCnt = UBound(vData,2)
End If
rs.close : Set rs = 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_ic06.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="/manager/content/04popup/list.asp/" tabindex="<%=getTabIndex()%>">부가기능</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="space"></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="b_l_subject" <%if v_search = "b_l_subject" Then response.write "selected='selected'" End if %>>제목</option>
								<option value="b_l_url" <%if v_search = "b_l_url" Then response.write "selected='selected'" End If %>>연결주소</option>
							</select></li>
							<li><input type="text" size="62" 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><%=vCnt+1%></strong>개
					</div>


				<form id= "frm_list" action=""  method='post'>
					<div>
						<input type="hidden" name="status" />
						<input type="hidden" name="b_l_chk" />
						<input type="hidden" name="b_l_num" />

						<input type="hidden" id="chk_all" name="chk_all" />
						
					</div>


					<div class="list_count">
						<!-- 전체 <strong>14</strong>개 (페이지 <strong class="orange">1</strong>/2) -->
					</div>


				

					<fieldset>
						<legend>회원관리 수정/삭제/보기</legend>
						<table cellspacing="0" class="bbs_<%=skin%>" summary="사이트의 회원을 관리합니다.">
						<caption>회원관리 서식</caption>
						<colgroup>
						<col width="40" />
						<col width="50" />
						<col />
						<col width="150" />
						<col width="80" />
						<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>
						</tr>
						</thead>

						<tbody>
						


						<%
							
							If vCnt >- 1 Then

								zz = 1
								For i=0 To vCnt 

									Call arr2Value(Query_Fields, "vData", i)

									If b_l_chk = "Y" then
										b_l_chk_str = "<strong>사용</strong>"
									ElseIf b_l_chk = "N" then
										b_l_chk_str = "중지"
									End if
						%>

						<tr>
							<td scope="row" class="center"><input type="checkbox" name="chk" value="<%=b_l_num%>" title="해당 배너 선택" tabindex="<%=getTabIndex()%>" /></td>
							<td scope="row" class="center"><a href="move.asp?move=up&amp;b_l_num=<%=b_l_num%>&amp;b_l_code=<%=b_l_code%>" title="순서 위로 이동" tabindex="<%=getTabIndex()%>"><img src="/manager/img/ic_up.gif" width="10" height="9" alt="순서 위로 이동" /></a><a href="move.asp?move=down&amp;b_l_num=<%=b_l_num%>&amp;b_l_code=<%=b_l_code%>" title="순서 아래로 이동" tabindex="<%=getTabIndex()%>"><img src="/manager/img/ic_down.gif" width="10" height="9" alt="순서 아래로 이동" /></a></td>
							<td scope="row" class="center">
								<a href="javascript:page_go2('http://<%=b_l_url%>');" tabindex="<%=getTabIndex()%>">
								<img src = "/data/banner/<%=b_l_img%>" alt="<%=b_l_subject%>" />
								<br/><%=b_l_subject%>
								</a>
							</td>
							<td scope="row" class="center"><span class="orange"><%=b_l_sdate%> ~ <%=b_l_edate%></span></td>
							<td scope="row" class="center"><%=b_l_chk_str%></td>
							<td scope="row" class="center"><input type="button" value="수정" class="ct_bt01" onclick="dialog_open('배너수정', 'write_ui.asp?b_l_num=<%=b_l_num%>', '');" tabindex="<%=getTabIndex()%>"/></td>
							<td scope="row" class="center"><input type="button" value="삭제" class="ct_bt01" onclick="d_chk('delete_ok.asp?b_l_num=<%=b_l_num%>&amp;<%=page_info%>');" tabindex="<%=getTabIndex()%>"/></td>
						</tr>
						<%		
									zz = zz + 1
								next
						
							
							else
						%>
						
						<tr>
							<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>
							<td scope="row" class="center"></td>
						</tr>
						<% 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"><span class="gray">|</span> &nbsp;선택한 배너를 
								<select id="tot_m_level" name="tot_level_chk" title="선택한 배너 사용여부 선택" tabindex="<%=getTabIndex()%>">
									<option value="Y" selected="selected">사용</option>
									<option value="N">중지</option>
								</select>으로
						</li>
						<li class="pt7 pl2"><div class="bt01"><a href="javascript:tot_levelchage('<%=page_info%>');" tabindex="<%=getTabIndex()%>"><span>변경</span></a></div></li>
						</ul>
					</div>


				</form>

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

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

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