<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org"
	  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	  layout:decorate="~{/web/layout/homeLayout}">
<th:block layout:fragment="layout_css">
	<link rel="stylesheet" href="/css/web/statistics_client.css">
</th:block>

<th:block layout:fragment="layout_top_script">
	<script src="/js/web/common_option.js"></script>
	<script src="/js/web/jquery.twbsPagination.js" type="text/javascript"></script>
	<script>
		let menuClass     = "[[${param.menuClass}]]"==""?"":"[[${param.menuClass}]]";

		let selectUseYn   = "[[${selectUseYn}]]"==""?"N":"[[${selectUseYn}]]";
		let insertUseYn   = "[[${insertUseYn}]]"==""?"N":"[[${insertUseYn}]]";
		let updateUseYn   = "[[${updateUseYn}]]"==""?"N":"[[${updateUseYn}]]";
		let deleteUseYn   = "[[${deleteUseYn}]]"==""?"N":"[[${deleteUseYn}]]";
		let downloadUseYn = "[[${downloadUseYn}]]"==""?"N":"[[${downloadUseYn}]]";

		/* 검색 관련 변수 */
		// let memberSearchKeywordParam = "[[${param.memberSearchKeywordParam}]]";
		// let memberSort               = "[[${param.memberSort}]]";
		// let memberDir                = "[[${param.memberDir}]]";
		// let memberStart              = "[[${param.memberStart}]]"==""?0:"[[${param.memberStart}]]";
		// let memberLimit              = "[[${param.memberLimit}]]"==""?100:"[[${param.memberLimit}]]";
		//
		// let memberSearchGroupId      = "[[${param.memberSearchGroupId}]]"==""?"":"[[${param.memberSearchGroupId}]]";
		// let memberSearchDutyId       = "[[${param.memberSearchDutyId}]]"==""?"":"[[${param.memberSearchDutyId}]]";
		// let memberSearchAuthId       = "[[${param.memberSearchAuthId}]]"==""?"":"[[${param.memberSearchAuthId}]]";

	</script>
</th:block>
<th:block layout:fragment="layout_content">
	<!-- 센터쪽 -->
	<div class="center_box">
		<p class="page_title">고객 통계</p>

		<div class="filter_box">
            <div class="form_box">
                <div class="calendar_box">
                    <div class="date_box">
                        <img src="/image/web/calendar.svg" alt="calendar">
                        <input type="text" class="date_picker" id="statisticsSearchDate">
                    </div>
                </div>
            </div>
        </div>

		<div class="main">
			<ul class="statistics_list">
				<li class="first">
					<label>방문고객(전체)</label>
					<p id="totalVisitorCount"><span>0</span> 명</p>
				</li>
				<li>
					<label>고객유형</label>
					<p class="span_wrap" id="firstYnVisitorCount">
						초진 <span>0</span>
						재진 <span>0</span> 명
					</p>
				</li>
				<li>
					<label>성별</label>
					<p class="span_wrap" id="genderVisitorCount">
						여성 <span>0</span>
						남성 <span>0</span> 명
					</p>
				</li>
				<li>
					<label>멤버십 회원</label>
					<p id="membershipVisitorCount"><span>0</span> 명</p>
				</li>
			</ul>

			<article>
				<div class="title_box">
					<p class="title">방문 고객 트렌드</p>
				</div>

				<div class="box">
					<!--그래프박스-->
					<canvas id="dailyFirstYnGraph" width="1500" height="300"></canvas>
				</div>

				<div class="graph">
					<div class="box_wrap first">
						<p class="title">초진/재진 비율</p>
						<div class="box diff">
							<!--그래프박스-->
							<canvas id="firstYnPercentGraph" width="350" height="350"></canvas>
						</div>
					</div>
					<div class="box_wrap">
						<p class="title">예약 유형</p>
						<div class="box diff">
							<!--그래프박스-->
							<canvas id="reserveCategoryGraph" width="720" height="350"></canvas>
						</div>
					</div>
				</div>

				<div class="graph">
					<div class="box_wrap">
						<p class="title">성별/연령</p>
						<div class="box diff">
							<!--그래프박스-->
							<canvas id="genderAgeGraph" width="720" height="350"></canvas>
						</div>
					</div>
					<div class="box_wrap last">
						<p class="title">멤버십</p>
						<div class="box diff">
							<!--그래프박스-->
							<canvas id="membershipGraph" width="350" height="350"></canvas>
						</div>
					</div>
				</div>

				<div class="graph">
					<div class="box_wrap same">
						<p class="title">국적</p>
						<div class="box">
							<!--그래프박스-->
							<div id="nationalityGrid" class="table_box ag-theme-balham" style="height:482px;"></div>
						</div>
					</div>
					<div class="box_wrap same">
						<p class="title">고객구분</p>
						<div class="box">
							<!--그래프박스-->
							<div id="userTypeGrid" class="table_box ag-theme-balham" style="height:482px;"></div>
						</div>
					</div>
				</div>
			</article>

			<article class="pst">
				<div class="title_box">
					<p class="title">상세 내역</p>

					<div class="right_btn_box">
						<button class="download_btn" id="downLoadBtn">
							<img src="/image/web/download.svg" alt="내려받기">
							<p>내려받기</p>
						</button>
					</div>
				</div>

				<div class="box">
					<!--그래프박스-->
					<div id="userGrid" class="table_box ag-theme-balham" style="height:450px;"></div>
				</div>

				<!-- 페이지게이션 -->
				<div class="page_box">
					<nav ria-label="Page navigation" class="navigation">
						<ul class="pagination" id="userStatisticsPagination"></ul>
					</nav>
				</div>
			</article>
		</div>
	</div>
	<form id="memberSelectListForm" method="POST" target="_blank"></form>
</th:block>
<th:block layout:fragment="layout_popup">

</th:block>
<th:block layout:fragment="layout_script">
    <script src="/js/web/ag-grid-community-29.3.5.min.js"></script>
    <script src="/js/web/chart-4.4.3.js"></script>
    <script src="/js/web/statistics/statisticsUser.js"></script>
</th:block>
</html>