<!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/membership_list.css">
	<link rel="stylesheet" href="/css/web/grid.css?v1.1">
</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 membershipSearchKeywordParam = "[[${param.membershipSearchKeywordParam}]]";
		let membershipSort               = "[[${param.membershipSort}]]";
		let membershipDir                = "[[${param.membershipDir}]]";
		let membershipStart              = "[[${param.membershipStart}]]"==""?0:"[[${param.membershipStart}]]";
		let membershipLimit              = "[[${param.membershipLimit}]]"==""?100:"[[${param.membershipLimit}]]";

	</script>
</th:block>
<th:block layout:fragment="layout_content">
	<div class="center_box">
<!-- 센터쪽 -->
	<p class="page_title">멤버십 고객 목록</p>

	<div class="box_wrap">
		<div class="total_box first">
			<p>멤버십 고객</p>
			<p id="totalMembershipUser">- 명</p>
		</div>
		<div class="total_box">
			<p>멤버십 누적 충전금액</p>
			<p class="blue" id="sumChargeBalance">
				- 원
			</p>
		</div>
		<div class="total_box">
			<p>멤버십 누적 사용금액</p>
			<p class="red" id="sumUsageBalance">
				- 원
			</p>
		</div>
	</div>

	<div class="filter_box">
		<div class="form_box">
			<div class="search_list_box">
				<div class="search_box">
					<img src="/image/web/search_G.svg" alt="검색"/>
					<input type="text" id="membershipSearchKeyword" placeholder="고객명, 연락처,생년월일">

					<div class="search_list"></div><!-- 검색내역 나오는곳 -->
				</div>
				<button class="search_btn" id="btnSearchMembership">조회</button>
			</div>
		</div>

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

	<!-- 테이블 -->
	<div id="membershipGrid" class="table_box ag-theme-balham"></div>

	<!-- 페이지게이션 -->
	<div class="page_box">
		<nav ria-label="Page navigation" class="navigation">
			<ul class="pagination" id="membershipPagination"></ul>
		</nav>
	</div>
</div>
<form id="excelForm" 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/membership/membershipSelectList.js"></script>
</th:block>
</html>