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

<script type="text/javascript" src="/common/js/03member_group.js"></script>

<%

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

table			= "member_group"			' 테이블명
idx_field		= "g_num"		' 기본키
Query_OrderBy	= "g_code ASC"	' 정렬기준 필드
Query_Fields	= "g_num, g_code, g_menuname, g_chk, g_hdsize, g_wdate, g_webmail, g_money, g_myhome, g_cafe, g_blog, g_sms, g_manager"				' 불러올 필드

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

' 검색어가 있다면
if p_keyword <> "" And p_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_ic03.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/03member_group/write.asp" tabindex="<%=getTabIndex()%>">권한관리</a> &gt; <a href="write.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" method="post" action="write_ok.asp" onsubmit="return w_chk();">

							<ul>
							<li class="text"><label for="g_menuname">회원그룹등록</label> :</li>
							<li><input type="text" size="76" title="회원그룹명 입력" id="g_menuname" name="g_menuname" class="input_box input" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value=""  tabindex="<%=getTabIndex()%>"/>
							</li>
							<li><select id="g_chk" name="g_chk" title="회원그룹 사용여부 선택" tabindex="<%=getTabIndex()%>">
								<option value="Y" selected="selected">사용</option>
								<option value="N" >중지</option>
							</select></li>
							<li><div id="<%=skin%>_bt"><span class="button"><input type="submit" value="등록" tabindex="<%=getTabIndex()%>" /></span></div></li>
							</ul>

							</form>
						</div>

					</div>

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

						<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 width="50" />
						<col />
						<col width="70" />
						<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 vCnt>-1 Then

	zz = 1
	For i=0 To vCnt

		Call arr2Value(Query_Fields, "vData", i)

		If g_chk ="Y" then
			g_chk_str = "<strong class='orange'>사용</strong>"
		else
			g_chk_str = "중지"
		End if

		If g_manager ="Y" then
			g_manager_str = "<strong class='orange'>사용</strong>"
		else
			g_manager_str = "중지"
		End if

%>


						<tr>
							<td scope="row" class="center"><%If Not(g_num = "1" or g_num = "2") then%><input type="checkbox" name="chk" value="<%=g_num%>" title="해당 그룹 선택" tabindex="<%=getTabIndex()%>" /><%End if%></td>
							<td scope="row" class="center"><a href="move.asp?move=up&amp;g_num=<%=g_num%>&amp;g_code=<%=g_code%>" title="순서 위로 이동" tabindex="<%=getTabIndex()%>"><img src="/manager/img/ic_up.gif" width="10" height="9" alt="순서 위로 이동" /></a><a href="move.asp?move=down&amp;g_num=<%=g_num%>&amp;g_code=<%=g_code%>" title="순서 아래로 이동" tabindex="<%=getTabIndex()%>"><img src="/manager/img/ic_down.gif" width="10" height="9" alt="순서 아래로 이동" /></a></td>
							<td scope="row" class="center"><input type="text" size="50" title="회원그룹명 수정" id="g_menuname<%=zz%>" name="g_menuname<%=zz%>" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=g_menuname%>" maxlength="50" tabindex="<%=getTabIndex()%>" />
							</td>
							<td scope="row" class="center"><%=g_manager_str%></td>
							<td scope="row" class="center"><%=g_chk_str%></td>
							<td scope="row" class="center">
								<%If g_num <> "1" then%>
								<input type="button" value="권한" class="ct_bt01" onclick="dialog_open('회원그룹/권한설정', 'awrite_ui.asp?g_num=<%=g_num%>', '');" tabindex="<%=getTabIndex()%>" />
								<%End if%>

							</td>
							<td scope="row" class="center"><input type="button" value="수정" class="ct_bt01" onclick="frm_modify<%=zz%>(<%=g_num%>);" tabindex="<%=getTabIndex()%>" />
								<script type="text/javascript">
								<!--
									function frm_modify<%=zz%>(g_num){

										document.getElementById('frm_m').g_menuname.value	= document.getElementById('frm_list').g_menuname<%=zz%>.value;
										//document.getElementById('frm_m').g_chk.value		= document.getElementById('frm_list').g_chk<%=zz%>.value;

										document.getElementById('frm_m').g_num.value		= g_num;
										document.getElementById('frm_m').action				= "write_ok.asp";
										document.getElementById('frm_m').submit();
									}
								//-->
								</script>
							</td>
							<td scope="row" class="center">
								<%If Not(g_num = "1" or g_num = "2") then%>
									<input type="button" value="삭제" class="ct_bt01" onclick="d_chk('delete_ok.asp?g_num=<%=g_num%>');" tabindex="<%=getTabIndex()%>"/>
								<%End if%>
							</td>
						</tr>


<%
		zz = zz+1
	next
End if 

%>


						<!-- <tr>
							<td scope="row" class="center" colspan="2"></td>
							<td scope="row" class="left">&nbsp;&nbsp;&nbsp;<strong>비회원</strong></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"><input type="button" value="권한" class="ct_bt01" onclick="" /></td>
							<td scope="row" class="center"></td>
							<td scope="row" class="center"></td>
						</tr> -->


						</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_level_chk" 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();" tabindex="<%=getTabIndex()%>"><span>변경</span></a></div></li>
						</ul>
					</div>


				</form>

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

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

		<form id= "frm_m" method='post' action="">
			<div>
			<input type="hidden" name="g_menuname" />
			<input type="hidden" name="g_chk" />
			<input type="hidden" name="g_num" />
			
			</div>
		</form>


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