<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="kr.co.udapsoft.common.code.*" %>
<%@ page import="kr.co.hsnc.common.config.WAFConfig %>
<%
	String guarUrl = WAFConfig.get("waf.guar.url");
%>
<script>

	/************************
	보증 신청창 띄우기
	************************/
	function popOpenGuar(wG, wSeq, wCauseCd, wOnOff, wGStatus, wOffid, wConRefNo, wChgNo){	
		var	sGuarKind		=	wG;														//보증서종류
		var	sGuarSeq		=	wSeq;															//일련번호
		var	sGuarOnoffYn	=	wOnOff;												//온오프여부
		var	sGuarStatus		=	wGStatus;													//보증진행상태
		
		var	sChgNo			=	wChgNo;	//계약차수
	
		var	style			=	"";
		var	src				=	"";
		var	sGrtType	=	"";	//	보증종목구분
	
		if(sGuarKind == "1")			sGrtType	=	"002";	//계약
		else if(sGuarKind == "2")	sGrtType	=	"006";	//지급
		else if(sGuarKind == "3")	sGrtType	=	"004";	//선급금
		else if(sGuarKind == "4")	sGrtType	=	"005";	//근재
		else if(sGuarKind == "5")	sGrtType	=	"003";	//하자	
	
		//검토대기나 완료일경우
		if(sGuarOnoffYn == "Y" && sGuarStatus.length > 0 && (sGuarStatus == "08" || sGuarStatus == "09")){
			
			var	sOffId				=	wOffid;		//	수신기관 ID
			var	conRefNo			=	wConRefNo; 							//	계약번호
			var	sGrtSeq				=	wSeq;	//	보증차수			
			var	sMsgFuncCode		=	"53";																//	문서기능
			var	sModule				=	"PO";																//	모듈구분코드
			
			if(sChgNo == "")	
				sChgNo	=	"00";
			else if(sChgNo.length == 1)
				sChgNo = "0" + sChgNo;
				
			if(sGrtSeq.length == 1)
				sGrtSeq = "0" + sGrtSeq;
				
			//parameter 확인 요함
			src		= "<%=guarUrl%>/transure/view/KSCFCView.jsp?offID="+sOffId+"&conRefNo="+conRefNo+"&conSeqNo="+sChgNo+"&grtSeq="+sGrtSeq+"&grtType="+sGrtType+"&msgFuncCode="+sMsgFuncCode+"&module="+sModule;
			style	=	"width=720,height=800, loactionbar=visible, menubar=visible, scrollbars=no";
		}
		
		var	id		=	"WARR";		
		openPopup(src, id, "yes", 720, 800);
		/*
		var	clNew	=	window.open(src,id,style);
		
		if(clNew == null){
			alert("          ▒【보증신청】페이지는 팝업창으로 구성되어 있습니다. ▒\n\n\n'팝업이 차단되었습니다. 팝업 또는 추가 옵션을 보려면 여기를 클릭하십시오.' 라는\n\n 메세지가 보일경우에는 그 메세지를 클릭하셔서 '현재 사이트의 팝업을 항상 허용'이나\n\n'임시로 팝업허용'으로 설정해주시기 바랍니다.");
		}else{
			clNew.focus();
		}
		*/
	}
</script>

<div class="application-info  magT10" id="warr1">
	<div class="application-sub-title">
		<span class="title">보증정보</span>
	</div>
	<div class="application-location">
	</div>
</div>
<TABLE class="form-table" id="warr2">
	<colgroup>
		<col width="10%" />
		<col width="50" />
		<col width="10%" />
		<col width="10%" />
		<col width="10%" />
		<col width="10%" />
		<col width="10%" />
		<col width="10%" />
		<col width="10%" />
		<col width="*" />
	</colgroup>
  <TR height="25"> 
	<TH style="text-align:center;">제증권명</TH>
	<TH style="text-align:center;">등록</TH>
	<TH style="text-align:center;">변경구분</TH>
	<TH style="text-align:center;">발행방법</TH>
	<TH style="text-align:center;">발급기관</TH>
	<TH style="text-align:center;">진행상태</TH>
	<TH style="text-align:center;">발급일</TH>
	<TH style="text-align:center;">증권번호</TH>
	<TH style="text-align:center;">보증금액</TH>
	<TH style="text-align:center;">보증기간</TH>
  </TR>
<%
if (warrList.size()>0){
	for(int i=0;i<warrList.size();i++){
%>  
  <TR height="25"> 
	<TD><%=warrList.getRow(i).get("WARR_GUBUN_NM")%></TD>        
	<TD style="text-align:center;">
	<%if ((warrList.getRow(i).get("GUAR_STATUS").equals("08") || warrList.getRow(i).get("GUAR_STATUS").equals("09")) && warrList.getRow(i).get("GUAR_ONOFF_YN").equals("Y")){ %>
		<IMG src="/img/buyer/button/bt_search_right.gif" onclick="javascript:popOpenGuar('<%=warrList.getRow(i).get("WARR_GUBUN")%>','<%=warrList.getRow(i).get("WARR_SEQ")%>','<%=warrList.getRow(i).get("CAUSECODE")%>','<%=warrList.getRow(i).get("GUAR_ONOFF_YN")%>','<%=warrList.getRow(i).get("GUAR_STATUS")%>','<%=warrList.getRow(i).get("WARR_GOFFICE_ID")%>','<%=warrList.getRow(i).get("GRTREQNO")%>','<%=warrList.getRow(i).get("MOD_NO")%>');" id="contPurWarr" alt="보증정보" border="0" align="absmiddle" style="cursor:pointer;" />
	<%}else{ %>
		<IMG src="/img/buyer/button/bt_search_right.gif" onclick="javascript:popContWarr('<%=warrList.getRow(i).get("WARR_GUBUN")%>','<%=warrList.getRow(i).get("WARR_SEQ")%>','<%=warrList.getRow(i).get("CAUSECODE")%>');" id="contPurWarr" alt="보증정보" border="0" align="absmiddle" style="cursor:pointer;" />
	<%} %>
	</TD>          
	<TD style="text-align:center;"><%=warrList.getRow(i).get("CAUSECODE_NM")%></TD>          
	<TD style="text-align:center;"><%=warrList.getRow(i).get("GUAR_ONOFF_NM")%></TD>          
	<TD><%=warrList.getRow(i).get("WARR_GOFFICE")%></TD>
	<TD style="text-align:center;"><%=warrList.getRow(i).get("GUAR_STATUS_NM")%></TD>
	<TD style="text-align:center;"><%=Formatter.formatDate(warrList.getRow(i).get("PAPERDATE"), "-")%></TD>
	<TD><input type="text" name="warrWgno" id="warrWgno" value="<%=warrList.getRow(i).get("WARR_WGNO")%>" style="font-family:gulim;background-color:transparent;border:0 solid black;text-align:left;" readonly></TD>
	<TD><input type="text" name="warrWamt" id="warrWamt" value="<%=Formatter.formatCurrency(warrList.getRow(i).get("WARR_WAMT"))%>" style="background-color:transparent;border:0 solid black;text-align:right;" readonly></TD>
	<TD style="text-align:center;"><%=Formatter.formatDate(warrList.getRow(i).get("WARR_SDATE"), "-") +" ~ "+ Formatter.formatDate(warrList.getRow(i).get("WARR_EDATE"), "-")%></TD>
  </TR>
<%
	}
}	
%>  
</table> 
<br />