<%
/**
 * <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"%>


    <!-- 회원정보관리 섹션 -->
    <div class="location myinfo">
        <h2 class="blind">회원정보관리 섹션영역</h2>
        <div class="inner">
            <div class="row-top">
                <div class="location-box">
                    <ul class="loc">
                        <li>HOME</li>
                        <li>마이페이지</li>
                        <li class="on">회원정보관리</li>
                    </ul>
                    <ul class="tit">
                        <li><span>회원정보</span>관리</li>
                    </ul>
                </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>${loginVO.name }</span>님!</h3>
                            <div class="sns-login">
                                <span class="icon"><img src="/images/icon/icon-${fn:toLowerCase(loginVO.snsType) }.png" alt="sns 아이콘"></span>
                                <span class="type"></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">${lastLogin.dtStr }</span>
                                <span class="time">${lastLogin.tmStr }</span>
                            </div>
                        </div>
                        <div class="right">
                            <div class="top-box">
                                <div class="con-1">
                                
                                    <h3>대출현황</h3>
                                    <div class="list-box">   
                                        <div>
                                            <p>${rentStats.lentAppCnt }/${rentStats.lentResvCnt }</p>
                                            <p>신청/예약</p>
                                        </div>
                                        <div>
                                            <p>${rentStats.lentCancelCnt }</p>
                                            <p>취소</p>
                                        </div>
                                        <div>
                                            <p>${rentStats.lentCnt }</p>
                                            <p>대출중</p>
                                        </div>
                                        <div>
                                            <p>${rentStats.lentRtnCnt }</p>
                                            <p>반납</p>
                                        </div>
                                        <div>
                                            <p>${rentStats.lentOverCnt }</p>
                                            <p>연체</p>
                                        </div>
                                    </div>
                                </div>
                                <div class="con-2">
                                    <h3>방문열람현황</h3>
                                    <div class="list-box">
                                        <div>
                                            <p>${rentStats.reqAppCnt }</p>
                                            <p>신청</p>
                                        </div>
                                        <div>
                                            <p>${rentStats.reqCancelCnt }</p>
                                            <p>취소</p>
                                        </div>
                                        <div>
                                            <p>${rentStats.reqOkCnt }</p>
                                            <p>승인</p>
                                        </div>
                                        <div>
                                            <p>${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);" onclick="gfn_openNewWindow('https://${itemVisitedOrgs.domainHostNm}.nculture.org')"><span class="button">${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>${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('${item.masterId }')"><img src="${item.rprsThumbUrlWithDefaultSmall }" width="130" height="196" alt="썸네일"></a>
	                                        </div>
	                                        <div class="text">
	                                            <div class="ti">${item.title }</div>
	                                            <div class="cl">
	                                                <p class="typ"><span>자료유형 :</span><span>${item.typeDivNm } <c:if test="${not empty item.typeDivNm and not empty item.dtlsTypeDivNm }">&gt;</c:if> ${item.dtlsTypeDivNm }</span></p>
	                                                <p class="sub"><span>주제분야 :</span><span>${item.subjectNmUp } <c:if test="${not empty item.subjectNmUp and not empty item.subjectNm }">&gt;</c:if> ${item.subjectNm }</span></p>
	                                                <p class="age"><span>생산기관 :</span><span>${item.orgNm }</span></p>
	                                                <p class="yea"><span>생산년도 :</span><span>${item.creatYyyy }</span></p>
	                                            </div>
	                                        </div>
	                                    </div>
                                        
                                    </c:forEach>
                                   
                                </div>
                            </div>
                        </div>
                        
                        <div class="loan-history">
                            <div class="inner">
                                <div class="title-box">
                                    <div class="title"><h3><span>대출</span>내역</h3><div class="cont">총 <span>${rentTotalCount }</span>건</div></div>
                                    <div class="More"><a href="javascript:void(0);" onclick="gfn_gotoUrl('/rent/listRentItems.do')">더보기 <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>[${item.mngOrgNm }]</p>
		                                        </div>
		                                        <div class="con">
		                                            <p>${item.title }</p>
		                                            <p>
		                                                <span><em>자료유형 : </em> ${item.typeDivNm } <c:if test="${not empty item.typeDivNm and not empty item.dtlsTypeDivNm }">&gt;</c:if> ${item.dtlsTypeDivNm }</span>
		                                                <span><em>주제분야 : </em> ${item.subjectNmUp } <c:if test="${not empty item.subjectNmUp and not empty item.subjectNm }">&gt;</c:if> ${item.subjectNm }</span>
		                                                <span><em>생산기관 : </em> ${item.orgNm }</span>
		                                                <span><em>생산년도 : </em> ${item.creatYyyy }</span>
		                                            </p>
		                                        </div>
		                                        <div class="state">
		                                          <c:if test='${item.bookLtRvStatusCd == "A" }'><span class="subscription">${item.bookLtRvStatusNm}</span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "B" }'><span class="subscription">${item.bookLtRvStatusNm}</span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "C" }'><span class="cancel">${item.bookLtRvStatusNm}</span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "W" }'><span class="loan">${item.bookLtRvStatusNm}</span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "R0" }'><span class="return">${item.bookLtRvStatusNm}</span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "R1" }'><span class="return">${item.bookLtRvStatusNm}</span></c:if>
		                                          <c:if test='${item.bookLtRvStatusCd == "P" }'><span class="overdue">${item.bookLtRvStatusNm}</span></c:if>
		                                        </div>
		                                    </div>
		                                </div>                                        
                                    
                                </c:forEach>                                
                                
                            </div>
                        </div>
                        
                        <div class="visit-history">
                            <div class="inner">
                                <div class="title-box">
                                    <div class="title"><h3><span>방문열람</span>내역</h3><div class="cont">총 <span>${readTotalCount }</span>건</div></div>
                                    <div class="More"><a href="javascript:void(0);" onclick="gfn_gotoUrl('/read/listReadItems.do')">더보기 <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>[${item.mngOrgNm }]</p>
                                                </div>
                                                <div class="con">
                                                    <p>${item.title }</p>
                                                    <p>
                                                        <span><em>자료유형 : </em> ${item.typeDivNm } <c:if test="${not empty item.typeDivNm and not empty item.dtlsTypeDivNm }">&gt;</c:if> ${item.dtlsTypeDivNm }</span>
                                                        <span><em>주제분야 : </em> ${item.subjectNmUp } <c:if test="${not empty item.subjectNmUp and not empty item.subjectNm }">&gt;</c:if> ${item.subjectNm }</span>
                                                        <span><em>생산기관 : </em> ${item.orgNm }</span>
                                                        <span><em>생산년도 : </em> ${item.creatYyyy }</span>
                                                    </p>
                                                </div>
                                                <div class="state">
                                                  <c:if test='${item.reqStatusDivCd == "A0" }'><span class="wait">${item.reqStatusDivNm}</span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "A1" }'><span class="approval">${item.reqStatusDivNm}</span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "W" }'><span class="approval">${item.reqStatusDivNm}</span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "A2" }'><span class="return">${item.reqStatusDivNm}</span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "C" }'><span class="cancel">${item.reqStatusDivNm}</span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "R" }'><span class="read">${item.reqStatusDivNm}</span></c:if>
                                                  <c:if test='${item.reqStatusDivCd == "D" }'><span class="unread">${item.reqStatusDivNm}</span></c:if>
                                                </div>
                                            </div>
                                        </div>                                        
                                    
                                </c:forEach>                                
                                
                            </div>
                        </div>
                        
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
    
    