<%--
  - FileName   : ModStatus.jsp
  - Author(s)  : hoonseok choi
  - Date       : 2021.3.3	
  --%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<%@ page import="com.udapsoft.waf.common.ui.*" %>
<%@ page import="com.udapsoft.waf.common.ui.InitCombo" %>
<%@ page import="com.udapsoft.waf.common.util.DateUtil" %>
<%@ page import="kr.co.udapsoft.common.code.CommCodeManager" %>
<%@ 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();
    
    ValueObject vo = storage.getValueObject("modStatusListRowSet");
    ValueObject vo2 = storage.getValueObject("modTemplateRowSet");
    
	CommCodeManager commCodeManager = new CommCodeManager();
	
	InitCombo initCombo = new InitCombo();
	initCombo.makeComboData(commCodeManager.getCodeRowSet("BID_STATUS_CD","1","1"), "DETAILNM", "DETAILCD");
	String BID_STATUS_CD = initCombo.getCode();
	String BID_STATUS_NM = initCombo.getCodeName();

	InitCombo initCombo2 = new InitCombo();
	initCombo2.makeComboData(commCodeManager.getCodeRowSet("BID_RESOL_CD","1","1"), "DETAILNM", "DETAILCD");
	String BID_SUPP_STATUS_CD = initCombo2.getCode();
	String BID_SUPP_STATUS_NM = initCombo2.getCodeName();
	
	InitCombo initCombo3 = new InitCombo();
	initCombo3.makeComboData(commCodeManager.getCodeRowSet("TBE_LIST_STATUS","1","1"), "DETAILNM", "DETAILCD");
	String BID_TBE_STATUS_CD = initCombo3.getCode();
	String BID_TBE_STATUS_NM = initCombo3.getCodeName();
	
	InitCombo initCombo4 = new InitCombo();
	initCombo4.makeComboData(commCodeManager.getCodeRowSet("CONT_STATUS_CD","1","1"), "DETAILNM", "DETAILCD");
	String CONT_STATUS_CD = initCombo4.getCode();
	String CONT_STATUS_NM = initCombo4.getCodeName();
	
	InitCombo initCombo5 = new InitCombo();
	initCombo5.makeComboData(commCodeManager.getCodeRowSet("GUAR_STATUS","1","1"), "DETAILNM", "DETAILCD");
	String GUAR_STATUS_CD = initCombo5.getCode();
	String GUAR_STATUS_NM = initCombo5.getCodeName();
	
	InitCombo initCombo6 = new InitCombo();
	initCombo6.makeComboData(commCodeManager.getCodeRowSet("GAUR_KIND","1","1"), "DETAILNM", "DETAILCD");
	String GAUR_KIND_CD = initCombo6.getCode();
	String GAUR_KIND_NM = initCombo6.getCodeName();
	
    String statusSheetComboListText 	   = (String)storage.getObject("selectText");
	String statusSheetComboListValue 	   = (String)storage.getObject("selectValue");
	String statusSheetComboListText2 	   = (String)storage.getObject("selectText2");
	String statusSheetComboListValue2 	   = (String)storage.getObject("selectValue2");

	//검색조건 작성일
	String  initSearchDateStart = params.get("searchDateStart");
	String  initSearchDateEnd = params.get("searchDateEnd");
		
	//com.udapsoft.waf.common.util.DateUtil
	ValueObject defaultDate = DateUtil.getDefaultPeriod();
	if("".equals(initSearchDateStart))	initSearchDateStart = defaultDate.get("START_DATE");
	if("".equals(initSearchDateEnd))	initSearchDateEnd = defaultDate.get("END_DATE");
%>

<script type="text/javascript">
	/*예약함수*/
	var sheet1 = new ibsheetObject(); 
	var sheet2 = new ibsheetObject();
	var sheet3 = new ibsheetObject();
	var sheet4 = new ibsheetObject();
	var sheet5 = new ibsheetObject();
	var sheet6 = new ibsheetObject();
	var sheet7 = new ibsheetObject();
	var sheet1Row;
	var sheet1PageNo = 1;
	var pageLastRowIndex = 1;
	var validationResult = false;
	var filterShow = false;
	
	var clickRow;
	document.body.onload = doPageInit;

	function doPageInit(){		
		setSearchDate();
		
		var p_user_sabun = "<%=user.get("USER_SABUN")%>";
		var p_auth_id = "<%=vo.get("ADMIN_AUTH_ID")%>";
		if(p_user_sabun!=p_auth_id){
			document.getElementById('update_table1').style.display  = 'none';
			document.getElementById('update_table2').style.display  = 'none';
			document.getElementById('delete_table1').style.display  = 'none';
			document.getElementById('delete_table2').style.display  = 'none';
			document.getElementById('update_table3').style.display  = 'none';
			document.getElementById('update_table4').style.display  = 'none';
		}
		jQuery("#btnSearch3").click();		
		document.getElementById('btnSearch3').style.display  = 'none';
	}
	
	function _onReady(){
		gridInit(sheet1);
		gridInit(sheet2);
		gridInit(sheet3);
		gridInit(sheet4);
		gridInit(sheet5);
		gridInit(sheet6);
		gridInit(sheet7);
		jQuery("#btnSearch1").click(function() {
				if($("#p_dept_cd").val().trim() == ""){
					alert("현장선택은 필수입니다");
					return;
				}
				jQuery("#fevent").val("MOD_BID_STATUS");
				var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/ModStatusList_sheet.screen";
				Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form2"), 10, "");
		});
		
		jQuery("#btnSearch2").click(function() {
			if($("#key_col1").val().trim() != "" && $("#key_col2").val().trim() != "" && $("#key_col3").val().trim() != "" 
					&& $("#key_col4").val().trim() != "" && $("#key_col5").val().trim() != ""){
			}else{
				alert("조건값 입력(1~5)은 필수입니다.");
				return;
			}
			jQuery("#fevent").val("MOD_ERP_STS");
			var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/ModStatusList_sheet.screen";
			Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form2"), 10, "");
		});
		
		jQuery("#btnSearch3").click(function() {
			jQuery("#fevent").val("MOD_TEMPLATE");
			var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/ModStatusList_sheet.screen";
			Modular.view.IBSheet7.doSearch(sheet3, url, jQuery("#form2"), 10, "");
		});
		
		jQuery("#btnSearch4").click(function() {
			if($("#p_dept_cd2").val().trim() == ""){
				alert("현장선택은 필수입니다");
				return;
			}
			jQuery("#fevent").val("PUR_CONT_STATUS");
			var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/ModStatusList_sheet.screen";
			Modular.view.IBSheet7.doSearch(sheet4, url, jQuery("#form2"), 10, "");
		});
		
		jQuery("#btnSearch5").click(function() {
			if($("#p_dept_cd3").val().trim() == ""){
				alert("현장선택은 필수입니다");
				return;
			}
			jQuery("#fevent").val("SUB_CONT_STATUS");
			var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/ModStatusList_sheet.screen";
			Modular.view.IBSheet7.doSearch(sheet5, url, jQuery("#form2"), 10, "");
		});
		
		jQuery("#btnSearch6").click(function() {
			 
			if(jQuery("#searchDeptCd").val() == ""){
				alert("현장을 선택해주세요.");
				jQuery("#searchDeptCd").focus();
				return;
			}  
			
			jQuery("#fevent").val("SUB_PAY_STATUS");
			var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/ModStatusList_sheet.screen";
			Modular.view.IBSheet7.doSearch(sheet6, url, jQuery("#form2"), 10, "");
			
		});
		
		jQuery("#btnSearch7").click(function() {
			if(jQuery("#searchDeptCd2").val() == ""){
				alert("현장을 선택해주세요.");
				jQuery("#searchDeptCd2").focus();
				return;
			}  
			
			jQuery("#fevent").val("PUR_PAY_STATUS");
			var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/ModStatusList_sheet.screen";
			Modular.view.IBSheet7.doSearch(sheet7, url, jQuery("#form2"), 10, "");
			
		});
		
		jQuery("#btnSave").click(function() {			
			// 테이블명 체크
			if($("#table_nm").val().trim() != "")
	     	{
	     	   var regNum = /^[a-zA-Z0-9_.]*$/;
	     	   
	     	    /* if(!regNum.test($("#table_nm").val().trim()))
	     	    {
	     	       	alert("테이블명은 영문&숫자만 입력해 주세요.");
	     	      	$("#table_nm").focus();
	                return false;
	     	    } */
	     	}
	     	else
	     	{
	     	   alert("테이블명을 입력해 주세요");
	     	   $("#table_nm").focus();
	     	   return false;
	     	}
			
			if($("#set_1").val().trim() == "")
	     	{
	     	   alert("SET_1을 입력해 주세요");
	     	   $("#set_1").focus();
	     	   return false;
	     	} else if($("#set_1").val().trim().length > 200) {
				alert("SET_1은 200자 까지 입력할 수 있습니다.");
	     		$("#set_1").focus();
		     	return false;
			}

			if($("#where").val().trim() == "")
	     	{
	     	   alert("WHERE 조건문을 입력해 주세요");
	     	   $("#where").focus();
	     	   return false;
	     	} else if($("#where").val().trim().length > 100) {
				alert("WHERE는 100자리까지 입력할 수 있습니다.");
	     		$("#where").focus();
		     	return false;
			}

			if($("#where_val").val().trim() == "")
	     	{
	     	   alert("WHERE(값)을 입력해 주세요");
	     	   $("#where_val").focus();
	     	   return false;
	     	} else if($("#where_val").val().trim().length > 100) {
				alert("WHERE(값)은 100자리까지 입력할 수 있습니다.");
	     		$("#where_val").focus();
		     	return false;
			}			
			
		    if(confirm("수정하시겠습니까?")) {		    	
		    	submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_SEL_CNT", document.form1);
				//submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_MOD_LIST", document.form1);
			}
		}); 
		
		jQuery("#btnDel").click(function() {
			// 테이블명 체크
			if($("#del_table_nm").val().trim() != "")
	     	{
	     	   var regNum = /^[a-zA-Z0-9_.]*$/;
	     	   
	     	    if(!regNum.test($("#del_table_nm").val().trim()))
	     	    {
	     	       	alert("테이블명은 영문&숫자만 입력해 주세요.");
	     	      	$("#del_table_nm").focus();
	                return false;
	     	    }
	     	}
	     	else
	     	{
	     	   alert("테이블명을 입력해 주세요");
	     	   $("#del_table_nm").focus();
	     	   return false;
	     	}
			
			if($("#del_where").val().trim() == "")
	     	{
	     	   alert("WHERE 조건문을 입력해 주세요");
	     	   $("#del_where").focus();
	     	   return false;
	     	} else if($("#del_where").val().trim().length > 100) {
				alert("WHERE는 100자리까지 입력할 수 있습니다.");
	     		$("#del_where").focus();
		     	return false;
			}

			if($("#del_where_val").val().trim() == "")
	     	{
	     	   alert("WHERE(값)을 입력해 주세요");
	     	   $("#del_where_val").focus();
	     	   return false;
	     	} else if($("#del_where_val").val().trim().length > 100) {
				alert("WHERE(값)은 100자리까지 입력할 수 있습니다.");
	     		$("#del_where_val").focus();
		     	return false;
			}			
		    
		    if(confirm("삭제하시겠습니까?")) {
		    	submitXmlRequest("/test/ModStatusList_form.screen", "DEL_SEL_CNT", document.form1);
		    	//submitXmlRequest("/test/ModStatusList_form.screen", "DEL_MOD_LIST", document.form1);
			}
		});
		
		jQuery("#btnStart").click(function() {			
			// 테이블명 체크
			if($("#sign_interface_id").val().trim() != "")
	     	{
	     	   var regNum = /^[0-9]*$/;
	     	   
	     	    if(!regNum.test($("#sign_interface_id").val().trim()))
	     	    {
	     	       	alert("SIGN_INTERFACE_ID는 숫자만 입력해 주세요.");
	     	      	$("#sign_interface_id").focus();
	                return false;
	     	    }
	     	}
	     	else
	     	{
	     	   alert("sign_interface_id를 입력해 주세요");
	     	   $("#sign_interface_id").focus();
	     	   return false;
	     	}
			
			if($("#sign_deci_class").val().trim() == "")
	     	{
	     	   alert("sign_deci_class를 입력해 주세요");
	     	   $("#sign_deci_class").focus();
	     	   return false;
	     	}	
			
		    if(confirm("결재 하시겠습니까?(개발/운영 DB확인!)")) {		    	
		    	submitXmlRequest("/test/ModStatusList_form.screen", "START_SIGN_TEST", document.form1);
			}
		}); 
	}
	
	function gridInit(sheetName){
		var init_sheet = {};
		if(sheetName.id == "sheet1"){
			init_sheet.Cfg = {SearchMode:2, Page:10, SizeMode:2};
			init_sheet.Cols = [
			    			{Header:'상태',			Type:"Status", 			SaveName:"STATUS", 			Width:0, 	Align:"Center",	ColMerge:false, Hidden:"true"},
			    			{Header:'현장명',			Type:"Text", 			SaveName:"dept_nm",			Width:150, 	Align:"Left", Edit:"false", Hidden:"true"},
			    			{Header:'현장코드',		Type:"Text",			SaveName:"dept_cd", 		Width:50, 	Align:"Center", Edit:"false", Hidden:"true"},
			    			{Header:'구분코드',		Type:"Text", 			SaveName:"DEMANDED_KIND", 	Width:70,	Align:"Center",	Edit:"false", Hidden:"true"},
			    			{Header:'구분',			Type:"Text", 			SaveName:"DEMANDED_KIND_NM", 	Width:40,	Align:"Center",	Edit:"false"},
			    			{Header:'DEMANDED_ID',	Type:"Text", 			SaveName:"DEMANDED_ID", 	Width:70,	Align:"Center",	Edit:"false"},
			    			{Header:'입찰번호',		Type:"Text", 			SaveName:"BID_NO", 			Width:120,	Align:"Center", Edit:"false"},
			    			{Header:'입찰명',			Type:"Text", 			SaveName:"BID_MASTER_NM",	Width:150, 	Align:"Left", Edit:"false", Cursor:"pointer"},
			    			{Header:'변경입찰명',		Type:"Text", 			SaveName:"MOD_BID_MASTER_NM",	Width:150, 	Align:"Left", Edit:"true"},
			    			{Header:'차수(MASTER)',	Type:"Text", 			SaveName:"BID_DEG",			Width:70,	Align:"Center", Edit:"false", Cursor:"pointer"},
			    			{Header:'상태',			Type:"Text", 			SaveName:"STATUS_NM", 		Width:70, 	Align:"Center", Edit:"false"},
			    			{Header:'상태코드',		Type:"Text", 			SaveName:"STATUS_CD", 		Width:50, 	Align:"Center", Edit:"false"},
			    			{Header:'변경상태(MASTER)',	Type:"Combo", 		SaveName:"MOD_STATUS_CD",	Width:100,	Align:"Center",		ComboText:"<%=BID_STATUS_NM%>", ComboCode:"<%=BID_STATUS_CD%>"},
			    			{Header:'검토자',			Type:"Text", 			SaveName:"EVAL_EMPNM",			Width:70,	Align:"Center", Edit:"false", Cursor:"pointer"},
			    			{Header:'TBE상태',		Type:"Text", 			SaveName:"TBE_STATUS_NM", 		Width:70, 	Align:"Center", Edit:"false"},
			    			{Header:'TBE코드',		Type:"Text", 			SaveName:"TBE_STATUS_CD", 		Width:70, 	Align:"Center", Edit:"false"},
			    			{Header:'변경상태(TBE)',	Type:"Combo", 			SaveName:"TBE_MOD_STATUS_CD",	Width:100,	Align:"Center",		ComboText:"<%=BID_TBE_STATUS_NM%>", ComboCode:"<%=BID_TBE_STATUS_CD%>"},
			    			{Header:'업체코드',		Type:"Text", 			SaveName:"VENDOR_CD",		Width:70,	Align:"Center", Edit:"false", Hidden:"true"},
			    			{Header:'업체명(SUPP)',	Type:"Text", 			SaveName:"VENDOR_NAME",			Width:120,	Align:"Center", Edit:"false", Cursor:"pointer"},
			    			{Header:'업체상태',		Type:"Text", 			SaveName:"BID_STATUS_NM", 		Width:70, 	Align:"Center", Edit:"false"},
			    			{Header:'업체상태코드',	Type:"Text", 			SaveName:"BID_STATUS_CD", 		Width:70, 	Align:"Center", Edit:"false"},
			    			{Header:'변경상태(SUPP)',	Type:"Combo", 			SaveName:"SUPP_MOD_STATUS_CD",	Width:100,	Align:"Center",		ComboText:"<%=BID_SUPP_STATUS_NM%>", ComboCode:"<%=BID_SUPP_STATUS_CD%>"},
			    			{Header:'화폐단위',		Type:"Text", 			SaveName:"CURRENCY_GB", 		Width:70, 	Align:"Center", Edit:"false", Cursor:"pointer"},
			    			{Header:'환율',			Type:"Text", 			SaveName:"EXCHANGE", 			Width:40, 	Align:"Center", Edit:"false"},
			    			{Header:'변경환율',		Type:"Text", 			SaveName:"MOD_EXCHANGE",		Width:40, 	Align:"Center", Edit:"true"}
			];
		}else if(sheetName.id == "sheet2"){
			init_sheet.Cfg = {SearchMode:2, Page:10};
			init_sheet.Cols = [
					    		{Header:'Status',		Type:"Status", 			SaveName:"STATUS", 			Width:0, 		Align:"Center",	Hidden:"True"},
	   			    			{Header:'ERP결재코드',	Type:"Text", 			SaveName:"SIGN_CLASS_CD",	Width:0, 		Align:"Center"},
	   			    			{Header:'ERP결재명',		Type:"Text", 			SaveName:"SIGN_CLASS_NM",	Width:0, 		Align:"Center"},
	   			    			{Header:'INTERFACE ID',	Type:"Text", 			SaveName:"SIGN_INTERFACE_ID", 		Width:0, 		Align:"Center"},
	   			    			{Header:'문서ID',		Type:"Text", 			SaveName:"DOC_ID", 		Width:100, 		Align:"Center", Edit:false , Cursor:"pointer"},
	   			    			{Header:'결재코드',		Type:"Text", 			SaveName:"SIGN_DECI_CLASS", 		Width:80, 		Align:"Center", Edit:false},
	   			    			{Header:'결재상태',		Type:"Text", 			SaveName:"SIGN_DECI_CLASS_NM", 		Width:100, 		Align:"Center", Edit:false},
	   			    			{Header:'변경상태',		Type:"Combo", 			SaveName:"MOD_SIGN_DECI_CLASS",	Width:100,	Align:"Center",		ComboText:"-선택-|미결재|기안|반려|회수|완료|기안(접수부서)|반려(접수부서)|회수(접수부서)|완료(접수부서)|기안부서로 회송", ComboCode:"00||11|12|13|14|21|22|23|24|25"}
				];
		}else if(sheetName.id == "sheet3"){
			init_sheet.Cfg = {SearchMode:2, Page:10};
			init_sheet.Cols = [
					    		{Header:'Status',	Type:"Status", 			SaveName:"STATUS", 			Width:0, 		Align:"Center",	Hidden:"True"},
	   			    			{Header:'템플릿 코드',	Type:"Text", 			SaveName:"TEMPLATE_CD",		Width:0, 		Align:"Center"},
	   			    			{Header:'순번',		Type:"Text", 			SaveName:"SEQ",				Width:0,	 	Align:"Center"},
	   			    			{Header:'구분코드',	Type:"Text", 			SaveName:"JOB_DIV", 		Width:0, 		Align:"Center",	Hidden:"True"},
	   			    			{Header:'구분명',		Type:"Text", 			SaveName:"JOB_DIV_NM", 		Width:100, 		Align:"Center"},
	   			    			{Header:'템플릿명',	Type:"Text", 			SaveName:"TEMPLATE_NAME",	Width:80, 		Align:"Center", Edit:false, Cursor:"pointer"},
				];
		}else if(sheetName.id == "sheet4"){
			init_sheet.Cfg = {SearchMode:2, Page:10};
			init_sheet.Cols = [
					    		{Header:'Status',	Type:"Status", 			SaveName:"STATUS", 			Width:0, 		Align:"Center",	Hidden:"True"},
					    		{Header:'PUR_CONT_ID',		Type:"Text", 	SaveName:"PUR_CONT_ID",		Width:0, 		Align:"Center", Edit:"false",	Hidden:"True"},
	   			    			{Header:'PUR_CONT_MOD_ID',	Type:"Text", 	SaveName:"PUR_CONT_MOD_ID",	Width:70, 		Align:"Center", Edit:"false"},
	   			    			{Header:'현장명',		Type:"Text", 			SaveName:"DEPT_NAME",		Width:150,	 	Align:"Left", 	Edit:"false"},
	   			    			{Header:'계약번호',	Type:"Text", 			SaveName:"ORD_DOC_NO",		Width:100, 		Align:"Center", Edit:"false"},
	   			    			{Header:'계약명',		Type:"Text", 			SaveName:"CST_DOC_NAME",	Width:150, 		Align:"Left", 	Edit:"false"},
	   			    			{Header:'변경차수',	Type:"Text", 			SaveName:"MOD_NO",			Width:50, 		Align:"Center", Edit:"false", Cursor:"pointer"},
	   			    			{Header:'계약상태',	Type:"Text", 			SaveName:"STATUS_CD_NM",	Width:70, 		Align:"Center", Edit:"false"},
	   			    			{Header:'상태코드',	Type:"Text", 			SaveName:"STATUS_CD",		Width:50, 		Align:"Center", Edit:"false"},
	   			    			{Header:'변경상태(계약)',	Type:"Combo", 		SaveName:"CONT_STATUS_CD",	Width:100,		Align:"Center",		ComboText:"<%=CONT_STATUS_NM%>", ComboCode:"<%=CONT_STATUS_CD%>"},
	   			    			{Header:'보증서코드',	Type:"Text",	 		SaveName:"WARR_GUBUN",		Width:0,	 	Align:"Center", Edit:"false",	Hidden:"True"},
	   			    			{Header:'보증서',		Type:"Text",	 		SaveName:"GAUR_KIND_NM",	Width:80,	 	Align:"Center", Edit:"false", Cursor:"pointer"},
	   			    			{Header:'보증순번',	Type:"Text",			SaveName:"WARR_SEQ",		Width:50,	 	Align:"Center", Edit:"false"},
	   			    			{Header:'온라인보증',	Type:"Text",	 		SaveName:"GUAR_ONOFF_YN",	Width:60,	 	Align:"Center", Edit:"false"},
	   			    			{Header:'온라인변경',	Type:"Combo", 			SaveName:"MOD_GUAR_ONOFF_YN",	Width:100,	Align:"Center",		ComboText:"-선택-|Y|N", ComboCode:"00|Y|N"},
	   			    			{Header:'보증상태',	Type:"Text", 			SaveName:"GUAR_STATUS_NM",	Width:50, 		Align:"Center", Edit:"false"},
	   			    			{Header:'상태코드',	Type:"Text", 			SaveName:"GUAR_STATUS",		Width:50, 		Align:"Center", Edit:"false"},
	   			    			{Header:'변경상태(보증)',	Type:"Combo",		SaveName:"GUAR_STATUS_CD",	Width:100,		Align:"Center",		ComboText:"<%=GUAR_STATUS_NM%>", ComboCode:"<%=GUAR_STATUS_CD%>"},
	   			    			{Header:'템플릿명',	Type:"Text", 			SaveName:"TEMPLATE_NAME",	Width:80, 		Align:"Center", Edit:"false", Cursor:"pointer"},
	   			    			{Header:'순번',		Type:"Text", 			SaveName:"SEQ",				Width:0,	 	Align:"Center", Edit:"false"}
				];
		}else if(sheetName.id == "sheet5"){
			init_sheet.Cfg = {SearchMode:2, Page:10};
			init_sheet.Cols = [
					    		{Header:'Status',	Type:"Status", 			SaveName:"STATUS", 			Width:0, 		Align:"Center",	Hidden:"True"},
					    		{Header:'SUB_CONT_ID',		Type:"Text", 	SaveName:"SUB_CONT_ID",		Width:0, 		Align:"Center", Edit:"false",	Hidden:"True"},
	   			    			{Header:'SUB_CONT_MOD_ID',	Type:"Text", 	SaveName:"SUB_CONT_MOD_ID",	Width:70, 		Align:"Center", Edit:"false"},
	   			    			{Header:'현장명',		Type:"Text", 			SaveName:"DEPT_NAME",		Width:150,	 	Align:"Left", 	Edit:"false"},
	   			    			{Header:'계약번호',	Type:"Text", 			SaveName:"CON_DOC_NO",		Width:100, 		Align:"Center", Edit:"false"},
	   			    			{Header:'계약명',		Type:"Text", 			SaveName:"BUILD_NAME",		Width:150, 		Align:"Left", 	Edit:"false"},
	   			    			{Header:'변경차수',	Type:"Text", 			SaveName:"MOD_NO",			Width:50, 		Align:"Center", Edit:"false", Cursor:"pointer"},
	   			    			{Header:'계약상태',	Type:"Text", 			SaveName:"STATUS_CD_NM",	Width:70, 		Align:"Center", Edit:"false"},
	   			    			{Header:'상태코드',	Type:"Text", 			SaveName:"STATUS_CD",		Width:50, 		Align:"Center", Edit:"false"},
	   			    			{Header:'변경상태(계약)',	Type:"Combo", 		SaveName:"CONT_STATUS_CD",	Width:100,		Align:"Center",		ComboText:"<%=CONT_STATUS_NM%>", ComboCode:"<%=CONT_STATUS_CD%>"},
	   			    			{Header:'보증서코드',	Type:"Text",	 		SaveName:"WARR_GUBUN",		Width:0,	 	Align:"Center", Edit:"false",	Hidden:"True"},
	   			    			{Header:'보증서',		Type:"Text",	 		SaveName:"GAUR_KIND_NM",	Width:80,	 	Align:"Center", Edit:"false", Cursor:"pointer"},
	   			    			{Header:'보증순번',	Type:"Text",			SaveName:"WARR_SEQ",		Width:50,	 	Align:"Center", Edit:"false"},
	   			    			{Header:'온라인보증',	Type:"Text",	 		SaveName:"GUAR_ONOFF_YN",	Width:60,	 	Align:"Center", Edit:"false"},
	   			    			{Header:'온라인변경',	Type:"Combo", 			SaveName:"MOD_GUAR_ONOFF_YN",	Width:100,	Align:"Center",		ComboText:"-선택-|Y|N", ComboCode:"00|Y|N"},
	   			    			{Header:'보증상태',	Type:"Text", 			SaveName:"GUAR_STATUS_NM",	Width:50, 		Align:"Center", Edit:"false"},
	   			    			{Header:'상태코드',	Type:"Text", 			SaveName:"GUAR_STATUS",		Width:50, 		Align:"Center", Edit:"false"},
	   			    			{Header:'변경상태(보증)',	Type:"Combo",		SaveName:"GUAR_STATUS_CD",	Width:100,		Align:"Center",		ComboText:"<%=GUAR_STATUS_NM%>", ComboCode:"<%=GUAR_STATUS_CD%>"},
	   			    			{Header:'템플릿명',	Type:"Text", 			SaveName:"TEMPLATE_NAME",	Width:80, 		Align:"Center", Edit:"false", Cursor:"pointer"},
	   			    			{Header:'순번',		Type:"Text", 			SaveName:"SEQ",				Width:0,	 	Align:"Center", Edit:"false"}
				];
		}else if(sheetName.id == "sheet6"){
			init_sheet.Cfg = {SearchMode:2, Page:10};
			init_sheet.Cols = [
					    	{Header:'상태',			Type:"Status", 			SaveName:"Status",					Width:70, 	Align:"Left", Hidden:"True"},
					    	{Header:'SUB_CONT_ID',	Type:"Text", 			SaveName:"SUB_CONT_ID",				Width:70, 	Align:"Left", Edit:"false"},
					    	{Header:'ACMP_ID',		Type:"Text", 			SaveName:"ACMP_ID",					Width:100, 	Align:"Left", Edit:"false"},
			    			{Header:'현장명',			Type:"Text", 			SaveName:"DEPT_NAME",				Width:100, 	Align:"Left", Edit:"false"},
			    			{Header:'계약번호',		Type:"Text", 			SaveName:"CON_DOC_NO",				Width:120, 	Align:"Left", Edit:"false", Hidden:"True"},
			    			{Header:'계약명',			Type:"Text", 			SaveName:"BUILD_NAME",				Width:110, 	Align:"Left", Edit:"false"},
			    			{Header:'업체명',			Type:"Text", 			SaveName:"MEMBER_NAME",				Width:100, 	Align:"Left", Edit:"false"},
			    			{Header:'공사기간',		Type:"Text", 			SaveName:"START_END_WORK_DATE", 	Width:130, 	Align:"Left", Edit:"false"},
			    			{Header:'통화구분',		Type:"Text", 			SaveName:"CURRENCY_GB",				Width:55, 	Align:"Center", Edit:"false"},
			    			{Header:'통화구분자리',		Type:"Int", 			SaveName:"CURRENCY_DIGIT",			Width:100, 	Align:"Left", Hidden:"True"},
			    			{Header:'계약금액',		Type:"Int", 			SaveName:"CON_SUPPLY_AMT",	 		Width:80, 	Align:"Right", Edit:"false"},
			    			{Header:'계약금액',		Type:"Int", 			SaveName:"CON_AMT", 				Width:40, 	Align:"Right", Hidden:"True"},
			    			{Header:'계약상선급금',		Type:"Int", 			SaveName:"PREPAY_SUPPLY_AMT",	 	Width:80, 	Align:"Right", Edit:"false"},
			    			{Header:'선급금발생',		Type:"Int", 			SaveName:"REQ_PREPAY_SUPPLY_AMT",	Width:80, 	Align:"Right", Edit:"false"},
			    			{Header:'선급금\n신청날짜',	Type:"Text", 			SaveName:"PREPAY_DATE",	 			Width:65, 	Align:"Right", Edit:"false"},
			    			{Header:'기성년월',		Type:"Text", 			SaveName:"ACMP_YYYYMM",	 			Width:50, 	Align:"Right", Edit:"false"},
			    			{Header:'지급\n차수',		Type:"Int", 			SaveName:"ACMP_NO",	 				Width:40, 	Align:"Right", Edit:"false",	Cursor:"pointer"},
			    			{Header:'금회기성',		Type:"Int", 			SaveName:"FUND_AMT",	 			Width:80, 	Align:"Right", Edit:"false"},
			    			{Header:'선급금공제',		Type:"Int", 			SaveName:"PAY_DEDUCT_AMT",	 		Width:80, 	Align:"Right", Edit:"false"},
			    			{Header:'실지불액',		Type:"Int", 			SaveName:"REQU_SUPPLY_AMT",	 		Width:80, 	Align:"Right", Edit:"false"},
			    			{Header:'잔여기성',		Type:"Int", 			SaveName:"MOD_FUND_AMT",	 		Width:80, 	Align:"Right", Edit:"false"},
			    			{Header:'기성율\n(%)',	Type:"Float", 			SaveName:"FUND_RATE",	 			Width:40, 	Align:"Right",	Format:"##0.00", Edit:"false"},
			    			{Header:'기성상태',		Type:"Combo", 			SaveName:"STATUS_CD_NM",			Width:100, 	Align:"Center",	ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>", Edit:"false"},
			    			{Header:'상태코드',		Type:"Text", 			SaveName:"STATUS_CD",				Width:50, 	Align:"Center", Edit:"false"},
			    			{Header:'변경상태',		Type:"Combo", 			SaveName:"STATUS_CD2",				Width:100, 	Align:"Center",	ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>"},
				];
		}else if(sheetName.id == "sheet7"){
			init_sheet.Cfg = {SearchMode:2, Page:10};
			init_sheet.Cols = [
							{Header:'상태',			Type:"Status", 		SaveName:"Status", 					Width:70, 	Align:"Left", Hidden:"True"},
					    	{Header:'PAYREQ_ID',	Type:"Text", 		SaveName:"PAYREQ_ID",				Width:100, 	Align:"Left", Edit:"false"},
							{Header:'현장명',			Type:"Text", 		SaveName:"DEPT_NAME",				Width:200, 	Align:"Left",	Hidden:"True"},
							{Header:'계약번호',		Type:"Text", 		SaveName:"ORD_DOC_NO",				Width:200, 	Align:"Left", Edit:"false"},
							{Header:'계약명',			Type:"Text", 		SaveName:"CST_DOC_NAME",			Width:200, 	Align:"Left", Edit:"false"},
							{Header:'업체명',			Type:"Text", 		SaveName:"CORP_KOR",				Width:200, 	Align:"Left", Edit:"false"},
							{Header:'계약기간',		Type:"Text", 		SaveName:"ORD_DATE",				Width:200, 	Align:"Left", Edit:"false"},
							{Header:'계약금액',		Type:"Text", 	    SaveName:"ORD_AMT",					Width:100, 	Align:"Right" , Edit:"false"},
							{Header:'대금구분',		Type:"Text", 		SaveName:"PAY_DIV_NM",				Width:80, 	Align:"Center", Edit:"false"},
							{Header:'통화',			Type:"Text", 		SaveName:"CURRENCY_GB",				Width:60, 	Align:"Center", Edit:"false"},
							{Header:'지급구분',		Type:"Text", 		SaveName:"DEPOSIT_NM",				Width:80, 	Align:"Center", Edit:"false",	Cursor:"pointer"},
							{Header:'잔여공급가',		Type:"Float", 		SaveName:"REMAINDER_ACMP_SUPPLYAMT",Width:100, 	Align:"Right", Format:"Float", Edit:"false"},
							{Header:'잔여부가세',		Type:"Float", 		SaveName:"REMAINDER_ACMP_VAT",		Width:100, 	Align:"Right", Format:"Float", Edit:"false"},
							{Header:'잔여합계',		Type:"Float", 		SaveName:"REMAINDER_ACMP_AMT",		Width:100, 	Align:"Right", Format:"Float", Edit:"false"},
							{Header:'지급차수',		Type:"Text", 		SaveName:"DEPOSIT_SEQ",				Width:60, 	Align:"Center", Edit:"false",	Cursor:"pointer"},
							{Header:'증빙일자',		Type:"Text", 		SaveName:"REQ_DATE",				Width:80, 	Align:"Center", Edit:"false"},
							/* {Header:'선급공제액',		Type:"AutoSum",		SaveName:"CUR_PREPAY_APPLYAMT",		Width:100, 	Align:"Right", Format:"Integer", Edit:"false"},
							{Header:'청구액',			Type:"AutoSum",		SaveName:"CUR_REQ_AMT",				Width:100, 	Align:"Right", Format:"Integer", Edit:"false"}, */
							{Header:'잔여',			Type:"Float", 		SaveName:"REMAINDER_SUPPLYAMT",		Width:100, 	Align:"Right", Format:"Float", Hidden:"True"},			    			
							{Header:'지급율',			Type:"Float", 		SaveName:"CUR_ACMP_PERCENT",		Width:50, 	Align:"Right", Format:"##0.00",Hidden:"True"},
							{Header:'상태',			Type:"Combo", 		SaveName:"REQ_STATUS_NM",			Width:70, 	Align:"Center",	ComboText:"<%=statusSheetComboListText2%>", ComboCode:"<%=statusSheetComboListValue2%>", Edit:"false"},
							{Header:'상태코드',		Type:"Text", 		SaveName:"REQ_STATUS",				Width:50, 	Align:"Center", Edit:"false"},
							{Header:'변경상태',		Type:"Combo", 		SaveName:"REQ_STATUS2",				Width:70, 	Align:"Center",	ComboText:"<%=statusSheetComboListText2%>", ComboCode:"<%=statusSheetComboListValue2%>"},
							{Header:'계약ID',			Type:"Text", 		SaveName:"PUR_CONT_ID", 			Width:70, 	Align:"Center", Hidden:"True"}	
				];
		}
		
		init_sheet.HeaderMode = {Sort:1};
		IBS_InitSheet(sheetName, init_sheet);
		sheetName.SetDataAutoTrim(0);
		sheetName.SetMergeSheet(msPrevColumnMerge);
	
		setGridSize();
	}
	
	function sheet1_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
	    	sheet1.SetColFontColor("BID_DEG", "#0000ff");
	    	sheet1.SetColFontColor("VENDOR_NAME", "#0000ff");
	    	sheet1.SetColFontColor("BID_MASTER_NM", "#0000ff");
	    	sheet1.SetColFontColor("EVAL_EMPNM", "#0000ff");
	    	sheet1.SetColFontColor("CURRENCY_GB", "#0000ff");
		} else {
			alert("조회 실패");
		}
	}
	
	function sheet2_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
	    	sheet2.SetColFontColor("DOC_ID", "#0000ff");
		} else {
			alert("조회 실패");
		}
	}
	
	function sheet3_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
	    	sheet3.SetColFontColor("TEMPLATE_NAME", "#0000ff");
		} else {
			alert("조회 실패");
		}
	}
	
	function sheet4_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
	    	sheet4.SetColFontColor("PAY_DIV", "#0000ff");
	    	sheet4.SetColFontColor("MOD_NO", "#0000ff");
	    	sheet4.SetColFontColor("GAUR_KIND_NM", "#0000ff");
	    	sheet4.SetColFontColor("TEMPLATE_NAME", "#0000ff");
		} else {
			alert("조회 실패");
		}
	}
	
	function sheet5_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
	    	sheet5.SetColFontColor("MOD_NO", "#0000ff");
	    	sheet5.SetColFontColor("GAUR_KIND_NM", "#0000ff");
	    	sheet5.SetColFontColor("TEMPLATE_NAME", "#0000ff");
		} else {
			alert("조회 실패");
		}
	}
	
	function sheet6_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
	    	sheet6.SetColFontColor("ACMP_NO", "#0000ff");
		} else {
			alert("조회 실패");
		}
	}
	
	function sheet7_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
	    	sheet7.SetColFontColor("DEPOSIT_NM", "#0000ff");
	    	sheet7.SetColFontColor("DEPOSIT_SEQ", "#0000ff");
		} else {
			alert("조회 실패");
		}
	}

	function setGridSize() {
		sheet1.FitColWidth();
		sheet2.FitColWidth();
		sheet3.FitColWidth();
		sheet4.FitColWidth();
		sheet5.FitColWidth();
		sheet6.FitColWidth();
		sheet7.FitColWidth();
	}
	
	function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 if ((sheet1.ColSaveName(Col) == "BID_DEG")) {
				 if(sheet1.GetCellValue(Row, "MOD_STATUS_CD") == ""){
					 alert("변경상태(MASTER)를 선택하십시오");
					 return;
				 }
				var status = sheet1.GetCellValue(Row,8);
				$("#BID_NO").val(sheet1.GetCellValue(Row, "BID_NO"));
				$("#BID_DEG").val(sheet1.GetCellValue(Row, "BID_DEG"));
				$("#MOD_STATUS_CD").val(sheet1.GetCellValue(Row, "MOD_STATUS_CD"));
				
				if (confirm("입찰상태(MASTER)를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet1.GetCellValue(Row, "MOD_STATUS_CD")+")")){
					submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_BID_STATUS", document.form1);
				}
		}else if ((sheet1.ColSaveName(Col) == "VENDOR_NAME")) {
			if(sheet1.GetCellValue(Row, "DEMANDED_KIND") == "O"){
				 alert("구매업체만 변경가능합니다.");
				 return;
			 }
			 if(sheet1.GetCellValue(Row, "SUPP_MOD_STATUS_CD") == ""){
				 alert("변경상태(SUPP)를 선택하십시오.");
				 return;
			 }
			var status = sheet1.GetCellValue(Row,8);
			$("#BID_NO").val(sheet1.GetCellValue(Row, "BID_NO"));
			$("#BID_DEG").val(sheet1.GetCellValue(Row, "BID_DEG"));
			$("#VENDOR_CD").val(sheet1.GetCellValue(Row, "VENDOR_CD"));
			$("#SUPP_MOD_STATUS_CD").val(sheet1.GetCellValue(Row, "SUPP_MOD_STATUS_CD"));
			
			if (confirm("입찰업체상태(SUPP)를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet1.GetCellValue(Row, "SUPP_MOD_STATUS_CD")+")")  ){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_SUPP_BID_STATUS", document.form1);
			}
		}else if ((sheet1.ColSaveName(Col) == "BID_MASTER_NM")) {
			 if(sheet1.GetCellValue(Row, "MOD_BID_MASTER_NM") == ""){
				 alert("변경할 입찰명을 입력하십시오");
				 return;
			 }
			var status = sheet1.GetCellValue(Row,8);
			$("#DEMANDED_ID").val(sheet1.GetCellValue(Row, "DEMANDED_ID"));
			$("#MOD_BID_MASTER_NM").val(sheet1.GetCellValue(Row, "MOD_BID_MASTER_NM"));
			
			if (confirm("입찰명을 변경 하시겠습니까?")){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_BID_MASTER_NM", document.form1);
			}
		}else if ((sheet1.ColSaveName(Col) == "EVAL_EMPNM")) {
			if(sheet1.GetCellValue(Row, "EVAL_EMPNM") == ""){
				 alert("등록된 TBE가 없습니다");
				 return;
			 }
			if(sheet1.GetCellValue(Row, "TBE_MOD_STATUS_CD") == ""){
				 alert("변경상태(TBE)를 선택하십시오");
				 return;
			 }
			var status = sheet1.GetCellValue(Row,8);
			$("#BID_NO").val(sheet1.GetCellValue(Row, "BID_NO"));
			$("#BID_DEG").val(sheet1.GetCellValue(Row, "BID_DEG"));
			$("#TBE_MOD_STATUS_CD").val(sheet1.GetCellValue(Row, "TBE_MOD_STATUS_CD"));
			
			if (confirm("TBE 상태를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet1.GetCellValue(Row, "TBE_MOD_STATUS_CD")+")")){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_TBE_STATUS", document.form1);
			}
		}else if ((sheet1.ColSaveName(Col) == "CURRENCY_GB")) {
			if(sheet1.GetCellValue(Row, "EXCHANGE") == ""){
				 alert("등록된 환율정보가 없습니다");
				 return;
			 }
			if(sheet1.GetCellValue(Row, "MOD_EXCHANGE") == ""){
				 alert("변경환율을 입력하십시오");
				 return;
			 }
			var status = sheet1.GetCellValue(Row,8);
			$("#BID_NO").val(sheet1.GetCellValue(Row, "BID_NO"));
			$("#BID_DEG").val(sheet1.GetCellValue(Row, "BID_DEG"));
			$("#MOD_EXCHANGE").val(sheet1.GetCellValue(Row, "MOD_EXCHANGE"));
			
			if (confirm("환율정보를 변경 하시겠습니까?(변경하려는 환율값 : "+sheet1.GetCellValue(Row, "MOD_EXCHANGE")+")")){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_EXCHANGE_VALUE", document.form1);
			}
		}
	}
	
	function sheet1_OnSaveEnd(code, msg) {
	    if(code >= 0) {
	    	alert("저장 성공");
	    } else {
	    	alert("저장 실패");
        }
	    
	    jQuery("#btnSearch").click();
	}
	
	function sheet2_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 if ((sheet2.ColSaveName(Col) == "DOC_ID")) {
				 if(sheet2.GetCellValue(Row, "MOD_SIGN_DECI_CLASS") == "00"){
					 alert("변경상태를 선택하십시오");
					 return;
				 }
				var status = sheet2.GetCellValue(Row,8);
				$("#DOC_ID").val(sheet2.GetCellValue(Row, "DOC_ID"));
				$("#MOD_SIGN_DECI_CLASS").val(sheet2.GetCellValue(Row, "MOD_SIGN_DECI_CLASS"));
				
				if (confirm("ERP 결재상태를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet2.GetCellValue(Row, "MOD_SIGN_DECI_CLASS")+")")){
					submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_ERP_SIGN_CLASS", document.form1);
				}
		}
	}
	
	function sheet2_OnSaveEnd(code, msg) {
	    if(code >= 0) {
	    	alert("저장 성공");
	    } else {
	    	alert("저장 실패");
        }
	    
	    jQuery("#btnSearch2").click();
	}
	
	function sheet3_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 if ((sheet3.ColSaveName(Col) == "TEMPLATE_NAME")) {
			var win_id = "Template";
			var p_template_cd = sheet3.GetCellValue(Row, "TEMPLATE_CD");
			var p_seq = sheet3.GetCellValue(Row, "SEQ");
			var p_job_div = sheet3.GetCellValue(Row, "JOB_DIV");
			
			var argObj = new Object();
			argObj.p_template_cd = p_template_cd;
		    argObj.p_seq = p_seq;
		    argObj.p_job_div = p_job_div;

			var link = "/test/TemplatePop.screen";
			    link += "?pop_win_id="+win_id;
			    link += "&p_template_cd="+p_template_cd;
			    link += "&p_seq="+p_seq;
			    link += "&p_job_div="+p_job_div;
			    link += "&sModule=LM";
			    
			    fLayerPop(win_id, link, 1040, 500, '', '', 'NO');
		}
	}
	
	function sheet4_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 if ((sheet4.ColSaveName(Col) == "TEMPLATE_NAME")) {
			var win_id = "ContPurTemplate";
			var p_gubun = "P";
			var p_cont_mod_id = sheet4.GetCellValue(Row, "PUR_CONT_MOD_ID");
			var p_seq = sheet4.GetCellValue(Row, "SEQ");
			
			var argObj = new Object();
			argObj.p_gubun = p_gubun;
		    argObj.p_cont_mod_id = p_cont_mod_id;
		    argObj.p_seq = p_seq;

			var link = "/test/ContTemplatePop.screen";
			    link += "?pop_win_id="+win_id;
			    link += "&p_gubun="+p_gubun;
			    link += "&p_cont_mod_id="+p_cont_mod_id;
			    link += "&p_seq="+p_seq;
			    link += "&sModule=LM";
			    fLayerPop(win_id, link, 1040, 500, '', '', 'NO');
		}else if ((sheet4.ColSaveName(Col) == "MOD_NO")) {
			 if(sheet4.GetCellValue(Row, "CONT_STATUS_CD") == ""){
				 alert("변경상태(계약)를 선택하십시오.");
				 return;
			 }
			var status = sheet4.GetCellValue(Row,8);
			$("#PUR_CONT_MOD_ID").val(sheet4.GetCellValue(Row, "PUR_CONT_MOD_ID"));
			$("#CONT_STATUS_CD").val(sheet4.GetCellValue(Row, "CONT_STATUS_CD"));
			
			if (confirm("계약상태를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet4.GetCellValue(Row, "CONT_STATUS_CD")+")")  ){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_PUR_CONT_STATUS", document.form1);
			}
		}else if ((sheet4.ColSaveName(Col) == "GAUR_KIND_NM")) {
			if(sheet4.GetCellValue(Row, "GAUR_KIND_NM") == ""){
				 alert("등록된 보증서가 없습니다");
				 return;
			 }
			if(sheet4.GetCellValue(Row, "GUAR_STATUS_CD") == ""){
			 	alert("변경상태(보증)를 선택하십시오.");
				 return;
			}
			if(sheet4.GetCellValue(Row, "MOD_GUAR_ONOFF_YN") == "00" || sheet4.GetCellValue(Row, "MOD_GUAR_ONOFF_YN") == ""){
				 alert("변경온라인을 선택하십시오");
				 return;
			}
			var status = sheet4.GetCellValue(Row,8);
			$("#PUR_CONT_MOD_ID").val(sheet4.GetCellValue(Row, "PUR_CONT_MOD_ID"));
			$("#WARR_SEQ").val(sheet4.GetCellValue(Row, "WARR_SEQ"));
			$("#GUAR_STATUS_CD").val(sheet4.GetCellValue(Row, "GUAR_STATUS_CD"));
			$("#MOD_GUAR_ONOFF_YN").val(sheet4.GetCellValue(Row, "MOD_GUAR_ONOFF_YN"));
			
			if (confirm("보증상태를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet4.GetCellValue(Row, "GUAR_STATUS_CD")+", 변경온라인유무값 : "+sheet4.GetCellValue(Row, "MOD_GUAR_ONOFF_YN")+")")  ){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_PUR_WARR_STATUS", document.form1);
			}
		}
	}
	
	function sheet4_OnSaveEnd(code, msg) {
	    if(code >= 0) {
	    	alert("저장 성공");
	    } else {
	    	alert("저장 실패");
        }
	    
	    jQuery("#btnSearch4").click();
	}
	
	function sheet5_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 if ((sheet5.ColSaveName(Col) == "TEMPLATE_NAME")) {
			var win_id = "ContSubTemplate";
			var p_gubun = "O";
			var p_cont_mod_id = sheet5.GetCellValue(Row, "SUB_CONT_MOD_ID");
			var p_seq = sheet5.GetCellValue(Row, "SEQ");
			
			var argObj = new Object();
			argObj.p_gubun = p_gubun;
		    argObj.p_cont_mod_id = p_cont_mod_id;
		    argObj.p_seq = p_seq;

			var link = "/test/ContTemplatePop.screen";
			    link += "?pop_win_id="+win_id;
			    link += "&p_gubun="+p_gubun;
			    link += "&p_cont_mod_id="+p_cont_mod_id;
			    link += "&p_seq="+p_seq;
			    link += "&sModule=LM";
			    fLayerPop(win_id, link, 1040, 500, '', '', 'NO');
		}else if ((sheet5.ColSaveName(Col) == "MOD_NO")) {
			 if(sheet5.GetCellValue(Row, "CONT_STATUS_CD") == ""){
				 alert("변경상태(계약)를 선택하십시오.");
				 return;
			 }
			var status = sheet5.GetCellValue(Row,8);
			$("#SUB_CONT_MOD_ID").val(sheet5.GetCellValue(Row, "SUB_CONT_MOD_ID"));
			$("#CONT_STATUS_CD").val(sheet5.GetCellValue(Row, "CONT_STATUS_CD"));
			
			if (confirm("계약상태를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet5.GetCellValue(Row, "CONT_STATUS_CD")+")")  ){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_SUB_CONT_STATUS", document.form1);
			}
		}else if ((sheet5.ColSaveName(Col) == "GAUR_KIND_NM")) {
			if(sheet5.GetCellValue(Row, "GAUR_KIND_NM") == ""){
				 alert("등록된 보증서가 없습니다");
				 return;
			 }
			if(sheet5.GetCellValue(Row, "GUAR_STATUS_CD") == ""){
			 	alert("변경상태(보증)를 선택하십시오.");
				 return;
			}
			if(sheet5.GetCellValue(Row, "MOD_GUAR_ONOFF_YN") == "00" || sheet5.GetCellValue(Row, "MOD_GUAR_ONOFF_YN") == ""){
				 alert("변경온라인을 선택하십시오");
				 return;
			}
			var status = sheet5.GetCellValue(Row,8);
			$("#PUR_CONT_MOD_ID").val(sheet5.GetCellValue(Row, "SUB_CONT_MOD_ID"));
			$("#WARR_SEQ").val(sheet5.GetCellValue(Row, "WARR_SEQ"));
			$("#GUAR_STATUS_CD").val(sheet5.GetCellValue(Row, "GUAR_STATUS_CD"));
			$("#MOD_GUAR_ONOFF_YN").val(sheet5.GetCellValue(Row, "MOD_GUAR_ONOFF_YN"));
			
			if (confirm("보증상태를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet5.GetCellValue(Row, "GUAR_STATUS_CD")+", 변경온라인유무값 : "+sheet5.GetCellValue(Row, "MOD_GUAR_ONOFF_YN")+")")  ){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_SUB_WARR_STATUS", document.form1);
			}
		}
	}
	
	function sheet5_OnSaveEnd(code, msg) {
	    if(code >= 0) {
	    	alert("저장 성공");
	    } else {
	    	alert("저장 실패");
       }
	    
	    jQuery("#btnSearch4").click();
	}
	
	function sheet6_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 if ((sheet6.ColSaveName(Col) == "ACMP_NO")) {
			 if(sheet6.GetCellValue(Row, "STATUS_CD2") == ""){
				 alert("변경상태를 선택하십시오.");
				 return;
			 }
			$("#ACMP_ID").val(sheet6.GetCellValue(Row, "ACMP_ID"));
			$("#STATUS_CD2").val(sheet6.GetCellValue(Row, "STATUS_CD2"));
			
			if (confirm("기성상태를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet6.GetCellValue(Row, "STATUS_CD2")+")")  ){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_SUB_PAY_STATUS", document.form1);
			}
		}
	}
	
	function sheet6_OnSaveEnd(code, msg) {
	    if(code >= 0) {
	    	alert("저장 성공");
	    } else {
	    	alert("저장 실패");
       }
	    
	    jQuery("#btnSearch6").click();
	}
	
	function sheet7_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 if ((sheet7.ColSaveName(Col) == "DEPOSIT_SEQ")) {
			 if(sheet7.GetCellValue(Row, "REQ_STATUS2") == ""){
				 alert("변경상태를 선택하십시오.");
				 return;
			 }
			$("#PAYREQ_ID").val(sheet7.GetCellValue(Row, "PAYREQ_ID"));
			$("#REQ_STATUS2").val(sheet7.GetCellValue(Row, "REQ_STATUS2"));
			
			if (confirm("대금신청상태를 변경 하시겠습니까?(변경하려는 코드값 : "+sheet7.GetCellValue(Row, "REQ_STATUS2")+")")  ){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_PUR_PAY_STATUS", document.form1);
			}
		}else if ((sheet7.ColSaveName(Col) == "DEPOSIT_NM")) {
			 if( !(sheet7.GetCellValue(Row, "REMAINDER_ACMP_SUPPLYAMT") == "0" && sheet7.GetCellValue(Row, "REMAINDER_ACMP_VAT") != "0") ){
				 alert("잔여부가세 보정 대상이 아닙니다.");
				 return;
			 }
			 $("#PAYREQ_ID").val(sheet7.GetCellValue(Row, "PAYREQ_ID"));
			if (confirm("잔여부가세를 보정 하시겠습니까?")  ){
				submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_PUR_REVISE_REMAINDER", document.form1);
			}
		}
	}
	
	function sheet7_OnSaveEnd(code, msg) {
	    if(code >= 0) {
	    	alert("저장 성공");
	    } else {
	    	alert("저장 실패");
      }
	    
	    jQuery("#btnSearch7").click();
	}
	
	function SubetemplateClose(){
		setTimeout(function(){fLayerPopClose('Template');},100);
		jQuery("#btnSearch3").click();
	}
	
	function SubContPurTemplateClose(){
		setTimeout(function(){fLayerPopClose('ContPurTemplate');},100);
		jQuery("#btnSearch4").click();
	}
	
	function SubContSubTemplateClose(){
		setTimeout(function(){fLayerPopClose('ContSubTemplate');},100);
		jQuery("#btnSearch5").click();
	}
	
	//검색조건에 기성년월 초기 설정
	function setSearchDate(){
	    
		var newDay = new Date( get_year(), get_month(), "");
	    var lastDay = newDay.getDate();
	    var searchFromDate = get_year() +'-'+ '01';
	    var searchToDate   = get_year() +'-'+ get_month();
    	    
	    jQuery('#searchFromDate').val(searchFromDate);
	    jQuery('#searchToDate').val(searchToDate);

	  	//검색조건 시작일 
		var startDate = get_year() +'-'+ get_month()  +'-'+ '01';
	    if(jQuery('#searchDateStart').val() == ""){
	    	jQuery('#searchDateStart').val(startDate);	
	    }
			
		//검색조건 종료일
		var nowYearMonth = new Date( get_year(), get_month(), "");
	    var lastDay = nowYearMonth.getDate();
		var endDate = get_year() +'-'+ get_month()  +'-'+ lastDay;
	    if(jQuery('#searchDateEnd').val() == ""){
	    	jQuery('#searchDateEnd').val(endDate);	
	    }
	}
	
	function calendar(thisDayObj){
		dlgCalendar(thisDayObj);
	}
	
	function doResult(resultObj) {
		try {
			document.form1.isSubmit = false;
			
			if( resultObj.getRequestEvent() == "SAVE_SEL_CNT") {
				if($("#and_1").val().trim() != "" && $("#and_2").val().trim() != ""  && $("#and_3").val().trim() != "" && $("#and_1_val").val().trim() != "" && $("#and_2_val").val().trim() != ""  && $("#and_3_val").val().trim() != ""){
					alert("SELECT COUNT(*) AS CNT \n  FROM "+$("#table_nm").val().trim()+"\n WHERE "+$("#where").val().trim()+" = "+$("#where_val").val().trim()+"\n   AND "+$("#and_1").val().trim()+" = "+$("#and_1_val").val().trim()+"\n   AND "+$("#and_2").val().trim()+" = "+$("#and_2_val").val().trim()+"\n   AND "+$("#and_3").val().trim()+" = "+$("#and_3_val").val().trim() );
				}else if($("#and_1").val().trim() != "" && $("#and_2").val().trim() != "" && $("#and_1_val").val().trim() != "" && $("#and_2_val").val().trim() != ""){
					alert("SELECT COUNT(*) AS CNT \n  FROM "+$("#table_nm").val().trim()+"\n WHERE "+$("#where").val().trim()+" = "+$("#where_val").val().trim()+"\n   AND "+$("#and_1").val().trim()+" = "+$("#and_1_val").val().trim()+"\n   AND "+$("#and_2").val().trim()+" = "+$("#and_2_val").val().trim() );
				}else if($("#and_1").val().trim() != "" && $("#and_1_val").val().trim() != ""){
					alert("SELECT COUNT(*) AS CNT \n  FROM "+$("#table_nm").val().trim()+"\n WHERE "+$("#where").val().trim()+" = "+$("#where_val").val().trim()+"\n   AND "+$("#and_1").val().trim()+" = "+$("#and_1_val").val().trim() );
				}else if($("#where").val().trim() != "" && $("#where_val").val().trim() != ""){
					alert("SELECT COUNT(*) AS CNT \n  FROM "+$("#table_nm").val().trim()+"\n WHERE "+$("#where").val().trim()+" = "+$("#where_val").val().trim() );
				}
				
				if (confirm("SQL결과값을 확인하셨습니까?")){
					submitXmlRequest("/test/ModStatusList_form.screen", "SAVE_MOD_LIST", document.form1);
				}
			}else if( resultObj.getRequestEvent() == "DEL_SEL_CNT") {
				if($("#del_and_1").val().trim() != "" && $("#del_and_2").val().trim() != ""  && $("#del_and_3").val().trim() != "" && $("#del_and_1_val").val().trim() != "" && $("#del_and_2_val").val().trim() != ""  && $("#del_and_3_val").val().trim() != ""){
					alert("SELECT COUNT(*) AS CNT \n  FROM "+$("#del_table_nm").val().trim()+"\n WHERE "+$("#del_where").val().trim()+" = "+$("#del_where_val").val().trim()+"\n   AND "+$("#del_and_1").val().trim()+" = "+$("#del_and_1_val").val().trim()+"\n   AND "+$("#del_and_2").val().trim()+" = "+$("#del_and_2_val").val().trim()+"\n   AND "+$("#del_and_3").val().trim()+" = "+$("#del_and_3_val").val().trim() );
				}else if($("#del_and_1").val().trim() != "" && $("#del_and_2").val().trim() != "" && $("#del_and_1_val").val().trim() != "" && $("#del_and_2_val").val().trim() != ""){
					alert("SELECT COUNT(*) AS CNT \n  FROM "+$("#del_table_nm").val().trim()+"\n WHERE "+$("#del_where").val().trim()+" = "+$("#del_where_val").val().trim()+"\n   AND "+$("#del_and_1").val().trim()+" = "+$("#del_and_1_val").val().trim()+"\n   AND "+$("#del_and_2").val().trim()+" = "+$("#del_and_2_val").val().trim() );
				}else if($("#del_and_1").val().trim() != "" && $("#del_and_1_val").val().trim() != ""){
					alert("SELECT COUNT(*) AS CNT \n  FROM "+$("#del_table_nm").val().trim()+"\n WHERE "+$("#del_where").val().trim()+" = "+$("#del_where_val").val().trim()+"\n   AND "+$("#del_and_1").val().trim()+" = "+$("#del_and_1_val").val().trim() );
				}else if($("#del_where").val().trim() != "" && $("#del_where_val").val().trim() != ""){
					alert("SELECT COUNT(*) AS CNT \n  FROM "+$("#del_table_nm").val().trim()+"\n WHERE "+$("#del_where").val().trim()+" = "+$("#del_where_val").val().trim() );
				}
				
				if (confirm("SQL결과값을 확인하셨습니까?")){
					submitXmlRequest("/test/ModStatusList_form.screen", "DEL_MOD_LIST", document.form1);
				}
			}else if( resultObj.getRequestEvent() == "SAVE_MOD_LIST") {
				if( resultObj.getSuccess() ) 
				{
					alert("수정되었습니다.");
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "DEL_MOD_LIST") {
				if( resultObj.getSuccess() ) 
				{
					alert("삭제되었습니다.");
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_BID_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("입찰상태가 수정되었습니다.");
					jQuery("#btnSearch1").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_SUPP_BID_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("구매업체 입찰상태가 수정되었습니다.");
					jQuery("#btnSearch1").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_BID_MASTER_NM") {
				if( resultObj.getSuccess() ) 
				{
					alert("입찰명이 수정되었습니다.");
					jQuery("#btnSearch1").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_TBE_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("TBE상태가 수정되었습니다.");
					jQuery("#btnSearch1").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_EXCHANGE_VALUE") {
				if( resultObj.getSuccess() ) 
				{
					alert("환율값이 수정되었습니다.");
					jQuery("#btnSearch1").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_ERP_SIGN_CLASS") {
				if( resultObj.getSuccess() ) 
				{
					alert("결재상태가 수정되었습니다.");
					jQuery("#btnSearch2").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_PUR_CONT_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("구매계약상태가 수정되었습니다.");
					jQuery("#btnSearch4").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_PUR_WARR_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("구매보증상태가 수정되었습니다.");
					jQuery("#btnSearch4").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_SUB_CONT_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("외주계약상태가 수정되었습니다.");
					jQuery("#btnSearch5").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_SUB_WARR_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("외주보증상태가 수정되었습니다.");
					jQuery("#btnSearch5").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "START_SIGN_TEST") {
				if( resultObj.getSuccess() ) 
				{
					alert("결재 처리 완료되었습니다.");
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_SUB_PAY_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("외주기성상태가 수정되었습니다.");
					jQuery("#btnSearch6").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_PUR_PAY_STATUS") {
				if( resultObj.getSuccess() ) 
				{
					alert("대금신청상태가 수정되었습니다.");
					jQuery("#btnSearch7").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}else if( resultObj.getRequestEvent() == "SAVE_PUR_REVISE_REMAINDER") {
				if( resultObj.getSuccess() ) 
				{
					alert("잔여 부가세가 보정되었습니다.");
					jQuery("#btnSearch7").click();
				}else{
					alert("입력값을 확인하십시오.");
				}
			}
		}
		catch(errorObject) {
			showErrorDlg("doResult()", errorObject);
		}
	}
	
</script>



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

<form id="form2" name="form2" method="post" modular:type="search" style="width:100%;height:100%;">	
	<INPUT type="hidden" name="fevent" id="fevent" value="">		

<div align="left" id="title">
    <ul>
     <li>ERP결재상태 변경</li>
    </ul>
</div> 
	<!-- 검색조건 시작 -->
	<table id="search-table" class="search-form-table">
		<colgroup>
			<col width="100" />
			<col width="100" />
			<col width="100" />
			<col width="100" />
			<col width="100" />
			<col width="100" />
			<col width="100" />
		</colgroup>
		<tr height="25">
   			<th>
       			KEY_COL1
   			</th>
  				<td>
    				<input type="text" name="key_col1" id="key_col1" style="width: 90%;"  value=""/>
  				</td>
			<th>
       			KEY_COL2
   			</th>
  				<td>
    				<input type="text" name="key_col2" id="key_col2" style="width: 90%;"  value=""/>
  				</td>
  			<th>
      			KEY_COL3
  			</th>
  				<td>
  					<input type="text" name="key_col3" id="key_col3" style="width: 90%;"  value=""/>
  				</td>
  			<td class="button" rowspan="2">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch2">검색</a></span>
			</td>
  			</tr>
  			<th>
       			KEY_COL4
   			</th>
  				<td>
    				<input type="text" name="key_col4" id="key_col4" style="width: 90%;"  value=""/>
  				</td>
			<th>
       			KEY_COL5
   			</th>
  				<td>
    				<input type="text" name="key_col5" id="key_col5" style="width: 90%;"  value=""/>
  				</td>
  			<th>
      			KEY_COL6
  			</th>
  				<td>
  					<input type="text" name="key_col6" id="key_col6" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
	</table>
	<!-- 검색조건 종료 -->
	
<div id="sheet2_div" style="padding-top:5px; height: auto; min-height: 200px; overflow: auto;">
	<script>createIBSheet('sheet2','100%', '180px');</script>
</div>


<div align="left" id="title">
    <ul>
     <li>전자조달 템플릿 관리</li>
    </ul>
    <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch3">검색</a></span>
</div>   
	<!-- 검색조건 시작 -->
<div id="sheet3_div" style="padding-top:5px; height: auto; min-height: 550px; overflow: auto;">
	<script>createIBSheet('sheet3','100%', '550px');</script>
</div>
	
	<div align="left" id="title">
    <ul>
     <li>입찰상태변경</li>
    </ul>
  </div> 
	<!-- 검색조건 시작 -->
	<table id="search-table" class="search-form-table">
		<colgroup>
			<col width="100" />
			<col width="350" />
			<col width="100" />
			<col width="*" />
			<col width="150" />
		</colgroup>
		<tr>
			<th>현장</th>
			<td>
				<%=InputText.getSiteCodeNew("p_dept_cd", "p_dept_nm", "", user, params.get("p_dept_cd"), params.get("p_dept_nm"))%>
			</td>
			<th>입찰공고명</th>
			<td>
				<INPUT type="text" name="P_BID_MASTER_NM" id="P_BID_MASTER_NM" class="input" value="<%=params.get("P_BID_MASTER_NM") %>" style="width:90%"> 
			</td>
			<td class="button" rowspan="2">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch1">검색</a></span>
			</td>						
		</tr>
		<tr>
			<th>입찰번호</th>
			<td>
				<INPUT type="text" name="P_BID_NO" id="P_BID_NO" class="input" value="<%=params.get("P_BID_NO") %>" style="width:90%"> 
			</td>
			<th>상태</th>
			 <td><%=CommCodeManager.getSelectCodeSearchList("BID_STATUS_CD","P_DEMANDED_STATUS","height=18;width:80px;","<option value=''>--전체--</option>",params.get("P_DEMANDED_STATUS"),"","DETAILCD") %>
			</td>
		</tr>
	</table>
	<!-- 검색조건 종료 -->
	
<div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
	<script>createIBSheet('sheet1','100%', '300px');</script>
</div>


<div align="left" id="title">
    <ul>
     <li>구매 계약서 관리</li>
    </ul>
</div>   
	<!-- 검색조건 시작 -->
	<table id="search-table" class="search-form-table">
		<colgroup>
			<col width="100" />
			<col width="350" />
			<col width="100" />
			<col width="*" />
			<col width="150" />
		</colgroup>
		<tr>
			<th>현장</th>
			<td>
				<%=InputText.getSiteCodeNew("p_dept_cd2", "p_dept_nm2", "", user, params.get("p_dept_cd2"), params.get("p_dept_nm2"))%>
			</td>
			<th>계약명</th>
			<td>
				<INPUT type="text" name="P_CST_DOC_NAME" id="P_CST_DOC_NAME" class="input" value="<%=params.get("P_CST_DOC_NAME") %>" style="width:90%"> 
			</td>
			<td class="button" rowspan="2">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch4">검색</a></span>
			</td>						
		</tr>
		<tr>
			<th>계약번호</th>
			<td>
				<INPUT type="text" name="P_ORD_DOC_NO" id="P_ORD_DOC_NO" class="input" value="<%=params.get("P_ORD_DOC_NO") %>" style="width:90%"> 
			</td>
			<th>차수</th>
			<td>
				<INPUT type="text" name="P_MOD_NO" id="P_MOD_NO" class="input" value="<%=params.get("P_MOD_NO") %>" style="width:90%"> 
			</td>
		</tr>
	</table>
	<!-- 검색조건 종료 -->
<div id="sheet4_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
	<script>createIBSheet('sheet4','100%', '300px');</script>
</div>

<div align="left" id="title">
    <ul>
     <li>외주 계약서 관리</li>
    </ul>
</div>   
	<!-- 검색조건 시작 -->
	<table id="search-table" class="search-form-table">
		<colgroup>
			<col width="100" />
			<col width="350" />
			<col width="100" />
			<col width="*" />
			<col width="150" />
		</colgroup>
		<tr>
			<th>현장</th>
			<td>
				<%=InputText.getSiteCodeNew("p_dept_cd3", "p_dept_nm3", "", user, params.get("p_dept_cd3"), params.get("p_dept_nm3"))%>
			</td>
			<th>계약명</th>
			<td>
				<INPUT type="text" name="P_BUILD_NAME" id="P_BUILD_NAME" class="input" value="<%=params.get("P_BUILD_NAME") %>" style="width:90%"> 
			</td>
			<td class="button" rowspan="2">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch5">검색</a></span>
			</td>						
		</tr>
		<tr>
			<th>계약번호</th>
			<td>
				<INPUT type="text" name="P_CON_DOC_NO" id="P_CON_DOC_NO" class="input" value="<%=params.get("P_CON_DOC_NO") %>" style="width:90%"> 
			</td>
			<th>차수</th>
			<td>
				<INPUT type="text" name="P_MOD_NO" id="P_MOD_NO" class="input" value="<%=params.get("P_MOD_NO") %>" style="width:90%"> 
			</td>
		</tr>
	</table>
	<!-- 검색조건 종료 -->
<div id="sheet5_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
	<script>createIBSheet('sheet5','100%', '300px');</script>
</div>

<div align="left" id="title">
    <ul>
     <li>외주 기성 관리</li>
    </ul>
</div>   
	<!-- 검색조건 영역 : 시작 -->
	<table id="search-table" class="search-form-table">
		<colgroup>
			<col width="100px">
			<col width="*">
			<col width="100px">
			<col width="*">
			<col width="100px">
		</colgroup>
		<TR>
			<Th>현장</Th>
			<TD>
				<%=InputText.getSiteCodeNew("searchDeptCd", "searchDeptNm", "", user, "", "")%>
			</TD>
			<TH>업체명</TH>
			<TD>
				<INPUT type="text" id="searchCorp" name="searchCorp" value="" maxlength="50" class="input" style="IME-MODE : active; width:90%;"  desc='업체명' onKeyPress="doKeyPress();">
			</TD>
			<TD class="button" rowspan="2">
				<!-- 검색버튼 영역 : 시작 -->
			    <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch6">검색</a></span>
			    <!-- 검색버튼 영역 : 종료 -->   
			</TD>
		</TR>
		<TR>
			<Th>계약명</Th>
			<TD>
				<INPUT type="text" id="searchBuldNm" name="searchBuldNm" value="" maxlength="50" class="input" style="IME-MODE : active; width:90%;"  desc='계약명' onKeyPress="doKeyPress();">
			</TD>
  			<Th>기성년월</Th>
   			<TD>
   				<%= InputText.get("searchFromDate", "", 10, 50, "hangule,center, desc=기성년월, ReadOnly") %>
				<IMG name="start_img" id="calender_from" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgMCalendar('searchFromDate');">
				~
				<%= InputText.get("searchToDate", "", 10, 50, "hangule,center, desc=기성년월, ReadOnly") %>
				<IMG name="start_img" id="calender_to" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgMCalendar('searchToDate');">
			</TD>	
  		</TR>
	</TABLE>	
	<!-- 검색조건 종료 -->
<div id="sheet6_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
	<script>createIBSheet('sheet6','100%', '300px');</script>
</div>





	<div align="left" id="title">
    	<ul>
     		<li>대금지급관리</li>
    	</ul>
  	</div> 

	<!-- 검색조건 영역 : 시작 -->
	<table id="search-table" class="search-form-table">
		<colgroup>
			<col width="100px">
			<col width="40%">
			<col width="100px">
			<col/>
			<col width="100px">
		</colgroup>
		<TR>
			<Th>현장</Th>
			<TD>
				<%=InputText.getSiteCodeNew("searchDeptCd2", "searchDeptNm2", "", user, "", "")%>
			</TD>
			<Th>계약명</Th>
			<TD>
				<INPUT type="text" id="searchBuildName" name="searchBuildName" maxlength="50" class="input" style="IME-MODE : active;width:95%;"   desc='계약명' onKeyPress="doKeyPress();">
			</TD>			
			<TD class="button" rowspan="3">
				<!-- 검색버튼 영역 : 시작 -->
			    <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch7">검색</a></span>
			    <!-- 검색버튼 영역 : 종료 -->   
			</TD>
		</TR>
		<TR>
  			<Th>증빙일</Th>
   			<TD>
				<%= InputText.get("searchDateStart", initSearchDateStart, 15, 10, "Center, date, PerSize, readonly", "date", "") %>
				<a href="JavaScript:calendar('searchDateStart');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
				&nbsp;~&nbsp;
				<%= InputText.get("searchDateEnd", initSearchDateEnd, 15, 10, "Center, date, PerSize, readonly", "date", "") %>
				<a href="JavaScript:calendar('searchDateEnd');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>			
			</TD>
<%-- 			<th>상태</th>
			<td colspan="1">
				<%= HTMLMaker.getSelectTag(statusComboList, "DETAILCD", "DETAILNM", "searchStatusCd", "width:25%;height=18;", "<option value=''>--전체--</option>", initStatusCd) %>
			</td> --%>
			<TH>업체명</TH>
			<TD colspan="3">
				<INPUT type="text" id="searchCorp2" name="searchCorp2" value="" maxlength="50" class="input" style="IME-MODE : active; width:42%;"  desc='업체명' onKeyPress="doKeyPress();">
			</TD>
  		</TR>
	</TABLE>	

	<div id="sheet7_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
		<script>createIBSheet('sheet7','100%', '350px');</script>
	</div>







</form>

<form id="form1" name="form1" method="post">
<INPUT type="hidden" name="fevent" id="fevent" value="">
<INPUT type="hidden" name="p_user_sabun" value="">
	<INPUT type="hidden" name="BID_NO" value="">
	<INPUT type="hidden" name="BID_DEG" value="">
	<INPUT type="hidden" name="VENDOR_CD" value="">	
	<INPUT type="hidden" name="MOD_STATUS_CD" value="">	
	<INPUT type="hidden" name="SUPP_MOD_STATUS_CD" value="">
	<INPUT type="hidden" name="TBE_MOD_STATUS_CD" value="">
	<INPUT type="hidden" name="BID_MASTER_NM" value="">	
	<INPUT type="hidden" name="MOD_BID_MASTER_NM" value="">
	<INPUT type="hidden" name="DEMANDED_ID" value="">
	<INPUT type="hidden" name="DOC_ID" value="">
	<INPUT type="hidden" name="MOD_SIGN_DECI_CLASS" value="">
	<INPUT type="hidden" name="MOD_EXCHANGE" value="">
	<INPUT type="hidden" name="PUR_CONT_MOD_ID" value="">
	<INPUT type="hidden" name="SUB_CONT_MOD_ID" value="">
	<INPUT type="hidden" name="CONT_STATUS_CD" value="">
	<INPUT type="hidden" name="GUAR_STATUS_CD" value="">
	<INPUT type="hidden" name="WARR_SEQ" value="">	
	<INPUT type="hidden" name="MOD_GUAR_ONOFF_YN" value="">
	<INPUT type="hidden" name="ACMP_ID" value="">	
	<INPUT type="hidden" name="STATUS_CD2" value="">	
	<INPUT type="hidden" name="PAYREQ_ID" value="">	
	<INPUT type="hidden" name="REQ_STATUS2" value="">	
   	
<!-- 제목 및 버튼(UPDATE) -->
   	<table width="100%" id="update_table1">
		<colgroup>
			<col width="500" />
			<col width="*" />
		</colgroup>
		<tr>
		   	<th>
			   <div align="left" id="title">
			    <ul>
			     <li>데이타 수정(update)	<span style="color:yellow">     * SET 입력시 ''입력 필수</span></li>
			    </ul>
			   </div>
		   </th>
		   <td align="right">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">수정</a></span>
		   </td>
	   	</tr>
   	</table>
   	

	<TABLE class="form-table" id="update_table2">
		<col width="150px">
		<col>
		<col width="150px">
		<col>
		
		<tr height="25"> 
  			<!-- 검색조건 타이틀 1 -->
  				<th class="required">
  				테이블명
  				</th>
 					<td colspan="3">
						<input type="text" name="table_nm" id="table_nm" numberOnly="true" style="width: 38%;" maxlength="100" value=""/>
					</td>
				<tr height="25">
  				<Th class="required">
      			SET_1
  				</th>
  				<td>
  					<input type="text" name="set_1" id="set_1" style="width: 90%;"  value=""/>
  				</td>
				<th class="required">
       			SET_1(값)
   				</th>
  				<td>
    					<input type="text" name="set_1_val" id="set_1_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  			<tr height="25">
   				<th>
       			SET_2
   				</th>
  				<td>
    					<input type="text" name="set_2" id="set_2" style="width: 90%;"  value=""/>
  				</td>
				<th>
       			SET_2(값)
   				</th>
  				<td>
    					<input type="text" name="set_2_val" id="set_2_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  				<Th>
      			SET_3
  				</th>
  				<td>
  					<input type="text" name="set_3" id="set_3" style="width: 90%;"  value=""/>
  				</td>
					<th>
       			SET_3(값)
   				</th>
  				<td>
    					<input type="text" name="set_3_val" id="set_3_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  			<tr height="25">
   				<th>
       			SET_4
   				</th>
  				<td>
    					<input type="text" name="set_4" id="set_4" style="width: 90%;"  value=""/>
  				</td>
					<th>
       			SET_4(값)
   				</th>
  				<td>
    					<input type="text" name="set_4_val" id="set_4_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  			<tr height="25">
   				<th class="required">
       			WHERE
   				</th>
  				<td>
    					<input type="text" name="where" id="where" style="width: 90%;"  value=""/>
  				</td>
					<th class="required">
       			WHERE(값)
   				</th>
  				<td colspan="3" >
    					<input type="text" name="where_val" id="where_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  			<tr height="25">
   				<th>
       			AND_1
   				</th>
  				<td>
    					<input type="text" name="and_1" id="and_1" style="width: 90%;"  value=""/>
  				</td>
					<th>
       			AND_1(값)
   				</th>
  				<td colspan="3" >
    					<input type="text" name="and_1_val" id="and_1_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  			<tr height="25">
   				<th>
       			AND_2
   				</th>
  				<td>
    					<input type="text" name="and_2" id="and_2" style="width: 90%;"  value=""/>
  				</td>
					<th>
       			AND_2(값)
   				</th>
  				<td colspan="3" >
    					<input type="text" name="and_2_val" id="and_2_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  			<tr height="25">
   				<th>
       			AND_3
   				</th>
  				<td>
    					<input type="text" name="and_3" id="and_3" style="width: 90%;"  value=""/>
  				</td>
				<th>
       			AND_3(값)
   				</th>
  				<td colspan="3" >
    					<input type="text" name="and_3_val" id="and_3_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
	</table>

<!-- 제목 및 버튼(DELETE) -->
   	<table width="100%" id="delete_table1">
		<colgroup>
			<col width="500" />
			<col width="*" />
		</colgroup>
		<tr>
		   	<th>
			   <div align="left" id="title">
			    <ul>
			     <li>데이타 삭제(delete)</li>
			    </ul>
			   </div>
		   </th>
		   <td align="right">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnDel">삭제</a></span>
		   </td>
	   	</tr>
   	</table>
   	

	<TABLE class="form-table" id="delete_table2">
		<col width="150px">
		<col>
		<col width="150px">
		<col>
		
		<tr height="25"> 
  			<!-- 검색조건 타이틀 1 -->
  				<th class="required">
  					테이블명
  				</th>
 					<td colspan="3">
						<input type="text" name="del_table_nm" id="del_table_nm" numberOnly="true" style="width: 38%;" maxlength="100" value=""/>
					</td>
  			<tr height="25">
   				<th class="required">
       			WHERE
   				</th>
  				<td>
    					<input type="text" name="del_where" id="del_where" style="width: 90%;"  value=""/>
  				</td>
				<th class="required">
       			WHERE(값)
   				</th>
  				<td colspan="3" >
    					<input type="text" name="del_where_val" id="del_where_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  			<tr height="25">
   				<th>
       			AND_1
   				</th>
  				<td>
    					<input type="text" name="del_and_1" id="del_and_1" style="width: 90%;"  value=""/>
  				</td>
				<th>
       			AND_1(값)
   				</th>
  				<td colspan="3" >
    					<input type="text" name="del_and_1_val" id="del_and_1_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  			<tr height="25">
   				<th>
       			AND_2
   				</th>
  				<td>
    					<input type="text" name="del_and_2" id="del_and_2" style="width: 90%;"  value=""/>
  				</td>
				<th>
       			AND_2(값)
   				</th>
  				<td colspan="3" >
    					<input type="text" name="del_and_2_val" id="del_and_2_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
  				<tr height="25">
   				<th>
       			AND_3
   				</th>
  				<td>
    					<input type="text" name="del_and_3" id="del_and_3" style="width: 90%;"  value=""/>
  				</td>
				<th>
       			AND_3(값)
   				</th>
  				<td colspan="3" >
    					<input type="text" name="del_and_3_val" id="del_and_3_val" style="width: 90%;"  value=""/>
  				</td>
  			</tr>
	</table>	

<!-- 제목 및 버튼(결재 테스트) -->	
  	<table width="100%" id="update_table3">
		<colgroup>
			<col width="500" />
			<col width="*" />
		</colgroup>
		<tr>
		   	<th>
			   <div align="left" id="title">
			    <ul>
			     <li>결재테스트	<span style="color:yellow">     * 개발위주 테스트 진행 요망</span></li>
			    </ul>
			   </div>
		   </th>
		   <td align="right">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btnStart">실행</a></span>
		   </td>
	   	</tr>
   	</table>
   	
	<TABLE class="form-table" id="update_table4">
		<col width="150px">
		<col>
		<col width="150px">
		<col>
		
		<tr height="25"> 
  		<!-- 검색조건 타이틀 1 -->
  			<th class="required">
  			SIGN_INTERFACE_ID
  			</th>
 			<td>
				<input type="text" name="sign_interface_id" id="sign_interface_id" numberOnly="true" style="width: 38%;" maxlength="100" value=""/>
			</td>
			<Th class="required">
      		SIGN_DECI_CLASS
  			</th>
  			<td>
  				<input type="text" name="sign_deci_class" id="sign_deci_class" numberOnly="true" style="width: 38%;" maxlength="100" value=""/>
  			</td>
  		</tr>
	</table>	
</form>