<%--
  - FileName   : OutSupplierApprList.jsp
  - Author(s)  : Sung Min Lee
  - Date       : 2014.09.02
  -
  - 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.*" %>
<%@page import="java.net.URLEncoder"%>
<%@ page import="com.udapsoft.waf.common.util.StringUtils" %>
<%@ page import="kr.co.udapsoft.common.code.CommCodeManager" %>
<%@ 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();
    
    ValueObject vo = storage.getValueObject("ResultDetail01BizVo");
    RowSet fileRowSet = storage.getRowSet("RESULT_PDF");
    RowSet ADD_02 = new RowSetImpl();
    
    String pageEvent = storage.getEvent();
%>

<script type="text/javascript">
<!--

	$(document).on("keyup", "input:text[numberOnly]", function() 
	{
	    $(this).val( $(this).val().replace(/[^0-9]/gi,"") );		//숫자만입력 정규식...
	    $(this).val($(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));  //콤마찍기 정규식...귀찮타
	 });
	 
	$(document).on("keyup", "input:text[number]", function() 
   	{
   	    $(this).val( $(this).val().replace(/[^0-9]/gi,"") );		//숫자만입력 정규식...
   	 });
	
	$(function(){
		$.gridInit = function()
		{
	        var init_sheet = {};
	        init_sheet.Cfg = {SearchMode:2, MergeSheet:msHeaderOnly, Page:10, SumPosition:1};
			
			init_sheet.Cols = [
										{Header:"삭제",								Type:"DelCheck",			SaveName:"DEL_CHECK", 				Width:50, 		Align:"Center",     Hidden:"True"},
										{Header:'Status',							Type:"Status", 			    SaveName:"STATUS", 					Width:0, 		Align:"Center", 	Edit:"False",  Hidden:"True"},
										{Header:"SEQ",	 							Type:"Text", 				SaveName:"SEQ",						Width:80, 	 	Align:"Center", 	Hidden:"True"},
										{Header:"SUB_CONT_MOD_ID",	 		        Type:"Text", 				SaveName:"SUB_CONT_MOD_ID",	        Width:80, 	 	Align:"Center", 	Hidden:"True"},
										{Header:"ACMP_YYYY",	 					Type:"Text", 				SaveName:"ACMP_YYYY",				Width:80, 	 	Align:"Center", 	Hidden:"True"},
										{Header:"SOC_CD",	 						Type:"Text", 				SaveName:"SOC_CD",					Width:80, 	 	Align:"Center", 	Hidden:"True"},
										{Header:"공사(종)명",	 						Type:"Text", 				SaveName:"CONT_NM",					Width:80, 	 	Align:"Center"},
										{Header:"계약액",	 							Type:"AutoSum", 			SaveName:"CONT_AMT",				Width:80, 	 	Align:"Right", 	    Format:"#,##0"},
										{Header:"착공년월일",						    Type:"Date", 				SaveName:"CONT_SDATE",				Width:80, 	 	Align:"Right"},
										{Header:"준공년월일",	 					    Type:"Date", 				SaveName:"CONT_EDATE",				Width:80, 	 	Align:"Right"},
										{Header:"전년도 기성액",	 					Type:"AutoSum", 			SaveName:"PRV_PAY_AMT",			    Width:80, 	 	Align:"Right", 	    Format:"#,##0"},
										{Header:"당년도 기성액",	 					Type:"AutoSum", 			SaveName:"CUR_PAY_AMT",			    Width:80, 	 	Align:"Right", 	    Format:"#,##0"},
										{Header:"하도급 금액",	 					    Type:"AutoSum", 			SaveName:"SCONT_AMT",				Width:80, 	 	Align:"Right", 	    Format:"#,##0",  Hidden:"True"},
										{Header:"미기성 금액",	 					    Type:"AutoSum", 			SaveName:"PAY_NAMT",				Width:80, 	 	Align:"Right", 	    Format:"#,##0"}
										
			                   		];
			
			
			init_sheet.HeaderMode = {Sort:1};
			IBS_InitSheet(sheet1, init_sheet);
			sheet1.SetEditable(false);
			sheet1.SetDataAutoTrim(0);
// 			sheet1.SetEditable(false);
			sheet1.SetCountPosition(0);
			sheet1.SetCellText(sheet1.LastRow(), "CONT_NM", "합 계");
			sheet1.GetSumFontBold(1);
			
		
			sheet1.FitColWidth();
		}
	    
	    
	                       
	    $.searchList = function()
		{
		    $("#fevent").val("GET_LIST");
		    
			var url = Modular.model.PageContext.CONTEXT_ROOT + "/portal/result/ResultDetail03_sheet.screen";
			Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 30, "");
			
		};
		
		
	    $("#btn_sheet_add").click(function(){
	        sheet1.DataInsert(-1);
	    });
		
		
	    $(".numberic").each(function(){
	        $(this).val($(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(',')); 
	    });
		    
		$.callCalendar = function(id){
	        
	        var str_value = id;
	        var re = new RegExp("_", "ig");
	        var resultArray = str_value.match(re);
	        
	        if(resultArray.length == 1)
	        {
	            dlgCalendar(id);
	        }
	        else if(resultArray.length == 2)
	        {
	            id = id.substring(0, id.lastIndexOf("_"));
	            dlgCalendar(id);
	        }
    	};
	    
	    
	    $("#btn_list").click(function(){
	        
	        //"/result/outside/ResultIngList.screen"
	        $("#fevent").val("");
            $("#form1").attr("action", "<%=params.get("p_List") %>");
	        
		    $("#form1").attr("target", "_self");
			$("#form1").attr("method", "post");
			$("#form1").submit();
		    
	    });
         $("#btn_preview").click(function(){
		    
        	 var reportInfo = new ReportInfo();
			    
	            reportInfo.title = "대한전문건설협회 실적증명";
	            reportInfo.reportName = "/report/mrd/buyer/supplier/buld_application2.mrd";
	            reportInfo.set("<%=vo.get("corp_id")%>");    			// $1
	            reportInfo.set("<%=vo.get("sub_cont_mod_id")%>");    	// $2
	            reportInfo.set("<%=vo.get("acmp_yyyy")%>");    			// $3
	            reportInfo.set("<%=vo.get("soc_cd")%>");    			// $4
	            
		        reportInfo.width = 1000;                         	// Default: 1024
		        reportInfo.height = 700;                         	// Default: 768
				reportInfo.showPopup();
				$("#pdf").val("");
		    
		});
	    
	    $("#btn_save").click(function(){
	        var f = document.form1;
	        fMakeItemInfo();
	        if($(':radio[name="p_reson"]:checked').val() == undefined)
            {
	            alert("발급 승인여부를 선택해 주세요.");
	            return;
            }
	        
	        if(confirm($("#btn_save").text() + " 하시겠습니까?"))
            {
	            if($(':radio[name="p_reson"]:checked').val() == "91" )
	            {
	                if($("#p_return_reson").val().trim() == "")
                    {
	                    alert("반려사유를 입력해 주세요.");
	                    return $("#p_return_reson").focus();
                    }
		            $("#fevent").val("SAVE_STATUS");
		            submitXmlRequest("/result/outside/ResultDetail01_form.screen", "SAVE_STATUS", f);
                }else{
                	$("#fevent").val("SIGN_OK");
		            submitXmlRequest("/result/outside/ResultDetail01_form.screen", "SIGN_OK", f);
                }
            }
	       
	    });
	    
	    //2016.1.25
	    $("#btn_delete").click(function(){
	        var f = document.form1;
	        
	        if(confirm( "반려 하시겠습니까?"))
            {
	        	$(':radio[name="p_reson"]:checked').val("91");
	            $("#fevent").val("SAVE_STATUS");
		            submitXmlRequest("/result/outside/ResultDetail01_form.screen", "SAVE_STATUS", f);	            
            }
	       
	    });
	    
		$(':radio[name="p_reson"]').click(function(){
	        
	        if($(':radio[name="p_reson"]:checked').val() == "91" )
            {
	            $("#reson_area").css("display", "table-row");
	            $("#btn_save").text("반려");
	            $("#p_return_reson").val("");
	            
	            $("#p_return_reson").removeClass();
	            $("#p_return_reson").attr("readonly", false);
	            $("#p_return_reson").focus();
            }
	        else
            {
	            $("#reson_area").css("display", "none");
	            $("#btn_save").text("승인");
	            
	            $("#p_return_reson").val("");
	            $("#p_return_reson").addClass("bg_gry");
	            $("#p_return_reson").attr("readonly", true);
            }
	    });
	    
	    
	});
	
	$(document).ready(function(){
		$.gridInit(sheet1);
		$.searchList();
		/* viewSheet(); */
		
	    if($("#p_success_gubun").val() == "R")
        {
	        $(':radio[name="p_reson"]').attr("disabled", true);
	        $(':input').attr("readonly", true);
	        $(':input[type="text"]').addClass("bg_gry");
	        $(':input[type="text"]').addClass("input_blank");
        }
	    
	    
	    
	    if($(':radio[name="p_reson"]:checked').val() == "91" )
        {
            $("#reson_area").css("display", "table-row");
            $("#btn_save").text("반려");
            
            $("#p_return_reson").removeClass();
            $("#p_return_reson").attr("readonly", false);
            $("#p_return_reson").focus();
        }
        else
        {
            $("#reson_area").css("display", "none");
            $("#btn_save").text("저장");
            
            $("#p_return_reson").val("");
            $("#p_return_reson").addClass("bg_gry");
            $("#p_return_reson").attr("readonly", true);
        }
	    
	    
	    if($("#p_page_gubun").val() == "info")
        {
	        if($("#prog_stat_cd").val() == "20")
            {
	            $("#btn_issue_req").css("display", "inline");
		        $(':input').attr("readonly", true);
		        $(':input[type="text"]').addClass("bg_gry");
		        $(':input[type="text"]').addClass("input_blank");
// 	            $("#btn_save").css("display", "none");
		        $("#btn_delete").css("display", "none");  //2016.1.25
            }
	        else  if($("#prog_stat_cd").val() == "30")
            {
	            $("#btn_save_area").css("display", "none");
            }
	        else  if($("#prog_stat_cd").val() == "91")
            {
	        	$("#p_return_reson").removeClass();
	            $("#p_return_reson").attr("readonly", false);
	            $(':input').attr("readonly", false);
	            $("#btn_issue_req").css("display", "none");
	            $("#btn_delete").css("display", "none");
	            
            }
	        else  if($("#prog_stat_cd").val() == "10")
            {
    			$("#btn_issue_req").css("display", "none");
 	            $("#btn_save").css("display", "none");
	            $("#btn_delete").css("display", "none");
            }
	        else
            {
	        	$("#btn_issue_req").css("display", "none");
	            $("#btn_delete").css("display", "none");
	            $("#btn_save_area").css("display", "none");
	            
	            $("#issue_no").attr("readonly", "true");
	            $("#lic_org").attr("readonly", "true");
	            $("#lic_date").attr("readonly", "true");
	            $("#lic_nm").attr("readonly", "true");
	            $("#reg_no").attr("readonly", "true");
	            $("#isu_charge_nm").attr("readonly", "true");
	            $("#etc").attr("readonly", "true");
	            $("#isu_req_hp1").attr("readonly", "true");
	            $("#isu_req_hp2").attr("readonly", "true");
	            $("#isu_req_hp3").attr("readonly", "true");
            }
	        
	        
	        if($("#prog_stat_cd").val() == "91")
            {
	            $("#p_return_reson").removeClass();
	            $("#p_return_reson").attr("readonly", false);
            }
	        else
            {
	            $("#p_return_reson").val();
            }
        }
	    else
        {
	        $("#btn_issue_req").css("display", "none");
        }
	    
	});
	

	
	function doResult(resultObj) {
		try 
		{
		    document.form1.isSubmit = false;
		    
			if( resultObj.getRequestEvent() == "SAVE_STATUS") 
			{
				if( resultObj.getSuccess() ) 
				{
					alert($("#btn_save").text() + " 되었습니다.");
					if($(':radio[name="p_reson"]:checked').val() == "91" )
				    {
					    location.href="/result/outside/ResultIngList.screen";
				    }
					else
				    {
					    location.href="/result/outside/ResultFinishList.screen";
				    }
				}
				else 
				{
	// 				dlgErrorMsg(resultObj.getMessage);
					alert(resultObj.getValueObject().get("errMsg"));
				}
			}else if(resultObj.getRequestEvent() == "SIGN_OK"){
				if( resultObj.getSuccess() ) 
				{
					alert($("#btn_save").text() + " 되었습니다.");
					if($(':radio[name="p_reson"]:checked').val() == "91" )
				    {
					    location.href="/result/outside/ResultIngList.screen";
				    }
					else
				    {
					    location.href="/result/outside/ResultFinishList.screen";
				    }
				}
				else 
				{
					alert("실패하였습니다.");
					//alert(resultObj.getValueObject().get("errMsg"));
				}
			}
		}
		catch(errorObject) {
			showErrorDlg("doResult()", errorObject);
		}
	}
	
	function fMakeItemInfo(){
		
		var sColumDelimiter = "┃";
		var sRowDelimiter		= "↕";
		var sSumDelimiter		= "╂";
		var sEncDelimiter		= "⇔";
		var isNull	= "NULL";
//해시
		var	sContHash				=	"";
		var	sTemplate				=	"01";			
		<%-- var	sMainVendcd				=	"<%=vo.get("isu_vendcd") %>"; --%>
		var	sMainVendcd				=	"1234567890";	//	원사업자번호
		var issue_no = "<%=vo.get("issue_no") %>";
		var lic_org = "<%=vo.get("lic_org") %>";
		var lic_nm = "<%=vo.get("lic_nm") %>";
		var reg_no = "<%=vo.get("reg_no") %>";
		var cur_cont_amt = "<%=vo.get("cur_cont_amt") %>";
		var cur_pay_amt = "<%=vo.get("cur_pay_amt") %>";
		var prv_pay_amt = "<%=vo.get("prv_pay_amt") %>";
		var cur_pay_samt = "<%=vo.get("cur_pay_samt") %>";
		var prv_pay_samt = "<%=vo.get("prv_pay_samt") %>";
		var etc = "<%=StringUtils.cvtHTML(vo.get("etc")) %>";
		
		sContHash=issue_no		+sColumDelimiter
				+lic_org		+sColumDelimiter
				+lic_nm			+sColumDelimiter
				+reg_no			+sColumDelimiter
				+cur_pay_amt	+sColumDelimiter
				+prv_pay_amt	+sColumDelimiter
				+cur_pay_samt	+sColumDelimiter
				+prv_pay_samt	+sColumDelimiter
				+etc			+sRowDelimiter;
				
		var GrowCount = sheet1.LastRow();
	
		for(var	i=1; i < 	GrowCount+1; i++)
		{
			
			var	cont_nm			=	"";							
			var	cont_amt						=	"";			
			var	cont_sdate				=	"";					
			var	cont_edate		=	"";							
			var	prv_pay_amt			=	"";						
			var	cur_pay_amt						=	"";			
			var	scont_amt						=	"";			
			var	pay_namt						=	"";			

			
			
			cont_nm = sheet1.GetCellValue(i,"CONT_NM");
			if(cont_nm.length > 0){
				cont_amt = sheet1.GetCellValue(i,"CONT_AMT");
				if(isEmptyVal(cont_amt))
					cont_amt = isNull;
				cont_sdate = sheet1.GetCellValue(i,"CONT_SDATE");
				if(isEmptyVal(cont_sdate))
					cont_sdate = isNull;
				cont_edate = sheet1.GetCellValue(i,"CONT_EDATE");
				if(isEmptyVal(cont_edate))
					cont_edate = isNull;
				prv_pay_amt = sheet1.GetCellValue(i,"PRV_PAY_AMT");
				if(isEmptyVal(prv_pay_amt))
					prv_pay_amt = isNull;
				cur_pay_amt = sheet1.GetCellValue(i,"CUR_PAY_AMT");
				if(isEmptyVal(cur_pay_amt))
					cur_pay_amt = isNull;
				scont_amt = sheet1.GetCellValue(i,"SCONT_AMT");
				if(isEmptyVal(scont_amt))
					scont_amt = isNull;
				pay_namt = sheet1.GetCellValue(i,"PAY_NAMT");
				if(isEmptyVal(pay_namt))
					pay_namt = isNull;
				
				sContHash	=	sContHash
									+	sTemplate	+	sColumDelimiter           
									+	sMainVendcd	+	sColumDelimiter           
									+	cont_amt	+	sColumDelimiter           
									+	cont_sdate	+	sColumDelimiter           
									+	cont_edate	+	sColumDelimiter           
									+	prv_pay_amt	+	sColumDelimiter           
									+	cur_pay_amt +	sColumDelimiter           
									+  	scont_amt 	+	sColumDelimiter               
									+	pay_namt	+	sRowDelimiter
			} 
		}
		 $("#CONT_HASH").val(sContHash);

		 //if(confirm("서명 하시겠습니까?")){
			 //SignData();	 
		 //}
	}
	
	function isEmptyVal( value ) {
		if(value.length == 0){
			return true;
		}
		if( value == "" ) {
			return true;
		}
		return false;
	}
	

//-->
</script>


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

<form id="form1" name="form1" method="post" modular:type="search">
<INPUT type="hidden" name="fevent" id="fevent" value="" />
<input type="hidden" name="p_page_gubun" id="p_page_gubun" value="<%=params.get("p_page_gubun") %>" />

<input type="hidden" name="p_sub_cont_mod_id" id="p_sub_cont_mod_id" value="<%=vo.get("sub_cont_mod_id") %>" />
<input type="hidden" name="p_acmp_yyyy" id="p_acmp_yyyy" value="<%=vo.get("acmp_yyyy") %>" />
<input type="hidden" name="p_corp_id" id="p_corp_id" value="<%=vo.get("corp_id") %>" />
<input type="hidden" name="p_soc_cd" id="p_soc_cd" value= "<%=params.get("p_soc_cd") %>" />

<input type="hidden" name="sub_cont_mod_id" id="sub_cont_mod_id" value="<%=vo.get("sub_cont_mod_id") %>" />
<input type="hidden" name="acmp_yyyy" id="acmp_yyyy" value="<%=vo.get("acmp_yyyy") %>" />
<input type="hidden" name="corp_id" id="corp_id" value="<%=vo.get("corp_id") %>" />
<input type="hidden" name="soc_cd" id="soc_cd" value= "<%=params.get("p_soc_cd") %>" />
<input type="hidden" name="dept_cd" id="dept_cd" value= "<%=vo.get("dept_cd") %>" />
<input type="hidden" name="dept_nm" id="dept_nm" value= "<%=vo.get("dept_name") %>" />
<input type="hidden" name="isu_vendcd" id="isu_vendcd" value= "<%=vo.get("isu_vendcd") %>" />
<input type="hidden" name="con_amt" id="con_amt" value= "<%=vo.get("con_amt") %>" />
<input type="hidden" name="prog_stat_cd" id="prog_stat_cd" value= "<%=vo.get("prog_stat_cd") %>" />
<input type="hidden" name="p_success_gubun" id="p_success_gubun" value= "<%=params.get("p_success_gubun") %>" />

<input type="hidden" name="p_yyyy" id="p_yyyy" value= "<%=params.get("p_yyyy") %>" />
<input type="hidden" name="p_dept_nm" id="p_dept_nm" value= "<%=params.get("p_dept_nm") %>" />
<input type="hidden" name="p_cont_nm" id="p_cont_nm" value= "<%=params.get("p_cont_nm") %>" />
<input type="hidden" name="p_status" id="p_status" value= "<%=params.get("p_status") %>" />
<input type="hidden" name="CONT_HASH" id="CONT_HASH" value= "" />

<input type="hidden" name="PRV_PAY_AMT_O" id="PRV_PAY_AMT_O" value= "<%=vo.get("PRV_PAY_AMT_O") %>" />
<input type="hidden" name="CUR_PAY_NAMT_O" id="CUR_PAY_NAMT_O" value= "<%=vo.get("CUR_PAY_NAMT_O") %>" />



<div align="left" id="title" style="float: left;">
	<ul>
		<li>실적증명 상세(<%=vo.get("PROG_STAT_NM").equals("") ? "작성대상" :  vo.get("PROG_STAT_NM")%>)</li>
	</ul>
</div>

<div style="float: right; margin-top: 16px;">
	<span class="btnSearch center"><a href="javascript:void(0);" id="btn_list">목록</a></span>
	<span class="btnSearch center" id="btn_preview_area"><a href="javascript:void(0);" id="btn_preview">미리보기</a></span>
	<span class="btnSearch center" id="btn_save_area"><a href="javascript:void(0);" id="btn_save">승인</a></span>
<!-- 	<span class="btnSearch center"><a href="javascript:void(0);" id="btn_issue_req">발급요청</a></span> -->
 	<span class="btnSearch center"><a href="javascript:void(0);" id="btn_delete">반려</a></span> <!--2016.1.25 완료된자료 반려 -->
</div>


<div style="float: left;" class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">진행상태</span>
	</div>
	<div class="application-location">
	</div>
</div>

<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class=form-table>
	<colgroup>
		<col width="15%" />
		<col width="*%" />
	</colgroup>
	
	<tr>
		<th style="text-align: left; width: 100px;" >발급 승인여부</th>
		<td style="text-align: left;" colspan="3">
			<span><input type="radio"  name="p_reson" id="p_reson1" value="30" <%=vo.get("prog_stat_cd").equals("30") ? "checked=\"checked\"" : "" %> /> 승인</span>
			<span style="margin-left: 50px;"><input type="radio"  name="p_reson" id="p_reson2" value="91" <%=vo.get("prog_stat_cd").equals("91") ? "checked=\"checked\"" : "" %> /> 반려</span>
		</td>
	</tr>
	<tr id="reson_area" style="display: none;">
		<th style="text-align: left;">반려사유</th>
		<td colspan="3">
			<textarea name="p_return_reson" id="p_return_reson" rows="5" style="width: 100%;" ><%=vo.get("return_reson") %></textarea>
		</td>
	</tr>
</table>

<!-- 기성실적증명서 정보 -->
<div style="float: left;" class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">기성실적증명서 정보</span>
	</div>
	<div class="application-location">
	</div>
</div>

<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class=form-table>
	<colgroup>
		<col width="15%" />
		<col width="35%" />
		<col width="15%" />
		<col width="35%" />
	</colgroup>
	<!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
	<tr>
		<th style="text-align: left;">발 급 협 회</th>
		<td>
			대한전문건설협회
		</td>
		<th style="text-align: left;">&nbsp;</th>
		<td>
			&nbsp;<%-- <input type="text" name="issue_no" id="issue_no" value="<%=vo.get("issue_no") %>" />  --%>
		</td>
	</tr>
</table>

<!-- 신청인 -->
<div style="float: left;" class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">신청인</span>
	</div>
	<div class="application-location">
	</div>
</div>



<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class=form-table>
	<colgroup>
		<col width="15%" />
		<col width="35%" />
		<col width="15%" />
		<col width="35%" />
	</colgroup>
	<!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
	<tr>
		<th style="text-align: left;">상 호</th>
		<td>
			<input type="text" name="isu_vendnm" id="isu_vendnm" value="<%=vo.get("ISU_VENDNM") %>" class="bg_gry input_blank" readonly="readonly"/> 
		</td>
		<th style="text-align: left;">대 표 자</th>
		<td>
			<input type="text" name="isu_pres_nm" id="isu_pres_nm" value="<%=vo.get("isu_pres_nm") %>" class="bg_gry input_blank" readonly="readonly"/> 
		</td>
	</tr>
	<tr>
		<th style="text-align: left;">영업소 소재지</th>
		<td colspan="3">
			<input type="text" name="isu_addr" id="isu_addr" value="<%=vo.get("ISU_ADDR") %>" class="bg_gry input_blank" readonly="readonly"/> 
		</td>
	</tr>
</table>


<!-- 공사내역 -->
<div style="float: left;" class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">공사내역</span>
	</div>
	<div class="application-location">
	</div>
</div>


<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class=form-table>
	<colgroup>
		<col width="15%" />
		<col width="35%" />
		<col width="15%" />
		<col width="35%" />
	</colgroup>
	<!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
	<tr>
		<th style="text-align: left;">공 사 명</th>
		<td>
			<input type="text" name="cont_nm" id="cont_nm" value="<%=vo.get("cont_nm") %>" class="bg_gry input_blank" readonly="readonly"/> 
		</td>
		<th style="text-align: left;">총 공 사 금 액</th>
		<td>
			해당사항 없음
		</td>
	</tr>
	
	<tr>
		<th style="text-align: left;">현 장 소 재 지</th>
		<td>
			<input type="text" name="work_place" id="work_place" value="<%=vo.get("work_place") %>" class="bg_gry input_blank" readonly="readonly"/> 
		</td>
		<th style="text-align: left;">인 허 가 기 관</th>
		<td>
			<input type="text" name="lic_org" id="lic_org" value="<%=vo.get("lic_org") %>"  style="width: 100%;"/> 
		</td>
	</tr>
	
	<tr>
		<th style="text-align: left;">공 사 유 형</th>
		<td>
			<%-- <input type="text" name="cont_type" id="cont_type" value="<%=vo.get("cont_type") %>" style="width: 100%;"/>  --%>
			<LABEL for="cont_type1"><INPUT id="cont_type1" name="cont_type" type="radio" name="cont_type1" value="N" <%=vo.get("cont_type").equals("N") ? "checked=\"checked\"" : ""%> disabled>신설공사</LABEL>
			<LABEL for="cont_type2"><INPUT id="cont_type2" name="cont_type" type="radio" name="cont_type2" value="M" <%=vo.get("cont_type").equals("M") ? "checked=\"checked\"" : ""%> disabled>유지보수공사</LABEL>
		</td>
		<th style="text-align: left;">주 력 분 야</th>
		<td>
			<input type="text" name="main_field" id="main_field" value="<%=vo.get("main_field") %>" style="width: 100%;" readonly="readonly"/>  
		</td>
	</tr>
		
	<tr>
		<th style="text-align: left;">계약연월일</th>
		<td >
			<input type="text" name="cont_cdate" id="cont_cdate" value="<%=vo.get("cont_cdate") %>" class="bg_gry input_blank" readonly="readonly" style="width: 80px;"/> 
		</td>
		<th style="text-align: left;">인허가연월일</th>
		<td>
			<input type="text" name="lic_date" id="lic_date" value="<%=vo.get("lic_date") %>" readonly="readonly" class="bg_gry input_blank"  style="width: 80px;"/> 
		</td>
	</tr>
	 
	
	<tr>
		<th style="text-align: left;">착 공 연 월 일</th>
		<td>
			<input type="text" name="cont_sdate" id="cont_sdate" value="<%=vo.get("cont_sdate") %>" class="bg_gry input_blank" readonly="readonly" style="width: 80px;" /> 
		</td>
		<th style="text-align: left;">준공(예정) 연월일</th>
		<td>
			<input type="text" name="cont_edate" id="cont_edate" value="<%=vo.get("cont_edate") %>" class="bg_gry input_blank" readonly="readonly" style="width: 80px;" /> 
		</td>
	</tr>
	
	<tr>
		<th style="text-align: left;">업종(면허)명</th>
		<td>
			<input type="text" name="lic_nm" id="lic_nm" value="<%=vo.get("lic_nm") %>" style="width: 100%;"/> 
		</td>
		<th style="text-align: left;">면허번호</th>
		<td>
			<input type="text" name="reg_no" id="reg_no" value="<%=vo.get("reg_no") %>" style="width: 100%;"/> 
		</td>
	</tr>
	
	<tr>
		<th style="text-align: left;">당년도계약액 또는 이월액</th>
		<td>
			<input type="text" name="cur_cont_amt" id="cur_cont_amt" value="<%=vo.get("cur_cont_amt") %>" style="text-align: right; width: 200px;" numberOnly="true" class="numberic bg_gry input_blank" readonly="readonly"/> 천원
		</td>
		<th style="text-align: left;">계약금액(총계약금액)</th>
		<td>
			<input type="text" name="cont_tamt" id="cont_tamt" value="<%=vo.get("cont_tamt") %>" style="text-align: right; width: 200px;" numberOnly="true" class="numberic bg_gry input_blank" readonly="readonly"/> 천원
			(<input type="text" name="cont_tamt_o" id="cont_tamt_o" value="<%=vo.get("cont_tamt_O") %>"  style="text-align: right; width: 70px;" class="numberic bg_gry input_blank"  readonly="readonly" /> )
		</td>
	</tr>
	
	<tr>
		<th style="text-align: left;">당년도기성액(총기성액)</th>
		<td>
			<input type="text" name="cur_pay_amt" id="cur_pay_amt" value="<%=vo.get("cur_pay_amt") %>" style="text-align: right; width: 200px;" numberOnly="true" class="numberic bg_gry input_blank" readonly="readonly"/> 천원
			(<input type="text" name="cur_pay_amt_o" id="cur_pay_amt_o" value="<%=vo.get("cur_pay_amt_O") %>"  style="text-align: right; width: 70px;" class="numberic bg_gry input_blank"  readonly="readonly" /> ) 
		</td>
		<th style="text-align: left;">전년도까지 누계기성액</th>
		<td>
			<input type="text" name="prv_pay_amt" id="prv_pay_amt" value="<%=vo.get("prv_pay_amt") %>" style="text-align: right; width: 200px;" numberOnly="true" class="numberic bg_gry input_blank" readonly="readonly"/> 천원
		</td>
	</tr>
	
	<tr>
		<th style="text-align: left;">당년도 기성지급액</th>
		<td>
			<input type="text" name="cur_pay_samt" id="cur_pay_samt" value="<%=vo.get("cur_pay_samt") %>" style="text-align: right; width: 200px;" numberOnly="true" class="numberic bg_gry input_blank" readonly="readonly"/> 천원
		</td>
		<th style="text-align: left;">전년도까지 누계지급액</th>
		<td>
			<input type="text" name="prv_pay_samt" id="prv_pay_samt" value="<%=vo.get("prv_pay_samt") %>" style="text-align: right; width: 200px;" numberOnly="true" class="numberic bg_gry input_blank" readonly="readonly"/> 천원
		</td>
	</tr>	
	
	<tr>
		<th style="text-align: left;">기타</th>
		<td colspan="3">
<!-- 			(공사의 규모, 공법, 공동조급 내역 등)<br/> -->
			<%=vo.get("etc").replace("\n", "<br/>") %>
<%-- 			<textarea rows="5" cols="100" name="etc" id="etc" class="bg_gry"><%=vo.get("etc").replace("\n", "<br/>") %></textarea> --%>
		</td>
	</tr>
	
	<tr>
		<th style="text-align: left;">공종</th>
		<td>
		 <%=CommCodeManager.getSelectCodeSearchList("RESULT_01","ADD_01","height=18;width:180px;","<option value=''>--선택--</option>", vo.get("ADD_01"),"","DETAILNM") %>
		</td>
		<th style="text-align: left;">세부공종(전문)</th>
		<td>
		 <%=CommCodeManager.getSelectCodeSearchList("RESULT_01_D","ADD_02","height=18;width:180px;","<option value=''>--선택--</option>", vo.get("ADD_02"),"AND DETAILCD LIKE '" + vo.get("ADD_01") + "%' ","DETAILNM") %>
		</td>
	</tr>
</table>

<!-- 복합공종-->
<div style="float: left;" class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">복합공종(타공종 포함) 실적 내용 (단위:천원, 부가세 포함) <input type="checkbox" id="viewSheet" style="visibility: hidden;"></span>
	</div>
	<div class="application-location">
	</div>
</div>
<div id="sheetDiv">
	<div style="float: right; margin-top: -23px; margin-bottom: 5px;" id="sheet1_btn">
		<span class="btnSearch center" id="btn_sheet_add_area" style="display: none;"><a href="javascript:void(0);" id="btn_sheet_add">추가</a></span>
	<!-- 	<span class="btnSearch center"><a href="javascript:void(0);" id="btn_sheet_delete">삭제</a></span> -->
	</div>
	
	
	<!-- 시트 -->
	<div style="width: 100%; height: 150px; margin-top: 5px; margin-bottom: 30px;">
		<!-- 데이터 영역 : 시작 -->
		<!-- ibsheet7 그리드 생성 -->
			<script>createIBSheet("sheet1","100%", "150px;");</script>
		<!-- 데이터 영역 : 종료 -->
	</div>
</div>

<!-- 공사내역 -->
<div style="float: left;" class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">발급요청자 정보</span>
	</div>
	<div class="application-location">
	</div>
</div>

<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class=form-table>
	<colgroup>
		<col width="15%" />
		<col width="35%" />
		<col width="15%" />
		<col width="35%" />
	</colgroup>
	<!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
	<tr>
		<th style="text-align: left;">담당자명</th>
		<td>
			<input type="text" name="isu_charge_nm" id="isu_charge_nm" value="<%=vo.get("isu_charge_nm").equals("") ? user.get("user_name") : vo.get("isu_charge_nm") %>" /> 
		</td>
		<th style="text-align: left;">휴대전화</th>
		<td>
			<input type="text" name="isu_req_hp1" id="isu_req_hp1" value="<%=vo.get("isu_req_hp1").equals("") ? user.get("hp1") : vo.get("isu_req_hp1") %>" style="width: 80px;" maxlength="3" number="true"/> -
			<input type="text" name="isu_req_hp2" id="isu_req_hp2" value="<%=vo.get("isu_req_hp2").equals("") ? user.get("hp2") : vo.get("isu_req_hp2") %>" style="width: 120px;" maxlength="4" number="true"/> -
			<input type="text" name="isu_req_hp3" id="isu_req_hp3" value="<%=vo.get("isu_req_hp3").equals("") ? user.get("hp3") : vo.get("isu_req_hp3") %>" style="width: 120px;" maxlength="4" number="true"/> 
		</td>
	</tr>
</table>
<%if(vo.get("prog_stat_cd").equals("30")){ %>
<div id="file_area" style="width: 100%;">
<!-- 첨부파일 -->
<div style="float: left;" class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">첨부파일</span>
	</div>
	<div class="application-location">
	</div>
</div>

<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class=form-table>
	<colgroup>
		<col width="15%" />
		<col width="*" />
	</colgroup>
	<!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
	<tr>
		<th style="text-align: left;">첨부파일</th>
		<td colspan="3">
			<div id="auto_attach_file_view" class="attach_file_view">
				<ul>
					<%
						for(int i=0; i<fileRowSet.size(); i++)
						{
					%>
					<li>
						<a href="/common/file/FileDownloadServlet?mode=fpDown&filePath=<%=fileRowSet.getRow(i).get("FILE_PATH")%>&fileName=<%=URLEncoder.encode(fileRowSet.getRow(i).get("FILE_NAME"), "UTF-8")%>&fileRealName=<%=fileRowSet.getRow(i).get("REAL_FILE_NAME")%>"><%=i+1%> : <%=fileRowSet.getRow(i).get("FILE_NAME")%> (<%=fileRowSet.getRow(i).get("FILE_SIZE").trim() %>)</a>
					</li>
					<%
						}	
					%>
				</ul>
			</div>
		</td>
	</tr>
</table>

</div>
<%} %>

</form>

