|
@@ -4,6 +4,7 @@
|
|
@php
|
|
@php
|
|
//var_dump($siseList['Page']);
|
|
//var_dump($siseList['Page']);
|
|
//var_dump($siseItems)
|
|
//var_dump($siseItems)
|
|
|
|
+ $today = date('Y-m-d');
|
|
@endphp
|
|
@endphp
|
|
|
|
|
|
<div class="sub golf">
|
|
<div class="sub golf">
|
|
@@ -21,6 +22,7 @@
|
|
<div class="container">
|
|
<div class="container">
|
|
<label>회원권 검색</label>
|
|
<label>회원권 검색</label>
|
|
<input type="text" id="membership-name" placeholder="회원권명">
|
|
<input type="text" id="membership-name" placeholder="회원권명">
|
|
|
|
+ <input type="date" id="date" value="{{$today}}">
|
|
<button type="button" class="btn" onclick="searchMemberShip()">검색</button>
|
|
<button type="button" class="btn" onclick="searchMemberShip()">검색</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -116,15 +118,36 @@
|
|
// 회원권 검색
|
|
// 회원권 검색
|
|
function searchMemberShip() {
|
|
function searchMemberShip() {
|
|
var membershipName = document.getElementById('membership-name').value.toLowerCase();
|
|
var membershipName = document.getElementById('membership-name').value.toLowerCase();
|
|
- if (!membershipName) {
|
|
|
|
- alert('회원권명을 입력해주세요.');
|
|
|
|
- return;
|
|
|
|
|
|
+ var date = document.getElementById('date').value;
|
|
|
|
+ // console.log('date : ', date);
|
|
|
|
+ // if (!membershipName) {
|
|
|
|
+ // alert('회원권명을 입력해주세요.');
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ var formattedDate = '';
|
|
|
|
+ if (date) {
|
|
|
|
+ var parts = date.split('-');
|
|
|
|
+ formattedDate = parts.join('');
|
|
}
|
|
}
|
|
|
|
+
|
|
// console.log('siseList : ', siseList);
|
|
// console.log('siseList : ', siseList);
|
|
|
|
+
|
|
var filteredSiseList = siseList.filter(function(sise) {
|
|
var filteredSiseList = siseList.filter(function(sise) {
|
|
- return sise['PostTitle'].toLowerCase().includes(membershipName);
|
|
|
|
|
|
+ var postTitleMatch = sise['PostTitle'].toLowerCase().includes(membershipName);
|
|
|
|
+ // var dateMatch = sise['Pc6'] && sise['Pc6'] === formattedDate;
|
|
|
|
+ var dateMatch = date ? (sise['Pc6'] && sise['Pc6'] === formattedDate) : true;
|
|
|
|
+ console.log('dateMatch : ', dateMatch);
|
|
|
|
+
|
|
|
|
+ if(membershipName == ''){
|
|
|
|
+ return dateMatch
|
|
|
|
+ }else{
|
|
|
|
+ return postTitleMatch && dateMatch;
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ // console.log('filteredSiseList : ', filteredSiseList);
|
|
|
|
+
|
|
renderSiseList(filteredSiseList);
|
|
renderSiseList(filteredSiseList);
|
|
}
|
|
}
|
|
// 동적으로 tbody 생ㄱ성
|
|
// 동적으로 tbody 생ㄱ성
|