<%@page contentType="text/html; charset=UTF-8"%> <%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.session.*,com.csc.library.components.*,com.csc.library.report.*,java.util.*;"%> <jsp:useBean id="SWAPLANGEDIT" class="com.csc.library.system.Task" scope="page" /> <jsp:useBean id="MultiSave" class="com.csc.library.dwr.Multisave" scope="page" /> <% SWAPLANGEDIT.setChannel(request, response); HelpEntry screen = (HelpEntry) SWAPLANGEDIT.process("HelpEntry","SWAPLANGSHOW"); CheckNull chk=new CheckNull(); ThaiUtilities thail = new ThaiUtilities(); String condition=thail.ASCII2Unicode(chk.chkNullString(request.getParameter("__fixCon"))); String numpage = chk.chkNullString(request.getParameter("__goPage"),"1"); String cmd = chk.chkNullString(request.getParameter("__cmd"),""); String jsonHeader = chk.chkNullString(request.getParameter("__jsonHeader"),""); String objJSON = chk.chkNullString(request.getParameter("__objJSON"),""); String siteid = chk.chkNullString(request.getParameter("__siteid"),""); String module_option = chk.chkNullString(request.getParameter("__moduleImport"),""); String module_search = chk.chkNullString(request.getParameter("checkboxmodule"),"CENTER"); String searchthai = chk.chkNullString(request.getParameter("__searchthai"),""); String searcheng = chk.chkNullString(request.getParameter("__searcheng"),""); String searchcodeid = chk.chkNullString(request.getParameter("__searchcodeid"),""); int nextrec = 1; if(siteid != ""){ DbInquiry di = new InitialInquiry(screen.getUProfile()).getDbInquiry("SWAPLANG_DETAIL"); di.setColumn("LINE_NO"); di.setFilter("SITEID = '"+siteid+"'"); di.setOrderBy("LINE_NO DESC"); di.refresh(); di.first(); while(di.next()){ String line_no = di.getString("line_no"); nextrec += Integer.parseInt(line_no); break; } di.closeConnection(); } //--------------------- Set MultiSave Bean --------------------------------- String tableName = "swaplang_detail"; String[] tableField = new String[]{"line_no$integer", "siteid", "codeid", "thai", "eng", "module"}; MultiSave.setUProfile(screen.getUProfile()); MultiSave.setNextRecord(nextrec); MultiSave.setTable(tableName); MultiSave.setField(tableField); MultiSave.setJsonHeader(jsonHeader); if (cmd.equalsIgnoreCase("save")) { System.out.println("*********************** save condition ***********************"); MultiSave.setObjJson(objJSON); MultiSave.saveRecord(); cmd = "savecomplete"; } if (cmd.equalsIgnoreCase("delete")) { System.out.println("*********************** delete condition ***********************"); MultiSave.setObjJson(objJSON); MultiSave.deleteRecord(); cmd = "deletecomplete"; } if (cmd.equalsIgnoreCase("addchild")) { System.out.println("*********************** addchild condition **********************"); searchcodeid = ""; objJSON = "{\"savejson\":[{\"line_no\":\""+nextrec+"\",\"siteid\":\""+siteid+"\",\"codeid\":\""+searchcodeid+"\",\"thai\":\""+searchthai+"\",\"eng\":\""+searcheng+"\",\"module\":\""+module_search+"\"}]}"; MultiSave.setObjJson(objJSON); MultiSave.saveRecord(); //condition = "siteid='"+siteid+"' and line_no="+String.valueOf(nextrec); condition = "siteid='"+siteid+"' and thai='' and eng=''"; } if (cmd.equalsIgnoreCase("import")) { System.out.println("*********************** import condition ***********************"); MultiSave.setModuleForImport(module_option); MultiSave.setSiteId(siteid); String[] field = new String[]{"thai", "eng"}; MultiSave.setField(field); MultiSave.setJsonHeader("changelanguage"); MultiSave.setObjJson(objJSON); MultiSave.ImportOldXmlToSave(); cmd = "importcomplete"; } ReportUDF udf = new ReportUDF(); String[] listModule = udf.getSystemCode("MODULETYPE_SWAPLANG",screen.getUProfile().get("lang")); ListBox listboxStandard = new ListBox(); listboxStandard.setUProfile(screen.getUProfile()); listboxStandard.setName("Module_option"); //ชื่อ ListBox listboxStandard.setValidCode("MODULETYPE_SWAPLANG"); //tag Systemcode ที่เรียกใช้ listboxStandard.setDisable("false"); listboxStandard.setChecked("01"); int maxLine = 50; screen.setMaxLine(maxLine); screen.getInquiry().setFilter(condition); screen.getInquiry().setOrderBy("LINE_NO ASC"); screen.process(); %> <html ng-app="myHR"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link href="../CSS/TISCO.css" rel="stylesheet" type="text/css"/> <script language="JavaScript" src="../JS/SCREEN.js"></script> <script type='text/javascript' src="../JS/ICONSMENU.js"></script> <script language='javascript' src="../JS/HOTKEY.js"></script> <script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</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='/hr/dwr/interface/ChkDuplicateValue.js'></script> <script type='text/javascript' src='/hr/dwr/interface/export_xml.js'></script> <script type='text/javascript' src='/hr/dwr/engine.js'></script> <script type='text/javascript' src='/hr/dwr/util.js'></script> <script src="../JS/angular-1.3.15/angular.js"></script> <script type='text/JavaScript' SRC='../JS/ANGULAR/SCREEN_ANGULAR.js'></script> <link href="../CSS/jquery-ui-csc.css" rel="stylesheet" type="text/css"/> <style> input:focus { background-color: #99ccff; } .texterror { background-color: red; } .lineerror { background-color: red; } .portlet-import { cursor: pointer; } .portlet-export { cursor: pointer; } .portlet-delete { cursor: pointer; } .portlet-popup { position: absolute; display: block; } .swaplang_search_hide { display: none; } .swaplang_search_show { } .New_type { } .style1 {font-size: 12px} .bgwhite {background-color: white} </style> <script language="JavaScript" type="text/JavaScript"> var strCMD = "<%=cmd%>"; var lang = "<%=screen.getUProfile().get("lang")%>"; switch (strCMD) { case "savecomplete": if(lang === 'tha'){ alert('บันทึกเรียบร้อย'); } else { alert('Save Data Successful'); } break; case "importcomplete": if(lang === 'tha'){ alert('นำเข้าข้อมูลเรียบร้อย'); } else { alert('Import Data Successful'); } break; case "deletecomplete": if(lang === 'tha'){ alert('ลบเรียบร้อย'); } else { alert('Delete Data Successful'); } break; } //------------------- Global Variable -----------------------// var inputvalue; var jsObjJSON = {}; var jsonArray = []; function alertSiteId(){ if(lang === 'tha'){ alert('กรุณาเลือกไซด์'); } else { alert('Please Choose SiteID'); } } function GoSearch(){ with(document.cscform){ var filterheal=""; var modulecodition = setAndGetCheckedValueModule(); filterheal=checkCondition(filterheal,__siteid,"siteid"); filterheal=checkCondition(filterheal,__searchthai,"thai"); filterheal=checkCondition(filterheal,__searcheng,"eng"); filterheal=checkCondition(filterheal,__searchcodeid,"codeid"); if(modulecodition != ""){ filterheal=checkFilter(filterheal); filterheal+="module in("+modulecodition.substring(0,modulecodition.length-1)+")"; } __fixCon.value=filterheal; console.log(__fixCon.value); search(); } } function setAndGetCheckedValueModule(){ var modulecodition = ""; $('input[name="checkboxmodule"]:checked').each(function() { var getvalue = $(this).val(); modulecodition += "'"+getvalue+"'"; modulecodition += "," }); $('input[name="__getcheckvalue"]').val(modulecodition); return modulecodition; } function checkFilter(fil){ if(fil.length>0) fil+=" and "; return fil; } function checkCondition(filcon,objname,targetname){ with(document.cscform){ if(objname.value.length>0 && targetname === "siteid"){ filcon=checkFilter(filcon); filcon+= targetname+"='"+objname.value+"'"; } else if (objname.value.length>0){ filcon=checkFilter(filcon); var find = '"'; var repOriginalValue = new RegExp(find, 'g'); var value = objname.value; value = value.replace(repOriginalValue,'\\\"'); filcon+= "upper("+targetname+") like upper('%"+value+"%')"; } return filcon; } } function GoDelete(){} function GoUpdate(){} function goHelp(helpName,inputName){ with(document.cscform){ var helpReturn; var fixcon=__fixCon.value; __fixCon.value=""; if(inputName==="__siteid" ){ helpReturn="__siteid:siteid"; } linkHelp_Return(helpName,helpReturn); __fixCon.value=fixcon; } } function linkHelp(input){ var param="PRU084.jsp?__helpName=MSITENAMEHELP&__helpReturn="+input+":siteid&__pageCall=SWAPLANGEDIT&__fixCon=&__checkVerify=off"; win = window.open(param,"Help","left=150,top=150,width=600,height=400,toolbar=no,status=yes,scrollbars=yes,resizable=yes"); if(window.focus){win.focus();} } function GoClean(){ with(document.cscform){ decheckAll(); __siteid.value=""; __searchcodeid.value=""; __searchthai.value=""; __searcheng.value=""; __cmd.value=""; } } function checkEmpty(){ with(document.cscform){ if(__siteid.value === ""){ __siteid.focus(); return true; } return false; } } function goPage(page){ with(document.cscform){ __goPage.value=page; submit(); } } function GoSave() { with(document.cscform){ var obj = { savejson : jsonArray }; $.extend(true, jsObjJSON, obj); console.log("jsObjJSON ==> "+JSON.stringify( jsObjJSON )); __objJSON.value = JSON.stringify( jsObjJSON ); __cmd.value = "save"; submit(); } } function deleteChild() { with(document.cscform){ var deleteArray = []; var i = 1; var obj = { savejson : deleteArray }; $(".delcb").each(function(index,value){ if($(this).is(':checked')){ var value = $(this).val().split("$"); deleteArray.push({"siteid":value[0],"line_no":value[1]}); i++; } }); $.extend(true, jsObjJSON, obj); console.log("jsObjJSON ==> "+JSON.stringify( jsObjJSON )); __objJSON.value = JSON.stringify( jsObjJSON ); __cmd.value = "delete"; submit(); } } function addChild(){ with(document.cscform){ if(!checkEmpty()){ setAndGetCheckedValueModule(); __fixCon.value = ""; __cmd.value = "addchild"; submit(); } else { alertSiteId(); } } } function GoExport(){ with(document.cscform){ var chk = true; var getRadioLangValue = $('input[name="exportradio"]:checked').val(); var getRadioConditionValue = $('input[name="conditionradio"]:checked').val(); var getSiteID = ""; if($('input[name="siteid_export"]').val() !== ""){ getSiteID = $('input[name="siteid_export"]').val(); } else { alertSiteId(); chk = false; } var chkArray = []; var getTypeExport = $('input[name="type_exportradio"]:checked').val(); if(getTypeExport === "OLD"){ getRadioLangValue = "OLD"; } $('input[name="module_export"]:checked').each(function() { var getCode = $(this).val(); chkArray.push(getCode); }); if(chkArray.length === 0){ //CheckModule if(lang === 'tha'){ alert('กรุณาเลือก Module'); } else { alert('Please Choose Module'); } chk = false; } if(chk){ console.log("getSiteID ==> "+getSiteID+", getRadioLangValue ==> "+getRadioLangValue+", getRadioConditionValue ==> "+getRadioConditionValue+", chkArray ==> "+chkArray+", getTypeExport ==> "+getTypeExport); export_xml.export_zip(getSiteID, getRadioLangValue, getRadioConditionValue, chkArray, getTypeExport, callBackJ); $("#modal_export_file").dialog('close'); } } } function callBackJ(data){ var filename = data; var param="../FileDownload.jsp?uploadfield=export_xml.xmlmenu&filename="+filename; win = window.open(param,"Export File"); } function swaptype(obj){ with(document.cscform){ var type_swap = document.getElementById("New_type"); var data = obj.value; if( data == "NEW"){ type_swap.style.display = ""; } else { type_swap.style.display = "none"; } } } function enterPress(event){ if(event.keyCode === 13){ document.getElementById('GoSearch').focus(); } } $(document).ready(function(){ var beforeinput = ""; $(".inputcode").focus(function() { beforeinput = $(this).val(); }); $(".inputcode").change(function() { var this_attr_name = $(this).attr('name'); var this_module = this_attr_name; this_module = this_module.replace("CODEID","MODULE"); var this_siteid = this_attr_name; this_siteid = this_siteid.replace("CODEID","SITEID"); var this_codeid_value = $(this).val(); var this_module_value = $("select[name$='"+this_module+"']").val(); var this_siteid_value = $("input[name$='"+this_siteid+"']").val(); var chk = true; $(".inputcode").each(function(){ var each_attr_name = $(this).attr('name'); each_attr_name = each_attr_name.replace("CODEID","MODULE"); var chkmodule = $("select[name$='"+each_attr_name+"']").val(); each_attr_name = each_attr_name.replace("MODULE","SITEID"); var chksiteid = $("input[name$='"+each_attr_name+"']").val(); var chkcodeid = $(this).val(); if($(this).attr('name') !== this_attr_name){ if(this_siteid_value === chksiteid && this_codeid_value === chkcodeid && this_module_value === chkmodule){ chk = false; } } }); if(chk){ chkDuplicateValue(this_siteid_value, this_codeid_value, this_module_value, this_attr_name, beforeinput); } else { var data = ["TRUE", this_attr_name, beforeinput]; callBackBoolean(data); } }); function chkDuplicateValue(siteid, codeid, module, inputname, beforeinput){ ChkDuplicateValue.process(siteid, codeid, module, inputname, beforeinput, callBackBoolean); } function callBackBoolean(data){ if(data[0] === "TRUE"){ if(lang === 'tha'){ alert('รหัสภาษาซ้ำ\nกรุณากรอกรหัสภาษาใหม่'); } else { alert('CODEID Has Duplicate\nPlease Try Again'); } $("input[name$='"+data[1]+"']").val(data[2]); } else { setObjValue(data[1]); } } $( ".swaplang_chkinput input" ).focus(function() { inputvalue = $(this).val(); $(this).blur(function(){ if($(this).val() != inputvalue){ setObjValue($(this).attr('name')); } }); }); $( ".swaplang_chkinput select" ).change(function() { setObjValue($(this).attr('name')); }); function setObjValue(dataname){ var inputname = dataname.split("$"); var siteid = inputname[1]; var line_no = inputname[2]; inputname = "__SITEID$"+siteid+"$"+line_no; var siteid = $("input[name$='"+inputname+"']").val(); inputname = "__CODEID$"+siteid+"$"+line_no; var codeid = $("input[name$='"+inputname+"']").val(); inputname = "__THAI$"+siteid+"$"+line_no; var thai = $("input[name$='"+inputname+"']").val(); inputname = "__ENG$"+siteid+"$"+line_no; var eng = $("input[name$='"+inputname+"']").val(); inputname = "__MODULE$"+siteid+"$"+line_no; var module = $("select[name$='"+inputname+"']").val(); setObjArray(line_no, siteid, codeid, thai, eng, module); console.log("jsonArray ==> "+JSON.stringify( jsonArray )); } function setObjArray(line_no, siteid, codeid, thai, eng, module){ var chk = true; for (var i=0; i<jsonArray.length; i++){ if (jsonArray[i]["line_no"]) { var valueOldLineNo = jsonArray[i]["line_no"]; var valueOldSiteId = jsonArray[i]["siteid"]; if(valueOldLineNo === line_no && valueOldSiteId === siteid){ jsonArray[i]["line_no"] = line_no; jsonArray[i]["siteid"] = siteid; jsonArray[i]["codeid"] = codeid; jsonArray[i]["thai"] = thai; jsonArray[i]["eng"] = eng; jsonArray[i]["module"] = module; chk = false; } } } if(chk){ jsonArray.push({"line_no":line_no, "siteid":siteid, "codeid":codeid, "thai":thai, "eng":eng, "module":module}); } } //----------------- Set Dialog UI import ------------------- $("#modal_import_file").dialog({ autoOpen: false, minHeight: 100, width: 350, modal: true, closeOnEscape: true, draggable: false, resizable: false, buttons: { 'Yes': function(){ callback(); }, 'No': function(){ $(this).dialog('close'); } } }); $("#modal_export_file").dialog({ autoOpen: false, minHeight: 200, width: 500, modal: true, closeOnEscape: true, draggable: true, resizable: true, buttons: { 'Yes': function(){ GoExport(); }, 'No': function(){ $(this).dialog('close'); } } }); $("#modal_confirm_delete").dialog({ autoOpen: false, minHeight: 100, width: 350, modal: true, closeOnEscape: true, draggable: false, resizable: false, buttons: { 'Yes': function(){ deleteChild(); $(this).dialog('close'); }, 'No': function(){ $(this).dialog('close'); } } }); //----------------- delete ------------------- $(".portlet-delete").click( function() { $("#modal_confirm_delete").dialog( "option", "position", { my: "center top", at: "center top+200", of: window } ).dialog('open'); }); //----------------- export ------------------- $(".portlet-export").click( function() { setModuleExport(); $("input[name='siteid_export']").val($("input[name='__siteid']").val()); $("#modal_export_file").dialog( "option", "position", { my: "center top", at: "center top+200", of: window } ).dialog('open'); }); //------ function Export ------- function setModuleExport(){ var mainModule = ""; $(".module_main").each(function(){ if($(this).prop('checked')){ if(mainModule !== ""){ mainModule += ","; } mainModule += $(this).val(); } }); var mainArray = mainModule.split(","); console.log("Main module ==> "+mainArray); $(".module_export").each(function(){ if($.inArray( $(this).val(), mainArray ) !== -1){ $(this).prop('checked',true); console.log("true"); } else { $(this).prop('checked',false); console.log("false"); } }); } //----------------- import ------------------- $(".portlet-import").click( function() { if(!checkEmpty()){ $("#modal_import_file").dialog( "option", "position", { my: "center top", at: "center top+200", of: window } ).dialog('open'); } else { alertSiteId(); } }); //------ function Import ------- function callback(){ var getPath = $("input[name$='__FILEIMPORT']").val(); if(getPath.indexOf(".xml") != -1 && getPath.indexOf("SWAPLANG") != -1){ handleFileSelect(); $("#modal_import_file").dialog( "close" ); }else{ alert("กรุณาเลือกไฟล์ swaplang.xml เท่านั้น"); } } function handleFileSelect(){ if (window.File || window.FileReader || window.FileList || window.Blob) {//(support IE 10+ ,Chrome, Firefox etc.) ps2. File API input = document.getElementById('__FILEIMPORT'); var getPath = $("input[name$='__FILEIMPORT']").val(); var type = $("select[name$='__Module_option']").val(); $('input[name="__dataimportType"]').val(type); if (!input) { alert("Um, couldn't find the fileinput element."); } else if (!input.files) { alert("This browser doesn't seem to support the `files` property of file inputs."); } else if (!input.files[0]) { alert("Please select a file before clicking 'Load'"); } else { file = input.files[0]; fr = new FileReader(); fr.onload = function(e) { if(getPath.indexOf(".json") != -1 || getPath.indexOf(".txt") != -1){ console.log(e.target.result); }else{ sentXmlToServer(e.target.result); } }; fr.readAsText(file, "UTF-8"); } }else if(window.ActiveXObject) {//For Internet Explorer Ver 10 or Below var ForReading = 1, ForWriting = 2, ForAppending = 8; var xmlDoc = new ActiveXObject("Scripting.FileSystemObject"); //setting following to http://stackoverflow.com/questions/4153841/ || When Error var getPath = $("input[name$='__FILEIMPORT']").val(); var canload = xmlDoc.OpenTextFile(getPath,ForReading); if (!canload.AtEndOfStream){ sentXmlToServer(canload.ReadAll()); } } } function sentXmlToServer(data){ with(document.cscform){ var jsonXmlArray = {"changelanguage":""}; var xml = $.parseXML(data), $xml = $( xml ); jsonXmlArray.changelanguage = setXMLtoJSONSwapLang($xml.find("changelanguage")); console.log("jsObjJSON ==> "+JSON.stringify( jsObjJSON )); __objJSON.value = JSON.stringify(jsonXmlArray); __moduleImport.value = $("select[name$='__Module_option']").val(); __cmd.value = "import"; submit(); } } function setXMLtoJSONSwapLang(data){ var find = '_'; var repOriginalValue = new RegExp(find, 'g'); var jsonArrayMenu = []; data.children().each(function(){ var thaiValue = $(this).text(); var engValue = $(this)[0].tagName; jsonArrayMenu.push( { "thai": thaiValue, "eng": engValue.replace(repOriginalValue," ") } ); }); return jsonArrayMenu; } }); //--> </script> </head> <body> <div id="toolTipLayer" style="position:absolute; visibility: hidden"></div> <script language="javascript">initToolTips();</script> <form name="cscform" method="post" action="SWAPLANGEDIT.jsp"> <!----------BEGIN CSC INITIAL ZONE ------------------------> <%=screen.InitialVariable()%> <!----------END CSC INITIAL ZONE --------------------------> <input type="hidden" name="__cmd" value=""/> <input type="hidden" name="__help" value=""/> <input type="hidden" name="__notNull" value=""/> <input type="hidden" name="__helpReturn" value=""/> <input type="hidden" name="__helpName" value=""/> <input type="hidden" name="__pageCall" value=""/> <input type="hidden" name="__referPage" value=""/> <input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>"/> <input type="hidden" name="__lockPage" value=""/> <input type="hidden" name="__goPage" value=""/> <input type="hidden" name="__calendar"/> <input type="hidden" name="__screen" value="SWAPLANGEDIT"/> <input type="hidden" name="__webid"/> <input type="hidden" name="__readposter"/> <input type="hidden" name="__employeeid" value=""/> <input type="hidden" name="__docno" value=""/> <input type="hidden" name="__formulaid" value=""/> <input type="hidden" name="__fixCon" value="<%=condition%>"/> <input type="hidden" name="__orderBy" value="<%=request.getParameter("__orderBy")%>"/> <input type="hidden" name="__companyid" value="<%=screen.getUProfile().get("companyid")%>"/> <input type="hidden" name="__complainid" value=""/> <input type="hidden" name="__getcheckvalue" value="<%=request.getParameter("__getcheckvalue")%>"/> <input type="hidden" name="__objJSON" value=""/> <input type="hidden" name="__moduleImport" value=""/> <input type="hidden" name="__jsonHeader" value="savejson"/> <script language="javascript">getInputFormatDate();</script> <% String[] getCheckValue = {"'start'"}; String checkNull = request.getParameter("__getcheckvalue"); if(checkNull!=null && !checkNull.isEmpty()){ getCheckValue = checkNull.split(","); } %> <script language="JavaScript" src="../JS/HOTKEY.js"></script> <script language="javascript"> var titlename=swap2String('Swap Language Edit'); document.write(Icons("SWAPLANGEDIT,"+titlename)); </script> <br/> <div align="center"> <table cellpadding="0" cellspacing="0" class="largest"> <tr> <td colspan="2" class="header" >SWAPLANGEDIT, <script language="javascript">swapLang(titlename);</script> </td> </tr> <tr> <td> <table class="maxsize" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td colspan="12" class="blankspace"> <table width="638" border="0" align="center" cellpadding="0" cellspacing="1" class="inframe "> <tr> <td colspan="2" class="blankspace"></td> </tr> <tr> <td class="columnlabel"><%=screen.getLabel("siteid")%> </td> <td class="columnobject1"><%=screen.getInput("siteid")%></td> </tr> <tr> <td class="columnlabel"></td> <td class="columnobject1">---------------------------------Search---------------------------------</td> </tr> <tr> <td class="columnlabel">Module </td> <td class="columnobject1"> <table width="200" border="0" align="left" cellpadding="0" cellspacing="1"> <% int count = 0; for(int i = 0;i<listModule.length;i++){ if(i%4==0){ %> <tr> <% } boolean createCheckedBox = false; for(int j =0;j<getCheckValue.length;j++){//Check CheckBox when CheckBox is checked String foo = getCheckValue[j]; if(foo.indexOf("'") != -1){ //Check Null Value if(getCheckValue[j].split("'")[1].equals(listModule[i].split(",")[0])){ createCheckedBox = true; } } } if(createCheckedBox){ %> <td class="columnobject1"> <input type="checkbox" value=<%=listModule[i].split(",")[0]%> name="checkboxmodule" class="module_main" checked/> <%=listModule[i].split(",")[1]%> </td> <% } else { %> <td class="columnobject1"> <input type="checkbox" value=<%=listModule[i].split(",")[0]%> name="checkboxmodule" class="module_main"/> <%=listModule[i].split(",")[1]%> </td> <% } count = count + 1; if(count>0&&count%4==0){ %> </tr> <% count = 0; } } %> </table> </td> </tr> <tr> <td class="columnlabel"> </td> <td class="columnobject1"> <a href="javascript:;" onClick="checkAll()"><img src="../IMAGES/BUTTON/SELECTALL.gif" border="0"></a> <a href="javascript:;" onClick="decheckAll()"><img src="../IMAGES/BUTTON/DESELECTALL.gif" border="0"></a> </td> </tr> <tr> <td class="columnlabel"><%=screen.getLabel("CODEID")%> </td> <td class="columnobject1"><input type="Text" name="__searchcodeid" size="50" value="<%=searchcodeid%>" onkeydown="enterPress(event)"></td> </tr> <tr> <td class="columnlabel"><%=screen.getLabel("THAI")%> </td> <td class="columnobject1"><input type="Text" name="__searchthai" size="50" value="<%=searchthai%>" onkeydown="enterPress(event)"></td> </tr> <tr> <td class="columnlabel"><%=screen.getLabel("ENG")%> </td> <td class="columnobject1"><input type="Text" name="__searcheng" size="50" value="<%=searcheng%>" onkeydown="enterPress(event)"></td> </tr> <tr> <td class="columnlabel"> </td> <td> <a href="javascript:GoSearch();" id="GoSearch"><img src="../IMAGES/BUTTON/SEARCH.gif" border="0"></a> <span class="portlet-export"><img src="../IMAGES/BUTTON/EXPORT.gif" border="0"></span> </td> </tr> <tr> <td colspan="2" class="columnlabel"></td> </tr> </table> <br/> <div align="right" class="style1"><%=screen.getPageTag()%></div> <table width="638" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#808080" class="inframe" id="resultData"> <tr class="title1"> <td width="2%" class="row3" align="center"><swaplang code="SW000289"></swaplang></td> <td width="4%" nowrap class="row3" align="center"><swaplang code="SW001393"></swaplang></td> <td width="5%" nowrap class="row3" align="center"><%=screen.getLabel("swaplang_detail","siteid")%></td> <td width="15%" nowrap class="row3" align="center"><%=screen.getLabel("swaplang_detail","codeid")%></td> <td width="25%" nowrap class="row3" align="center"><%=screen.getLabel("swaplang_detail","thai")%></td> <td width="25%" nowrap class="row3" align="center"><%=screen.getLabel("swaplang_detail","eng")%></td> <td width="23%" nowrap class="row3" align="center"><%=screen.getLabel("swaplang_detail","module")%></td> </tr> <% if (numpage.indexOf("+") >= 0 || numpage.indexOf("-") >= 0){ numpage = numpage.substring(1, numpage.length()); } int i = (maxLine * Integer.parseInt(numpage)) - (maxLine - 1); while (screen.nextRec()) { if(screen.checkLinePage()){ int line_no = Integer.parseInt(screen.getString("swaplang_detail","line_no")); String row_siteid = screen.getString("swaplang_detail","siteid"); ListBox listbox1 = new ListBox(); listbox1.setUProfile(screen.getUProfile()); listbox1.setName("MODULE$"+row_siteid+"$"+line_no); //ชื่อ ListBox listbox1.setValidCode("MODULETYPE_SWAPLANG"); //tag Systemcode ที่เรียกใช้ listbox1.setDisable("false"); listbox1.setChecked(screen.getString("swaplang_detail","module")); %> <tr align="center"> <td><input class="delcb" type="checkbox" name="__DEL$<%=row_siteid%>$<%=line_no%>" value="<%=row_siteid%>$<%=line_no%>"></td> <td><%=i%></td> <td><%=row_siteid%><input type="hidden" name="__SITEID$<%=row_siteid%>$<%=line_no%>" value="<%=row_siteid%>"></td> <td><input type="Text" name="__CODEID$<%=row_siteid%>$<%=line_no%>" size="12" value="<%=screen.getString("swaplang_detail","codeid")%>" class="inputcode"></td> <td class="swaplang_chkinput"><input type="Text" name="__THAI$<%=row_siteid%>$<%=line_no%>" size="30" value="<%=screen.getString("swaplang_detail","thai")%>"></td> <td class="swaplang_chkinput"><input type="Text" name="__ENG$<%=row_siteid%>$<%=line_no%>" size="30" value="<%=screen.getString("swaplang_detail","eng")%>"></td> <td class="swaplang_chkinput"><%=listbox1.process()%></td> </tr> <% } if(screen.outLinePage()){ break; } i++; } %> </table> </td> </tr> <tr> <td colspan="2" class="blankspace"></td> </tr> <tr> <td colspan="2" align="center"> <a href="javascript:;" onClick="addChild()"><img src="../IMAGES/BUTTON/ADD.gif" border="0"></a> <span class="portlet-import"><img src="../IMAGES/BUTTON/BROWSE.gif" border="0"></span> <span class="portlet-delete"><img src="../IMAGES/BUTTON/DELETE.gif" border="0"></span> </td> </tr> <tr> <td colspan="2" class="blankspace"></td> </tr> <tr> <td colspan="2" class="bottom"></td> </tr> </table> </td> </tr> </table> </div> <!---------- POPUP Jquery UI ------------------------> <div id="modal_import_file" class="portlet-popup" title="Import File"> <div id="dialog_tips" align="center"> <swaplang code="SW011600"></swaplang> :: SWAPLANG.xml </div> <br/> <div id="dialog_tips" align="left"> Module: <%=listboxStandard.process()%> </div> <br/> <input name="__FILEIMPORT" id="__FILEIMPORT" type="file" size="30" accept="text/xml,text/json,text/txt"/> </div> <div id="modal_confirm_delete" class="portlet-popup" title="Confirm Delete?"> <span> <swaplang code="SW011601"></swaplang> </span> </div> <div id="modal_export_file" class="portlet-popup" title="Export File"> <table border="1" class="inframe bgwhite"> <tr> <td width="150"> <%=screen.getLabel("siteid")%> </td> <td> <input name="siteid_export" size="10" readonly="true" alt="SITEID" onmousemver="toolTip('SITEID')" type="Text"/> <a href="javascript:linkHelp('siteid_export');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('siteid_export_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <img src="http://localhost:8082/hr/IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="siteid_export_image" align="absmiddle" border="0" height="20" width="20"/> </a> </td> </tr> <tr> <td width="80"> Module </td> <td width="350"> <table border="0" align="left" cellpadding="0" cellspacing="1" class="inner2"> <% count = 0; for(i = 0;i<listModule.length;i++){ if(i%2==0){ %><tr><% } %> <td class="columnobject1"> <input type="checkbox" value=<%=listModule[i].split(",")[0]%> name="module_export" class="module_export"/> <%=listModule[i].split(",")[1]%> </td> <% count = count + 1; if(count>0&&count%4==0){ %></tr><% count = 0; } } %> </table> </td> </tr> <tr> <td width="150"> Condition Value </td> <td> <input type="radio" name="conditionradio" value="MODULE" checked> Module</input> <input type="radio" name="conditionradio" value="CENTER"> Center</input> </td> </tr> <tr> <td> Type Export </td> <td> <input onclick="swaptype(this);" type="radio" name="type_exportradio" value="OLD" checked> OLD</input> <input onclick="swaptype(this);" type="radio" name="type_exportradio" value="NEW" > NEW</input> </td> </tr> <tr style="display: none;" id="New_type"> <td> Language Export </td> <td> <input type="radio" name="exportradio" value="ALL" checked> All</input> <input type="radio" name="exportradio" value="THAI"> Thai</input> <input type="radio" name="exportradio" value="ENG"> Eng</input> </td> </tr> </table> </div> </form> </body> </html>