Feat: VIP 리스트 페이지 UX 개선 - 만료일 스타일링, 행 클릭 모달, 경고창, 카테고리 필터 추가
This commit is contained in:
@ -35,11 +35,18 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
|
||||
<label class="btn btn-outline-primary" for="search_group_all">전체</label>
|
||||
<?php
|
||||
$group_name = getVipCatName();
|
||||
$show_all = isset($_REQUEST['show_all_cat']) ? true : false;
|
||||
foreach ($group_name as $row) { // VIP구분 가지고 와서 뿌려주기
|
||||
// 비활성 카테고리 숨김
|
||||
if ($row['gr_used'] == 0 && !$show_all) continue;
|
||||
$inactive_class = ($row['gr_used'] == 0) ? ' inactive-cat' : '';
|
||||
?>
|
||||
<input type="radio" name="search_group" id="search_group_<?=$row['gr_id']?>" class="btn-check" value="<?=$row['gr_id']?>" <?php if ($search_group === $row['gr_id']) echo "checked" ?>>
|
||||
<label class="btn btn-outline-primary" for="search_group_<?=$row['gr_id']?>"><?=$row['gr_name']?></label>
|
||||
<label class="btn btn-outline-primary<?=$inactive_class?>" for="search_group_<?=$row['gr_id']?>" style="<?=($row['gr_used'] == 0) ? 'opacity: 0.5;' : ''?>"><?=$row['gr_name']?></label>
|
||||
<?php } ?>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" onclick="toggleShowAllCat()">
|
||||
<?=($show_all) ? '활성만 보기' : '모두보기'?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group col-md-6">
|
||||
<span class="input-group-text" id="search_word">회원검색</span>
|
||||
@ -177,27 +184,32 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider">
|
||||
<?php foreach($R as $R) {?>
|
||||
<tr class="<?=($R['status'] != '정상') ? "unused" : "" ?>">
|
||||
<?php foreach($R as $R) {
|
||||
$today = date('Y-m-d');
|
||||
$expire_date = $R['vip_date'];
|
||||
$is_expired = ($expire_date != '9999-12-31' && strtotime($expire_date) < strtotime($today)) ? true : false;
|
||||
$expired_class = $is_expired ? 'expired-vip' : '';
|
||||
?>
|
||||
<tr class="<?=($R['status'] != '정상') ? "unused" : "" ?> vip-row <?=$expired_class?>" style="cursor: pointer;" data-bs-toggle="modal" data-bs-target="#modify_modal_<?=$R['idx']?>">
|
||||
<td class="text-center"><?=$R['vip_card_no']?></td>
|
||||
<td class="text-center"><?=$R['status']?></td>
|
||||
<td class="text-center"><?=$R['vip_name']?></td>
|
||||
<td class="text-center"><?=$R['vip_tel']?></td>
|
||||
<td class="text-center"><?=$R['vip_birth']?></td>
|
||||
<td class="text-center"><?=($R['vip_date'] == '9999-12-31')? '평생' : $R['vip_date']?></td>
|
||||
<td class="text-center" style="<?=($is_expired) ? 'color: #999; opacity: 0.6;' : ''?>"><?=($R['vip_date'] == '9999-12-31')? '평생' : $R['vip_date']?></td>
|
||||
<td class="text-center">
|
||||
<?php
|
||||
$edate = $R['last_ent_date'];
|
||||
echo ($edate == '0000-00-00 00:00:00')? '미이용' : date('Y-m-d',strtotime($edate));
|
||||
?></td>
|
||||
<td class="text-center"><?=$R['ent_count']?></td>
|
||||
<td class="text-center d-flex justify-content-center gap-1">
|
||||
<td class="text-center d-flex justify-content-center gap-1" onclick="event.stopPropagation();">
|
||||
|
||||
<?php if($_SESSION['user_lv'] > "1"){ ?>
|
||||
|
||||
<!-- 입장처리 버튼 -->
|
||||
<?php if ($R['status'] == '정상') { ?>
|
||||
<a class="btn btn-danger btn-xs" href="javascript:entMem('<?=$R['idx']?>')" role="button"><i class="fas fa-sign-in-alt"></i></a>
|
||||
<a class="btn btn-danger btn-xs" href="javascript:entMemWithConfirm('<?=$R['idx']?>', <?=$is_expired ? 'true' : 'false'?>)" role="button"><i class="fas fa-sign-in-alt"></i></a>
|
||||
<?php } else { ?>
|
||||
<i class="fas fa-times"></i>
|
||||
<?php } ?>
|
||||
@ -341,4 +353,40 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.expired-vip {
|
||||
opacity: 0.7;
|
||||
color: #999;
|
||||
}
|
||||
.expired-vip td {
|
||||
color: #999 !important;
|
||||
}
|
||||
.vip-row:hover {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.inactive-cat {
|
||||
opacity: 0.6;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function toggleShowAllCat() {
|
||||
const url = new URL(window.location);
|
||||
if (url.searchParams.has('show_all_cat')) {
|
||||
url.searchParams.delete('show_all_cat');
|
||||
} else {
|
||||
url.searchParams.set('show_all_cat', '1');
|
||||
}
|
||||
window.location = url.toString();
|
||||
}
|
||||
|
||||
function entMemWithConfirm(idx, isExpired) {
|
||||
let confirmMsg = isExpired ? '만료된 회원입니다. 입장처리 하시겠습니까?' : '입장처리 하시겠습니까?';
|
||||
|
||||
if (confirm(confirmMsg)) {
|
||||
entMem(idx);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include_once FG_MANAGER_PATH."/tail.php";
|
||||
Reference in New Issue
Block a user