diff --git a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/fndtnEnhanceTrn/eduAplctList.jsp b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/fndtnEnhanceTrn/eduAplctList.jsp index 27780760..58b0edd0 100644 --- a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/fndtnEnhanceTrn/eduAplctList.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/fndtnEnhanceTrn/eduAplctList.jsp @@ -121,10 +121,97 @@ $(document).ready(function(){ } // 텍스트가 "접수중"인지 확인 -// if ($thisCell.text().trim() !== "접수중") { -// $applyButton.prop('disabled', true); // 버튼 비활성화 -// } - //alert($applyStts.text().trim()); + if ($thisCell.text().trim() === "접수중") { + + //신청상태 + if ($applyStts.text().trim() === "요청") { + //취소 + $applyButton.prop('disabled', false); // 버튼 비활성화 + $applyButton.text('취소'); + $applyButton.attr('title','취소 창 열림'); + $applyButton.attr('onclick', "fn_cancel('" + $($thisCell).closest('tr').data('value') + "');"); + + }else{ + $applyButton.prop('disabled', false); // 버튼 비활성화 + } + + } + if ($thisCell.text().trim() === "접수전") { + $applyButton.prop('disabled', false); // 버튼 비활성화 + $applyButton.text('찜하기'); + $applyButton.attr('title','찜하기 창 열림'); + $applyButton.attr('onclick', "fn_ggim('" + $($thisCell).closest('tr').data('value') + "');"); + } + if ($thisCell.text().trim() === "찜하기") { + + var $currentRow = $thisCell.closest('tr'); + + var strtPnttm = new Date($currentRow.find("td:eq(2)").text().split("~")[0].trim()); + var endPnttm = new Date($currentRow.find("td:eq(2)").text().split("~")[1].trim()); + var currentDate = new Date(); + + // 시간, 분, 초 초기화 + strtPnttm.setHours(0, 0, 0, 0); + endPnttm.setHours(0, 0, 0, 0); + currentDate.setHours(0, 0, 0, 0); + + var ddlnCdText = ''; + + if (currentDate >= strtPnttm && currentDate <= endPnttm && $thisCell.text().trim() === "찜하기") { + $applyButton.prop('disabled', false); // 버튼 비활성화 + } + + + } + + /* 24.01.22 웹접근성 검사를 위하여 disabled 사용제외 */ + if($applyButton.prop('disabled')){ + $applyButton.removeAttr('onclick'); + $applyButton.prop('disabled', false); + $applyButton.css('background-color', '#888'); + /*24.01.23 웹접근성 검사를 위하여 title 추가*/ + $applyButton.attr('title','비활성화됨'); + $applyButton.removeAttr('data-tooltip'); + + } + }); + + // 리스트 상태값 확인 + $(".ddlnCdSttsM").each(function() { + var $thisCell = $(this); + var $applyButton = $thisCell.closest('ul').find(".aplctBtnM button"); + var $applyStts = $thisCell.closest('ul').find(".aplctSttsM"); + + + + // 텍스트가 비어있는지 확인 + if ($thisCell.text().trim() === "") { + var $currentRow = $thisCell.closest('ul'); + + var strtPnttm = new Date($currentRow.find("li:eq(2)").text().split("~")[0].trim()); + var endPnttm = new Date($currentRow.find("li:eq(2)").text().split("~")[1].trim()); + var currentDate = new Date(); + + // 시간, 분, 초 초기화 + strtPnttm.setHours(0, 0, 0, 0); + endPnttm.setHours(0, 0, 0, 0); + currentDate.setHours(0, 0, 0, 0); + + var ddlnCdText = ''; + + if (currentDate < strtPnttm) { + ddlnCdText = "접수전"; + } else if (currentDate >= strtPnttm && currentDate <= endPnttm) { + ddlnCdText = "접수중"; + } else if (currentDate > endPnttm) { + ddlnCdText = "접수종료"; + } + + $thisCell.text(ddlnCdText); + + } + + // 텍스트가 "접수중"인지 확인 if ($thisCell.text().trim() === "접수중") { //신청상태 @@ -499,7 +586,10 @@ $(document).ready(function(){