diff --git a/src/main/java/kcc/ve/aplct/fndtnEnhanceTrn/web/FndtnEnhanceTrnController.java b/src/main/java/kcc/ve/aplct/fndtnEnhanceTrn/web/FndtnEnhanceTrnController.java index c904249a..e674527a 100644 --- a/src/main/java/kcc/ve/aplct/fndtnEnhanceTrn/web/FndtnEnhanceTrnController.java +++ b/src/main/java/kcc/ve/aplct/fndtnEnhanceTrn/web/FndtnEnhanceTrnController.java @@ -457,6 +457,45 @@ public class FndtnEnhanceTrnController { } + /** + * 교육 list select + */ + @RequestMapping("/web/ve/aplct/fndtnEnhanceTrn/eduSelectAjax.do") + public ModelAndView eduSelectAjax( + @ModelAttribute("vEPrcsDetailVO") VEPrcsDetailVO vEPrcsDetailVO + , ModelMap model + , HttpServletRequest request + ) throws Exception { + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("jsonView"); + + //로그인 처리==================================== + //로그인 정보 가져오기 + + String s_oprtnLoginCheckNInfo = checkLoginUtil.oprtnCheckNInfo(model); + if (!"".equals(s_oprtnLoginCheckNInfo)) { + modelAndView.addObject("result", "loginFail"); + return modelAndView; + } + + //로그인 처리==================================== + LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); //권한에 따른 로그인 정보 가져오기 + SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기 + + // 페이징 없이 select를 하기 위한 + vEPrcsDetailVO.setRecordCountPerPage(10000); + vEPrcsDetailVO.setFirstIndex(0); + + List vEPrcsDetailVOList = vEPrcsAplctPrdService.selectPagingList4Fndth(vEPrcsDetailVO); + + modelAndView.addObject("data", vEPrcsDetailVOList); + modelAndView.addObject("result", "success"); + + return modelAndView; + + } + private String dateChk(VEPrcsDetailVO vEPrcsDetailVO , LocalDate currentDate) { diff --git a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/fndtnEnhanceTrn/eduAplctDetail.jsp b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/fndtnEnhanceTrn/eduAplctDetail.jsp index 0375c42c..5e1b44a8 100644 --- a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/fndtnEnhanceTrn/eduAplctDetail.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/fndtnEnhanceTrn/eduAplctDetail.jsp @@ -33,6 +33,9 @@ function ddlnCdSttsChk(){ var $ddlnCdStts = $("#ddlnCdStts"); + + // 상태에따라 싱천버튼 활성화 비활성화 + var regStatus = true; // 텍스트가 비어있는지 확인 if ($ddlnCdStts.text().trim() === "") { @@ -41,15 +44,18 @@ var strtPnttm = new Date(dateText.split("~")[0].trim().replace(/\./g, '-')); var endPnttm = new Date(dateText.split("~")[1].trim().replace(/\./g, '-')); var currentDate = new Date(); - if (currentDate < strtPnttm) { $ddlnCdStts.text("접수전"); } else if (currentDate >= strtPnttm && currentDate <= endPnttm) { $ddlnCdStts.text("접수중"); + regStatus = false; } else if (currentDate > endPnttm) { $ddlnCdStts.text("접수종료"); } + + console.log('regStatus :: ', regStatus); } + $('#regBtn').prop('disabled', regStatus); // 버튼 비활성화 } function fncGoList(){ @@ -223,5 +229,15 @@ +
+
+
+
+
+
+ +
+
+ \ No newline at end of file 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 8bbe3b9e..69f925bd 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 @@ -17,6 +17,67 @@ $(document).ready(function(){ + + $('.tab_button').click(function(){ + var type = $(this).data('info'); + // list 타입이면 return; + if(type === 'list') + return false; + + var data = fncEduSelect(); + console.log('data : ', data); + + // 월 하이라이트 체크 + fn_MonthHL(); + + // 현재 날짜를 가져옵니다. + var today = new Date(); + var currentMonth = today.getMonth() + 1; + + // 데이터 추가 전 촐기화 + $(".edu_program tbody").empty(); + // 반복시작 + $.each(data, function(index, item) { + var prcsNm = item.prcsNm; + var startDt = item.eduStrtPnttm; + // 교육 일수 구하기 + var dayDiff = fn_dayDiff(item); + var newRow = $(""); + + // prcsNm 값을 추가합니다. + newRow.append('' + prcsNm + ''); + + // dayDiff 값을 추가합니다. + newRow.append('' + dayDiff + ''); + + // 교육일정 칼럼을 초기화합니다. + for (var i = 1; i <= 12; i++) { + // 다음 월 class + var cellClass = "edup_pass"; // 기본값 + + // 전 월 class + if (i < currentMonth) { + cellClass = "edup_pre"; + // 현재 월 + } else if (i === currentMonth) { + cellClass = "edup_this"; + } + if (i === parseInt(startDt.split('.')[1])) { + newRow.append('' + parseInt(startDt.split('.')[2]) + ''); + } else { + newRow.append(''); + } + } + // 테이블에 새로운 행을 추가합니다. + $(".edu_program tbody").append(newRow); + + }); + //-- /반복끝 + }); + + + + // 상태값 확인 $(".ddlnCdStts").each(function() { var $thisCell = $(this); @@ -38,9 +99,6 @@ $(document).ready(function(){ var ddlnCdText = ''; - console.log('currentDate : ', currentDate); - console.log('strtPnttm : ', strtPnttm); - console.log('endPnttm : ', endPnttm); console.log(''); if (currentDate < strtPnttm) { ddlnCdText = "접수전"; @@ -63,6 +121,69 @@ $(document).ready(function(){ }); + + function fn_dayDiff(item){ + + var startDt = item.eduStrtPnttm; + var endDt = item.eduDdlnPnttm; + + // 날짜 문자열을 Date 객체로 변환합니다. + var startDate = new Date(startDt.split('.').join('-')); + var endDate = new Date(endDt.split('.').join('-')); + + // 두 날짜 사이의 밀리초 차이를 구합니다. + var differenceInMilliseconds = endDate - startDate; + + // 밀리초를 일수로 변환합니다. (1일 = 24시간 = 24 * 60분 = 24 * 60 * 60초 = 24 * 60 * 60 * 1000 밀리초) + var differenceInDays = differenceInMilliseconds / (24 * 60 * 60 * 1000); + + // 시작 날짜와 종료 날짜를 모두 포함하여 계산 + differenceInDays += 1; + + return differenceInDays; + + } + + + + function fn_MonthHL(){ + var today = new Date(); + // 현재 달을 가져옵니다. (0부터 시작하므로 1을 더해줍니다.) + var currentMonth = today.getMonth() + 1; + + // 해당하는 달의 요소에 'edup_this' 클래스를 추가합니다. + $("#monthTemp th:nth-child(" + currentMonth + ")").addClass("edup_this"); + } + function fncEduSelect(){ + var returnVal = ''; + var data = new FormData(document.getElementById("selectForm")); + var url = "${pageContext.request.contextPath}/web/ve/aplct/fndtnEnhanceTrn/eduSelectAjax.do"; + console.log(data); + $.ajax({ + type:"POST", + url: url, + data: data, + dataType:'json', + async: false, + processData: false, + contentType: false, + cache: false, + success:function(returnData){ + if(returnData.result == "success"){ + console.log('returnData : ', returnData); + returnVal = returnData.data; + } + }, + error:function(request , status, error){ + alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); + } + }); + + return returnVal; + + + } + function fncEduReg(prcsAplctPrdOrd){ var regForm = document.regForm; regForm.prcsAplctPrdOrd.value = prcsAplctPrdOrd; @@ -100,14 +221,12 @@ $(document).ready(function(){ listForm.submit(); } - function fncGoDetail(prcsAplctPrdOrd){ var viewForm = document.viewForm ; viewForm.prcsAplctPrdOrd.value = prcsAplctPrdOrd ; - viewForm.action = ""; + viewForm.action = ""; viewForm.submit(); } - function fncGoList(){ linkPage(1); @@ -140,6 +259,9 @@ $(document).ready(function(){
+
+ +
@@ -151,7 +273,7 @@ $(document).ready(function(){
-

교육신청목록

+

강의목록

@@ -204,143 +326,14 @@ $(document).ready(function(){
    -
  • -
  • +
  • +
-
-
-
- - -
-
-
- -
- ~ -
- -
- - -
-
- -
-
6개의 검색결과가 있습니다.
-
    -
  • 지난교육일정
  • -
  • 당월교육일정
  • -
  • 교육예정일정
  • -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
교육일정표
교육과정명
(상세 내용을 보시려면 과정을 클릭하세요)
일수시간교육일정(교육 시작일)
123456789101112
[경영기획] 경영기획기본21415,222242281427
[경영기획] 경영기획기본21415,222242281427
[경영기획] 경영기획기본21415,222242281427
-
-
-
+ +
+
@@ -453,5 +446,136 @@ $(document).ready(function(){
+ + +
+ +
+
6개의 검색결과가 있습니다.
+
    +
  • 지난교육일정
  • +
  • 당월교육일정
  • +
  • 교육예정일정
  • +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
교육일정표
교육과정명
(상세 내용을 보시려면 과정을 클릭하세요)
일수교육일정(교육 시작일)
123456789101112
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/sspnIdtmt/eduAplctDetail.jsp b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/sspnIdtmt/eduAplctDetail.jsp index 0375c42c..535d5ce3 100644 --- a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/sspnIdtmt/eduAplctDetail.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/sspnIdtmt/eduAplctDetail.jsp @@ -33,7 +33,10 @@ function ddlnCdSttsChk(){ var $ddlnCdStts = $("#ddlnCdStts"); - + + // 상태에따라 싱천버튼 활성화 비활성화 + var regStatus = true; + // 텍스트가 비어있는지 확인 if ($ddlnCdStts.text().trim() === "") { var dateText = $ddlnCdStts.closest('table').find("td:eq(2)").text().trim(); @@ -46,10 +49,12 @@ $ddlnCdStts.text("접수전"); } else if (currentDate >= strtPnttm && currentDate <= endPnttm) { $ddlnCdStts.text("접수중"); + regStatus = false; } else if (currentDate > endPnttm) { $ddlnCdStts.text("접수종료"); } } + $('#regBtn').prop('disabled', regStatus); // 버튼 비활성화 } function fncGoList(){ @@ -223,5 +228,14 @@
+
+
+
+
+
+
+ +
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/sspnIdtmt/eduAplctList.jsp b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/sspnIdtmt/eduAplctList.jsp index 9f9b3d2d..841c2a1e 100644 --- a/src/main/webapp/WEB-INF/jsp/web/ve/aplct/sspnIdtmt/eduAplctList.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/ve/aplct/sspnIdtmt/eduAplctList.jsp @@ -216,7 +216,7 @@ $(document).ready(function(){
-

교육신청목록1

+

강의목록