<%--
  Class Name : EgovNoticeInqire.jsp
  Description : (사용자)게시물 조회 화면
  Modification Information
 
      수정일      수정자              수정내용
     ----------  --------    ---------------------------
     2009.03.23   이삼섭        최초 생성
     2009.06.26   한성곤        2단계 기능 추가 (댓글관리, 만족도조사)
     2011.08.31   JJY       	경량환경 버전 생성
     2013.05.23   이기하       	상세보기 오류수정
 
    author   : 공통서비스 개발팀 이삼섭
    since    : 2009.03.23
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator"%>
<%pageContext.setAttribute("crlf", "\r\n"); %>
<head>
<style>
 .bbsImg p img{height:auto !important;}
</style>
<script>
    
    function fn_egov_select_noticeList(pageNo) {
        document.searchForm.action = "<c:url value='/web/cop/bbs/selectBoardList.do'/>";
        document.searchForm.submit();
    }
    
    function fn_egov_delete_notice() {
        if (confirm('<spring:message code="common.delete.msg" />')) {
            document.searchForm.action = "<c:url value='/web/cop/bbs/deleteBoardArticle.do'/>";
            document.searchForm.submit();
        }   
    }
    
    function fn_egov_moveUpdt_notice() {
        document.searchForm.action = "<c:url value='/web/cop/bbs/forUpdateBoardArticle.do'/>";
        document.searchForm.method = "get";
        document.searchForm.submit();          
    }
</script>

<!-- 댓글 작성 스크립트  -->
<c:if test="${brdMstrVO.addYn == 'Y'}">
	<script src="<c:url value="/validator.do"/>"></script>
	<validator:javascript formName="articleComment" staticJavascript="false" xhtml="true" cdata="false" />
	<script>
// 댓글 등록
function fn_egov_insert_commentList() {
	
	var form = document.getElementById("articleCommentVO");

	if (!validateArticleComment(form)){
		return;
	}
	if (confirm('<spring:message code="common.regist.msg" />')) {
		form.commentCn.value = form.commentCn.value.replace(/<(\/a|a)([^>]*)>/gi,"");
		form.submit();
	}
}

// 댓글 수정
function fn_egov_updt_commentList() {
	
	var form = document.getElementById("articleCommentVO");
	
	if (!validateArticleComment(form)){
		return;
	}

	if (confirm('<spring:message code="common.update.msg" />')) {
		form.commentCn.value = form.commentCn.value.replace(/<(\/a|a)([^>]*)>/gi,"");
		form.modified.value = "true";
		form.action = "<c:url value='/web/cop/cmt/updateArticleComment.do'/>";
		form.submit();
	}
}

// 댓글 수정 화면
function fn_egov_selectCommentForupdt(commentNo) {
	
	var form = document.getElementById("articleCommentVO");
	
	//form.subPageIndex.value = pageNo;
	
	form.commentNo.value = commentNo;
	form.action = "<c:url value='/web/cop/bbs/selectBoardArticle.do'/>";
	form.submit();
}

// 댓글 삭제
function fn_egov_deleteCommentList(commentNo) {

	var form = document.getElementById("articleCommentVO");
	
	if (confirm('<spring:message code="common.delete.msg" />')) {
		form.modified.value = "true";
		form.commentNo.value = commentNo;
		form.action = "<c:url value='/web/cop/cmt/deleteArticleComment.do'/>";
		form.submit();
	}
}

/* 댓글페이징 */
function fn_egov_select_commentList(pageNo) {
	
	var form = document.getElementById("articleCommentVO");
	
	// form.subPageIndex.value = pageNo;
	form.commentNo.value = '';
	form.action = "<c:url value='/web/cop/bbs/selectBoardArticle.do'/>";
	form.submit();
}
</script>
</c:if>
</head>
<body>
	<section class="sub">
		<c:choose>
			<c:when test="${brdMstrVO.bbsId == 'BBSMSTR_000000000037' || brdMstrVO.bbsId == 'BBSMSTR_000000000048' || brdMstrVO.bbsId == 'BBSMSTR_000000000014'}">
				<!-- ESG경영 -->
				<div class="s_visual s_visual_img02">
					<div class="textbar">
						<h2 class="s_tit">${brdMstrVO.bbsNm}</h2>
						<div class="sub_navi">
							<ul>
								<li class="home"><img alt="home" src="/img/s_navi_home.png" />&ensp;&gt;</li>
								<li>ESG경영 &gt;</li>
								<li>윤리 경영 &gt;</li>
								<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000037'}">
									<li><span>반부패 청렴활동</span></li>
								</c:if>
								<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000048'}">
									<li><span>부패행위 징계처분자 정보공개</span></li>
								</c:if>
								<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000014'}">
									<li><span>감사결과</span></li>
								</c:if>
							</ul>
						</div>
					</div>
				</div>
			</c:when>

			<c:when test="${brdMstrVO.bbsId == 'BBSMSTR_000000000018' || brdMstrVO.bbsId == 'BBSMSTR_000000000201' || brdMstrVO.bbsId == 'BBSMSTR_000000000029' || brdMstrVO.bbsId == 'BBSMSTR_000000000019' || brdMstrVO.bbsId == 'BBSMSTR_000000000060'}">
				<!-- POLA 소식 -->
				<div class="s_visual s_visual_img06">
					<div class="textbar">
						<h2 class="s_tit">${brdMstrVO.bbsNm}</h2>
						<div class="sub_navi">
							<ul>
								<c:if test="${not empty brdMstrVO.menuCours}">
									<li class="home"><img alt="home" src="/img/s_navi_home.png" />&ensp;&gt;</li>
									<li id="menuCours">${brdMstrVO.menuCours}</li>
								</c:if>
							</ul>
						</div>
					</div>
				</div>
			</c:when>

			<c:when test="${brdMstrVO.bbsId == 'BBSMSTR_000000000038' || brdMstrVO.bbsId == 'BBSMSTR_000000000039' || brdMstrVO.bbsId == 'BBSMSTR_000000000040' || brdMstrVO.bbsId == 'BBSMSTR_000000000043' || brdMstrVO.bbsId == 'BBSMSTR_000000000030' || brdMstrVO.bbsId == 'BBSMSTR_000000000056'}">
				<!-- POLA 소개 -->
				<div class="s_visual s_visual_img05">
					<div class="textbar">
						<h2 class="s_tit">${brdMstrVO.bbsNm}</h2>
						<div class="sub_navi">
							<ul>
								<c:if test="${not empty brdMstrVO.menuCours}">
									<li class="home"><img alt="home" src="/img/s_navi_home.png" />&ensp;&gt;</li>
									<li>POLA 소개 &gt;</li>
									<li>일반공시 &gt;</li>
									<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000038'}">
										<li><span>공무국외 여행보고서</span></li>
									</c:if>
									<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000039'}">
										<li><span>공용차량 운영현황</span></li>
									</c:if>
									<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000040'}">
										<li><span>소송관리 운영현황</span></li>
									</c:if>
									<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000043'}">
										<li><span>상품권 구매현황</span></li>
									</c:if>
									<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000030'}">
										<li><span>부서장 업무추진비</span></li>
									</c:if>
									<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000056'}">
										<li><span>금품처리 공개</span></li>
									</c:if>
								</c:if>
							</ul>
						</div>
					</div>
				</div>
			</c:when>

			<c:otherwise>
				<div class="s_visual s_visual_img0${fn:substring(brdMstrVO.firstDeptMenuNo,1,2)}">
					<div class="textbar">
						<h2 class="s_tit">${brdMstrVO.bbsNm}</h2>
						<div class="sub_navi">
							<ul>
								<c:if test="${not empty brdMstrVO.menuCours}">
									<li class="home"><img alt="home" src="/img/s_navi_home.png" />&ensp;&gt;</li>
									<li id="menuCours">${brdMstrVO.menuCours}</li>
								</c:if>
							</ul>
						</div>
					</div>
				</div>
			</c:otherwise>
		</c:choose>


		<!--내용s-->
		<form:form commandName="searchForm" name="searchForm" method="get" action="<c:url value='/web/cop/bbs/selectBoardList.do'/>">
			<input name="pageIndex" type="hidden" value="<c:out value='${searchVO.pageIndex}'/>"/>
			<input name="searchCnd" type="hidden" value="<c:out value='${searchVO.searchCnd}'/>"/>
			<input name="searchWrd" type="hidden" value="<c:out value='${searchVO.searchWrd}'/>"/>
			<input name="bbsId" type="hidden" value="<c:out value='${result.bbsId}'/>" />
			<input name="nttId" type="hidden" value="<c:out value='${result.nttId}'/>" />
		</form:form>
		<div id="container" class="board_wrap">
			<div class="view_wrap">
				<div class="view_subject">
					<c:out value="${result.nttSj}" />
				</div>
				<div class="meta">
					<div class="iconBox"><img src="/img/userIcon.png" alt="등록한 사람"></div>
					<span>
						<c:choose>
						<c:when test="${not empty result.frstRegisterId}">
							관리자
<!-- 관리자 <c:out value="${result.partTitle}" /> <c:out value="${result.offmTelno}" /> -->

						</c:when>
						<c:when test="${brdMstrVO.bbsId == 'BBSMSTR_000000000540' || brdMstrVO.bbsId == 'BBSMSTR_000000000541' || brdMstrVO.bbsId == 'BBSMSTR_000000000570'}">
							익명
						</c:when>						
						<c:otherwise>
							<c:out value="${result.frstRegisterNm}" />	
						</c:otherwise>
						</c:choose>
					</span>
					<div class="iconBox"><img src="/img/dateIcon.png" alt="작성날짜"></div>
					<span style="padding-left: 5px;"><c:out value="${result.frstRegisterPnttm}" /></span>
					<div class="iconBox"><img src="/img/eyeIcon.png" alt="조회수"></div>
					<span class="author">조회 수 : <c:out value="${result.inqireCo}" /></span>
					<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000153' && empty result.frstRegisterId}">
						<!-- 폴라스토리. 사용자구분 -->
						<div style="padding-top: 10px;">
							사용자 구분 : [<c:out value="${result.userTyNm}" />]
							<c:if test="${not empty result.userPosition}">
								<c:out value="${result.userPosition}" />
							</c:if>
						</div>
					</c:if>
					<c:if test="${brdMstrVO.bbsTyCode == 'BBST03' && brdMstrVO.bbsId == 'BBSMSTR_000000000151'}">
						<!-- 통합신고게시판 -->
						<div style="padding-top: 10px;">
							신고유형 : <c:out value="${result.reportTyNm}" />
						</div>
					</c:if>
				</div>
				<div class="view_content">
					<c:if test="${brdMstrVO.bbsTyCode == 'BBST05' || brdMstrVO.bbsTyCode == 'BBST06'}">
					<p>
						<c:import url="/cmm/fms/selectImageFileInfsWeb.do" charEncoding="utf-8">
							<c:param name="atchFileId" value="${result.atchFileId}" />
						</c:import>
					</p>
					<br/>
					</c:if>
					<div class="bbsImg" style="word-break: break-all;">
						<c:set var="vContent" value="${fn:replace(result.nttCn , 'onerror' , '1')}" />
						<c:out value="${fn:replace(vContent , crlf , '<br/>')}" escapeXml="false" />
					</div>
				</div>
			</div>
			
			<!-- 다언다청대통 게시판 구분 -->
			<c:if test="${brdMstrVO.bbsId == 'BBSMSTR_000000000221' && empty result.frstRegisterId}">
			<div style="padding-top: 7px;">
				<strong>구 분 : </strong>
				[<c:out value="${result.ddTyNm}" />]
			</div>
			</c:if>
			
			<c:if test="${brdMstrVO.fileAtchPosblAt == 'Y'}">
				<div class="bo_w_download">
					<div class="ico-file-bx"><strong>첨부파일</strong></div>
					<c:if test="${not empty result.atchFileId}">
						<c:import url="/cmm/fms/selectBBSFileInfs.do" charEncoding="utf-8">
							<c:param name="param_atchFileId" value="${result.atchFileId}" />
							<c:param name="nttId" value="${result.nttId}" />
							<c:param name="bbsId" value="${result.bbsId}" />
						</c:import>
					</c:if>
				</div>
			</c:if>

			<div class="btn_bo_write">
				<ul>
					<li><button class="btn_blue btn" onclick="javascript:fn_egov_select_noticeList(); return false;">
							<img alt="목록" src="/img/listIcon.png" style="width:18px; padding-right:5px;"> 목록
						</button></li>
					<c:if test="${brdMstrVO.writeAuth == 'ROLE_ANONYMOUS' }">
					<li>
						<button class="btn" onclick="javascript:fn_egov_moveUpdt_notice(); return false;">
							<img alt="수정" src="/img/penIcon.png" style="width:18px; padding-right:5px;">수정
						</button>
					</li>
					</c:if>
					<c:if test="${brdMstrVO.deleteAuth == 'ROLE_ANONYMOUS' }">
					<li><button class="btn_cancel btn" onclick="javascript:fn_egov_delete_notice('1'); return false;">
							<img alt="삭제" src="/img/deleteIcon.png" style="width:18px; padding-right:5px;"> 삭제
						</button></li>
					</c:if>
				</ul>
			</div>
			
			<!-- 댓글 -->
			<c:if test="${brdMstrVO.addYn == 'Y'}">
				<c:import url="/web/cop/cmt/selectArticleCommentList.do" charEncoding="utf-8"></c:import>
			</c:if>
			
		</div>
		<!-- 내용e -->

	</section>
</body>

