|
@@ -4,6 +4,7 @@
|
|
|
@php
|
|
|
//var_dump($siseList['Page']);
|
|
|
//var_dump($siseItems)
|
|
|
+ $today = date('Y-m-d');
|
|
|
@endphp
|
|
|
|
|
|
<div class="sub golf">
|
|
@@ -21,6 +22,7 @@
|
|
|
<div class="container">
|
|
|
<label>회원권 검색</label>
|
|
|
<input type="text" id="membership-name" placeholder="회원권명">
|
|
|
+ <input type="date" id="date" value="{{$today}}">
|
|
|
<button type="button" class="btn" onclick="searchMemberShip()">검색</button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -116,15 +118,36 @@
|
|
|
// 회원권 검색
|
|
|
function searchMemberShip() {
|
|
|
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);
|
|
|
+
|
|
|
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);
|
|
|
}
|
|
|
// 동적으로 tbody 생ㄱ성
|