<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ec" uri="/WEB-INF/tld/ecnet_tld.tld"%>
<!DOCTYPE html>
<html lang="ko">
<head>
<title>알림톡 전송내역 상세</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="<c:url value='/js/EgovMultiFile.js'/>"></script>
<script type="text/javaScript" language="javascript">
$( document ).ready(function(){
	// pdf 파일 보기
	$('#fax_ori_btn').click(function(){
		var fileNm = $(this).data('info');
		$('#fileDownloadForm #faxOriFilePath').val(fileNm);
		$('#fileDownloadForm').attr('action', '/uss/ion/fax/fileDownload.do');
		$('#fileDownloadForm').submit();
	})
	
	// tif 파일 다운로드
	$('#fax_cvt_btn').click(function(){
		var fileNm = $(this).data('info');
		$('#convertForm #faxConvertFilePath').val(fileNm);
		var popWin = window.open('', 'previewPop', 'scrollbars=yes, width=1400, height=800');
		$('#convertForm').attr('action', '/uss/ion/fax/pdfPreview.do');
		$('#convertForm').attr('target', 'previewPop');
		$('#convertForm').submit();
	})
	
});

// 회원 파업
function fnSelectMber(mberId) {
	document.modiForm.mberId.value = mberId;
	window.open("about:blank", 'popupSelectMber', 'width=900, height=1800, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbar=no');
    document.modiForm.action = "<c:url value='/uss/umt/user/EgovGnrlselectedUserView.do'/>";
    document.modiForm.target = "popupSelectMber";
    document.modiForm.submit();
}

//이전 목록으로 
function goList(){
	$('#faxDetailListForm').submit();
}

</script>

</head>

<body>
	<input type="hidden" id="orignlFileNmTemp" value="${faxDetailVO.orignlFileNm }" />
	<div class="contWrap">
		<div class="pageTitle">
			<div class="pageIcon"><img src="/pb/img/pageTitIcon4.png" alt=""></div>
			<h2 class="titType1 c_222222 fwBold">팩스 전송내역 상세</h2>
			<p class="tType6 c_999999">전송한 팩스의 상세 내용을 조회 할 수 있습니다.</p>
		</div>
		<div class="pageCont">
			<table class="tbType2">
				<colgroup>
					<col style="width: 20%">
					<col style="width: 80%">
				</colgroup>
				<tbody>
					<tr class="no_modi">
						<th>아이디</th>
						<td colspan="3">
							<a href="#none"  onclick="javascript:fnSelectMber('<c:out value="${faxDetailVO.userId}"/>'); return false;">
								<c:out value="${faxDetailVO.userId}"/>
							</a>
						</td>
					</tr>
					
					<tr>
						<th><span class="reqArea">제목</span></th>
						<td colspan="3">
							<c:out value="${faxDetailVO.subject }"/>
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">수신번호</span></th>
						<td colspan="3">
							<c:out value="${faxDetailVO.addr }"/>
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">발송매수</span></th>
						<td colspan="3">
							<c:out value="${faxDetailVO.page }"/>
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">첨부파일</span></th>
						<td style="cursor:pointer;" colspan="3" id="fax_ori_btn" data-info="${faxDetailVO.streFileNm }">
							<c:out value="${faxDetailVO.orignlFileNm }" />
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">변환파일</span></th>
						<!-- 변환 파일 명이  convert 테이블의 seq 값으로 된다 .pdf는 쿼리에서 붙임-->
						<td style="cursor:pointer;" colspan="3" id="fax_cvt_btn" data-info="${faxDetailVO.convertSeq }">
							<c:out value="${faxDetailVO.convertSeq }"/>
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">발송시간</span></th>
						<td colspan="3">
							<c:out value="${faxDetailVO.doneDate }"/>
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">발송금액</span></th>
						<td colspan="3">
							<c:out value="${faxDetailVO.totPrice }"/>
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">환불금액</span></th>
						<td colspan="3">
							<c:out value="${faxDetailVO.refundPrice }"/>
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">발송결과</span></th>
						<td colspan="3">
							<c:out value="${faxDetailVO.result }"/>
						</td>
					</tr>
					<tr>
						<th><span class="reqArea">실패사유</span></th>
						<td colspan="3" title="${faxDetailVO.resultDetailTxt }">
							<c:choose>
								<c:when test="${not empty faxDetailVO.resultTxt &&  not empty faxDetailVO.resultDetailTxt }">
									${empty faxDetailVO.resultTxt ? faxDetailVO.resultDetailTxt : faxDetailVO.resultTxt}
								</c:when>
								<c:otherwise>
								-
								</c:otherwise>
							</c:choose>
						</td>
					</tr>
					
				</tbody>
			</table>
			<div class="btnWrap">
				<input type="button" class="btnType1 bg_888888" value="목 록" onclick="goList(); return false;">
			</div>
	 	</div>
	</div>
	
<!-- 사용자 파업 -->
<form name="modiForm" id="modiForm" method="post">
	<input name="mberId" type="hidden" />
</form>

<!-- 목록 돌아긱 -->
<form name="faxDetailListForm" id="faxDetailListForm" action="<c:url value='/uss/ion/fax/faxAdmSendDetailList.do'/>" method="post">
	<input type="hidden" name="faxGroupId" id="faxGroupId" value="${faxDetailVO.faxGroupId }"/>
	<input type="hidden" name="searchKeyword" value="${searchVO.searchKeyword }"/>
	<input type="hidden" name="searchCondition" value="${searchVO.searchCondition }"/>
	<input type="hidden" name="pageIndex"  value="${searchVO.pageIndex }"/>
</form>

<!-- 원본 파일 다운로드 -->
<form id="fileDownloadForm" name="fileDownloadForm" action="">
	<input type="hidden" id="faxOriFilePath" name="faxOriFilePath" value="" /> <!-- 변환파일 경로  -->
	<input type="hidden" id="orignlFileNm" name="orignlFileNm" value="${faxDetailVO.orignlFileNm }"/>
</form>

<!-- PDF 뷰어 -->
<form id="convertForm" name="convertForm" action="">
	<input type="hidden" id="faxConvertFilePath" name="faxConvertFilePath" value="" /> <!-- 변환파일 경로  -->
</form>

</body>
</html>
