  <%--
  - FileName   : SYSRightPgmListSortForm.jsp
  - Author     : gyeongmo an
  - Date       : 2014.06.18
  - Copyright  : Copyright (c) 2014 www.udapsoft.co.kr, Inc.
  - All rights reserved.
  - Description: 그룹별 프로그램 순서 변경 Form
--%>
<%@ 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_list_id);
	});
	
	jQuery("#btnDown").click(function() {
		moveDownOption(document.form1.pgm_list_id);
	});
	
	jQuery("#btnSave").click(function() {
		var f = document.form1;

		var url = "/sycs/security/SYSRightPgmListSortFormWorker.screen?";

		if( f.pgm_list_id.options.length == null ) {
		
			url += "&pmg_list_id=" + f.pgm_list_id.options.value;
		}
		else {
		
			for( var i = 0 ; i < f.pgm_list_id.options.length ; i++ ) {
		
				url += "&pgm_list_id=" + f.pgm_list_id.options[i].value;
			}
		}

		window.frames['worker'].location.href = getDummyUrl(url);			
	});
	
	jQuery("#btnClose").click(function() {
		setTimeout(function(){parent.sysRightPgmListSortFormClose('close');},100);
	});
}

function saveResult() {
	parent.sysRightPgmListSortFormClose();
}

</SCRIPT>

<FORM name="form1" method="post" action="">
	<!-- 본문시작 -->
	<TABLE  border="0" cellspacing="0" cellpadding="0" width="400">
	    <TR>
	        <TD>
	        <!-- 리스트 시작 -->
	            <TABLE width="400" 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="300">
							<SELECT name="pgm_list_id" size="15" multiple style="width:280px">
								<%
									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_LIST_ID") %>"><%= row.get("PGM_NAME") %></OPTION>
								<%
									}
								%>
		    				</SELECT>
	    				</TD>
						<TD align="center">
							<TABLE width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
								    <TR>
								        <TD></TD>
								   	</TR>
								   	<tr>
									   	<td class="button">
											<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>
								    <TR>
								        <TD></TD>
								   	</TR>
								</TABLE>
						</TD>
					</TR>
	            </TABLE>
	        </TD>
	    </TR>
	</TABLE>
	
	<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
	    <TR height="28" valign="bottom">
		   	<td class="button" align="center">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">프로그램위치저장</a></span>
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnClose">닫기</a></span>
			</td>
	    </TR>
	</TABLE>
	<IFRAME width="0" height="0" name="worker" style="display: none;"></IFRAME>

</FORM>