<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/jsp/common/include/localemessage.jsp" %>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setHeader("Expires", "0");
%>

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="/jsp/common/include/css.jsp" />
<jsp:include page="/jsp/common/include/script.jsp" />

<script language="javascript">
var url       ='<c:url value="/onl/statistics/company/companyAnnuallyMan.json" />';
var url_view  ='<c:url value="/onl/statistics/company/companyAnnuallyMan.view" />';
var isDetail = false;
	function init(appDstcd, eaiBzwkDstcd, adptrInstiCode, companyCode,typeCode,annually){
		$.ajax({  
			type : "POST",
			url:url,
			dataType:"json",
			data:{cmd: 'LIST_DETAIL_COMBO'},
			success:function(json){
				var sndRecvCdRows 	= json.sndRecvCdRows;
				new makeOptions("CODE","NAME").setObj($("select[name=typeCode]")).setData(sndRecvCdRows).setFormat(codeName3OptionFormat).rendering();
				
				detail(appDstcd, eaiBzwkDstcd, adptrInstiCode, companyCode, typeCode,annually);
				
			},
			error:function(e){
				alert(e.responseText);
			}
		});
	}
	function detail( appDstcd, eaiBzwkDstcd, adptrInstiCode, companyCode,typeCode,annually) {
		if (!isDetail)
			return;
		$.ajax({
			type : "POST",
			url : url,
			dataType : "json",
			data : {
				cmd : 'DETAIL',
				appDstcd : appDstcd,
				eaiBzwkDstcd : eaiBzwkDstcd,
				adptrInstiCode : adptrInstiCode,
				companyCode : companyCode,
				typeCode : typeCode,
				annually : annually
			},
			success : function(json) {
				var data = json;
				
				$("#ajaxForm input[type!=radio],#ajaxForm select,#ajaxForm textarea").each(function(){
					var name = $(this).attr("name");
					var tag  = $(this).prop("tagName").toLowerCase();
					$(tag+"[name="+name+"]").val(data[name.toUpperCase()]);
				});

			},
			error : function(e) {
				alert(e.responseText);
			}
		});
	}
	$(document).ready(function() {
		var returnUrl = getReturnUrlForReturn();
		
		var appDstcd = "${param.appDstcd}";
		var eaiBzwkDstcd = "${param.eaiBzwkDstcd}";
		var adptrInstiCode = "${param.adptrInstiCode}";
		var companyCode = "${param.companyCode}";
		var typeCode = "${param.typeCode}";
		var annually= "${param.annually}";
		
		if(appDstcd!=null && appDstcd!='' && eaiBzwkDstcd!=null && eaiBzwkDstcd!=''){
			isDetail=true;
		}
		init(appDstcd, eaiBzwkDstcd, adptrInstiCode, companyCode,typeCode,annually);

		$("#btn_previous").click(function() {
			goNav(returnUrl);//LIST로 이동
		});
		
		
	});
</script>
</head>
<body>
	<div class="right_box">
		<div class="content_top">
			<ul class="path">
				<li><a href="#">${rmsMenuPath}</a></li>					
			</ul>					
		</div><!-- end content_top -->
		<div class="content_middle">
			<div class="search_wrap">
				<img src="<c:url value="/img/btn_previous.png"/>" alt="" id="btn_previous" level="R" status="DETAIL,NEW"/>
			</div>
			<div class="title">업체별 연별 거래현황 상세</div>						
			<form id="ajaxForm">
				<table class="table_row" cellspacing="0">
					<tr>
						<th width="30%" class="detail_title">일자</th>
						<td colspan="5"><input type="text" name="statcYMD" style="width: 100%" /></td>
					</tr>
					<tr>
						<th class="detail_title">어플리케이션코드</th>
						<td colspan="5"><input type="text" name="appDstcd" style="width: 100%" /></td>
					</tr>
					<tr>
						<th class="detail_title">어플리케이션명</th>
						<td colspan="5"><input type="text" name="appName" style="width: 100%" /></td>
					</tr>
					<tr>
						<th class="detail_title">업무명</th>
						<td colspan="5"><input type="text" name="eaiBzwkDstcd" style="width: 100%" /></td>
					</tr>
					<tr>
						<th class="detail_title">업체코드</th>
						<td colspan="5"><input type="text" name="companyCode" style="width: 100%" /></td>
					</tr>
					<tr>
						<th class="detail_title">업체명</th>
						<td colspan="5"><input type="text" name="companyName" style="width: 100%" /></td>
					</tr>
					<tr>
						<th class="detail_title">접속기관명</th>
						<td colspan="5"><input type="text" name="codeName" style="width: 100%" /></td>
					</tr>
					<tr>
						<th class="detail_title"><%=localeMessage.getString("batInterfaceMan.popSndRecvDiv")%></th>
						<td colspan="5">
							<div class="select-style">
								<select name="typeCode"></select>
							</div>
						</td>
					</tr>
					<tr>
						<th class="detail_title">총 건수</th>
						<td><input type="text" name="totalCnt" style="width: 100%" /></td>
						<th class="detail_title">정상 건수</th>
						<td><input type="text" name="successCnt" style="width: 100%" /></td>
						<th class="detail_title">오류 건수</th>
						<td><input type="text" name="errorCnt" style="width: 100%" /></td>
					</tr>
					<tr>
						<th class="detail_title">총 전문크기</th>
						<td><input type="text" name="totalLen" style="width: 100%" /></td>
						<th class="detail_title">정상 전문크기</th>
						<td><input type="text" name="successLen" style="width: 100%" /></td>
						<th class="detail_title">오류 전문크기</th>
						<td><input type="text" name="errorLen" style="width: 100%" /></td>
					</tr>
				</table>
			</form>
		</div><!-- end content_middle -->
	</div><!-- end right_box -->
</body>
</html>