Fix: VIP 리스트 행 클릭 모달 - 작업 셀 제외 처리

- 작업 셀(입장처리, 수정, 재발급, 삭제 버튼) 클릭 시 모달이 나타나지 않도록 수정
- 확인 대화창에서 취소 선택 시에도 모달이 나타나지 않도록 개선
- handleRowClick() 함수 추가로 action-cell 클릭 시 이벤트 무시
This commit is contained in:
2026-02-20 15:46:59 +09:00
parent d3d9f2e8ed
commit f1fce78661

View File

@ -191,7 +191,7 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
$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; height: 60px;" data-bs-toggle="modal" data-bs-target="#modify_modal_<?=$R['idx']?>">
<tr class="<?=($R['status'] != '정상') ? "unused" : "" ?> vip-row <?=$expired_class?>" style="cursor: pointer; height: 60px;" onclick="handleRowClick(event, '<?=$R['idx']?>')">
<td class="text-center align-middle"><?=$R['vip_card_no']?></td>
<td class="text-center align-middle"><?=$R['status']?></td>
<td class="text-center align-middle"><?=$R['vip_name']?></td>
@ -204,15 +204,15 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
echo ($edate == '0000-00-00 00:00:00')? '미이용' : date('Y-m-d',strtotime($edate));
?></td>
<td class="text-center align-middle"><?=$R['ent_count']?></td>
<td class="text-center align-middle d-flex justify-content-center gap-1" onclick="event.stopPropagation();" style="min-height: 60px;">
<td class="text-center align-middle d-flex justify-content-center gap-1 action-cell" onclick="event.stopPropagation();" style="min-height: 60px;">
<?php if($_SESSION['user_lv'] > "1"){ ?>
<?php if($R['status'] == '정상' || $R['status'] == '만료') { ?>
<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>
<a class="btn btn-danger btn-xs" href="#" onclick="event.preventDefault(); event.stopPropagation(); entMemWithConfirm('<?=$R['idx']?>', <?=$is_expired ? 'true' : 'false'?>);" role="button"><i class="fas fa-sign-in-alt"></i></a>
<button type="button" class="btn btn-success btn-xs" data-bs-toggle="modal" data-bs-target="#modify_modal_<?=$R['idx']?>" onclick="event.stopPropagation()"><i class="fa-solid fa-pen-to-square"></i></button>
<button type="button" class="btn btn-primary btn-xs" data-bs-toggle="modal" data-bs-target="#renew_modal_<?=$R['idx']?>" onclick="event.stopPropagation()"><i class="fa-solid fa-repeat"></i></button>
<?php } ?>
<?php if($_SESSION['user_lv'] === "4" && $R['status'] != "재발급"){ ?>
<a class="btn btn-danger btn-xs" href="javascript:deleteItem('<?=$R['idx']?>')" role="button"><?=($R['status'] == '정상')? '<i class="fa-solid fa-trash-can"></i>' : '<i class="fa-solid fa-trash-can-arrow-up"></i>'?></a>
<a class="btn btn-danger btn-xs" href="#" onclick="event.preventDefault(); event.stopPropagation(); deleteItem('<?=$R['idx']?>');" role="button"><?=($R['status'] == '정상')? '<i class="fa-solid fa-trash-can"></i>' : '<i class="fa-solid fa-trash-can-arrow-up"></i>'?></a>
<?php } ?>
<?php } ?>
</td>
@ -363,6 +363,15 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
</style>
<script>
function handleRowClick(event, idx) {
// 작업 셀을 클릭했는지 확인
if (event.target.closest('.action-cell')) {
return;
}
const modal = new bootstrap.Modal(document.getElementById('modify_modal_' + idx));
modal.show();
}
function toggleShowAllCat() {
const btn = event.target;
const showAll = !btn.getAttribute('data-show-all') || btn.getAttribute('data-show-all') === 'false';