<%@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.report.*"%> <%@ page import="com.csc.library.entry.*,com.csc.library.entity.*,com.csc.library.database.*,com.csc.library.session.*" %> <%@ include file="CHECKPROFILE.jsp" %> <jsp:useBean id="CSCQUQUE" class="com.csc.library.system.Task" scope="page" /> <jsp:useBean id="CSCQUQUE01" class="com.csc.library.system.Task" scope="page" /> <% CSCQUQUE.setChannel(request, response); UIManager screenq = (UIManager) CSCQUQUE.process("SingleEntry","CSC_QUQUE"); CSCQUQUE01.setChannel(request, response); HelpEntry screen = (HelpEntry) CSCQUQUE01.process("HelpEntry","CSC_QUQUEHELP"); screen.setMaxLine(30); screen.getInquiry().setFilter("process_status<>'D' and user_name = '"+screen.getUProfile().get("username")+"'"); CheckNull chk=new CheckNull(); ThaiUtilities thai = new ThaiUtilities(); ReportUDF rf=new ReportUDF(); String module[]=rf.getSystemCode("MODULELIST",screen.getUProfile().get("lang")); String gopage=chk.chkNullString(request.getParameter("__goPage"),"+1"); %> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" > <link href="./CSS/MENU.css" rel="stylesheet" type="text/css"> <link href="./CSS/TISCO.css" rel="stylesheet" type="text/css"> <script language='javascript' src="./JS/VIEWCALENDAR.js"></script> <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 type='text/javascript' src='/hr/dwr/interface/SearchDWR.js'></script> <script type='text/javascript' src='/hr/dwr/engine.js'></script> <script type='text/javascript' src='/hr/dwr/util.js'></script> <script type="text/javascript" src="/hr/dwr/interface/SystemCode.js"></script> <script type="text/javascript" src="/hr/dwr/interface/CscCalendar.js"></script> <script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script> <script language="JavaScript" type="text/JavaScript"> <!-- function chkDateTime2(valueSearch,comm){ // 23/03/2004 var tmpval=""; with(document.cscform){ var valueSearch1=valueSearch.split(comm); if(valueSearch1.length==3){ if(valueSearch1[1].length==1){ valueSearch1[1]="0"+valueSearch1[1]; } if(valueSearch1[0].length==1){ valueSearch1[0]="0"+valueSearch1[0]; } valueSearch1[2]=parseInt(valueSearch1[2]); return valueSearch=valueSearch1[2]+"-"+valueSearch1[1]+"-"+valueSearch1[0]; } } } function ownerList(){ var own; var ownlist=""; with(document.cscform){ var len=parseFloat("<%=module.length%>"); for(var m=0;m<len;m++){ own=eval("owner"+m); if(own.checked){ ownlist+="'"+own.value+"',"; } } } if(ownlist.length>0){ ownlist=ownlist.substring(0,ownlist.length-1); ownlist="owner in ("+ownlist+")"; } return ownlist; } function getOptionlist(){ var optionlist=""; with(document.cscform){ for(i=__usernameList.length;i >0;i--){ optionlist+="'"+__usernameList.options[i-1].value+"',"; } } if(optionlist.length>0){ optionlist=optionlist.substring(0,optionlist.length-1); optionlist="user_name in ("+optionlist+")"; } return optionlist; } function GoSearch() { var filter=""; with(document.cscform) { filter=addPosfix(ownerList()); filter+=addPosfix(getOptionlist()); if(pstatus.value.length>0) filter+=addPosfix("process_status ='"+pstatus.value+"'"); if(ptype.value.length>0) filter+=addPosfix("process_type ='"+ptype.value+"'"); if(pgroup.value.length>0) filter+=addPosfix("process_group ='"+pgroup.value+"'"); filter+=addPosfix("process_status<>'D'"); filter=checkLastFilter(filter); __fixCon.value=filter; search(); } } function addPosfix(filter){ if(filter.length>0) filter+=" and " return filter; } function checkLastFilter(filter){ var substr1=filter.substring(0,filter.length-5); var substr2=filter.substring(filter.length-5,filter.length); if(substr2==" and "){ return substr1; } return filter; } function checkFixCon(inputName,column,num){ var fixcon=""; with(document.cscform){ var input1="" ; var input2 =""; if(num=="2"){ input1=eval(inputName+"1.value"); input2=eval(inputName+"2.value"); }else{ var inputobj=eval(inputName); if(checkLength(inputobj)){ for(var n=0;n<inputobj.length;n++){ if(inputobj[n].checked){ input1=inputobj[n].value; break; } } }else{ input1=eval(inputName+".value"); } } if(input1.length>0 && input2.length>0){ fixcon="("+column+" between '"+input1+"' and '"+input2+"')"; }else{ if(input1.length>0){ fixcon="("+column+" ='"+input1+"' )"; } if(input2.length>0){ fixcon="("+column+" ='"+input2+"' )"; } } } return fixcon; } function checkLength(strfiled){ with(document.cscform){ if((typeof strfiled.length)!="undefined"){ return true; }else{ return false; } } } function GoSave() { beforeSave(); document.cscform.__ququeid.value="-9999"; confirmSave(); } function GoDelete(){ } function GoUpdate(){ } function goHelp(helpName,inputName){ var helpReturn; if(inputName=="__employeeid" ) helpReturn="__employeeid:EMPLOYEEID,__fullname:fullname"; else if(inputName=="__asset1" || inputName=="__asset2" ) helpReturn=inputName+":assetid,"+inputName+"desc:tdesc"; else if(inputName=="__astype1" || inputName=="__astype2" ) helpReturn=inputName+":astypeid,"+inputName+"desc:tdesc"; linkHelp_Return(helpName,helpReturn); } function beforeSave(){ with(document.cscform){ __statuslist.value=""; if(checkLength(__delprocess)){ for(var v=0;v<__delprocess.length;v++){ if(__delprocess[v].checked){ __statuslist.value+=__delprocess[v].value+","; } } }else{ if(__delprocess.checked) __statuslist.value+=__delprocess.value+","; } } } function goHelp1(helpName,inputName,listName){ var helpReturn; var key; var tdesc="empid",edesc=""; if (inputName=="__usernameList" ) { helpReturn="usernameid"; key="usernameid"; } with(document.cscform){ if (__fixCon.value!="") __fixCon.value=__fixCon.value; var param="PRU085.jsp?__helpName="+helpName+"&__helpReturn="+helpReturn +"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off" +"&__listName="+listName+"&__key="+key+"&__tdesc="+tdesc+"&__edesc="+edesc; window.open(param,"Help","left=150,top=150,width=600,height=400,toolbar=no,status=yes,scrollbars=yes,resizable=yes"); } } function addOption(objOption,objList) { addToOption(objOption,objList) ; } // End of addOption() function addToOption(objOption,destList) { var lengthAll = parseInt(objOption.length)+parseInt(destList.options.length); newDestList = new Array(lengthAll); var clen=0; for(len=0; len<destList.options.length; len++) { if (destList.options[len] != null) { newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected ); clen++; } } for ( var j = 0 ; j < objOption.length; j++ ) { if ( objOption[ j ] != null ) { newDestList[ clen ] = objOption[ j ]; clen++; } } //newDestList.sort( compareOptionValues ); for( var i = destList.options.length - 1; i >= 0; i-- ) { if ( destList.options[i] != null ) { destList.options[i] = null; } } for ( var j = 0; j < newDestList.length; j++ ) { if ( newDestList[ j ] != null ) { destList.options[ j ] =new Option(newDestList[ j ].text,newDestList[ j ].value); } } } // End of addToOption() function findKey(objOption,myList){ for ( var j = 0 ; j < objOption.length; j++ ) { for(var i=0;i < myList.length;i++){ if(objOption[j].value == myList.options[i].value){ alert(myList.options[i].value+" มีข้อมูลแล้ว"); return true; }//if }//for } //for return false; } function viewProcess(page,key){ with(document.cscform){ action=page+".jsp"; __help.value="__ququeid#"+key+",__companyid#<%=screen.getUProfile().get("companyid")%>"; __ququeid.value=key; __cmd.value="search"; submit(); } } function checkAll(){ with(document.cscform){ for(i=0;i<elements.length;i++){ if(elements[i].type=="checkbox" && elements[i].name.indexOf("owner")) elements[i].checked=true; }//end for }//end with }//end function function decheckAll(){ with(document.cscform){ for(i=0;i<elements.length;i++){ if(elements[i].type=="checkbox" && elements[i].name.indexOf("owner")) elements[i].checked=false; }//end for }//end with }//end function function goPreview(fName){ window.open("./REPORT/"+fName); } EngCode[250]= " Do you want cancel proceee ? "; ThaiCode[250]= " ต้องการยกเลิก Process หรือไม่ ?"; function cancelProcess(processid) { var bcon=confirm(MyCode[250]); with(document.cscform){ if(bcon){ __ququeid.value="-99999"; __cmd.value="save"; __cancelprocess.value=processid; __confirm.value="s"; submit(); } } } function dirtypop(objname) { var generator=window.open('','name','height=400,width=500,scrollbars=yes,resizable=yes'); generator.document.write('<html><head><title>Popup</title>'); generator.document.write('<link rel="stylesheet" href="style.css">'); generator.document.write('</head><body>'); generator.document.write('<p>'+eval("document.cscform."+objname+".value")+'</p>'); generator.document.write('</body></html>'); generator.document.close(); } function init() { fillTable(); } function useLoadingMessage(message) { var loadingMessage; if (message) loadingMessage = message; else loadingMessage = "<b>Loading...<b>"; DWREngine.setPreHook(function() { var disabledZone = $('disabledZone'); $('messageZone').innerHTML = loadingMessage; disabledZone.style.visibility = 'visible'; }); DWREngine.setPostHook(function() { $('disabledZone').style.visibility = 'hidden'; }); } function fillTable() { useLoadingMessage(); DWREngine.beginBatch(); SearchDWR.searchDBXMLAll(new Array("CSC_QUQUEHELP","csc_quque.cancle_time,csc_quque.user_name,csc_quque.ququeid,csc_quque.class_name,csc_quque.condition,csc_quque.process_msg,csc_quque.process_group,csc_quque.end_time,csc_quque.parentid,csc_quque.employeeid,csc_quque.next_time,csc_quque.screen_name,csc_quque.process_type,csc_quque.remote_ip,csc_quque.interval_type,csc_quque.owner,csc_quque.ename,csc_quque.cancle_by,csc_quque.remark,csc_quque.interval,csc_quque.tname,csc_quque.companyid,csc_quque.process_priority,csc_quque.cancle_msg,csc_quque.process_status,csc_quque.start_time,csc_quque.server_name,csc_quque.result_type,csc_quque.ptype,csc_quque.csc_log,csc_quque.jobname,csc_quque.longtime","csc_quque:process_status='R' ","server_name,ququeid","langon"),filltablevalue); DWREngine.endBatch({ async:false, timeout:1000 }); setTimeout("fillTable();",30000); } var filltablevalue=function (data1){ /* [0 cancle_time] [1 user_name] [2 ququeid] [3 class_name] [4 condition] [5 process_msg] [6 process_group] [7 end_time] [8 parentid] [9 employeeid] [10 next_time] [11 screen_name] [12 process_type] [13 remote_ip] [14 interval_type] [15 owner] [16 ename] [17 cancle_by] [18 remark] [19 interval] [20 tname] [21 companyid] [22 process_priority] [23 cancle_msg] [24 process_status] [25start_time] [26 server_name] [27 result_type] [28 ptype] [29 csc_log] [30 jobname][31 longtime] */ var id; var rtype=""; var msg=""; var tmpmsg=""; var clog=""; for(var i=0;i<data1.length;i++){ id=data1[i][2]; if(data1[i][27]=="EXPORT_PDF"){ rtype="PDF"; }else if(data1[i][27]=="EXPORT_HTML"){ rtype="HTML"; }else if(data1[i][27]=="EXPORT_XML"){ rtype="XML"; }else if(data1[i][27]=="EXPORT_CSV_COM"){ rtype="CSV"; }else if(data1[i][27]=="EXPORTFILE"||data1[i][27]=="EXPORT_TXT"){ rtype="TXT"; }else if(data1[i][27]=="EXPORT_XLS"){ rtype="XLS"; } else{ rtype=""; } msg=data1[i][5]; if(msg.length>0){ if(msg.length>20){ msg=msg.substring(0,20)+"..."; }else{ msg=msg.substring(0,msg.length)+"..."; } } clog=data1[i][29]; if(clog.length>0) clog="<a href=javascript:goPreview('"+id+"log.txt')><img src='IMAGES/WARNING.gif' width='20' height='20' border='0'></a>"; tmpmsg="<a href=javascript:dirtypop('__msg"+id+"')>"+msg+"</a>"; tmpmsg+="<input type='hidden' name='__msg"+id+"' value='"+data1[i][5]+"'>"; DWRUtil.cloneNode("pattern", { idSuffix:id}); DWRUtil.setValue("parentid"+id,data1[i][26]); DWRUtil.setValue("user_name"+id,data1[i][1]); DWRUtil.setValue("jobname"+id,data1[i][30]); DWRUtil.setValue("process_type"+id,data1[i][12]); DWRUtil.setValue("process_priority"+id,data1[i][22]); DWRUtil.setValue("process_group"+id,data1[i][6]); DWRUtil.setValue("process_status"+id,data1[i][24]); DWRUtil.setValue("owner"+id,data1[i][15]); DWRUtil.setValue("peocess_msg"+id,tmpmsg+clog); DWRUtil.setValue("start_time"+id,data1[i][25]); DWRUtil.setValue("end_time"+id,data1[i][7]); DWRUtil.setValue("longtime"+id,data1[i][31]); $("pattern" + id).style.display = ""; } } //--> </script> <style type="text/css"> <!-- .style1 {color: #FF0000} .layout { width: 100px; table-layout: fixed; } span.label1{ color:#FFFFFF; background-color:#FF0000; position:absolute; left:90%; top:0px; } --> </style> </head> <body > <div class="centered"> <div id="disabledZone" style="position:absolute; left:92%;top:0px;visibility: hidden"><span id="messageZone" class="label1"></span></div> <div id="toolTipLayer" style="position:absolute; visibility: hidden"></div> <script language="javascript">initToolTips();</script> <form name="cscform" method="post"> <!----------BEGIN CSC INITIAL ZONE ------------------------> <%=screen.InitialVariable()%> <!----------END CSC INITIAL ZONE --------------------------> <input type="hidden" name="__calendar"> <input type="hidden" name="__screen" value="CSCQUQUE01"> <input type="hidden" name="__webid"> <input type="hidden" name="__readposter"> <script language="javascript">getInputFormatDate();</script> <input type="hidden" name="__cmd" value=""> <input type="hidden" name="__help" value=""> <input type="hidden" name="__goPage" value="<%=gopage%>"> <input name="__notNull" type="hidden" value="<%//=screen.getRequire()%>"> <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 name="__language" type="hidden" value="<%=screen.getUProfile().get("lang")%>"> <input type="hidden" name="__lockPage" value=""> <input name="__fixCon" type="hidden" value=""> <input type="hidden" name="__orderBy" value="<%=request.getParameter("__orderBy")%>"> <input type="hidden" name="__companyid" value="<%=screen.getUProfile().get("companyid")%>"> <input type="hidden" name="__ququeid" value=""> <input type="hidden" name="__statuslist" value=""> <input type="hidden" name="__confirm" value=""> <input type="hidden" name="__cancelprocess" value=""> <script language="JavaScript" src="./JS/HOTKEY.js"></script> <script language="javascript"> var titlename=swap2String('Process running'); </script> <!--span class="label1" id="loading"></span--> <br> <div align="center"> <% screen.process();%> <table width="638" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#808080" class="inframe"> <tr class="title1"> <td colspan="12" nowrap="nowrap" class="header"><div align="right"><span class="header">CSCQUQUE04, <script language="javascript">swapLang(titlename);</script> </span></div></td> </tr> <tr class="title1"> <td width="5%" class="title1" nowrap="nowrap"><div align="center"><%=screen.getLabel("server_name")%></div></td> <td width="8%" class="title1"><div align="center"><%=screen.getLabel("user_name")%></div></td> <td width="20%" class="title1"><div align="center"><%=screen.getLabel("tname")%></div></td> <td width="2%" class="title1"><div align="center">TY</div></td> <td width="2%" class="title1"><div align="center">PP</div></td> <td width="2%" class="title1"><div align="center">GP</div></td> <td width="2%" class="title1"><div align="center">ST</div></td> <td width="9%" class="title1"><div align="center"><%=screen.getLabel("owner")%></div></td> <td width="14%" class="title1"><div align="center"><%=screen.getLabel("process_msg")%></div></td> <td width="8%" class="title1"><div align="center"><%=screen.getLabel("start_time")%></div></td> <td width="8%" class="title1"><div align="center"><%=screen.getLabel("end_time")%></div></td> <td width="8%" class="title1"><div align="center"> <script language="javascript">swapLang("Total time");</script></div></td> </tr> <tbody id="peoplebody"> <tr id="pattern" style="display:none;"> <td width="5%" nowrap="nowrap"><span id="parentid"></span></td> <td width="8%" ><span id="user_name"></span></td> <td width="20%" ><span id="jobname"></span></td> <td width="2%" ><div align="center"><span id="process_type"></span></div></td> <td width="2%" ><div align="center"><span id="process_priority"></span></div></td> <td width="2%" ><div align="center"><span id="process_group"></span></div></td> <td width="2%" ><div align="center"><span id="process_status"></span></div></td> <td width="9%" ><span id="owner"></span></td> <td width="14%"><span id="peocess_msg"></span></td> <td width="8%" nowrap ><span id="start_time"></span></td> <td width="8%" nowrap ><span id="end_time"></span></td> <td width="8%" nowrap ><div align="center"><span id="longtime"></span></div></td> </tr> </table> <script language="javascript">init();</script> </td> </tr> <tr> <td class="bottom" ></td> </tr> </table></td> </tr> </table> </div> </form> </body> </html>