<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@page contentType="text/html; charset=UTF-8"%> <%@ page import="com.csc.library.entry.*,com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.session.*,com.csc.library.components.*,com.csc.library.report.*,java.util.*,java.text.DecimalFormat,java.math.BigDecimal,com.csc.library.database.DataSet;"%> <jsp:useBean id="PRU203" scope="page" class="com.csc.library.system.Task" /> <jsp:useBean id="EMPLOYEE" class="com.csc.library.system.Task" scope="page" /> <html ng-app="myHR"> <% CheckNull chk = new CheckNull(); CscCalendar cs = new CscCalendar(); String datatransfer = chk.chkNullString(request.getParameter("__condition$datatransfer")); PRU203.setChannel(request ,response); ProcessEntry screen=(ProcessEntry)PRU203.process("ProcessEntry","Process"); screen.process(); EMPLOYEE.setChannel(request ,response); HelpEntry screen2 = (HelpEntry) EMPLOYEE.process("HelpEntry", "MEMPLOYEEHELP"); //initial value String emp1 = chk.chkNullString(request.getParameter("__emp1")); String emp2 = chk.chkNullString(request.getParameter("__emp2")); String bu1 = chk.chkNullString(request.getParameter("__bu1")); String bu2 = chk.chkNullString(request.getParameter("__bu2")); String bu3 = chk.chkNullString(request.getParameter("__bu3")); String bu4 = chk.chkNullString(request.getParameter("__bu4")); String bu5 = chk.chkNullString(request.getParameter("__bu5")); String salatype = chk.chkNullString(request.getParameter("__salatype")); String saladesc = chk.chkNullString(request.getParameter("__saladesc")); String groupid = chk.chkNullString(request.getParameter("__group")); String groupdesc = chk.chkNullString(request.getParameter("__groupdesc")); String cmd = chk.chkNullString(request.getParameter("__cmd")); String getlistJS = chk.chkNullString(request.getParameter("__listGenRecord")); String thisdate = cs.getYYYYMMDD(); String language = screen2.getUProfile().get("lang"); String getFixcon = chk.chkNullString(request.getParameter("__fixCon"),""); String getFixcon2 = chk.chkNullString(request.getParameter("__fixCon2"),""); String getOrderBy = chk.chkNullString(request.getParameter("__groupby")); String getStatusSearch = chk.chkNullString(request.getParameter("__status_search")); System.out.println("OrderBy = "+getOrderBy); if(getFixcon2.equals("")){ screen2.getInquiry().setFilter("employeeid in (select employeeid from ttemp_salaryinc)"); }else{ screen2.getInquiry().setFilter(getFixcon2 + "and employeeid in (select employeeid from ttemp_salaryinc)"); } if(!getOrderBy.equals("")){ screen2.getInquiry().setOrderBy(getOrderBy); } screen2.getInquiry().refresh(); %> <head> <title>ReportOption</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="../CSS/TISCO.css" rel="stylesheet" type="text/css"> <link href="../CSS/bootstrap.css" rel="stylesheet" type="text/css"> <link href="../CSS/bootstrap_csc_backend.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script> <script type='text/javascript' src="../JS/bootstrap.js"></script> <link href="../CSS/Bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <script type='text/javascript' src='../JS/jquery-1.11.1.min.js'></script> <script src="../JS/jquery-1.11.2.js" type="text/javascript"></script> <script src="../JS/jquery-ui-1.11.4.js" type="text/javascript"></script> <script type='text/javascript' src='../JS/bootstrap.js'></script> <script src="../JS/SCREEN.js"></script> <SCRIPT TYPE='text/JavaScript' SRC='../TA/JS/TA_SCREEN.js'></SCRIPT> <script src="../JS/angular-1.3.15/angular.js" type="text/javascript"></script> <script src="../JS/ANGULAR/SCREEN_ANGULAR.js" type="text/javascript"></script> <script type='text/JavaScript' SRC='../JS/ANGULAR/SCREEN_ANGULAR.js'></script> <!-- <script type='text/JavaScript' SRC='../JS/ANGULAR/SWAPLANG.js'></script> --> <script type='text/javascript' src='../JS/ICONSMENU.js'></script> <script language='javascript'>setLang('<%=screen2.getUProfile().get("lang")%>');</script> <script src="../JS/VIEWCALENDAR.js"></script> <script src='../JS/ICONSMENU.js'></script> <script src='../JS/HOTKEY.js'></script> <script src="../JS/DATEINPUT.js"></script> <script src="../JS/CscBase.js"></script> <script src="../JS/CscCalendar.js"></script> <!-- Call DWR --> <script type='text/javascript' src='/hr/dwr/interface/YearlySalaryInc.js'></script> <script type='text/javascript' src='/hr/dwr/engine.js'></script> <script type='text/javascript' src='/hr/dwr/util.js'></script> <script>getTitleName();</script> <style> td.result { border: 1px solid black; } td.init{ height: 0px; } </style> <script type="text/JavaScript"> var lang = getLang(); //--> var sw = new swaplang2(); //------- Global value -------- var jsonArray = []; var jsonArrayJS = []; var chkJsonArray = []; function goHelp(helpName,inputName){ var helpReturn; var fixcon; var thisdate = "<%=cs.getYYYYMMDD()%>"; if(inputName.indexOf("__employeeid$") > -1){ var getrow = inputName.split('$'); var row = getrow[1]; var fieldinputname = "__employeeName"+row; helpReturn = inputName+":employeeid,"+fieldinputname+":fullname" // Add First Name,Last Name when linkhelp_Return var getCheckEmp = document.cscform.__getEmpJS.value; if(getCheckEmp.length == 0){ fixcon = "resigndate > '"+thisdate+"' and employeeid not in(select employeeid from ttemp_salaryinc)"; }else{ fixcon = "resigndate > '"+thisdate+"' and employeeid not in(select employeeid from ttemp_salaryinc) and employeeid not in ("+document.cscform.__getEmpJS.value+")"; } linkHelp_Return(helpName,helpReturn,fixcon); }else if(inputName.indexOf("__emp") > -1){ helpReturn = inputName+":employeeid" fixcon = "employeeid in(select employeeid from ttemp_salaryinc)"; linkHelp_Return(helpName,helpReturn,fixcon); } else{ if(inputName=="__bu1" ){ helpReturn="__bu1:bu1id,__bu1_desc:tdesc|desc"; }else if(inputName=="__bu2" ){ helpReturn="__bu2:bu2id,__bu2_desc:tdesc|desc"; }else if(inputName=="__bu3" ){ helpReturn="__bu3:bu3id,__bu3_desc:tdesc|desc"; }else if(inputName=="__bu4" ){ helpReturn="__bu4:bu4id,__bu4_desc:tdesc|desc"; }else if(inputName=="__bu5" ){ helpReturn="__bu5:bu5id,__bu5_desc:tdesc|desc"; }else if(inputName=="__salatype" ){ helpReturn="__salatype:codeid,__saladesc:tdesc|desc"; }else if(inputName=="__group" ){ helpReturn="__group:groupid,__groupdesc:tdesc|desc"; }else if(inputName.indexOf("group$") > -1){ helpReturn= inputName+":groupid"; } linkHelp_Return(helpName,helpReturn); } } function postReturn(){ with(document.cscform){ var listGenByJS = __listGenRecord.value; if(listGenByJS.length == 1){ var employee = $("[name='__employeeid$"+listGenByJS+"']").val(); __getEmpJS.value = "'"+employee+"'"; }else{ __getEmpJS.value = ""; var split_list = listGenByJS.split(","); for(var i = 0;i<split_list.length;i++){ var field = "[name='__employeeid$"+split_list[i]+"']"; var employee = $(field).val(); if(i == 0){ __getEmpJS.value = "'"+employee+"'"; }else{ __getEmpJS.value += ",'"+employee+"'"; } } } } } function GoSearch(){ with(document.cscform){ var filterheal=""; var filterheal2=""; filterheal=checkCondition2(filterheal2,__emp1,__emp2,"employeeid") filterheal2=checkCondition(filterheal2,__bu1,"bu1"); filterheal2=checkCondition(filterheal2,__bu2,"bu2"); filterheal2=checkCondition(filterheal2,__bu3,"bu3"); filterheal2=checkCondition(filterheal2,__bu4,"bu4"); filterheal2=checkCondition(filterheal2,__bu5,"bu5"); filterheal2=checkCondition(filterheal2,__salatype,"salatype"); filterheal=checkCondition(filterheal,__group,"groupid"); filterheal=checkCondition(filterheal,__status_search,"status"); __fixCon.value=filterheal; __fixCon2.value=filterheal2; search(); } } function checkCondition(filcon,objname,targetname){ with(document.cscform){ if(objname.value.length>0){ filcon=checkFilter(filcon); filcon+= targetname+"='"+objname.value+"'"; } return filcon; } } function checkCondition2(filcon,objname1,objname2,targetname){ // For EmployeeID (Between) with(document.cscform){ var emp1 = objname1.value; var emp2 = objname2.value; if(emp1 === "" && emp2===""){ return filcon; }else if(emp1 === ""){ emp1 = emp2; }else if(emp2 === ""){ emp2 = emp1; } filcon = checkFilter(filcon); filcon += targetname+" between '"+emp1+"' and '"+emp2+"'"; return filcon; } } function checkFilter(fil){ if(fil.length>0) fil+=" and "; return fil; } function GoSave(){ with(document.cscform){ //Save Change Data //Sent to DWR to Save //waitingDialog.show('Processing'); var listGenByJS = __listGenRecord.value; //get gen record by JS to save var toSave = true; if(listGenByJS.length != 0){ toSave = addDataToSave(listGenByJS); } if(toSave){ var countJS = jsonArrayJS.length; if(countJS > 0){ for(var i = 0;i<countJS;i++){ jsonArray.push(jsonArrayJS[i]); } YearlySalaryInc.saveRecord(JSON.stringify(jsonArray),AfterSaveSalaryInc); } } } } function addDataToSave(listGenByJS){ with(document.cscform){ var getAllRow = listGenByJS.split(","); for(var i = 0;i<getAllRow.length;i++){ var row = getAllRow[i]; var employee = $("[name='__employeeid$"+row+"']").val(); var thisYear = $("[name='__year$"+row+"']").val(); var thisMonth = $("[name='__month$"+row+"']").val(); var thisEffDate = $("[name='__effective_date$"+row+"']").val(); var thisGrade = $("[name='grade$"+row+"']").val(); var thisScore = $("[name='score$"+row+"']").val(); var thisGroup = $("[name='group$"+row+"']").val(); var thisAmountINC = $("[name='amountInc$"+row+"']").val(); var thisPercent = $("[name='percent$"+row+"']").val(); var thisCurBasepay = $("[name='curB$"+row+"']").val(); var thisNewBasepay = $("[name='newB$"+row+"']").val(); var chk = true; var chk2 = true; var lang = '<%=screen2.getUProfile().get("lang")%>'; if((employee == "" || employee==null) || (thisEffDate == "" || thisEffDate == null)){ chk = false; chk2 = false; if(lang === 'eng'){ alert("employeeid or effectiveDate must not be null at row "+row+"."); }else{ alert("employeeid และ effectiveDate จะต้องไม่เป็นค่าว่างที่แถว "+row+""); } } if((thisAmountINC == ""||thisAmountINC == null) || (thisPercent == ""||thisPercent == null) || (thisCurBasepay == ""||thisCurBasepay == null) || (thisNewBasepay == ""||thisNewBasepay == null)){ chk = false; chk2 = false; if(lang === 'eng'){ alert("Amount_Increase or Percent or Current Basepay or New Basepay must not be null at row "+row+"."); }else{ alert("ค่า Amount_Increase หรือ Percent หรือ Current Basepay หรือ New Basepay จะต้องไม่เป็นค่าว่างที่แถว "+row+""); } } //chk = checkNewBValue(thisNewBasepay,row); for(var i = 0;i<jsonArrayJS.length; i++){ if (jsonArrayJS[i]["empid"] === employee){ chk = false; } } if(chk){ jsonArrayJS.push({"empid":employee, "year":thisYear, "month":thisMonth, "eff_date":thisEffDate, "grade":thisGrade, "score":thisScore, "group":thisGroup, "amount_inc":thisAmountINC,"percent":thisPercent,"cur_basepay":thisCurBasepay,"new_basepay":thisNewBasepay}); console.log("JSJsonArray ==> "+JSON.stringify(jsonArrayJS)); }else if(!chk2){ return false; } } return true; } } function AfterSaveSalaryInc(data){ //waitingDialog.hide(); alert(data); GoSearch(); } function GoProcess(){ //Send to process with(document.cscform){//Check checkbox var chkGenByJS = false; chkGenByJS = getCheckGenByJS(); var lang = '<%=screen2.getUProfile().get("lang")%>'; if(chkGenByJS){ if(lang === 'eng'){ alert("Data is not in database can not be transfer."); }else{ alert("ข้อมูลที่ไม่ได้อยู่ฐานข้อมูล ไม่สามารถโอนย้ายได้"); } }else{ getCheckValue(); //DWR Check employee's resign in each checked employee. YearlySalaryInc.checkResignDate(JSON.stringify(chkJsonArray),GoProcess2); } } } function GoProcess2(data){ with(document.cscform){ var lang = '<%=screen2.getUProfile().get("lang")%>'; if(data != "Ok."){ if(lang === 'eng'){ alert("Data employee = "+data+" has resign before today which can not be transfer. Please delete data before transfer."); }else{ alert("ข้อมูลพนักงาน "+data+" มีวันลาออก(resigndate) ก่อนวันนี้ซึ่งไม่สามารถโอนย้ายได้ กรุณาลบข้อมูลดังกล่าวก่อนโอนย้าย"); } }else{ __condition$datatransfer.value = JSON.stringify(chkJsonArray); if(lang == 'eng'){ bCon=confirm("Confirm to process Yearly Salary Increase?"); }else{ bCon=confirm("ยืนยันข้อมูลการปรับเงินเดือนประจำปี"); } if (bCon==true) { __cmd.value = "save"; alert("Data Transfer"); submit(); } } } } function getCheckGenByJS(){ with(document.cscform){ var listGenByJS = __listGenRecord.value; if(listGenByJS.length == 1){ var getfieldcheckbox = "input[name='__js_transfer$"+listGenByJS+"']:checked"; // '' $(getfieldcheckbox).each(function(){ // found checked ing return true; }); }else{ var splitListGenByJS = listGenByJS.split(","); for(var i = 0;i<splitListGenByJS.length;i++){ var getfieldcheckbox = "input[name='__js_transfer$"+splitListGenByJS[i]+"']:checked"; // '' $(getfieldcheckbox).each(function(){ return true; }); } } } } function GoDelete(){ //Send to process with(document.cscform){ //Check checkbox from gen by js and gen by search var listGenByJS = __listGenRecord.value; if(listGenByJS.length != 0){ delRow(listGenByJS); } var countcheckboxsearch = 0; $('input[name^="__transfer$"]:checked').each(function(){ countcheckboxsearch++; }); if(countcheckboxsearch > 0){ getCheckValue(); console.log("chkJsonArray ==> "+JSON.stringify( chkJsonArray )); YearlySalaryInc.deleteRecord(JSON.stringify(chkJsonArray),AfterDelSalaryInc); } } } function delRow(listGenByJS){ with(document.cscform){ if(listGenByJS.length == 1){ var getfieldcheckbox = "input[name='__js_transfer$"+listGenByJS+"']:checked"; // '' $(getfieldcheckbox).each(function(){ var inputChk = eval("__js_transfer$"+listGenByJS); deleteRow(inputChk); }); }else{ var splitListGenByJS = listGenByJS.split(","); for(var i = 0;i<splitListGenByJS.length;i++){ var getfieldcheckbox = "input[name='__js_transfer$"+splitListGenByJS[i]+"']:checked"; // '' $(getfieldcheckbox).each(function(){ var inputChk = eval("__js_transfer$"+splitListGenByJS[i]); deleteRow(inputChk); }); } } } } function deleteRow(btn) { with(document.cscform){ var cell, row, sect; if ((cell = btn.parentNode) && (row = cell.parentNode)&& (sect = row.parentNode) && sect.removeChild) { row.parentNode.removeChild(cell.parentNode); var line = btn.name.substring(btn.name.lastIndexOf("$")+1, btn.name.length); var getListRecord = __listGenRecord.value; var split_list = getListRecord.split(","); if(split_list.length == 1){ __listGenRecord.value = ""; }else{ for (i = 0; i<split_list.length; i++) { var thisline = split_list[i]; if (thisline == line){ if(i == 0){ __listGenRecord.value = __listGenRecord.value.replace(line+",",""); }else{ __listGenRecord.value = __listGenRecord.value.replace(","+line,""); } } } } } postReturn(); } } function getCheckValue(){ chkJsonArray = []; $('input[name^="__transfer$"]:checked').each(function(){ var getfieldname = $(this).attr('name'); var temprow = getfieldname.split("$"); var row = temprow[1]; //Set all data of this row var employee = $("[name='emp"+row+"']").text(); var tempEMPID = employee.split(" "); var thisempid = tempEMPID[0]; var thisYear = $("[name='__year$"+row+"']").val(); var thisMonth = $("[name='__month$"+row+"']").val(); var thisEffDate = $("[name='__effective_date$"+row+"']").val(); var thisGrade = $("[name='grade$"+row+"']").val(); var thisScore = $("[name='score$"+row+"']").val(); var thisGroup = $("[name='group$"+row+"']").val(); var thisAmountINC = $("[name='amountInc$"+row+"']").val(); var thisPercent = $("[name='percent$"+row+"']").val(); var thisCurBasepay = $("[name='curB$"+row+"']").val(); var thisNewBasepay = $("[name='newB$"+row+"']").val(); var chk = true; for(var i = 0;i<chkJsonArray.length; i++){ if (chkJsonArray[i]["empid"] === thisempid){ chk = false; } } if(chk){ chkJsonArray.push({"empid":thisempid, "year":thisYear, "month":thisMonth, "eff_date":thisEffDate, "grade":thisGrade, "score":thisScore, "group":thisGroup, "amount_inc":thisAmountINC,"percent":thisPercent,"cur_basepay":thisCurBasepay,"new_basepay":thisNewBasepay}); } }); } function AfterDelSalaryInc(data){ //waitingDialog.hide(); alert(data); GoSearch(); } //Add Child Row function AddChild(){ with(document.cscform){ var last_record = $("input[name=__lastRecord]").val(); var line = parseInt(last_record)+1; __lastRecord.value = line; var getListRecord = $("input[name=__listGenRecord]").val(); if(getListRecord == "" ||getListRecord == null){ __listGenRecord.value = line; }else{ __listGenRecord.value += ","+line; } addRow(line); } } function addRow(line){ var table = document.getElementById("tableYearly").tBodies[0]; var tr = document.createElement("tr"); //Begin Check_box var cell1 = document.createElement("td"); cell1.align = "center"; cell1.className = "result"; var inputChkBox = document.createElement("input"); inputChkBox.name = "__js_transfer$"+line; inputChkBox.type = "checkbox"; cell1.appendChild(inputChkBox); //End Check_box Field //Begin Line_no var cell1_1 = document.createElement("td"); cell1_1.align = "center"; cell1_1.className = "result"; var spanId = document.createElement("span"); spanId.innerHTML = line; cell1_1.appendChild(spanId); //End Line_no Field //Begin Employee Field var cell2 = document.createElement("td"); cell2.align = "left"; cell2.className = "result"; var employeeid = document.createElement("input"); var thisfield = "__employeeid$"+line; employeeid.name = thisfield; employeeid.type = "text"; employeeid.size = 6; employeeid.maxLength = 10; var employeeName = document.createElement("input"); var thisfield2 = "__employeeName"+line; employeeName.name = thisfield2; employeeName.type = "text"; employeeName.disabled = "true"; employeeName.size = 12; employeeName.maxLength = 20; var linkCal1 = document.createElement("a"); linkCal1.href = "javascript:goHelp('MEMPLOYEEHELP','"+thisfield+"')"; var imgCal1 = document.createElement("img"); imgCal1.src = "../IMAGES/BUTTON/MAIN/SEARCH20.gif"; imgCal1.alt = "Help"; imgCal1.name = "imgBu1"; imgCal1.border = 0; imgCal1.align = "absmiddle"; linkCal1.onmouseout = function(){MM_swapImgRestore()}; linkCal1.onmouseover = function(){MM_swapImage('imgBu1','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1);}; linkCal1.appendChild(imgCal1); cell2.appendChild(employeeid); cell2.appendChild((document.createTextNode (" "))); cell2.appendChild(employeeName); cell2.appendChild(linkCal1); //End Employee Field //Begin Year Field var cell3 = document.createElement("td"); cell3.className = "result"; cell3.align = "center"; var selectYear = document.createElement("select"); var thisyear = "<%=cs.getYear()%>"; selectYear.name = "__year$"+line; selectYear.className = "chkinputlist"; var year = parseInt(thisyear); for(var i = year - 5;i <= year + 5;i++){ var optionSelect = document.createElement("option"); optionSelect.value= i; optionSelect.innerHTML = i; if(i == year){ optionSelect.selected = true; } selectYear.appendChild(optionSelect); } cell3.appendChild(selectYear); //End Year Field //Begin Month Field var cell4 = document.createElement("td"); cell4.className = "result"; cell4.align = "center"; var selectMonth = document.createElement("select"); var thisMonth = "<%=cs.getMonth()%>"; selectMonth.name = "__month$"+line; selectMonth.className = "chkinputlist"; var month = parseInt(thisMonth); for(var i = 1;i < 13;i++){ var optionSelect = document.createElement("option"); optionSelect.value= i; optionSelect.innerHTML = i; if(i == month+1){ optionSelect.selected = true; } selectMonth.appendChild(optionSelect); } cell4.appendChild(selectMonth); //End Month Field //Begin Effective Date Field var cell5 = document.createElement("td"); cell5.className = "result"; cell5.align = "center"; var inputEffDate = document.createElement("input"); var thiseffdatefield = "__effective_date$"+line; inputEffDate.name = thiseffdatefield; inputEffDate.className = "chkinput"; inputEffDate.type = "text"; inputEffDate.size = 9; inputEffDate.maxLength = 10; inputEffDate.style = "text-align:center;"; inputEffDate.onkeyup = function(){sysIsEdit();formatDate(this)}; inputEffDate.onfocus = function(){this.select()}; inputEffDate.alt = "Effective Date"; var linkCal2 = document.createElement("a"); linkCal2.href = "javascript:;"; var imgCal2 = document.createElement("img"); imgCal2.src = "../IMAGES/BUTTON/MAIN/CALENDAR20.gif"; imgCal2.alt = "Calendar"; imgCal2.name = "Image12"; imgCal2.id = "c"; imgCal2.width = 20; imgCal2.border = 0; imgCal2.align = "absmiddle"; imgCal2.onclick = function(){viewCal(thiseffdatefield)}; linkCal2.onmouseout = function(){MM_swapImgRestore()}; linkCal2.onmouseover = function(){MM_swapImage('Image12','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1);}; linkCal2.appendChild(imgCal2); cell5.appendChild(inputEffDate); cell5.appendChild(linkCal2); //End Effective Date Field //Begin Grade Field //<input type="text" name="grade$2" value="B2" size="8" class="chkinput" style="text-align:right;padding-right:2mm;"> var cell6 = document.createElement("td"); cell6.className = "result"; cell6.align = "center"; var inputGrade = document.createElement("input"); inputGrade.name = "grade$"+line; inputGrade.className = "chkinput"; inputGrade.type = "text"; inputGrade.size = 9; inputGrade.style = "text-align:left;"; cell6.appendChild(inputGrade); //End Grade Field //Begin Score Field var cell7 = document.createElement("td"); cell7.className = "result"; cell7.align = "center"; var inputScore = document.createElement("input"); inputScore.name = "score$"+line; inputScore.className = "chkinput"; inputScore.type = "text"; inputScore.size = 9; inputScore.maxlength = 10; inputScore.style = "text-align:right;padding-right:2mm;" ; inputScore.onkeypress = function(){checkWordNumber(this.value,event)}; inputScore.onkeyup = function(){sysIsEdit();checkComma(this,2)}; inputScore.onblur = function(){checkNumFloat(this,0,10000000)}; cell7.appendChild(inputScore); //End Score Field //Begin Group Field var cell8 = document.createElement("td"); cell8.className = "result"; cell8.align = "center"; var groupid = document.createElement("input"); var groupidfield = "group$"+line; groupid.name = groupidfield; groupid.type = "text"; groupid.size = 9; groupid.maxLength = 10; var linkCal3 = document.createElement("a"); linkCal3.href = "javascript:goHelp('MYEARLY_GROUPHELP','"+groupidfield+"')"; var imgCal3 = document.createElement("img"); imgCal3.src = "../IMAGES/BUTTON/MAIN/SEARCH20.gif"; imgCal3.alt = "Help"; imgCal3.name = "imgBu1"; imgCal3.border = 0; imgCal3.align = "absmiddle"; linkCal3.onmouseout = function(){MM_swapImgRestore()}; linkCal3.onmouseover = function(){MM_swapImage('imgBu1','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1);}; linkCal3.appendChild(imgCal3); cell8.appendChild(groupid); cell8.appendChild(linkCal3); //End Group Field //Begin Amount_Increase Field var cell9 = document.createElement("td"); cell9.className = "result"; cell9.align = "center"; var inputAmountIncrease = document.createElement("input"); inputAmountIncrease.name = "amountInc$"+line; inputAmountIncrease.className = "chkinput"; inputAmountIncrease.type = "text"; inputAmountIncrease.size = 9; inputAmountIncrease.maxlength = 10; inputAmountIncrease.style = "text-align:right;padding-right:2mm;" ; inputAmountIncrease.onkeypress = function(){checkWordNumber(this.value,event)}; inputAmountIncrease.onkeyup = function(){sysIsEdit();checkComma(this,2)}; inputAmountIncrease.onblur = function(){checkNumFloat(this,0,10000000)}; cell9.appendChild(inputAmountIncrease); //End Amount_Increase Field //Begin Percent Field var cell10 = document.createElement("td"); cell10.className = "result"; cell10.align = "center"; var inputPercent = document.createElement("input"); inputPercent.name = "percent$"+line; inputPercent.className = "chkinput"; inputPercent.type = "text"; inputPercent.size = 9; inputPercent.maxlength = 10; inputPercent.style = "text-align:right;padding-right:2mm;" ; inputPercent.onkeypress = function(){checkWordNumber(this.value,event)}; inputPercent.onkeyup = function(){sysIsEdit();checkComma(this,2)}; inputPercent.onblur = function(){checkNumFloat(this,0,10000000)}; cell10.appendChild(inputPercent); //End Percent Field //Begin Current_Basepay Field var cell11 = document.createElement("td"); cell11.className = "result"; cell11.align = "center"; var inputCurB = document.createElement("input"); inputCurB.name = "curB$"+line; inputCurB.className = "chkinput"; inputCurB.type = "text"; inputCurB.size = 9; inputCurB.maxlength = 10; inputCurB.style = "text-align:right;padding-right:2mm;" ; inputCurB.onkeypress = function(){checkWordNumber(this.value,event)}; inputCurB.onkeyup = function(){sysIsEdit();checkComma(this,2)}; inputCurB.onblur = function(){checkNumFloat(this,0,10000000)}; cell11.appendChild(inputCurB); //End Percent Field //Begin New_Basepay Field var cell12 = document.createElement("td"); cell12.className = "result"; cell12.align = "center"; var inputNewB = document.createElement("input"); inputNewB.name = "newB$"+line; inputNewB.className = "chkinput"; inputNewB.type = "text"; inputNewB.size = 9; inputNewB.maxlength = 10; inputNewB.style = "text-align:right;padding-right:2mm;" ; inputNewB.onkeypress = function(){checkWordNumber(this.value,event)}; inputNewB.onkeyup = function(){sysIsEdit();checkComma(this,2)}; inputNewB.onblur = function(){checkNumFloat(this,0,10000000);checkNewBValue(this.value,line)}; //<input type="hidden" name="backup$newB$5" value="59,000.00"> inputHidNewB = document.createElement("input"); inputHidNewB.name = "backup$newB$"+line; inputHidNewB.type = "hidden"; inputHidNewB.value = ""; inputHidNewB.size = 9; inputHidNewB.maxlength = 10; cell12.appendChild(inputNewB); cell12.appendChild(inputHidNewB); //End Percent Field tr.appendChild(cell1); tr.appendChild(cell1_1); tr.appendChild(cell2); tr.appendChild(cell3); tr.appendChild(cell4); tr.appendChild(cell5); tr.appendChild(cell6); tr.appendChild(cell7); tr.appendChild(cell8); tr.appendChild(cell9); tr.appendChild(cell10); tr.appendChild(cell11); tr.appendChild(cell12); table.appendChild(tr); } function checkNumFloat(obj,min,max){ if (obj.value != "") { var thisvalue = obj.value; if(thisvalue.indexOf(",")>-1){ thisvalue = thisvalue.replace(",",""); } obj.value = parseFloat(thisvalue)+""; // แปลงจาก 01234.xx เป็น 1234.xx checkInputComma(obj); // ถ้าพิม xxx ก็ให้เป็น xxx.00 if (min >= 0 && max > 0) { callMaxMin(obj,min,max); // ตรวจดูว่าค่าที่กรอกเกินค่าสูงสุด หรือต่ำกว่าค่าต่ำสุดหรือไม่ } insertComma(obj); //123456 ==> 123,456 } } function checkInputComma(obj) { var temp = obj.value.split("."); if (temp.length == 2) { if (temp[1].length == 0) { obj.value = obj.value + "00"; } else if (temp[1].length == 1) { obj.value = obj.value + "0"; } } else { obj.value = obj.value + ".00"; } } $(document).ready(function(){ $(".chkinputlist" ).on("change",function(){ var thisinput = $(this).val(); var thisfieldname = $(this).attr('name'); var getpos = thisfieldname.split("$"); var posRow = getpos[1]; setObjValue(posRow); }); $(".chkinput" ).on("blur",function(){ var lang = '<%=screen2.getUProfile().get("lang")%>'; var thisinput = $(this).val(); var thisfieldname = $(this).attr('name'); var getpos = thisfieldname.split("$"); var posRow = getpos[1]; var fieldBackup = "input[name='backup$"+thisfieldname+"']"; if(thisfieldname.indexOf("percent$")>-1||thisfieldname.indexOf("amountInc$")>-1||thisfieldname.indexOf("curB$")>-1||thisfieldname.indexOf("newB$")>-1){ var test = thisinput.match("^[0-9]+(\.[0-9]{1,2})*$"); if (test==null) { if(lang === 'eng'){ alert("Data must not be null."); }else{ alert("ข้อมูลไม่สามารถเป็นค่าว่างได้"); } var backdata = $(fieldBackup).val(); if (backdata!=""){ $(this).val(backdata); }else{ $(this).val(""); } }else{ setObjValue(posRow); } }else{ setObjValue(posRow); } }); function setObjValue(row){ //Ex field1$1 //Set all data of this row var employee = $("[name='emp"+row+"']").text(); var tempEMPID = employee.split(" "); var thisempid = tempEMPID[0]; var thisYear = $("[name='__year$"+row+"']").val(); var thisMonth = $("[name='__month$"+row+"']").val(); var thisEffDate = $("[name='__effective_date$"+row+"']").val(); var thisGrade = $("[name='grade$"+row+"']").val(); var thisScore = $("[name='score$"+row+"']").val(); var thisGroup = $("[name='group$"+row+"']").val(); var thisAmountINC = $("[name='amountInc$"+row+"']").val(); var thisPercent = $("[name='percent$"+row+"']").val(); var thisCurBasepay = $("[name='curB$"+row+"']").val(); var thisNewBasepay = $("[name='newB$"+row+"']").val(); setObjArray(row,thisempid,thisYear,thisMonth,thisEffDate,thisGrade,thisScore,thisGroup,thisAmountINC,thisPercent,thisCurBasepay,thisNewBasepay); console.log("jsonArray ==> "+JSON.stringify( jsonArray )); } function setObjArray(row,empid,year,month,eff_date,grade,score,group,amount_inc,percent,cur_basepay,new_basepay){ var chk = true; for (var i=0; i<jsonArray.length; i++){ if (jsonArray[i]["empid"] === empid){ jsonArray[i]["year"] = year; jsonArray[i]["month"] = month; jsonArray[i]["eff_date"] = eff_date; jsonArray[i]["grade"] = grade; jsonArray[i]["score"] = score; jsonArray[i]["group"] = group; jsonArray[i]["amount_inc"] = amount_inc; jsonArray[i]["percent"] = percent; jsonArray[i]["cur_basepay"] = cur_basepay; jsonArray[i]["new_basepay"] = new_basepay; chk = false; } } if(chk){//Add new row to ObjJSON jsonArray.push({"empid":empid, "year":year, "month":month, "eff_date":eff_date, "grade":grade, "score":score, "group":group, "amount_inc":amount_inc,"percent":percent,"cur_basepay":cur_basepay,"new_basepay":new_basepay}); } } }); function checkNumFloat(obj,min,max){ if (obj.value != "") { var thisvalue = obj.value; if(thisvalue.indexOf(",")>-1){ thisvalue = thisvalue.replace(",",""); } obj.value = parseFloat(thisvalue)+""; // แปลงจาก 01234.xx เป็น 1234.xx checkInputComma(obj); // ถ้าพิม xxx ก็ให้เป็น xxx.00 if (min >= 0 && max > 0) { callMaxMin(obj,min,max); // ตรวจดูว่าค่าที่กรอกเกินค่าสูงสุด หรือต่ำกว่าค่าต่ำสุดหรือไม่ } insertComma(obj); //123456 ==> 123,456 } } function checkInputComma(obj) { var temp = obj.value.split("."); if (temp.length == 2) { if (temp[1].length == 0) { obj.value = obj.value + "00"; } else if (temp[1].length == 1) { obj.value = obj.value + "0"; } } else { obj.value = obj.value + ".00"; } } function checkAll(){ with(document.cscform){ for(i=0;i<elements.length;i++){ if(elements[i].type=="checkbox") { elements[i].checked=true; } } } } function decheckAll(){ with(document.cscform){ for(i=0;i<elements.length;i++){ if(elements[i].type=="checkbox") { elements[i].checked=false; } } } } function checkNewBValue(data,row){ with(document.cscform){ var lang = '<%=screen2.getUProfile().get("lang")%>'; var curB = $("[name='curB$"+row+"']").val(); var newBField = $("[name='newB$"+row+"']"); var valNewB = 0.0; var valCurB = 0.0; if((curB != "")&&(data != "")){ var valueCurB = curB.replace(",",""); var valueNewB = data.replace(",",""); var valNewB = parseFloat(valueNewB); var valCurB = parseFloat(valueCurB); }else if((data == "")){//new basepay = "" return false; }else{//current basepay = "" //Do nothing return false; } if(valNewB < valCurB){ var fieldBackup = "input[name='backup$newB$"+row+"']"; //Ex backup$newB$2 var backdata = $(fieldBackup).val(); if(lang === 'eng'){ alert("New Basepay's value must more than Current Basepay's value in row "+row+"."); var backdata = $(fieldBackup).val(); $(newBField).val(backdata); return false; }else{ alert("ค่า New Basepay จะต้องมากกว่าค่า Current Basepay ที่แถว "+row+""); var backdata = $(fieldBackup).val(); $(newBField).val(backdata); return false; } } return true; } } </script> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <form name="cscform" method="post" action ="PRU203.jsp"> <!----------BEGIN CSC INITIAL ZONE ------------------------> <%=screen2.InitialVariable()%> <input type="hidden" name="__cmd" value="<%=request.getParameter("__cmd")%>"> <input type="hidden" name="__screen" value="PRU203"> <input type="hidden" name="__help" value=""> <input type="hidden" name="__calendar" value=""> <script language="javascript">getInputFormatDate();</script> <input type="hidden" name="__companyid" value="<%=screen2.getUProfile().get("companyid")%>"> <input type="hidden" name="__referPage" value=""> <input type="hidden" name="__fixCon" value=""> <input type="hidden" name="__fixCon2" value=""> <input type="hidden" name="__language" value="<%=screen2.getUProfile().get("lang")%>"> <!-- For process class --> <input type="hidden" name="__getEmpJS" value=""> <input type="hidden" name="__process" value=""> <input type="hidden" name="__ptype" value=""> <input type="hidden" name="__tname" value="การส่งข้อมูลการปรับเงินเดือนประจำปี"> <input type="hidden" name="__ename" value="Transfer Yearly Salary Increase"> <input type="hidden" name="__prclass" value="TransfersYearlySalaryInc"> <input type="hidden" name="__condition$datatransfer" value="<%=datatransfer%>"> <!----------END CSC INITIAL ZONE --------------------------> <div align="center"> <table height="" align="center" cellpadding="0" cellspacing="0" border="1" class="largest"> <tr bgcolor="#3366CC"> <td height="20" class="header" colspan="4">PRU203,<span swlang code="SW011954">Transfer Yearly Salary Increase</span> </td> </tr> <tr> <td class="blankspace" colspan="4"></td> </tr> <tr> <td align="right"><strong><span swlang code="SW000350">Employee ID</span> </strong></td> <td colspan="3"><input type="text" name="__emp1" size="15" value="<%=emp1%>"> <a href="javascript:goHelp('MEMPLOYEEHELP','__emp1')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="Image2" border="0" align="absmiddle"></a> - <input type="text" name="__emp2" size="15" value="<%=emp2%>"> <a href="javascript:goHelp('MEMPLOYEEHELP','__emp2')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="Image3" border="0" align="absmiddle"></a></span> </td> </tr> <tr> <td align="right"><!-- <swaplang code='SW000309'></swaplang> --><!-- <script>sw.write('SW000309');</script> --> <span swlang code="SW010728">Division</span> </td> <td colspan="3"><input type="text" name="__bu1" size="15" value="<%=bu1%>"> <a href="javascript:goHelp('MBU1HELP','__bu1')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgBu1','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="imgBu1" border="0" align="absmiddle"></a> <input name="__bu1_desc" type="text" value="<%=chk.chkNullString(request.getParameter("__bu1_desc"))%>" size="35" readonly=""> </td> </tr> <tr> <td align="right"><!-- <swaplang code='SW000310'></swaplang> --><!-- <script>sw.write('SW000310');</script> --> <span swlang code="SW002031">Department</span> </td> <td colspan="3"><input type="text" name="__bu2" size="15" value="<%=bu2%>"> <a href="javascript:goHelp('MBU2HELP','__bu2')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgBu2','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="imgBu2" border="0" align="absmiddle"></a> <input name="__bu2_desc" type="text" value="<%=chk.chkNullString(request.getParameter("__bu2_desc"))%>" size="35" readonly=""> </td> </tr> <tr> <td align="right"><!-- <swaplang code='SW000311'></swaplang> --><!-- <script>sw.write('SW000311');</script> --> <span swlang code="SW000052">Section</span> </td> <td colspan="3"><input type="text" name="__bu3" size="15" value="<%=bu3%>"> <a href="javascript:goHelp('MBU3HELP','__bu3')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgBu3','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="imgBu3" border="0" align="absmiddle"></a> <input name="__bu3_desc" type="text" value="<%=chk.chkNullString(request.getParameter("__bu3_desc"))%>" size="35" readonly=""> </td> </tr> <tr> <td align="right"><!-- <swaplang code='SW000312'></swaplang> --><!-- <script>sw.write('SW000312');</script> --> <span swlang code="SW011728">Sub Section #1</span> </td> <td colspan="3"><input type="text" name="__bu4" size="15" value="<%=bu4%>"> <a href="javascript:goHelp('MBU4HELP','__bu4')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgBu4','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="imgBu4" border="0" align="absmiddle"></a> <input name="__bu4_desc" type="text" value="<%=chk.chkNullString(request.getParameter("__bu4_desc"))%>" size="35" readonly=""> </td> </tr> <tr> <td align="right"><!-- <swaplang code='SW000313'></swaplang> --><!-- <script>sw.write('SW000313');</script> --> <span swlang code="SW011729">Sub Section #2</span> </td> <td colspan="3"><input type="text" name="__bu5" size="15" value="<%=bu5%>"> <a href="javascript:goHelp('MBU5HELP','__bu5')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgBu5','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="imgBu5" border="0" align="absmiddle"></a> <input name="__bu5_desc" type="text" value="<%=chk.chkNullString(request.getParameter("__bu5_desc"))%>" size="35" readonly=""></td> </tr> <tr> <td align="right"><!-- <swaplang code='SW000865'></swaplang> --><!-- <%=language.equals("tha")?"ประเภทการจ่ายเงิน":"Salary Type"%> --> <span swlang code="SW000865">Salary Type </span> </td> <td colspan="3"><!-- Salary Type --> <input type="Text" name="__salatype" size="5" maxlength="5" value="<%=salatype%>" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Salary Type" onmousemver="toolTip('Salary Type')" onmouseout="toolTip()"> <a href="javascript:goHelp('MSALATYPE0HELP','__salatype');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__salatype_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__salatype_image" border="0" align="absmiddle"></a> <input type="Text" name="__saladesc" size="35" value="<%=saladesc%>" readonly> </td> </tr> <tr> <td align="right"><!-- <swaplang code=''></swaplang> --><!-- <%=language.equals("eng")?"Group":"เกรดการปรับเงินเดือนประจำปี"%> --> <span swlang code="SW000471">Group</span> </td> <td colspan="3"><!-- Salary Type --> <input type="Text" name="__group" size="5" maxlength="5" value="<%=groupid%>" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Salary Type" onmousemver="toolTip('Salary Type')" onmouseout="toolTip()"> <a href="javascript:goHelp('MYEARLY_GROUPHELP','__group');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__group_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__group_image" border="0" align="absmiddle"></a> <input type="Text" name="__groupdesc" size="35" value="<%=groupdesc%>" readonly> </td> </tr> <tr> <td><div align="right"><!-- <swaplang code='SW000004'></swaplang> --><!-- <script>sw.write('SW000004');</script> --> <span swlang code="SW000004">Order By</span> </div></td> <td colspan="3"> <select name="__groupby" id="__groupby"> <option value=""></option> <option value="employeeid" <%=(getOrderBy.equals("employeeid"))?"selected":""%>><%=language.equals("tha")?"รหัสพนักงาน":"Employee ID"%></option> <option value="bu1" <%=(getOrderBy.equals("bu1"))?"selected":""%>><%=language.equals("tha")?"หน่วยงานระดับที่ 1":"Business Unit 1"%></option> <option value="bu2" <%=(getOrderBy.equals("bu2"))?"selected":""%>><%=language.equals("tha")?"หน่วยงานระดับที่ 2":"Business Unit 2"%></option> <option value="bu3" <%=(getOrderBy.equals("bu3"))?"selected":""%>><%=language.equals("tha")?"หน่วยงานระดับที่ 3":"Business Unit 3"%></option> <option value="bu4" <%=(getOrderBy.equals("bu4"))?"selected":""%>><%=language.equals("tha")?"หน่วยงานระดับที่ 4":"Business Unit 4"%></option> <option value="bu5" <%=(getOrderBy.equals("bu5"))?"selected":""%>><%=language.equals("tha")?"หน่วยงานระดับที่ 5":"Business Unit 5"%></option> <option value="salatype" <%=(getOrderBy.equals("salatype"))?"selected":""%>><%=language.equals("tha")?"ประเภทการจ่ายเงิน":"Salary Type"%></option> <!-- <option value="groupid" <%=(getOrderBy.equals("groupid"))?"selected":""%>><%=language.equals("tha")?"Group":"Group"%></option> --> </select> </td> </tr> <tr> <td><div align="right"><!-- <script>sw.write('SW000019');</script> --> <span swlang code="SW000019">Status</span> </div></td> <td colspan="3"> <select name="__status_search"> <option value="" <%=(getStatusSearch.equals(""))?"selected":""%>><%=language.equals("eng")?"All":"ทั้งหมด"%></option> <option value="1" <%=(getStatusSearch.equals("1"))?"selected":""%>><%=language.equals("eng")?"Transfer":"ยืนยัน"%></option> <option value="0" <%=(getStatusSearch.equals("0"))?"selected":""%>><%=language.equals("eng")?"Not Transfer":"ยังไม่ยืนยัน"%></option> </select> </td> </tr> <tr> <td class="blankspace" colspan="4"></td> </tr> <tr> <td class="buttonline" colspan="7"><div align="center"> <button type="button" class="btn btn-primary width100" swlang code="SW003537" onClick="GoSearch();">SEARCH</button> </div> </td> </tr> <tr> <td class="blankspace" colspan="4"></td> </tr> <!-- Create Table. --> <%if(cmd != null && cmd.equals("search")){%> <tr> <td colspan="4"> <table border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#808080" class="large" id="tableYearly"> <tr align="center"> <td class="result row3"><b></b></td> <td class="result row3"><b><!-- <script>sw.write('SW001393');</script> --><span swlang code="SW001393">No</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW000307');</script> --><span swlang code="SW000307">Employee</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW000717');</script> --><span swlang code="SW000717">Year</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW000800');</script> --><span swlang code="SW000800">Month</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW005039');</script> --><span swlang code="SW005039">Effective Date</span></b></td> <td class="result row3"><b><!-- <%=language.equals("eng")?"Grade":"เกรด"%> --><span swlang code="SW000069">Grade</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW000013');</script> --><span swlang code="SW000013">Score</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW000471');</script> --><span swlang code="SW000471">Group</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW011714');</script> --><span swlang code="SW011714">Amount Increase</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW000707');</script> --><span swlang code="SW000707">Percent</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW011715');</script> --><span swlang code="SW011715">Current Basepay</span></b></td> <td class="result row3"><b><!-- <script>sw.write('SW011716');</script> --><span swlang code="SW011716">New Basepay</span></b></td> </tr> <% //Create Data screen2.referLangOn(); int countemp = 0; //while(inqEmp.next()){ while(screen2.nextRec()){ String StatusEMP = screen2.getDataLabel("status"); boolean chkStatusEMP = false; DbInquiry inqCheckStatus = new InitialInquiry(screen2.getUProfile()).getDbInquiry("Memployee"); inqCheckStatus.setColumn("employeeid"); inqCheckStatus.setFilter("employeeid = '"+screen2.getDataLabel("employeeid")+"' and status in ('Y','Z','C','X','D','U')"); inqCheckStatus.refresh(); while(inqCheckStatus.next()){ chkStatusEMP = true; } DbInquiry inq2 = new InitialInquiry(screen2.getUProfile()).getDbInquiry("Ttemp_salaryinc"); inq2.setColumn("*"); if(getFixcon == null||getFixcon.equals("")){ inq2.setFilter("employeeid ='"+screen2.getDataLabel("employeeid")+"'"); }else{ inq2.setFilter("employeeid ='"+screen2.getDataLabel("employeeid")+"' and "+getFixcon); } inq2.refresh(); while(inq2.next()){ countemp++; String status = inq2.getString("status"); %> <tr> <%if(chkStatusEMP){//this emp has status is 'Y','Z','C','X','D','U' %> <%if(status.equals("1")){%> <td align="center" class="result"><!-- <input type="checkbox" disabled> --></td> <td align="center" class="result" style="color: FF0000;"><%=countemp%></td> <td align="left" class="result" style="color: FF0000;"><%=screen2.getDataLabel("employeeid")+" "+screen2.getDataLabel("fullname")%></td> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=Integer.valueOf(inq2.getString("year"))%></td> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=Integer.valueOf(inq2.getString("month"))%></td> <% String getEffDate = inq2.getString("effective_date"); CscCalendar c = new CscCalendar(getEffDate); getEffDate = c.getDDMMYYYY(); %> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=getEffDate%></td> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=inq2.getString("grade")%></td> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=inq2.getString("score")%></td> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=inq2.getString("groupid")%></td> <% String getAmountInc = inq2.getString("amount_increase"); BigDecimal bctotal1 = new BigDecimal(Double.valueOf(getAmountInc)); DecimalFormat df = new DecimalFormat("###,###,###,###.00"); getAmountInc = df.format(bctotal1); if(getAmountInc.equals(".00")){ getAmountInc = "0.00"; } %> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=getAmountInc%></td> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=inq2.getString("percent")%></td> <% String getCurB = inq2.getString("current_basepay"); BigDecimal bctotal2 = new BigDecimal(Double.valueOf(getCurB)); getCurB = df.format(bctotal2); if(getCurB.equals(".00")){ getCurB = "0.00"; } %> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=getCurB%></td> <% String getNewB = inq2.getString("new_basepay"); BigDecimal bctotal3 = new BigDecimal(Double.valueOf(getNewB)); getNewB = df.format(bctotal3); if(getNewB.equals(".00")){ getNewB = "0.00"; } %> <td align="center" class="result" style="color: #FF0000;text-align:right;padding-right:2mm;"><%=getNewB%></td> <%}else{%> <td align="center" class="result"><input type="checkbox" name="__transfer$<%=countemp%>"></td> <td align="center" class="result" style="color: #FF0000;"><%=countemp%></td> <td align="left" class="result" name="emp<%=countemp%>" style="color: #FF0000;"><%=screen2.getDataLabel("employeeid")+" "+screen2.getDataLabel("fullname")%></td> <td align="center" class="result" ><!-- ListBox --> <% int getYear = Integer.valueOf(inq2.getString("year")); %> <select name="__year$<%=countemp%>" class="chkinputlist" style="color:red"> <% for(int i = getYear-5;i<=getYear+5;i++){%> <option value="<%=i%>" <%=(i == getYear)?"selected":""%> ><%=i%></option> <%}%> </td> <td align="center" class="result"> <% int getMonth = Integer.valueOf(inq2.getString("month")); %><select name="__month$<%=countemp%>" class="chkinputlist" style="color:red"><% for(int i = 1;i<=12;i++){%> <option value="<%=i%>" <%=(i == getMonth)?"selected":""%>><%=i%></option> <%}%> </td> <td align="center" class="result"> <!-- Effective Date --> <% String field = "__effective_date$"+countemp; String valueEff = inq2.getString("effective_date"); %> <input type="calendar" name="<%=field%>" size="8" maxlength="10" value="<%=new CscCalendar(valueEff).getDDMMYYYY()%>" onkeyup="sysIsEdit();formatDate(this);" onblur="" onfocus="this.select();" alt="Effective Date" class="chkinput" style="text-align:center;color: #FF0000;"> <a href="javascript:;" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image12','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)" onclick="viewCal('<%=field%>')"> <img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Calendar" name="Image12" width="20" border="0" align="absmiddle" id="Image12"></a> </td> <td align="center" class="result"> <% String getGrade = inq2.getString("grade"); %> <input type="text" name="grade$<%=countemp%>" value="<%=getGrade%>" size="8" align="right" class="chkinput" style="text-align:right;padding-right:2mm;color: #FF0000;"> </td> <td align="center" class="result"> <% String getScore = inq2.getString("score"); %> <input type="text" name="score$<%=countemp%>" value="<%=getScore%>" size="8" align="right" class="chkinput" style="text-align:right;padding-right:2mm;color: #FF0000;" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000)"> </td> <td align="center" class="result"> <% String getGroup = inq2.getString("groupid"); %> <input type="text" name="group$<%=countemp%>" value="<%=getGroup%>" size="8" align="right" class="chkinput" style="text-align:right;padding-right:2mm;color:#FF0000;"> <a href="javascript:goHelp('MYEARLY_GROUPHELP','group$<%=countemp%>')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgBu1','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="imgBu1" border="0" align="absmiddle"></a> </td> <td align="center" class="result"> <% String getAmountInc = inq2.getString("amount_increase"); BigDecimal bctotal1 = new BigDecimal(Double.valueOf(getAmountInc)); DecimalFormat df = new DecimalFormat("###,###,###,###.00"); getAmountInc = df.format(bctotal1); if(getAmountInc.equals(".00")){ getAmountInc = "0.00"; } %> <input type="hidden" name="backup$amountInc$<%=countemp%>" value="<%=getAmountInc%>"></input> <input type="text" name="amountInc$<%=countemp%>" value="<%=getAmountInc%>" size="8" style="text-align:right;padding-right:2mm;color: #FF0000;" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000)" class="chkinput"> </td> <td align="center" class="result"> <% String getPercent = inq2.getString("percent"); %> <input type="hidden" name="backup$percent$<%=countemp%>" value="<%=getPercent%>"></input> <input type="text" name="percent$<%=countemp%>" value="<%=getPercent%>" size="8" align="right" class="chkinput" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000)" style="text-align:right;padding-right:2mm;color: #FF0000;"> </td> <td align="center" class="result"> <% String getCurB = inq2.getString("current_basepay"); BigDecimal bctotal2 = new BigDecimal(Double.valueOf(getCurB)); getCurB = df.format(bctotal2); if(getCurB.equals(".00")){ getCurB = "0.00"; } %> <input type="hidden" name="backup$curB$<%=countemp%>" value="<%=getCurB%>"></input> <input type="text" name="curB$<%=countemp%>" value="<%=getCurB%>" size="8" align="right" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000)" class="chkinput" style="text-align:right;padding-right:2mm;color: #FF0000;"> </td> <td align="center" class="result"> <% String getNewB = inq2.getString("new_basepay"); BigDecimal bctotal3 = new BigDecimal(Double.valueOf(getNewB)); getNewB = df.format(bctotal3); if(getNewB.equals(".00")){ getNewB = "0.00"; } %> <input type="hidden" name="backup$newB$<%=countemp%>" value="<%=getNewB%>"></input> <input type="text" name="newB$<%=countemp%>" value="<%=getNewB%>" size="8" align="right" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000);checkNewBValue(this.value,<%=countemp%>)" class="chkinput" style="text-align:right;padding-right:2mm;color:#FF0000;"> </td> <%}%> <%}else{ if(status.equals("1")){%> <td align="center" class="result"><!-- <input type="checkbox" disabled> --></td> <td align="center" class="result" style="color: #329F37;"><%=countemp%></td> <td align="left" class="result" style="color: #329F37;"><%=screen2.getDataLabel("employeeid")+" "+screen2.getDataLabel("fullname")%></td> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=Integer.valueOf(inq2.getString("year"))%></td> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=Integer.valueOf(inq2.getString("month"))%></td> <% String getEffDate = inq2.getString("effective_date"); CscCalendar c = new CscCalendar(getEffDate); getEffDate = c.getDDMMYYYY(); %> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=getEffDate%></td> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=inq2.getString("grade")%></td> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=inq2.getString("score")%></td> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=inq2.getString("groupid")%></td> <% String getAmountInc = inq2.getString("amount_increase"); BigDecimal bctotal1 = new BigDecimal(Double.valueOf(getAmountInc)); DecimalFormat df = new DecimalFormat("###,###,###,###.00"); getAmountInc = df.format(bctotal1); if(getAmountInc.equals(".00")){ getAmountInc = "0.00"; } %> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=getAmountInc%></td> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=inq2.getString("percent")%></td> <% String getCurB = inq2.getString("current_basepay"); BigDecimal bctotal2 = new BigDecimal(Double.valueOf(getCurB)); getCurB = df.format(bctotal2); if(getCurB.equals(".00")){ getCurB = "0.00"; } %> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=getCurB%></td> <% String getNewB = inq2.getString("new_basepay"); BigDecimal bctotal3 = new BigDecimal(Double.valueOf(getNewB)); getNewB = df.format(bctotal3); if(getNewB.equals(".00")){ getNewB = "0.00"; } %> <td align="center" class="result" style="color: #329F37;text-align:right;padding-right:2mm;"><%=getNewB%></td> <%}else{%> <td align="center" class="result"><input type="checkbox" name="__transfer$<%=countemp%>"></td> <td align="center" class="result"><%=countemp%></td> <td align="left" class="result" name="emp<%=countemp%>"><%=screen2.getDataLabel("employeeid")+" "+screen2.getDataLabel("fullname")%></td> <td align="center" class="result"><!-- ListBox --> <% int getYear = Integer.valueOf(inq2.getString("year")); %> <select name="__year$<%=countemp%>" class="chkinputlist"> <% for(int i = getYear-5;i<=getYear+5;i++){%> <option value="<%=i%>" <%=(i == getYear)?"selected":""%>><%=i%></option> <%}%> </td> <td align="center" class="result"> <% int getMonth = Integer.valueOf(inq2.getString("month")); %><select name="__month$<%=countemp%>" class="chkinputlist"><% for(int i = 1;i<=12;i++){%> <option value="<%=i%>" <%=(i == getMonth)?"selected":""%>><%=i%></option> <%}%> </td> <td align="center" class="result"> <!-- Effective Date --> <% String field = "__effective_date$"+countemp; String valueEff = inq2.getString("effective_date"); %> <input type="calendar" name="<%=field%>" size="8" maxlength="10" value="<%=new CscCalendar(valueEff).getDDMMYYYY()%>" onkeyup="sysIsEdit();formatDate(this);" onblur="" onfocus="this.select();" alt="Effective Date" class="chkinput" style="text-align:center;"> <a href="javascript:;" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image12','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)" onclick="viewCal('<%=field%>')"> <img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Calendar" name="Image12" width="20" border="0" align="absmiddle" id="Image12"></a> </td> <td align="center" class="result"> <% String getGrade = inq2.getString("grade"); %> <input type="text" name="grade$<%=countemp%>" value="<%=getGrade%>" size="8" align="right" class="chkinput" style="text-align:right;padding-right:2mm;"> </td> <td align="center" class="result"> <% String getScore = inq2.getString("score"); %> <input type="text" name="score$<%=countemp%>" value="<%=getScore%>" size="8" align="right" class="chkinput" style="text-align:right;padding-right:2mm;" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000)"> </td> <td align="center" class="result"> <% String getGroup = inq2.getString("groupid"); %> <input type="text" name="group$<%=countemp%>" value="<%=getGroup%>" size="8" align="right" class="chkinput" style="text-align:right;padding-right:2mm;"> <a href="javascript:goHelp('MYEARLY_GROUPHELP','group$<%=countemp%>')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('imgBu1','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="Help" name="imgBu1" border="0" align="absmiddle"></a> </td> <td align="center" class="result"> <% String getAmountInc = inq2.getString("amount_increase"); BigDecimal bctotal1 = new BigDecimal(Double.valueOf(getAmountInc)); DecimalFormat df = new DecimalFormat("###,###,###,###.00"); getAmountInc = df.format(bctotal1); if(getAmountInc.equals(".00")){ getAmountInc = "0.00"; } %> <input type="hidden" name="backup$amountInc$<%=countemp%>" value="<%=getAmountInc%>"></input> <input type="text" name="amountInc$<%=countemp%>" value="<%=getAmountInc%>" size="8" style="text-align:right;padding-right:2mm;" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000)" class="chkinput"> </td> <td align="center" class="result"> <% String getPercent = inq2.getString("percent"); %> <input type="hidden" name="backup$percent$<%=countemp%>" value="<%=getPercent%>"></input> <input type="text" name="percent$<%=countemp%>" value="<%=getPercent%>" size="8" align="right" class="chkinput" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000)" style="text-align:right;padding-right:2mm;"> </td> <td align="center" class="result"> <% String getCurB = inq2.getString("current_basepay"); BigDecimal bctotal2 = new BigDecimal(Double.valueOf(getCurB)); getCurB = df.format(bctotal2); if(getCurB.equals(".00")){ getCurB = "0.00"; } %> <input type="hidden" name="backup$curB$<%=countemp%>" value="<%=getCurB%>"></input> <input type="text" name="curB$<%=countemp%>" value="<%=getCurB%>" size="8" align="right" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000)" class="chkinput" style="text-align:right;padding-right:2mm;"> </td> <td align="center" class="result"> <% String getNewB = inq2.getString("new_basepay"); BigDecimal bctotal3 = new BigDecimal(Double.valueOf(getNewB)); getNewB = df.format(bctotal3); if(getNewB.equals(".00")){ getNewB = "0.00"; } %> <input type="hidden" name="backup$newB$<%=countemp%>" value="<%=getNewB%>"></input> <input type="text" name="newB$<%=countemp%>" value="<%=getNewB%>" size="8" align="right" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,10000000);checkNewBValue(this.value,<%=countemp%>)" class="chkinput" style="text-align:right;padding-right:2mm;"> </td> <%}%> </tr> <%} }}%> </table> </td> </tr> <tr> <td colspan="4" class="blankspace"></td> </tr> <tr> <td colspan="4" align="center"> <a href="javascript:AddChild()"><img src="../IMAGES/BUTTON/ADD.gif" border="0"></a> <a href="javascript:checkAll()"><img src="../IMAGES/BUTTON/SELECTALL.gif" border="0"></a> <a href="javascript:decheckAll()"><img src="../IMAGES/BUTTON/DESELECTALL.gif" border="0"></a> <a href="javascript:GoDelete();"><img src="../IMAGES/BUTTON/DELETE.gif" border="0"></a> </td> </tr> <tr> <td colspan="4" class="blankspace"></td> </tr> <tr> <td colspan="4" align="center"> <a href="javascript:GoSave();"><img src="../IMAGES/BUTTON/SAVE.gif" /></a> <a href="javascript:GoProcess();"><img src="../IMAGES/BUTTON/PROCESS.gif" border="0"></a> </td> </tr> <input type="hidden" name="__lastRecord" value="<%=countemp%>"> <input type="hidden" name="__listGenRecord" value="<%=getlistJS%>"><!-- List of row gen by JS --> <%}%> <tr> <td colspan="4" class="blankspace"></td> </tr> </table> </div> </form> </body> <script> //Credit by Nheung(Chamnan) var waitingDialog = waitingDialog || (function ($) { 'use strict'; // Creating modal dialog's DOM var $dialog = $( '<div class="modal fade" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true" style="padding-top:15%; overflow-y:visible;">' + '<div class="modal-dialog modal-m">' + '<div class="modal-content">' + '<div class="modal-header"><h3 style="margin:0;"></h3></div>' + '<div class="modal-body">' + '<div class="progress progress-striped active" style="margin-bottom:0;"><div class="progress-bar" style="width: 100%"></div></div>' + '</div>' + '</div></div></div>'); return { show: function (message, options) { // Assigning defaults if (typeof options === 'undefined') { options = {}; } if (typeof message === 'undefined') { message = 'Loading'; } var settings = $.extend({ dialogSize: 'm', progressType: '', onHide: null // This callback runs after the dialog was hidden }, options); // Configuring dialog $dialog.find('.modal-dialog').attr('class', 'modal-dialog').addClass('modal-' + settings.dialogSize); $dialog.find('.progress-bar').attr('class', 'progress-bar'); if (settings.progressType) { $dialog.find('.progress-bar').addClass('progress-bar-' + settings.progressType); } $dialog.find('h3').text(message); // Adding callbacks if (typeof settings.onHide === 'function') { $dialog.off('hidden.bs.modal').on('hidden.bs.modal', function (e) { settings.onHide.call($dialog); }); } $dialog.modal(); }, hide: function () { $dialog.modal('hide'); } }; })(jQuery); </script> </html> ��