<%@page import="monfox.toolkit.snmp.agent.modules.SnmpV2Mib.SysOREntry"%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="com.udapsoft.waf.system.*"%>
<%@ page import="com.udapsoft.waf.common.ui.*" %>
<%@ page import="com.udapsoft.waf.common.web.*" %>
<%@ page import="kr.co.hsnc.common.sql.*"%>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="kr.co.hsnc.common.sql.util.*"%>
<%@ page import="com.udapsoft.waf.system.HandlerStorage"%>
<%@ page import="kr.co.hsnc.common.util.ValueObject"%>
<%@ page import="kr.co.hsnc.common.message.WAFMessage"%>
<%@ page import="kr.co.udapsoft.ebid.buyer.common.file.FileManager"%>
<%@ page import="com.udapsoft.waf.common.util.StringUtils" %>
<%@ page import="kr.co.udapsoft.common.util.PCMSUtil" %>
<%@ page import="kr.co.hsnc.common.util.Formatter"%>
<%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />

<%
	ctx.init(request, response);
	String link = ctx.getServerDomain();

    HandlerStorage storage = ctx.getHandlerStorage();
	ValueObject params = storage.getParams();

   	
	WAFMessage wafMessage = WAFMessage.getInstance();
	
	ValueObject BidMaster  = storage.getValueObject("bidmaster");
	RowSet suppinfo =  null;
	suppinfo = storage.getRowSet("suppinfo");
	
	ValueObject File_in  = storage.getValueObject(BidMaster.get("DOC_ETC_IN"));
	ValueObject File_out  = storage.getValueObject(BidMaster.get("DOC_ETC_OUT"));
	ValueObject File_tbe  = storage.getValueObject(BidMaster.get("TOT_FILE_GB"));
	
	ValueObject sign_info = storage.getValueObject("SIGN_INFO");
	ValueObject sign_info2 = storage.getValueObject("SIGN_INFO2");
	
	RowSet getFileListRowSet = storage.getRowSet("getFileListRowSet");
	
	String gwurl	=	"https://gw.sgcenc.co.kr/";//WAFConfig.get("gw.url.address2");
	
%>

<br>

<TABLE width="709" border="0" cellspacing="0" cellpadding="0">
	<tbody>
    <TR>
        <TD align="center">
            <TABLE width="700" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#AEAFAF" border="1">
	          <COLGROUP>
	            <COL width="110"/>
	            <COL width="100"/>
	            <COL width="200"/>
	            <COL width="110"/>
				<COL width="200"/>
				<COL/>
	          </COLGROUP>
	          	<tr height="23" align="center">
	          		<td class="list_title4" nowrap align="Center">요청부서</td>
	          		<td class="list_data" nowrap align="Left" colspan="2">&nbsp;<%=BidMaster.get("DEPART_DEPT_NM")%></td>
	          		<td class="list_title3" nowrap align="Center">작성일</td>
	          		<td class="list_data" nowrap align="Left">&nbsp;<%=BidMaster.get("CRE_DT")%></td>
	          	</tr>
	          	<tr height="23" align="center">
	          		<td class="list_title3" nowrap align="Center">작성자</td>
	          		<td class="list_data" nowrap align="Left" colspan="2" >&nbsp;<%=BidMaster.get("CRE_NAME")%></td>
	          		<td class="list_title4" nowrap align="Center">사업주명</td>
	          		<td class="list_data" nowrap align="Left" colspan="2" >&nbsp;<%=BidMaster.get("DEALER_NM")%></td>
	          	</tr>
	          	<tr height="23" align="center">
	          		<td class="list_title7" nowrap align="Center">PROJECT명</td>
	          		<td class="list_data" nowrap align="Left" colspan="2" >&nbsp;<%=BidMaster.get("DEPT_NM")%></td>
	          		<td class="list_title4" nowrap align="Center">현장위치</td>
	          		<td class="list_data" nowrap align="Left" colspan="2" >&nbsp;<%=BidMaster.get("DELIVERY_PLACE")%></td>
	          	</tr>
	          	<tr height="23" align="center">
	          		<td class="list_title4" nowrap align="Center">계약번호</td>
	          		<td class="list_data" nowrap align="Left" colspan="2" >&nbsp;<%=BidMaster.get("CONF_NO")%></td>
					<td class="list_title6" nowrap align="Center">발주의뢰번호</td>
	          		<td class="list_data" nowrap align="Left" colspan="2" >&nbsp;
	          			<span onclick="doSignFile('<%=sign_info.get("doc_id") %>', '<%=sign_info.get("year") %>');" class="button" style="color:#4b70fd;text-decoration:underline;"><%=BidMaster.get("BID_NO")%></span>
	          			<%-- <IMG src="<%=link %>/img/buyer/button/bt_attach_file.gif" id="bt_attach_file" alt="발주의뢰문서" align="top" valign="top" onClick="doSignFile('<%=sign_info.get("doc_id") %>','<%=sign_info.get("year") %>');" class="button"> --%>
	          		</td>
	          	</tr>
	          	<tr height="23" align="center">
	          		<td class="list_title3" nowrap align="Center">계약명</td>
	          		<td class="list_data" nowrap align="Left" colspan="2" >&nbsp;<%=BidMaster.get("BID_MASTER_NM")%></td>
	          		<td class="list_title7" nowrap align="Center">시행결의요청일</td>
	          		<td class="list_data" nowrap align="Left" >&nbsp;<%=BidMaster.get("CONT_APP_REQ_DATE")%></td>
	          	</tr>
	          	<tr height="23" align="center">
	          		<td class="list_title3" nowrap align="Center">계약자</td>
	          		<td class="list_data" nowrap align="Left" colspan="4">&nbsp;<%=BidMaster.get("VENDOR_NAME")%>&nbsp;</td>
	          	</tr>	          	
	          	<tr height="23" align="center">
	          	<%if(!BidMaster.get("CURRENCY_GB").equals("KRW")){ %>
	          		<td class="list_title" nowrap align="Center" rowspan="5">예산집행<br>개요<br>(부가세별도)</td>
				<%}else{ %>	          		
	          		<td class="list_title" nowrap align="Center" rowspan="4">예산집행<br>개요<br>(부가세별도)</td>
				<%}%>	          	
	          		<td class="list_title4" nowrap align="Center">도급금액</td>
	          		<td class="list_data" nowrap align="left" colspan="3"><table style="width: 99%"><tr><td align="left" class="list_data"><%if(!BidMaster.get("CONT_AMT_NM").isEmpty()){%>일금 <%=BidMaster.get("CONT_AMT_NM")%> 원정<%} %></td><td align="right" class="list_data">(<%=Formatter2.currency(BidMaster.get("CONT_AMT"),0)%>)</td></tr></table></td>
	          	</tr>
    		   	<tr height="23" align="center">
	          		<td class="list_title4" nowrap align="Center">실행예산</td>
	          		<td class="list_data" nowrap align="left" colspan="3" ><table style="width: 99%"><tr><td align="left" class="list_data"><%if(!BidMaster.get("ACT_AMT_NM").isEmpty()){%>일금 <%=BidMaster.get("ACT_AMT_NM")%> 원정<%} %></td><td align="right" class="list_data">(<%=Formatter2.currency(BidMaster.get("ACT_AMT"),0)%>)</td></tr></table></td>
	          	</tr>	          	
	          	<tr height="23" align="center">
	          		<td class="list_title4" nowrap align="Center">결의금액</td>
	          		<td class="list_data" nowrap align="left" colspan="3" >
	          		<%if(!BidMaster.get("CURRENCY_GB").equals("KRW")){ %>
	          		<table style="width: 99%"><tr><td align="left" class="list_data"><%if(!BidMaster.get("WON_ESTI_AMT_NM").isEmpty()){%>일금 <%=BidMaster.get("WON_ESTI_AMT_NM")%> 원정<%}%></td><td align="right" class="list_data"><%if(!BidMaster.get("WON_ESTI_TOT_AMT").isEmpty()){ %>(<%=Formatter2.currency(BidMaster.get("WON_ESTI_TOT_AMT"),0)%>)<%} %></td></tr></table>
	          		<%} else {%>
	          		<table style="width: 99%"><tr><td align="left" class="list_data"><%if(!BidMaster.get("ESTI_TOT_AMT_NM").isEmpty()){%>일금 <%=BidMaster.get("ESTI_TOT_AMT_NM")%> 원정<%}%></td><td align="right" class="list_data"><%if(!BidMaster.get("ESTI_TOT_AMT").isEmpty()){ %>(<%=Formatter2.currency(BidMaster.get("ESTI_TOT_AMT"),0)%>)<%} %></td></tr></table>
	          		<%} %>	          		
	          		</td>
	          	</tr>
	          	<%if(!BidMaster.get("CURRENCY_GB").equals("KRW")){ %>
	          	<tr height="23" align="center">
	          		<td class="list_title" nowrap align="Center">결의금액(외화)</td>
	          		<td class="list_data" nowrap align="left" colspan="3" >
	          		<table style="width: 99%"><tr><td align="left" class="list_data"><%if(!BidMaster.get("ESTI_TOT_AMT_NM").isEmpty()){%><%=BidMaster.get("ESTI_TOT_AMT_NM")%> <%=BidMaster.get("CHG_CODE06") %><%} %></td><td align="right" class="list_data"><%if(!BidMaster.get("ESTI_TOT_AMT").isEmpty()){ %>(<%=Formatter2.currency(BidMaster.get("ESTI_TOT_AMT"),0)%>)<%} %></td></tr></table>
	          		</td>
	          	</tr>
	          	<%} %>	          	
	          	<tr height="23" align="center">
	          		<td class="list_title" nowrap align="Center">실행예산대비(%)</td>
	          		<td class="list_data" nowrap align="Center">&nbsp;<%=BidMaster.get("ACT_RATE")%>%</td>
	          		<td class="list_title" nowrap align="Center">실행예산대비절감액</td>
	          		<td class="list_data" nowrap align="right">(<%=Formatter2.currency(BidMaster.get("ACT_SAVINGS"),0)%>)&nbsp;&nbsp;</td>
	          	</tr>
	          	<tr height="23" align="center">
	          		<td class="list_title4" nowrap align="Center" >계약기간</td>
	          		<td class="list_data" nowrap align="Left" colspan="4">&nbsp;<%if(!BidMaster.get("DELI_START_DT").isEmpty()){%><%=BidMaster.get("DELI_START_DT")%> ~<%} %> <%=BidMaster.get("DELI_END_DT")%></td>
	          	</tr>
<%-- 				<tr height="23" align="center">
	          		<td class="list_title" nowrap align="Center">계 약 범 위</td>
	          		<td class="list_data" nowrap align="Left" colspan="2">&nbsp;<%=BidMaster.get("PAY_DIV")%></td>
	          		<td class="list_title" nowrap align="Center">인 도 조 건</td>
	          		<td class="list_data" nowrap align="Left" colspan="2">&nbsp;<%=BidMaster.get("DELIVERY_CONDITION")%></td>	          		
	          	</tr>--%>
				<tr height="23">
	          		<td class="list_title" nowrap align="Center" rowspan="3">지 불<br>조 건</td>
	          		<td class="list_title3" nowrap align="Center">선급금</td>
	          		<td class="list_data" nowrap align="Left" colspan="3">&nbsp;<%if(!BidMaster.get("OBC_FRST_CONT_RATE").isEmpty()){%>계약금액의 <%=BidMaster.get("OBC_FRST_CONT_RATE")%>%<%} %></td>
	          	</tr>
				<tr height="23">
	          		<td class="list_title3" nowrap align="Center">기성금</td>
	          		<td class="list_data" nowrap align="Left" colspan="3">&nbsp;<%if(!BidMaster.get("CPC_MID_RATE").isEmpty()){%>계약금액의 <%=BidMaster.get("CPC_MID_RATE")%>% (선급금 포함), <%} %><%if(!BidMaster.get("OBC_MID_PAYDAY").isEmpty()){%><%=BidMaster.get("OBC_MID_PAYDAY") %>일  <%} %><%if(!BidMaster.get("OBC_MID_CASH_RATE").isEmpty()){%>현금 <%=BidMaster.get("OBC_MID_CASH_RATE") %>%<%} %> <%if(!BidMaster.get("OBC_MID_BILL_RATE").isEmpty()){%>,어음 <%=BidMaster.get("OBC_MID_BILL_RATE") %>%<%} %> 지급</td>
	          	</tr>
				<tr height="23">
	          		<td class="list_title3" nowrap align="Center">준공금</td>
	          		<td class="list_data" nowrap align="Left" colspan="3">&nbsp;<%if(!BidMaster.get("PBC_REST_RATE").isEmpty()){%>계약금액의 <%=BidMaster.get("PBC_REST_RATE") %>% (선급금 포함), <%} %><%if(!BidMaster.get("OBC_FIN_PAYDAY").isEmpty()){%><%=BidMaster.get("OBC_FIN_PAYDAY") %>일  <%} %><%if(!BidMaster.get("OBC_FIN_CASH_RATE").isEmpty()){%>현금 <%=BidMaster.get("OBC_FIN_CASH_RATE") %>%<%} %> <%if(!BidMaster.get("OBC_FIN_BILL_RATE").isEmpty()){%>,어음 <%=BidMaster.get("OBC_FIN_BILL_RATE")%>%<%} %> 지급</td>
	          	</tr>
				<tr height="23" align="center">
	          		<td class="list_title4" nowrap align="Center">보증조건</td>
	          		<td class="list_data" nowrap align="Left" colspan="4">&nbsp;<% if(!BidMaster.get("CBC_FIRST_RATE").isEmpty()){%>선급금 보증 (<%=BidMaster.get("CBC_FIRST_RATE")%>%)<%}%><% if(!BidMaster.get("CONTFUL_RATE").isEmpty()){%>, 이행 보증 (<%=BidMaster.get("CONTFUL_RATE")%>%)<%}%><% if(!BidMaster.get("WARR_RATE").isEmpty()){%>, 하자 보증 (<%=BidMaster.get("WARR_RATE")%>%<% if(!BidMaster.get("CBC_DEFECT_DAY").isEmpty()){%>, 준공 후 <%=BidMaster.get("CBC_DEFECT_DAY")%>개월<%}%>)<%}%></td>
	          	</tr>
	          	<tr height="23" align="center">
	          		<td class="list_title" nowrap align="Center"><font color='yellow'><b>외주 발주진행율 누계</b></font></td>
	          		<td class="list_data" nowrap align="Left" colspan="2"><font color='red' size ='4px'><b>&nbsp;<%=BidMaster.get("PO_PRC")%>%</b></font></td>
	          		<td class="list_title" nowrap align="Center"><font color='yellow'><b>외주 발주실적율 누계</b></font></td>
	          		<td class="list_data" nowrap align="Left"><font color='red' size ='4px'><b>&nbsp;<%=BidMaster.get("RES_PRC")%>%</b></font></td>					
	          	</tr>
				<tr height="23" align="center">
	          		<td class="list_title6" nowrap align="Center">주요발주내용</td>
	          		<td class="list_data" nowrap align="Left" colspan="4"><%=StringUtils.cvtHTML(BidMaster.get("MAIN_PR_CONTENTS"))%>&nbsp;</td>
	          	</tr>	          		          	
	          	<tr height="23" align="center">
	          		<td class="list_title6" nowrap align="Center">특기사항</td>
	          		<td class="list_data" nowrap align="Left"  colspan="4"><%=StringUtils.cvtHTML(BidMaster.get("INNER_REMARKS"))%>&nbsp;</td>
	          	</tr>
	          	<tr height="60" align="center">
	          		<td class="list_title4" nowrap align="Center">첨부서류</td>
	          		<td class="list_data" nowrap align="Left"  colspan="4">
						<table style="height: 100%" width="100%" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#AEAFAF" border="1">
						<%			
							if(getFileListRowSet.size() > 0){
								int i_mod = 0;
								for(int i = 0; getFileListRowSet.size() > i; i++){
									i_mod = i%4;
									if(i_mod == 0){ %>
										<TR>
								<%	} %>										
											<td width="27%">
												<% if(getFileListRowSet.getRow(i).get("DETAILCD").equals("100")) { %>
													<input type="checkbox" checked disabled>&nbsp;
													<%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){%>
														<span class="button list_data" style="color:#4b70fd;text-decoration:underline;" nowrap onclick="open_apppend_file('<%=getFileListRowSet.getRow(i).get("FILE_GB") %>', '<%=getFileListRowSet.getRow(i).get("ID")%>');">
															<%=getFileListRowSet.getRow(i).get("DETAILNM") %>
														</span>
													<%}else{ %>
														<span class="button list_data" style="color:#4b70fd;text-decoration:underline;" nowrap onClick="detailRdProc('<%=BidMaster.get("BID_NO")%>', '<%=BidMaster.get("BID_DEG") %>');">
															<%=getFileListRowSet.getRow(i).get("DETAILNM") %>
														</span>														
													<%} %>
												<%}else if(getFileListRowSet.getRow(i).get("DETAILCD").equals("130")) { %>
													<input type="checkbox" <%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){out.print("checked");} %> disabled>&nbsp;
													<span <%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){%>class="button list_data" style="color:#4b70fd;text-decoration:underline;" <%}else{%>class="list_data"<%}%> nowrap onClick="openBidAmtPop('<%=BidMaster.get("BID_NO")%>','<%=BidMaster.get("BID_DEG")%>','<%=BidMaster.get("VENDOR_CD")%>','<%=BidMaster.get("VENDOR_NO")%>','<%=BidMaster.get("VENDOR_NAME")%>','<%=BidMaster.get("ESTI_TOT_AMT")%>','<%=BidMaster.get("DEMANDED_ID")%>','<%=BidMaster.get("FILE_GB")%>','<%=BidMaster.get("PointCount")%>');">
														<%=getFileListRowSet.getRow(i).get("DETAILNM") %>
													</span>
												<%}else{ %>
													<input type="checkbox" <%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){out.print("checked");} %> disabled>&nbsp;
													<span <%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){%>class="button list_data" style="color:#4b70fd;text-decoration:underline;" <%}else{%>class="list_data"<%}%> nowrap onclick="open_apppend_file('<%=getFileListRowSet.getRow(i).get("FILE_GB") %>', '<%=getFileListRowSet.getRow(i).get("ID")%>');">
														<%=getFileListRowSet.getRow(i).get("DETAILNM") %>
													</span>
												<%} %>
											</td>
								<%	if(i_mod == 4) { %>		
										</TR>
								<%	} %>		
							<%
								}
								for(int i=i_mod+1; i<4; i++){ %>
									<td>&nbsp;</td>
							<%	}
								if(i_mod < 4){ %>
									</TR>	
							<%	}
							}
						%>
						</table>
	          		</td>
	          	</tr>
			</TABLE>
        </TD>
    </TR>
  </tbody>
</TABLE>
<br>
<table><tr><td style="display:none;" id=doctitle_1 class=FIELD><%=BidMaster.get("doctitle")%></td></tr></table>
<br>
