<%
/**
 * <pre>
 * @Class Name : getMyInfo.jsp
 * 
 * @Description : 마이페이지  
 * 
 * 
 * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
 *
 * </pre>
 *
 * @ ------------    --------    ---------------------------
 * @ 수정일                     수정자             수정내용
 * @ ------------    --------    ---------------------------
 * @ 2021.11.09.     KNKIM       최초 생성
 *
 * 
 * @author 이씨플라자 * DIGITALSHIP KNKIM
 * @since 2021.11.09.
 * @version 1.0
 *
 */
 %>
<%@ page language="java" 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="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ 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" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<c:set var="pageTitle">회원정보관리</c:set>
<script>
<!--
$( document ).ready(function() {
    fn_setPageTitle("<c:out value='${pageTitle}'/>");
});
//-->
</script>

    <!-- 회원정보관리 섹션 -->
    <div class="location myinfo">
        <h2 class="blind"><c:out value='${pageTitle}'/> 섹션영역</h2>
        <div class="inner">
            <div class="row-top">
                <div class="location-box">
                    <ul class="loc">
                        <li>HOME</li>
                        <li>마이페이지</li>
                        <li class="on"><c:out value='${pageTitle}'/></li>
                    </ul>
                    <div class="tit">
                        <h2><span>회원정보</span>관리</h2>
                    </div>
                </div>
                <div class="arr"><img src="/images/icon/icon-join-arr2.png" alt=""></div>
            </div>
            <div class="contents row-bottom">
                <div class="myinfo-box">
                   
                    <div class="top-info">
                        <div class="left">
                            <h3>반갑습니다,<br><span><c:out value='${loginVO.name }'/></span>님!</h3>
                            <div class="sns-login">
                                <span class="icon">
                                    <img src="/images/icon/icon-<c:out value='${fn:toLowerCase(loginVO.snsType) }'/>.png"  
                                    <c:if test="${loginVO.snsType == 'KAKAO'}">alt="카카오"</c:if>
                                    <c:if test="${loginVO.snsType == 'GOOGLE'}">alt="구글"</c:if>
                                    <c:if test="${loginVO.snsType == 'NAVER'}">alt="네이버"</c:if>
                                    >
                                </span>
                                <span class="type"><c:out value='${fn:substring(loginVO.snsType, 0, 1)}'/><c:out value='${fn:toLowerCase(fn:substring(loginVO.snsType, 1, fn:length(loginVO.snsType)))}'/></span>
                                <span>계정으로 로그인 중</span>
                            </div>
                            <div class="myinfo-btn"><a href="javascript:void(0);" onclick="location.href = '/userInfo/pwCertMyInfo.do';">내정보</a></div>
                            <div class="date-box">
                                최근 방문일: <span class="date"><c:out value='${lastLogin.dtStr }'/></span>
                                <span class="time"><c:out value='${lastLogin.tmStr }'/></span>
                            </div>
                        </div>
                        <div class="right">
                            <div class="top-box">
                                <div class="con-1">
                                
                                    <h3>대출현황</h3>
                                    <div class="list-box">   
                                        <div>
                                            <p><c:out value='${rentStats.lentAppCnt }'/>/<c:out value='${rentStats.lentResvCnt }'/></p>
                                            <p>신청/예약</p>
                                        </div>
                                        <div>
                                            <p><c:out value='${rentStats.lentCancelCnt }'/></p>
                                            <p>취소</p>
                                        </div>
                                        <div>
                                            <p><c:out value='${rentStats.lentCnt }'/></p>
                                            <p>대출중</p>
                                        </div>
                                        <div>
                                            <p><c:out value='${rentStats.lentRtnCnt }'/></p>
                                            <p>반납</p>
                                        </div>
                                        <div>
                                            <p><c:out value='${rentStats.lentOverCnt }'/></p>
                                            <p>연체</p>
                                        </div>
                                    </div>
                                </div>
                                <div class="con-2">
                                    <h3>방문열람현황</h3>
                                    <div class="list-box">
                                        <div>
                                            <p><c:out value='${rentStats.reqAppCnt }'/></p>
                                            <p>신청</p>
                                        </div>
                                        <div>
                                            <p><c:out value='${rentStats.reqCancelCnt }'/></p>
                                            <p>취소</p>
                                        </div>
                                        <div>
                                            <p><c:out value='${rentStats.reqOkCnt }'/></p>
                                            <p>승인</p>
                                        </div>
                                        <div>
                                            <p><c:out value='${rentStats.reqCompCnt }'/></p>
                                            <p>반려</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="bottom-box">
                                <div class="con-1">
                                    <h3>소장자료관 접속현황</h3>
                                    <div class="key-box">
                                    <c:forEach var="itemVisitedOrgs" items="${visitedOrgs }">
                                        <a href="javascript:void(0);" title="새 창 열림" onclick="gfn_openNewWindow('https://<c:out value='${itemVisitedOrgs.domainHostNm}'/>.nculture.org')"><span class="button"><c:out value='${itemVisitedOrgs.deptNm }'/></span></a>
                                    </c:forEach>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="row-bottom">
                        <div class="concern-data">
                            <div class="inner">
                                <div class="title-box">
                                    <div class="title"><h3><span>관심</span>자료</h3><div class="cont">총 <span><c:out value='${interestTotalCount }'/></span>건</div></div>
                                    <div class="More"><a href="javascript:void(0);" onclick="gfn_gotoUrl('/interest/listInterests.do')">더보기 <img src="/images/icon/icon-more.png" alt="더보기"></a></div>
                                </div>
                                
                                <div class="list-box">
                                
                                    <c:forEach var="item" items="${interestList }">
	
	                                    <div class="list">
	                                        <div class="thum">
	                                            <a href="javascript:void(0);" onclick="gfn_getDetail('<c:out value='${item.masterId }'/>')"><img src="<c:out value='${item.rprsThumbUrlWithDefaultSmall }'/>" width="130" height="196" alt="<c:out value='${item.title }'/>"></a>
	                                        </div>
	                                        <div class="text">
	                                            <div class="ti"><a href="javascript:void(0);" onclick="gfn_getDetail('<c:out value='${item.masterId }'/>')"><c:out value='${item.title }'/></a></div>
	                                            <div class="cl">
	                                                <p class="typ"><span>자료유형 :</span><span><c:out value='${item.typeDivNm }'/>
	                                                   <c:if test="${not empty item.typeDivNm and not empty item.dtlsTypeDivNm }">&gt;</c:if> <c:out value='${item.dtlsTypeDivNm }'/>
	                                                   <c:if test="${empty item.typeDivNm and empty item.dtlsTypeDivNm }">-</c:if>
	                                                   </span></p>
	                                                <p class="sub"><span>주제분야 :</span><span><c:out value='${item.subjectNmUp } '/>
	                                                   <c:if test="${not empty item.subjectNmUp and not empty item.subjectNm }">&gt;</c:if> <c:out value='${item.subjectNm }'/>
	                                                   <c:if test="${empty item.subjectNmUp and empty item.subjectNm }">-</c:if>
	                                                   </span></p>
	                                                <p class="age"><span>생산기관 :</span><span><c:out value='${item.orgNm }'/>
	                                                   <c:if test="${empty item.orgNm }">-</c:if>
	                                                </span></p>
	                                                <p class="yea"><span>생산년도 :</span><span><c:out value='${item.creatYyyy }'/>
	                                                   <c:if test="${empty item.creatYyyy }">-</c:if>
	                                                </span></p>
	                                            </div>
	                                        </div>
	                                    </div>
                                        
                                    </c:forEach>
                                   
                                </div>
                            </div>
                        </div>
                        
                        <div class="loan-history list-wrap">
                            <div class="inner">
                                <div class="title-box">
                                    <div class="title"><h3><span>대출</span>내역</h3><div class="cont">총 <span><c:out value='${rentTotalCount }'/></span>건</div></div>
                                    <div class="More"><a href="javascript:void(0);" onclick="gfn_gotoUrl('/rent/listRentItems.do')"><span>더보기</span> <img src="/images/icon/icon-more.png" alt="더보기"></a></div>
                                </div>
                                
                                <c:forEach var="item" items="${rentList }">

		                                <div class="list-box">
		                                    <div class="list">
		                                        <div class="tit">
		                                            <p>[<c:out value='${item.mngOrgNm }'/>]</p>
		                                        </div>
		                                        <div class="con">
		                                            <p><a href="javascript:void(0);" onclick="gfn_getDetail('<c:out value='${item.masterId }'/>')"><c:out value='${item.title }'/></a></p>
		                                            <p>
		                                                <span><em>자료유형 : </em> <c:out value='${item.typeDivNm }'/>
		                                                  <c:if test="${not empty item.typeDivNm and not empty item.dtlsTypeDivNm }">&gt;</c:if> <c:out value='${item.dtlsTypeDivNm }'/>
		                                                  <c:if test="${empty item.typeDivNm and empty item.dtlsTypeDivNm }">-</c:if>
		                                                </span>
		                                                <span><em>주제분야 : </em> <c:out value='${item.subjectNmUp }'/>
		                                                  <c:if test="${not empty item.subjectNmUp and not empty item.subjectNm }">&gt;</c:if> <c:out value='${item.subjectNm }'/>
		                                                  <c:if test="${empty item.subjectNmUp and empty item.subjectNm }">-</c:if>
		                                                </span>
		                                                <span><em>생산기관 : </em> <c:out value='${item.orgNm }'/> <c:if test="${empty item.orgNm }">-</c:if></span>
		                                                <span><em>생산년도 : </em> <c:out value='${item.creatYyyy }'/> <c:if test="${empty item.creatYyyy }">-</c:if></span>
		                                            </p>
		                                        </div>
		                                        <div class="state">
		                                          <c:if test='${item.bookLtRvStatusCd == "A" }'><span class="subscription"><c:out value='${item.bookLtRvStatusNm}'/></span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "B" }'><span class="subscription"><c:out value='${item.bookLtRvStatusNm}'/></span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "C" }'><span class="cancel"><c:out value='${item.bookLtRvStatusNm}'/></span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "W" }'><span class="loan"><c:out value='${item.bookLtRvStatusNm}'/></span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "R" }'><span class="return"><c:out value='${item.bookLtRvStatusNm}'/></span></c:if>
                                                  <c:if test='${item.bookLtRvStatusCd == "R0" }'><span class="return"><c:out value='${item.bookLtRvStatusNm}'/></span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "R1" }'><span class="return"><c:out value='${item.bookLtRvStatusNm}'/></span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "P" }'><span class="overdue"><c:out value='${item.bookLtRvStatusNm}'/></span></c:if>
		                                        </div>
		                                    </div>
		                                </div>                                        
                                    
                                </c:forEach>                                
                                
                            </div>
                        </div>
                        
                        <div class="visit-history list-wrap">
                            <div class="inner">
                                <div class="title-box">
                                    <div class="title"><h3><span>방문열람</span>내역</h3><div class="cont">총 <span><c:out value='${readTotalCount }'/></span>건</div></div>
                                    <div class="More"><a href="javascript:void(0);" onclick="gfn_gotoUrl('/read/listReadItems.do')"><span>더보기</span> <img src="/images/icon/icon-more.png" alt="더보기"></a></div>
                                </div>

                                <c:forEach var="item" items="${readList }">

                                        <div class="list-box">
                                            <div class="list">
                                                <div class="tit">
                                                    <p>[<c:out value='${item.mngOrgNm }'/>]</p>
                                                </div>
                                                <div class="con">
                                                    <p><a href="javascript:void(0);" onclick="gfn_getDetail('<c:out value='${item.masterId }'/>')"><c:out value='${item.title }'/></a></p>
                                                    <p>
                                                        <span><em>자료유형 : </em> <c:out value='${item.typeDivNm }'/> 
	                                                        <c:if test="${not empty item.typeDivNm and not empty item.dtlsTypeDivNm }">&gt;</c:if> <c:out value='${item.dtlsTypeDivNm }'/>
	                                                        <c:if test="${empty item.typeDivNm and empty item.dtlsTypeDivNm }">-</c:if>
                                                        </span>
                                                        <span><em>주제분야 : </em> <c:out value='${item.subjectNmUp }'/> 
                                                            <c:if test="${not empty item.subjectNmUp and not empty item.subjectNm }">&gt;</c:if> <c:out value='${item.subjectNm }'/>
                                                            <c:if test="${empty item.subjectNmUp and empty item.subjectNm }">-</c:if>
                                                        </span>
                                                        <span><em>생산기관 : </em> <c:out value='${item.orgNm }'/> <c:if test="${empty item.orgNm }">-</c:if></span>
                                                        <span><em>생산년도 : </em> <c:out value='${item.creatYyyy }'/> <c:if test="${empty item.creatYyyy }">-</c:if></span>
                                                    </p>
                                                </div>
                                                <div class="state">
                                                  <c:if test='${item.reqStatusDivCd == "A0" }'><span class="wait"><c:out value='${item.reqStatusDivNm}'/></span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "A1" }'><span class="approval"><c:out value='${item.reqStatusDivNm}'/></span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "W" }'><span class="approval"><c:out value='${item.reqStatusDivNm}'/></span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "A2" }'><span class="return"><c:out value='${item.reqStatusDivNm}'/></span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "C" }'><span class="cancel"><c:out value='${item.reqStatusDivNm}'/></span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "R" }'><span class="read"><c:out value='${item.reqStatusDivNm}'/></span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "D" }'><span class="unread"><c:out value='${item.reqStatusDivNm}'/></span></c:if>
                                                </div>
                                            </div>
                                        </div>                                        
                                    
                                </c:forEach>                                
                                
                            </div>
                        </div>
                        
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
    
    
    