<%--
  - Author(s)  : Hyung min Son
  - Date       : 2014.06.30
  - Description: 입찰진행(외주) 견적의뢰
  --%>
  
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<%@ page import="com.udapsoft.waf.common.ui.*" %>
<%@ page import="kr.co.udapsoft.common.code.*" %>
<%@ page import="kr.co.udapsoft.common.util.PCMSUtil"%>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="kr.co.hsnc.common.sql.*" %>
<%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
<%@ page import="com.udapsoft.waf.common.util.StringUtils"%>
<%@ 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 Order = storage.getValueObject("Order");
    ValueObject filein = storage.getValueObject(Order.get("DOC_ETC_IN"));
    ValueObject fileout = storage.getValueObject(Order.get("DOC_ETC_OUT"));
    SimpleDateFormat sd = new SimpleDateFormat("yyyyMMdd");
    SimpleDateFormat sd2 = new SimpleDateFormat("yyyyMMddHHmm");
    String nowTime = sd.format(new Date());
    String to_yyyy = Order.get("BID_TO_DT").substring(0, 4);
    String to_MM = Order.get("BID_TO_DT").substring(5, 7);
    String to_dd = Order.get("BID_TO_DT").substring(8, 10);
    String to_hh = Order.get("BID_TO_DT").substring(11, 13);
    String to_mi = Order.get("BID_TO_DT").substring(14, 16);
    String nowTime_yyyy = nowTime.substring(0, 4);
    String nowTime_MM = nowTime.substring(4, 6);
    String nowTime_dd = nowTime.substring(6, 8);
    nowTime_MM = (Integer.valueOf(nowTime_MM)-1)+"";;
    to_MM = (Integer.valueOf(to_MM)-1)+"";
    boolean MODIFY_YN = true;
    boolean p_reason = false;
    boolean c_reason = false;
    boolean m_reason = false;
    if(Order.get("POSTPONE_REASON").length()> 0){
    	p_reason = true;
    }else  if(Order.get("CANCEL_REASON").length()> 0){
    	c_reason = true;
    }
    if(Order.get("MODIFY_REASON").length()> 0){
    	m_reason = true;
    }
    if(Order.getInt("MODIFY_CNT") > 0){
    	MODIFY_YN = false;
    }

	ValueObject sign_info = storage.getValueObject("SIGN_INFO");
	
	String gwurl	=	"http://gw.sgcenc.co.kr/";//WAFConfig.get("gw.url.address2");
%>
<SCRIPT language="JavaScript">
document.body.onresize = addEvent( document.body.onresize, "autoResize()");
	/*예약함수*/
	var sheet1 = new ibsheetObject();
	var sheet2 = new ibsheetObject();
	var sheet1Row;
	var sheet1PageNo = 1;
	var pageLastRowIndex = 1;
	var validationResult = false;
	var filterShow = false;
	
	var must_msg = "(은)는 필수 입력 항목입니다."; 
	function _onReady(){
		dpTime2();
		/**
		 *	IBSheet object initialize
		 */
		gridInit(sheet1);
		gridInit(sheet2);
		
		/**
		 *	Application Initialize
		 */
		 $("#btn_list").click(function() {
				$("#fevent").val("");
				$("#form1").attr("action", "/bid/outside/BidIngList.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				
				$("#form1").submit();
		});
		 $("#btn_modify").click(function() {
			 if(confirm("입찰정보 수정페이지로 이동하시겠습니까?"))
			 	if(<%=MODIFY_YN%>){
					$("#fevent").val("FORM_SELECT");
					$("#form1").attr("action", "/bid/outside/BidModify.screen");
					$("#form1").attr("target", "_self");
					$("#form1").attr("method", "post");
					
					$("#form1").submit();
			 	}else{
			 		alert("견적을 제출한 업체가 존재합니다. \n정정공고를 할 수 없습니다.");
			 	}
		});
		 
		
		 $("#btn_defer").click(function() {
			 var win_id = "_DeferPop";
			 var link = "/bid/outside/BidDeferPop.screen";
			       link += "?pop_win_id="+win_id;
			       link += "&BID_NO="+$("#BID_NO").val();
			       link += "&BID_DEG="+$("#BID_DEG").val();
			       link += "&BID_FROM_DT="+"<%=Order.get("BID_FROM_DT")%>";
			       link += "&BID_TO_DT="+"<%=Order.get("BID_TO_DT")%>";
			fLayerPop(win_id, link, 700,310, '', '', 'NO');
		});
		 
		 $("#btn_cancel").click(function() {
			 var win_id = "_CancelPop";
			 var link = "/bid/outside/BidCancelPop.screen";
			       link += "?pop_win_id="+win_id;
			       link += "&BID_NO="+$("#BID_NO").val();
			       link += "&BID_DEG="+$("#BID_DEG").val();
			       link += "&DEMANDED_ID="+$("#DEMANDED_ID").val();
			fLayerPop(win_id, link, 600,210, '', '', 'NO');
		});
		 
		 //2018.10.31입찰내역 
		 $("#btn_item").click(function() {
			 var win_id = "ItemPop";	
			 var link = "/bid/outside/BidItemPopup.screen";
			 link += "?pop_win_id="+win_id+"&BID_NO="+$("#BID_NO").val() + "&BID_DEG="+$("#BID_DEG").val() ;
			 fLayerPop(win_id, link, 650,500, '','', 'NO');
		});

		 $("#btn_request").click(function() {
			var f = document.form1;
			submitXmlRequest("/bid/outside/BidIng_form.screen", "EXAM_REQUEST_FORM", f);
		});
		
		//2015.3.12 입찰중 기술검토 결과서 반려추가 
		$("#btn_tbecheckpop").click(function() {
			var win_id = "_TBECheckPop";
			 var link = "/bid/outside/TBECheckPop.screen";
			       link += "?pop_win_id="+win_id;
			       link += "&BID_NO="+$("#BID_NO").val();
			       link += "&BID_DEG="+$("#BID_DEG").val();
			       link += "&RTN_YN=Y";
			fLayerPop(win_id, link, 900,450, '', '', 'YES');				
		});
		
		//2018.07.05 견적대상업체 SMS, mail발송 
		$("#btn_sms").click(function() {
			if(confirm("입찰 요청 SMS,e-MAIL을 발송하시겠습까?")){
				$("#fevent").val("BIDING_SMS");
				var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/BidIng_form.screen";
				var result = Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), false);
			}			
		});
		
		//보고자 조회
		doSearchSheet2();
		
		doRequest();
	}
	
	function PopClose(win_id,result){
		/*if( result != null ){
			if(result[0] == 0){
				setTimeout(function(){fLayerPopClose(win_id);},100);
				if(result[1].length> 0)alert(result[1]);
				//화면 재 조회
				$("#fevent").val("FORM_SELECT");
				$("#form1").attr("action", "/bid/outside/BidIng.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
			}
		}else{
			setTimeout(function(){fLayerPopClose(win_id);},100);
		}*/
		//2015.3.12 수정 
		if( result != null ){
			if(result[0] == 0){
				setTimeout(function(){	fLayerPopClose(win_id);},100);
				if(result[1].length> 0)alert(result[1]);
				$("#btn_list").click();
			}else if(result[0] == 1){
				setTimeout(function(){	fLayerPopClose(win_id);},100);
				if(result[1].length> 0)alert(result[1]);
				$("#fevent").val("FORM_SELECT");
				$("#form1").attr("action", "/bid/outside/BidIng.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
			}
		}else{
			setTimeout(function(){	fLayerPopClose(win_id);	},100);
		}
		
		
	}
	
	function doRequest(){
		if(<%=Order.get("TBE_FLAG").equals("Y")%>){
			if(document.getElementById('dpTime').innerHTML == "입찰마감"){
				jQuery("#btn_request").show();
				jQuery("#btn_sms").hide();
			}else{
				jQuery("#btn_request").hide();
				jQuery("#btn_sms").show();
			}
		}else{
			if(document.getElementById('dpTime').innerHTML == "입찰마감"){
				jQuery("#btn_request").show();
				jQuery("#btn_sms").hide();
			}else{
				jQuery("#btn_request").hide();
				jQuery("#btn_sms").show();
			}
		}
	}

	function doSearchSheet(){
		$("#fevent").val("GET_CORP_LIST");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/BidIng_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
	}

	function doSearchSheet2(){
		$("#fevent").val("GET_REPORT_EMP_LIST");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/BidPlan_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form1"), 30, "");
	}
	
	/**
	 *	IBSheet object initialize
	 */
	function gridInit(sheetName){
		var init_sheet = {};
		if(sheetName.id == "sheet1"){
			init_sheet.Cfg = {SearchMode:2, Page:30};
			init_sheet.Cols = [
	                        {Header:'CHK',	   	        Type:"CheckBox",		SaveName:"CHECK", 					Width:0, 		Align:"Center", HeaderCheck:0},
			       			{Header:'삭제',				Type:"DelCheck",		SaveName:"DEL_CHECK", 				Width:0, 		Align:"Center",	Edit:false, Hidden:"True"},
			    			{Header:'Status',			Type:"Status", 		    SaveName:"STATUS", 					Width:0, 		Align:"Center",	Edit:false, Hidden:"True"},
			    			{Header:'No.',				Type:"Seq", 			SaveName:"NO",						Width:0, 		Align:"Center",	Edit:false, Hidden:"True"},
			    			{Header:'추천부서',			Type:"Text", 			SaveName:"RECM_DEPT_NM", 			Width:100,		Align:"Center", Edit:false},
			    			{Header:'사업자번호',		    Type:"Text", 			SaveName:"VENDOR_NO", 				Width:100,		Align:"Center", Edit:false, Format:"SaupNo"},
			    			{Header:'업체명',			    Type:"Text", 			SaveName:"VENDOR_NAME", 			Width:100, 		Align:"Left"  , Edit:false},
			    			{Header:'대표자명',			Type:"Text", 			SaveName:"REPRE_NO", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'담당자명',			Type:"Text",	 		SaveName:"CHARGE_NAME", 			Width:100, 		Align:"Center", Edit:false},
			    			{Header:'전화번호',			Type:"Text", 			SaveName:"CORP_TEL", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'핸드폰',			    Type:"Text", 			SaveName:"CHAGE_HP", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'이메일',			    Type:"Text", 			SaveName:"CHARGE_EMAIL", 			Width:100, 		Align:"Left",   Edit:false},
			    			{Header:'견적제출시간',		Type:"Text", 			SaveName:"SIGN_DT", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'기술검토(TBE)',		Type:"Text", 			SaveName:"TBE_STATUS", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'상태',				Type:"Text", 			SaveName:"SIGN_STATUS", 			Width:100, 		Align:"Center", Edit:false},
			    			{Header:'견적설명참여여부',	Type:"Text", 			SaveName:"SITEPARTI_YN", 			Width:100, 		Align:"Center", Edit:false}
			];
		}else{
			init_sheet.Cfg = {SearchMode:2, Page:30,SizeMode:1};
			init_sheet.Cols = [
					       		{Header:'삭제',			Type:"DelCheck",		SaveName:"DEL_CHECK", 		Width:0, 		Align:"Center",	Hidden:"True"},
					    		{Header:'Status',		Type:"Status", 			SaveName:"STATUS", 			Width:0, 		Align:"Center",	Hidden:"True"},
	   			    			{Header:'No.',			Type:"Seq", 			SaveName:"NO",				Width:0, 		Align:"Center", Hidden:"True"},
	   			    			{Header:'계정ID',		Type:"Text", 			SaveName:"ACCT_ID", 		Width:0, 		Align:"Center", Hidden:"True"},
	   			    			{Header:'이름',			Type:"Text", 			SaveName:"USER_NAME", 		Width:100, 		Align:"Center", Edit:false},
	   			    			{Header:'부서명',			Type:"Text", 			SaveName:"BUSEO_NAME", 		Width:150, 		Align:"Left", Edit:false},
	   			    			{Header:'직위명',			Type:"Text", 			SaveName:"GRADE_NAME", 		Width:100, 		Align:"Center", Edit:false}
				];
		}
		init_sheet.HeaderMode = {Sort:1};
		IBS_InitSheet(sheetName, init_sheet);
		sheetName.SetDataAutoTrim(0);
		//sheetName.SetEditable(false);
		setGridSize();
	}
	
	/**
	 *	IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
	 */
	function sheet1_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
		} else {
			//조회 에러 수행
			alert(message);
		}
	}

	/**
	 *	IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
	 */
	function sheet2_OnSearchEnd(code, message) {
		 if(code == 0) {
			//sheet2.FitColWidth();
			//견적대상 업체 조회
			doSearchSheet();
		} else {
			//조회 에러 수행
			alert(message);
		}
	}
	
	function sheet1_OnSaveEnd(code, msg)
	{
		var event = $("#fevent").val();
		if(event == "BIDING_SMS"){
			alert("발송 되었습니다."); 			
		}
	}
	/**
	 *	IBSheet size setting
	 */
	function setGridSize() {
		sheet1.FitColWidth();
	}
	
	
	//첨부파일   
	function doAttachFile(obj,No) {
		var file_div = "bid/outside/"+"<%=Order.get("BID_NO")%>"+"/";
		var fileName = "<%=Order.get("DEMANDED_NO")%>" + "(" + "<%=Order.get("DEMANDED_TITLE")%>" + ")_";
		 if(obj==''){
			alert("After you have saved, you can attach a file.");
		}
		else if(obj != ''){ 
			if(No == 1){
				fileName += "내부자료";
				<%-- //viewFileList("<%=Order.get("DOC_ETC_IN")%>", obj.value, document.form1.p_AttachFile1, "N", "N", "Y", "N");
				//viewFileListNew("<%=Order.get("DOC_ETC_IN")%>", obj.value, document.form1.p_AttachFile1, "N", file_div); --%>
				viewFileListNew("<%=Order.get("DOC_ETC_IN")%>", obj.value, document.form1.p_AttachFile1, "N", file_div, null, null, null, null, "Y", fileName);
			}else{
				fileName += "외부자료";
				<%-- //viewFileList("<%=Order.get("DOC_ETC_OUT")%>", obj.value, document.form1.p_AttachFile2, "N", "N", "Y", "N");
				//viewFileListNew("<%=Order.get("DOC_ETC_OUT")%>", obj.value, document.form1.p_AttachFile2, "N", file_div); --%>
				viewFileListNew("<%=Order.get("DOC_ETC_OUT")%>", obj.value, document.form1.p_AttachFile2, "N", file_div, null, null, null, null, "Y", fileName);
			}
		} 
	}
	
	function doResult(resultObj) {
		try {
			if( resultObj.getRequestEvent() == "FORM_UPDATE") {
				if( resultObj.getSuccess() ) {
					alert("저장 되었습니다.");
 					$("#btn_list").click();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}
			
			if( resultObj.getRequestEvent() == "FORM_DELETE") {
				if( resultObj.getSuccess() ) {
					alert("삭제 되었습니다.");
 					$("#btn_list").click();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}

			if( resultObj.getRequestEvent() == "EXAM_REQUEST_FORM") {
				if( resultObj.getSuccess() ) {
					alert("요청 되었습니다.");
					document.form1.isSubmit = false;
				}
				else {
					dlgErrorMsg(resultObj);
				}
				document.form1.isSubmit = false;
			}
		} catch(errorObject) {
			showErrorDlg("doResult()", errorObject);
		}
	}
	
	function sheet1_OnSmartResize(Width, Height) { 
		sheet1.FitColWidth();
		autoResize();
	}

	function autoResize(){
		sheet1.SetSheetHeight(160); 
	}	
	
	setInterval("dpTime2()",1000);
	//시간 호출
	function dpTime2(){
	    var now = new Date();
	     hours = now.getHours();
	     minutes = now.getMinutes();
	     seconds = now.getSeconds();
         //alert("hours : " + hours + "\nminutes "+minutes+"\nseconds " + seconds);
	    /*  if (hours > 12){
	         hours -= 12;
	     	ampm = "오후 ";
	     }else{
	         ampm = "오전 ";
	     }
	     if (hours < 10)
	         hours = "0" + hours;
	     
	     if (minutes < 10)
	         minutes = "0" + minutes;
	     
	     if (seconds < 10)
	         seconds = "0" + seconds; */
	     
		//	document.getElementById("dpTime").innerHTML = ampm + hours + ":" + minutes + ":" + seconds;
			
			// 2010 년 6월 1일 (월은 0 ~ 11 월까지로 현재월 -1 값)

		    // 오후 6시 32분 35초 (시는 12 시간을 초과할 경우 12를 뺀 후 오후표시)

		    var day2= new Date(<%=to_yyyy%>,<%=to_MM%>,<%=to_dd%>,<%=to_hh%>,<%=to_mi%>,00);

		    // 2011 년 3월 1일 (월은 0 ~ 11 월까지로 현재월 -1 값)

		    // 오전 10시 15분 43초
		    var day1= new Date(<%=nowTime_yyyy%>,<%=nowTime_MM%>,<%=nowTime_dd%>,hours,minutes,seconds);

		    // 첫번째 날짜를 1/1000 값으로 환산

		    var ms1 = Date.parse(day1);

		//  alert(ms1);

		    // 두번째 날짜를 1/1000 값으로 환산

		    var ms2 = Date.parse(day2);

		//  alert(ms2);

		    var sep = (ms2-ms1)/1000; // 두 날짜간의 시간차 (1/1000 초 이므로 초로 환산)

		//  alert(sep);

		    var min = 60;

		    var hour= min * 60;

		    var day = hour * 24;

		    var sd  = parseInt(sep/day);

		    var sh  = parseInt((sep%day)/hour);

		    var sm  = parseInt((sep%hour)/min);

		    var ss  = sep%min+1;
			
		    var msg = "";
		    
		    //alert("sd : " + sd+"\nsh : " + sh +"\nsm : " + sm+"\nss : " + ss);
		    if(sd > 0){
		    	msg = sd+'일 '+sh+'시간 '+sm+'분 '+ss+'초 남았습니다. / 입찰진행중';
		    }else if(sd <= 0){
		    	if(sh <= 0){
		    		if(sm <= 0){
		    			msg = "입찰마감";
		    		}else{
		    			msg = sm+'분 '+ss+'초 남았습니다. / 입찰진행중';
		    		}
		    	}else{
		    		msg = sh+'시간 '+sm+'분 '+ss+'초 남았습니다. / 입찰진행중';
		    	}
		    }else{
		    	msg = "입찰마감";
		    }
		    document.getElementById('dpTime').innerHTML = msg;
		    
	 }
	
	function btnEvent(num){
		if(num == '1')
			$("#btn_list").click();
		if(num == '2')
		if(num == '3')
			 $("#btn_defer").click();
		if(num == '4')
			$("#btn_cancel").click();
	}
	
	function doSignFile(doc_id){
		
		//alert(doc_id);
		if(doc_id == ""){
			alert("결재 정보가 없습니다.");
			return;
		}
		var doc_chk = doc_id.substring(doc_id.length-3, doc_id.length);
		
		doc_chk = doc_chk * 1;
		
		var link = "";
		var year = "<%=sign_info.get("year") %>";
		if (year > "20151213"){
		 	link = "<%=gwurl%>upload_approval/TEC/doc/" + year.substr(0,4) + "/" + doc_chk + "/"+ doc_id+".mht";
		}
		else
		{
			link = "<%=gwurl%>upload_approval/TEC/doc/" + doc_chk + "/"+ doc_id+".mht";
		}
		window.open(link,"_viewDraft","");	
	}
	
</SCRIPT>


<modular:search id="form1">
	<modular:key id="fevent" />
</modular:search>
<BODY onresize="autoResize()">
<form id="form1" name="form1" method="post" modular:type="search">

<INPUT type='hidden' name="fevent" id="fevent"  value="">
<!-- List Search -->
<INPUT type='hidden' name="p_demanded_status" value="<%=params.get("p_demanded_status")%>">
<INPUT type='hidden' name="p_dept_cd" value="<%=params.get("p_dept_cd")%>">
<INPUT type='hidden' name="p_dept_nm" value="<%=params.get("p_dept_nm")%>">
<INPUT type='hidden' name="P_BID_MASTER_NM" value="<%=params.get("P_BID_MASTER_NM")%>">
<INPUT type='hidden' name="P_SITEDESCDATE_FROM_DT" value="<%=params.get("P_SITEDESCDATE_FROM_DT")%>">
<INPUT type='hidden' name="P_SITEDESCDATE_TO_DT" value="<%=params.get("P_SITEDESCDATE_TO_DT")%>">
<INPUT type='hidden' name="p_bid_from_dt" value="<%=params.get("p_bid_from_dt")%>">
<INPUT type='hidden' name="p_bid_to_dt" value="<%=params.get("p_bid_to_dt")%>">
<!-- List Search -->  
<INPUT type='hidden' name="DEMANDED_ID" value="<%=Order.get("DEMANDED_ID")%>">
<INPUT type='hidden' name="BID_NO" value="<%=Order.get("BID_NO")%>">
<INPUT type='hidden' name="BID_DEG" value="<%=Order.get("BID_DEG")%>">
<INPUT type='hidden' name="STATUS_CD" value="<%=Order.get("STATUS_CD")%>">
<INPUT type='hidden' name="CMPT_CD" value="<%=Order.get("CMPT_CD")%>">
<INPUT type='hidden' name="SITEPARTI_YN" value="Y">
<INPUT type='hidden' name="SITEDESC_FLAG" value="<%=Order.get("SITEDESC_FLAG")%>">
<table width="100%">
	<colgroup>
		<col width="500" />
		<col width="*" />
	</colgroup>
	<tr>
   		<th>
			<div align="left" id="title">
			    <ul><li>외주_입찰진행 상세<font style="font-size:11px"> (<%=Order.get("STATUS_NM")%>)</font></li></ul>
			</div> 
   		</th>
   		<td align="right">
				<span class="btnSearch center" id="btn_request"><a href="javascript:void(0);">개찰요청</a></span>
				<span class="btnSearch center" id="btn_modify"><a href="javascript:void(0);">정정공고</a></span>
				<span class="btnSearch center" id="btn_defer"><a href="javascript:void(0);">연기공고</a></span>
				<span class="btnSearch center" id="btn_cancel"><a href="javascript:void(0);">취소공고</a></span>
				<span class="btnSearch center" id="btn_item"><a href="javascript:void(0);">입찰내역</a></span>
				<span class="btnSearch center" id="btn_list"><a href="javascript:void(0);">목록</a></span>
   		</td>
  	</tr>
</table>

<%if(!Order.get("REBID_REASON").equals("") || !Order.get("REBID_OUTREASON").equals("")){%>
<div class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">재입찰사유</span>
	</div>
	<div class="application-location">
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="150"/>
		<col width="40%" />
		<col width="150" />
		<col width="*" />
	</colgroup>
  <TR height="25"> 
    <TH>재입찰사유<br>(내부보고)</TH>
	<TD><%=StringUtils.cvtHTML(Order.get("REBID_REASON"))%></TD>
	<TH>재입찰사유<br>(외부공지)
	</TH>
	<TD><%=StringUtils.cvtHTML(Order.get("REBID_OUTREASON"))%></TD>
  </TR>
 </TABLE>
<%} %>

<div class="application-info magT10">
	<div class="application-sub-title">
		<span class="title">발주의뢰정보</span>
	</div>
</div>

<!-- 발주의뢰정보 : 시작 -->

<TABLE class="form-table">
	<colgroup>
		<col width="150"/>
		<col width="23%">
		<col width="150"/>
		<col width="23%">
		<col width="150"/>
		<col/>
	</colgroup>
  <TR height="25"> 
    <TH> 현장</TH>
	<TD><%=Order.get("dept_nm") %></TD>
	<TH> 발주의뢰번호</TH>
	<TD><a href="javascript:doSignFile('<%=sign_info.get("doc_id") %>');"><%=Order.get("DEMANDED_NO")%></a>
	 </TD>
	<TH> 발주의뢰명</TH>
	<TD><%=Order.get("DEMANDED_TITLE")%></TD>
  </TR>

  <TR height="25"> 
	<TH> 발주의뢰일</TH>
	<TD><%= Order.get("DEMANDED_DATE")%></TD>
	<TH> 발주의뢰부서</TH>
	<TD><%= Order.get("REQ_DEPT_NM")%></TD>
	<TH> 발주의뢰자</TH>
	<TD><%= Order.get("EMP_NM")%></TD> 	
  </TR>
  
  <TR height="25"> 
	<TH> 발주접수일자</TH>
	<TD><%=Order.get("RECEIPT_DATE") %></TD>
	<TH> Pay Item</TH>
	<TD><%= Order.get("PAY_ITEM_NM") %></TD>
	<TH> 외주예산 (원)</TH>
	<TD><%= Formatter2.currency(Order.get("PUR_AMT"),0) %></TD>  <!-- 2015.3.2 외주예산추가 MKLEE -->	
  </TR> 	

  <TR height="25"> 
	<TH> 도급금액 (원)</TH>
	<TD><%= Formatter2.currency(Order.get("CONT_AMT"),0) %></TD>
	<TH> 실행예산 (원)</TH>
	<TD><%=Formatter2.currency(Order.get("ACT_AMT"),0) %></TD>
	<TH> 도급대비실행율(%)</TH>
	<TD><%= Order.get("ACT_RATE")%></TD> 	
  </TR>
  <TR height="25">
	<TH>공사기간</TH>
	<TD><%=Order.get("DELI_FROM_DY") %> <%if(!Order.get("DELI_FROM_DY").isEmpty()||!Order.get("DELI_TO_DY").isEmpty()){ %>~<%} %> <%= Order.get("DELI_TO_DY") %></TD>
	<TH>공사장소</TH>
	<TD><%= Order.get("DELIVERY_PLACE") %></TD>
	<TH>공종</TH>
	<TD><%= Order.get("OUT_ITEM_NM") %></TD> 
  </TR>
    
  <!-- 발주의뢰정보 : 종료 -->
</table>

<table width="100%">
	<colgroup>
		<col width="500" />
		<col width="*" />
	</colgroup>
	<tr>
   		<th>
   		<div class="application-info magT15">
			<div class="application-sub-title">
				<span class="title">입찰대상업체</span>
			</div>
		</div>
   		</th>
   		<td align="right">	
   		        <span class="btnSearch center" id="btn_sms"><a href="javascript:void(0);">입찰요청</a></span>
   				<span class="btnSearch center" id="btn_tbecheckpop"><a href="javascript:void(0);">기술검토결과서</a></span>
   				<!-- 2015.3.12 입찰중 기술검토 결과서 반려추가 -->
   		</td>
  	</tr>
</table>
	<div id="sheet1_div" style="padding-top:5px;height: auto; min-height: 160px; overflow: auto;">
		<script>createIBSheet('sheet1','100%', '160px');</script>
	</div>

<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">입찰기본정보</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="29%"/>
		<col width="145"/>
		<col/>
	</colgroup>
    <TH> 입찰번호-차수</TH>
	<TD colspan="2"><%=Order.get("BID_NO")%>-<%=Order.get("BID_DEG")%></TD>
	<TH> 온라인입찰여부</TH>
	<TD><%=Order.get("ONBID_YN")%></TD>
  </TR>


  <TR height="25"> 
	<TH> 입찰명</TH>
	<TD colspan="4"><%=Order.get("BID_MASTER_NM")%></TD>
  </TR>
  
  <TR height="25"> 
	<TH> 경쟁방법</TH>
	<TD colspan="2"><%=Order.get("CMPT_NM")%></TD>
	<TH> 낙찰자선정방법</TH>
	<TD><%=Order.get("SUCC_NM") %></TD> 	
  </TR> 	
  <!-- 발주의뢰정보 : 종료 -->
</table>

<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">입찰진행</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="29%"/>
		<col width="145"/>
		<col/>
	</colgroup>
  <TR height="25"> 
    <TH>업체공지일자</TH>
	<TD colspan="4"><%=Order.get("NOTI_DY") %></TD>
  </TR>


  <TR height="25"> 
	<TH rowspan="3"> 견적설명회 정보</TH>
	<TH> 여부</TH>
	<TD><%=Order.get("SITEDESC_FLAG")%></TD>
	<TH> 담당자</TH>
	<TD><%=Order.get("SITEDESCCHRGPRSNNM")%></TD>	
  </TR>
  
  <TR height="25"> 
	<TH> 담당자 전화번호</TH>
	<TD ><%=Order.get("SITEDESCTELNO")%></TD>
	<TH> 일시</TH>
	<TD ><%=Order.get("SITEDESCDATE")%></TD>		
  </TR> 	
  
    <TR height="25"> 
	<TH> 담당자 E-Mail</TH>
	<TD ><%=Order.get("SITEDESCEMAIL")%></TD>
	<TH> 장소</TH>
	<TD ><%=Order.get("SITEDESCPLACE")%></TD>		
  </TR> 
  
    <TR height="25"> 
	<TH rowspan="4"> 견적 의뢰</TH>
	<TH> 견적제출기간</TH>
	<TD colspan="3"> 
		<%=Order.get("BID_FROM_DT")%> ~<%=Order.get("BID_TO_DT")%> <font color='red'><b>(<span id="dpTime"></span>)</b></font>
	</TD>
  </TR>
  
  <TR height="25"> 
	<TH> 외주담당자</TH>
	<TD ><%=Order.get("PUREMPNM")%></TD>
	<TH> 외주담당자 전화번호</TH>
	<TD ><%=Order.get("PO_EMPNM")%></TD>		
  </TR> 	
  
    <TR height="25"> 
	<TH> 개찰자</TH>
	<TD colspan="3"><%=Order.get("OPEN_EMPNM")%></TD>	
  </TR> 

  <TR height="25"> 
	<TH> 보고자</TH>
	<TD colspan="3">
		<div  id="sheet2_div" style="width: 100%; height: 100%;"> 	
			<script>createIBSheet('sheet2','100%', '100px');</script>
		</div>
	</TD>
  </TR> 
    
  <TR height="25"> 
	<TH rowspan="2">기술검토(TBE)</TD>
	<TH> TBE 여부</TH>
	<TD  colspan="3"><%=Order.get("TBE_FLAG").equals("Y") ? "예" : "아니오"%></TD>
  </TR>
  
  <TR height="25"> 
	<TH> TBE 심사자</TH>
	<TD><%=Order.get("EVAL_EMPNM")%></TD>
	<TH>TBE담당자 전화번호 </TH>
	<TD ><%=Order.get("EVAL_TEL")%></TD>				
  </TR> 	
  <!-- 발주의뢰정보 : 종료 -->
</table>

<%if(p_reason || m_reason || c_reason){ %>
<div class="application-info magT20">
	<div class="application-sub-title">
		<span class="title">입찰사유</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="150">
		<col/>
	</colgroup>
   <%if(c_reason){ %>
  <TR height="25">
    <TH>취소사유</TH>
	<TD style="vertical-align: top"><%=StringUtils.cvtHTML(Order.get("CANCEL_REASON"))%></TD>
  </TR>
  <%} %>
   <%if(p_reason){ %>
  <TR height="25">
    <TH>연기사유</TH>
	<TD style="vertical-align: top" ><%=StringUtils.cvtHTML(Order.get("POSTPONE_REASON"))%></TD>
  </TR>
  <%} %>
  <%if(m_reason){ %>
  <TR height="25">
    <TH>정정사유</TH>
	<TD style="vertical-align: top"><%=StringUtils.cvtHTML(Order.get("MODIFY_REASON"))%></TD>
  </TR>
  <%} %>
</TABLE>
<%}%>

<div class="application-info magT20">
	<div class="application-sub-title">
		<span class="title">입찰조건</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="29%"/>
		<col width="145"/>
		<col/>
	</colgroup>
  <TR height="25"> 
	<TH>통화구분</TH>
	<TD colspan="4"> <%=Order.get("CURRENCY_GB_NM") %>
	</TD>
  </TR>
   <TR height="25"> 
	<TH>계약형태</TH>
	<TD colspan="4"> 
		<%=Order.get("OBC_CONT_TYPE_NM") %>
	</TD>
  </TR>
  <TR height="25"> 
  	<TH rowspan="2">공사대금</TH>
	<TH>선급금</TH>
	<TD><% if(!Order.get("OBC_FRST_CONT_RATE").isEmpty()){%> 계약금액의 : <%= Order.get("OBC_FRST_CONT_RATE") %>%<br><%}%>
	<%= Order.get("OBC_FRST_CONDI") %> <br>
	<%= Order.get("OBC_FRST_CNT_CONDI") %></TD>
	<TH>기성금</TH>
	<TD><% if(!Order.get("CPC_MID_RATE").isEmpty()){%> 계약금액의 :<%= Order.get("CPC_MID_RATE")%>% ,<%}%><% if(!Order.get("OBC_MID_CASH_RATE").isEmpty()){%> 현금 : <%=Order.get("OBC_MID_CASH_RATE")%>% <%}%><% if(!Order.get("OBC_MID_BILL_RATE").isEmpty()){%>어음 : <%= Order.get("OBC_MID_BILL_RATE")%>%<%}%><br>
			<% if(!Order.get("OBC_MID_PAYDAY").isEmpty()){%>세금계산서 발행일로부터 <%=Order.get("OBC_MID_PAYDAY")%> 일 내 지급<br><%} %>
			<% if(!Order.get("OBC_MID_BILL_DATE").isEmpty()){%>어음일 경우, 어음 만기일은 목적물 수령일로부터 (<%= Order.get("OBC_MID_BILL_DATE")%>)일<br><%} %>
			<% if(!Order.get("OBC_MID_PAYDAY").isEmpty()){%><%=Order.get("OBC_MID_REQ_MONTH")%> 개월 당 <%=Order.get("OBC_MID_CNT")%> 회 말일에 청구<%}%>
	</TD>	
  </TR>
    <TR height="25"> 
	<TH>준공금</TH>
	<TD colspan="3"><% if(!Order.get("PBC_REST_RATE").isEmpty()){%> 계약금액의 : <%=Order.get("PBC_REST_RATE")%>%, <%}%><% if(!Order.get("OBC_FIN_CASH_RATE").isEmpty()){%> 현금 : <%=Order.get("OBC_FIN_CASH_RATE")%>% <%}%><% if(!Order.get("OBC_FIN_BILL_RATE").isEmpty()){%> 어음 : <%=Order.get("OBC_FIN_BILL_RATE")%>%<%}%>
			<%-- <br><% if(!Order.get("OBC_FIN_PAYDAY").isEmpty()){%>세금계산서 발행일로부터 <%=Order.get("OBC_FIN_PAYDAY")%> 일 내 지급<%}%><br>
			<%=Order.get("OBC_FIN_CONDI") %></TD> --%>
  </TR>
  <TR height="25"> 
  	<TH rowspan="2">보증조건</TH>
	<TH>선급금보증</TH>
	<TD><% if(!Order.get("CBC_FIRST_RATE").isEmpty()){%>계약금액의 <%=Order.get("CBC_FIRST_RATE")%>%<%}%></TD>
	<TH>계약이행 보증</TH>
	<TD><% if(!Order.get("CONTFUL_RATE").isEmpty()){%>계약금액의 <%= Order.get("CONTFUL_RATE") %>%<%}%></TD>	
  </TR>
  <TR height="25"> 
	<TH>하자이행 보증</TH>
	<TD><% if(!Order.get("WARR_RATE").isEmpty()){%>준공금액의 <%= Order.get("WARR_RATE")%>%<%}%></TD>
	<TH>하자담보기간</TH>
	<TD><% if(!Order.get("CBC_DEFECT_DAY").isEmpty()){%>준공일로부터 <%= Order.get("CBC_DEFECT_DAY")%> 개월<%}%></TD>
  </TR>  
  <TR height="25"> 
  	<TH>기타조건</TH>
	<TH>하도급대금<br>연동 기준비율</TH>
	<TD><% if(!Order.get("PAY_CON_RATE").isEmpty()){%><%= Order.get("PAY_CON_RATE") %>%<%}%></TD>
	<TH>지체상금</TH>
	<TD><% if(!Order.get("CBC_DAMAGE_RATE").isEmpty()){%>일당 계약금액의 <%= Order.get("CBC_DAMAGE_RATE")%>%,<%}%><% if(!Order.get("CBC_DAMAGE_MAXRATE").isEmpty()){%> 최대 <%= Order.get("CBC_DAMAGE_MAXRATE")%>%<%}%></TD>	
  </TR>
  <TR height="25"> 
  	<TH rowspan="6">간접비 견적조건</TH>
	<TH>고용보험료</TH>
	<TD><% if(!Order.get("OBC_EMP_RATE").isEmpty()){%>노무비 * <%= Order.get("OBC_EMP_RATE")%>% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;
		<%}%><%=Order.get("OBC_EMP_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>연금보험료</TH>
	<TD><% if(!Order.get("OBC_PENSION_RATE").isEmpty()){%>직접노무비 <%=Order.get("OBC_PENSION_RATE")%>% &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;  &nbsp;
		<%}%><%=Order.get("OBC_PENSION_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>건강보험료</TH>
	<TD><% if(!Order.get("OBC_HEALTH_RATE").isEmpty()){%>직접노무비 * <%=Order.get("OBC_HEALTH_RATE")%>% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   &nbsp;
	<%}%><%=Order.get("OBC_HEALTH_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>노인장기보험료</TH>
	<TD><% if(!Order.get("OBC_ELDER_RATE").isEmpty()){%>건강보험료 * <%=Order.get("OBC_ELDER_RATE")%>% &nbsp; &nbsp;&nbsp; &nbsp;  &nbsp;
	<%}%><%=Order.get("OBC_ELDER_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>산재보험료</TH>
	<TD><% if(!Order.get("OBC_WORK_RATE").isEmpty()){%>노무비 * <%=Order.get("OBC_WORK_RATE")%>% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
		<%}%><%=Order.get("OBC_WORK_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>퇴직공제부금</TH>
	<TD><% if(!Order.get("OBC_RESIGN_RATE").isEmpty()){%>노무비 * <%=Order.get("OBC_RESIGN_RATE")%>% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
		<%}%><%=Order.get("OBC_RESIGN_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>안전관리비</TH>
	<TD><% if(!Order.get("OBC_SAFE_RATE").isEmpty()){%>노무비 * <%= Order.get("OBC_SAFE_RATE")%>% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
		<%}%><%=Order.get("OBC_SAFE_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>환경관리비</TH>
	<TD><% if(!Order.get("OBC_ENV_RATE").isEmpty()){%>재료비 * <%= Order.get("OBC_ENV_RATE")%>%  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;
		<%}%><%=Order.get("OBC_ENV_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>현장관리비</TH>
	<TD><% if(!Order.get("OBC_SITE_RATE").isEmpty()){%>직접비 * <%=Order.get("OBC_SITE_RATE")%>% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
		<%}%><%=Order.get("OBC_SITE_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>매입부가세</TH>
	<TD><% if(!Order.get("OBC_DUTY_RATE").isEmpty()){%>재료비 * 매입세율 <%= Order.get("OBC_DUTY_RATE")%>%  &nbsp;
		<%}%><%=Order.get("OBC_DUTY_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
   <TR height="25"> 
	<TH>간접비 정산조건</TH>
	<TD><%=Order.get("OBC_IND_YN").equals("Y") ? "<font color='blue'>[실적정산]</font>" : "<font color='red'>[비례정산]</font>" %></TD>
	<TH>건설기계 수수료</TH>
	<TD><%=Order.get("OBC_WARR_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
</TABLE>

<TABLE class="form-table" style="margin-top:5px">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="29%"/>
		<col width="145"/>
		<col/>
	</colgroup>
  <TR height="25"> 
    <TH>주요발주내용</TH>
	<TD colspan="2" style="vertical-align: top">
		<%=StringUtils.cvtHTML(Order.get("MAIN_PR_CONTENTS"))%> 
    </TD>
	
	<TH>입찰업체선정사유</TH>
	<TD style="vertical-align: top">
	 <%=StringUtils.cvtHTML(Order.get("BID_SUPP_SELECT_REASON"))%>            
	</TD>
  </TR>	
  <TR height="25"> 
    <TH>특이사항 내부</TH>
	<TD colspan="2" style="vertical-align: top">
		<%=StringUtils.cvtHTML(Order.get("INNER_REMARKS"))%> 
    </TD>
	
	<TH>특이사항 외부</TH>
	<TD style="vertical-align: top">
	 <%=StringUtils.cvtHTML(Order.get("OUTER_REMARKS"))%>            
	</TD>
  </TR>
  <TR height="100"> 
    <TH>내부자료</TH>
	<TD colspan="2"> 
	 <TEXTAREA name="p_AttachFile1" id="p_AttachFile1" style="width:85%;height:80px" rows="1" class="input" readOnly><%=filein.get(Order.get("DOC_ETC_IN")) %></TEXTAREA>
	                    <IMG id='search_spot_button' onClick="doAttachFile(document.form1.DEMANDED_ID,1);" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
    </TD>
	<TH>외부자료</TH>
	<TD>
	 <TEXTAREA name="p_AttachFile2" id="p_AttachFile2" style="width:85%;height:80px" rows="1" class="input" readOnly><%=fileout.get(Order.get("DOC_ETC_OUT")) %></TEXTAREA>
	                    <IMG id='search_spot_button' onClick="doAttachFile(document.form1.DEMANDED_ID,2);" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
	</TD>
  </TR>  
</TABLE>



</form>
