  <%--
  - FileName   : SYSRightPgmListGrSortForm.jsp
  - Author     : gyeongmo an
  - Date       : 2014.06.18
  - Copyright  : Copyright (c) www.udapsoft.co.kr, Inc.
  - All rights reserved.
--%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="kr.co.hsnc.common.sql.*" %>
<%@ page import="kr.co.hsnc.common.sql.util.*" %>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
<%
    ctx.init(request, response);

	ValueObject user = null;
   	String message = null;
	String event   = null;

    HandlerStorage storage = ctx.getHandlerStorage();
	ValueObject params = storage.getParams();

	RowSet listRowSet = storage.getRowSet("ListRowSet");

  	event = storage.getEvent();
	user = storage.getUser();
%>

<SCRIPT language="JavaScript">

function _onReady(){
	jQuery("#btnUp").click(function() {
		moveUpOption(document.form1.pgm_gr_id);
	});
	
	jQuery("#btnDown").click(function() {
		moveDownOption(document.form1.pgm_gr_id);
	});
	jQuery("#btnSaveProc").click(function() {
		var f = document.form1;

		var obj = f.pgm_gr_id;

		var url = "/sycs/security/SYSRightPgmListGrSortFormWorker.screen?right_id=" + f.right_id.value;

		if( obj.options.length == null ) {
		
			url += "&pgm_gr_id=" + obj.options.value;
		}
		else {
		
			for( var i = 0 ; i < obj.options.length ; i++ ) {
		
				url += "&pgm_gr_id=" + obj.options[i].value;
			}
		}
		window.frames['worker'].location.href = getDummyUrl(url);
	});
	
	jQuery("#btnCloseProc").click(function() {
		setTimeout(function(){parent.modGroupSeqProcClose('close');},100);
	});
}

function saveResult() {
	parent.modGroupSeqProcClose();
}
</SCRIPT>

<modular:search id="form1">
	<modular:key id="fevent" />
</modular:search>

<form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
<INPUT type="hidden" name="right_id" value="<%= params.get("right_id") %>">
<!-- 본문시작 -->
<TABLE  border="0" cellspacing="0" cellpadding="0" width="430">
    <TR>
        <TD>
        <!-- 리스트 시작 -->
            <TABLE width="430" cellspacing="0" cellpadding="0" bordercolordark="#FFFFF" bordercolorlight="#d2d2d2" border="1">
                <TR height="28" align="center">
                    <TD colspan="2">프로그램 그룹</TD>
               	</TR>
				<TR height="240">
					<TD align="center" width="310">
						<SELECT name="pgm_gr_id" size="15" multiple style="width:290px">
<%
	ValueObject row = null;
	int size = (listRowSet != null ? listRowSet.size() : 0);
    for( int i = 0 ; i < size ; i++ ) {

		row = RowSetUtility.getValueObject(listRowSet.getRow(i));
%>
	    					<OPTION value="<%= row.get("PGM_GR_ID") %>"><%= i + 1 %> : <%= row.get("PGM_GR_NAME") %></OPTION>
<%
	}
%>
	    				</SELECT>
    				</TD>
    				<td class="button" rowspan="2" align="center">
						<span class="btnSearch center"><a href="javascript:void(0);" id="btnUp">위</a></span>
						<br><br>
						<span class="btnSearch center"><a href="javascript:void(0);" id="btnDown">아래</a></span>
					</td>
				</TR>
            </TABLE>
        </TD>
    </TR>
</TABLE>

<TABLE  border="0" cellspacing="0" cellpadding="0" width="430">
    <TR>
        <td class="button" align="center">
			<span class="btnSearch center"><a href="javascript:void(0);" id="btnSaveProc">그룹위치저장</a></span>
			<span class="btnSearch center"><a href="javascript:void(0);" id="btnCloseProc">닫기</a></span>
		</td>
    </TR>
</TABLE>

<IFRAME width="0" height="0" name="worker" style="display: none;"></IFRAME>

</FORM>