<%--
  - FileName   : UserList.jsp
  - Author(s)  : Joung Kyu Park
  - Date       : 2007.05.16
  - Copyright  : Copyright (c) 2002-2007 www.hwenc.com, Inc.
  -
  - Description: 사용자 등록
  --%>
  


<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<%@ page import="com.udapsoft.waf.common.ui.*" %>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="kr.co.hsnc.common.sql.*" %>
<%@ include file="/jsp/work/taglib.jsp" %>
<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
<%
    ctx.init(request, response);
    HandlerStorage storage = ctx.getHandlerStorage();
    ValueObject params = storage.getParams();
    ValueObject user = storage.getUser();
    String event = storage.getEvent();
    String deptCd   = user.get("site_code");
    String deptName = user.get("site_name");
    deptCd   = params.get("buseo");
    RowSet rowSet = storage.getRowSet("ROWSET");
//     RowSet acctTypeRowSet = storage.getRowSet("AcctTypeRowSet"); //계정 타입

// 	ValueObject vo = storage.getValueObject("formData");
   
%>
<SCRIPT language="JavaScript">
	/*예약함수*/
	var sheet1 = new ibsheetObject();
	var sheet1Row;
	var sheet1PageNo = 1;
	var pageLastRowIndex = 1;
	var validationResult = false;
	var filterShow = false;
	
	
	$(document).ready(function(){
		
		var init_sheet = {};
		
		init_sheet.Cfg = {SearchMode:2, Page:10000, MergeSheet:msHeaderOnly};
		init_sheet.Cols = [
									{Header:'Del',				Type:"DelCheck",		SaveName:"DEL_CHECK", 		Width:50, 	Align:"Center",	Hidden:"True"},
									{Header:'Status',			Type:"Status", 			SaveName:"STATUS", 			Width:0, 	Align:"Center", Edit:"False"},
									{Header:'No.',				Type:"Seq", 			SaveName:"NO",				Width:80, 	Align:"Center", Edit:"False"},
									{Header:'제목.',				Type:"Text", 			SaveName:"TITLE",				Width:100, 	Align:"Center", Edit:"True"},
									{Header:'등록일',		Type:"Date", 			SaveName:"CREATE_DATE", 		Width:60, 	Format:"Ymd", Align:"Center", Edit:"True"}
		                   		];
		
		
		init_sheet.HeaderMode = {Sort:1};
		IBS_InitSheet(sheet1, init_sheet);
		sheet1.SetDataAutoTrim(0);
// 		sheet1.SetEditable(false);
		
		sheet1.FitColWidth();
		
	});
	
	
	
	
	$(function(){
		
		$("#btnSearch").click(function(){
			$("#event").val("GET_LIST");
			
			var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/TestList_sheet.screen";
			Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 10000, "");
// 			sheet1.DoSearch("/test/TestList_data.screen", $("#form1"));
			
		});
		
		$("#btnAdd").click(function(){
			sheet1.DataInsert(-1);
		});
		
		$("#btnSave").click(function(){
			if (confirm("저장하시겠습니까?"))
			{
				$("#event").val("SAVE_LIST");
				var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/TestList_sheet.screen";
				var result = Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), false);

			}
		});
		
		$("#btnSave2").click(function(){
			
			var f = document.form1
			$("#event").val("SAVE_FORM");
			
			submitXmlRequest("/test/TestList_form.screen", "SAVE_FORM", f);
// 			var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/TestList_sheet.screen";
// 			Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), 10000, false);
		});
	});
	
	
	
	function doResult(resultObj) {
		try {
			if( resultObj.getRequestEvent() == "SAVE_FORM") {
				if( resultObj.getSuccess() ) {
					alert("Process is completed.");
// 					goListProc();
					location.reload();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			//	document.form1.isSubmit = false;
			}
		}
		catch(errorObject) {
			showErrorDlg("doResult()", errorObject);
		}
	}
	
	

	
	function sheet1_OnSaveEnd(code, msg)
	{
		var event = $("#event").val();
		
		if(code >= "0")
		{
			dlgAlert("등록되었습니다.");
		}
		else
		{
			dlgAlert("등록실패.");
		}
		
		$("#event").val("GET_LIST");
		
// // 		var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/TestList_sheet.screen";
// 		Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 10000, "");
	}
	
	
	

</SCRIPT>


<modular:search id="form1">
	<modular:key id="event" />
</modular:search>
<form id="form1" name="form1" method="post" modular:type="search">
<TABLE border="0" cellspacing="0" cellpadding="0" width="100%">

<TR><TD height="1">
<INPUT type="hidden" name="p_user_sabun" value="">
<INPUT type="hidden" name="event" id="event" value="">
<INPUT type="hidden" name="p_user_pw" value="">
<INPUT type="hidden" name="p_buseo_nm" value="">
<INPUT type="hidden" name="p_job_dscr" value="">
<INPUT type="hidden" name="p_tel_no" value="">
<INPUT type="hidden" name="p_hand_tel_no" value="">
<INPUT type="hidden" name="p_e_mail" value="">
<INPUT type="hidden" name="p_user_name" value="">
<INPUT type="hidden" name="acct_id" value="">

<INPUT type="hidden" name="j_usertype" value="head">
<input type='hidden' name='login_id' >
<input type='hidden' name='login_pw' >
<INPUT type="hidden" name="j_admin_login_gb" value="Y">

<TABLE class="screen_title_table">
  <TR height="2"><TD colspan="2"></TD></TR>
  <TR height="25">
    <TD width="16" valign="middle"><IMG src="/img/buyer/template/bullet_03.gif" ></TD>
    <TD width="100%" class="screen_title_text">TEST</TD>
  </TR>
</TABLE>
</TD></TR>

<!-- 검색조건 영역 : 시작 -->
<TR><TD height="1">

<TABLE cellspacing="1" cellpadding="0" class="search_table">
  <TR height="25"> 
    <!-- 검색조건 타이틀 1 -->
    
  	<TD width="10%" class="search_table_title">
   		<img src="/img/buyer/button/bullet_01.gif" align="middle">Dept
  	</TD>
   	<TD width="30%" class="search_table_data">
  		&nbsp;<input type="text" name="dept" id="dept" value=""/>
  		
	</TD>

    <TD width="8%" class="search_table_title">
        <img src="/img/buyer/button/bullet_01.gif" align="middle">Account Type
    </TD>
    <TD witdh="5%" class="search_table_data">
    &nbsp;<input type="text" name="type" id="type" value=""/>
    </TD>

    <TD width="8%" class="search_table_title">
        <img src="/img/buyer/button/bullet_01.gif" align="middle">Emp. No.
    </TD>
    <TD width="10%" class="search_table_data">
      &nbsp;
   	  <%= InputText.get("user_sabun", "", 80, 50, "hangule, desc=사번, PerSize") %>
    </TD>


    <TD width="20%" rowspan="3" class="search_button"> 
      
         <!-- 검색버튼 영역 : 시작 -->
            <TABLE border="0" cellpadding="0" cellspacing="0" align="center">
              <TR>
                 <!-- 초기화버튼  : 시작 -->      
                 
                <TD>
                  <DIV id="btnSearch" class="button_style">
                    <TABLE border="0" cellpadding="0" cellspacing="0">
                      <TR> 
                        <TD class="button_left1"></TD>
                        <TD class="button_text1">Search&nbsp;</TD>
                        <TD class="button_right"></TD>
                      </TR>
                    </TABLE>
                  </DIV>
                </TD>
                <!-- 초기화버튼 : 종료 -->
                
                <!-- 검색버튼 구분 여백 : 시작 -->                
                <TD width="5"></TD>
                <!-- 검색버튼 구분 여백 : 종료 -->
                
                <!-- 검색버튼 : 시작 -->      
                <TD>
                  <DIV id="btnSave" class="button_style">
                    <TABLE border="0" cellpadding="0" cellspacing="0">
                      <TR> 
                        <TD class="button_left1"></TD>
                        <TD class="button_text1">Save&nbsp;</TD>
                        <TD class="button_right"></TD>
                      </TR>
                    </TABLE>
                  </DIV>
                  <DIV id="btnSave2" class="button_style">
                    <TABLE border="0" cellpadding="0" cellspacing="0">
                      <TR> 
                        <TD class="button_left1"></TD>
                        <TD class="button_text1">Save2&nbsp;</TD>
                        <TD class="button_right"></TD>
                      </TR>
                    </TABLE>
                  </DIV>
                </TD>
                <!-- 검색버튼 : 종료 -->
                
                <!-- 검색버튼 구분 여백 : 시작 -->                
                <TD width="5"></TD>
                <!-- 검색버튼 구분 여백 : 종료 -->
                
                <!-- 검색버튼 : 시작 -->
                <TD>
                  <DIV id="btnAdd" class="button_style">
                    <TABLE border="0" cellpadding="0" cellspacing="0">
                      <TR> 
                        <TD class="button_left1"></TD>
                        <TD class="button_text1">Add&nbsp;</TD>
                        <TD class="button_right"></TD>
                      </TR>
                    </TABLE>
                  </DIV>
                </TD>
				<TD width="5"></TD>
				<TD>
                  <DIV onclick="getEhr();" class="button_style"> <!-- SP_GET_EHR_EMPDATA 프로시져 호출-->
                    <TABLE border="0" cellpadding="0" cellspacing="0">
                      <TR> 
                        <TD class="button_left1"></TD>
                        <TD class="button_text1">EHR Sync&nbsp;</TD>
                        <TD class="button_right"></TD>
                      </TR>
                    </TABLE>
                  </DIV>
                </TD>
              </TR>
            </TABLE>     
            <!-- 검색버튼 영역 : 종료 -->  
    </TD>
  </TR>

  <TR height="25"> 
    <!-- 검색조건 타이틀 1 -->
    <TD width="8%" class="search_table_title">
        <img src="/img/buyer/button/bullet_01.gif" align="middle">Site
    </TD>
    <TD witdh="15%" class="search_table_data">
      &nbsp;
       <INPUT type="text" name="dept_cd" class="input" value="" readOnly style="width:30%;background-color: #dedede;" > 
       <INPUT type="text" name="dept_nm" class="input" value="" style="width:52%"> 
       <IMG onclick="dlgSearchSpotDept(document.form1.dept_cd, document.form1.dept_nm);" src="/img/buyer/button/bt_search_right.gif" alt="현장찾기" border="0" align="absmiddle" style="cursor:hand;">
    </TD>

    <TD width="8%" class="search_table_title">
        <img src="/img/buyer/button/bullet_01.gif" align="middle">Name
    </TD>
    <TD witdh="5%" class="search_table_data" colspan="3">
      &nbsp;
     <%//= InputText.get("user_name", "", 60, 50, "hangule, desc=성명, PerSize") %>  
     <INPUT type="text" name="user_name" value="<%=params.get("user_name") %>" maxlength="50" class="input" style="IME-MODE : active;width:30%;"   desc='성명' onKeyPress="doKeyPress();">  
      </TD>
  
  </TR>
  
</TABLE>

</TD></TR>


<!-- 검색조건 영역 : 종료 -->

<!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
<TR><TD height="1">
<TABLE border="0" cellspacing="0" cellpadding="0" class="search_data_div_height">
<TR><TD></TD></TR>
</TABLE>
</TD></TR>
<!-- 검색조건 영역, 테이터 영역 구분 여백 : 종료 -->



<!-- 검색조건 영역, 테이터 영역 구분 여백 : 종료 -->

</TABLE>
</FORM>

<table border="0" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;">
	<!-- 데이터 영역 : 시작 -->
	<tr>
		<td id="sheet1_td" >
		<!-- IBSheet7 그리드 생성 -->
		<script>createIBSheet("sheet1","100%", "100%");</script>
		</td>
	</tr>
	<!-- 데이터 영역 : 종료 -->
</table>
