<%@page contentType="text/html; charset=UTF-8"%> <%@page import="com.csc.library.utilities.CscCalendar,com.csc.library.entry.HelpEntry,com.csc.library.system.*"%> <%@page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*,com.csc.library.utilities.*" %> <%@page import="java.util.Calendar,java.util.GregorianCalendar,java.util.HashMap"%> <jsp:useBean id="SIMASSIGN_KKB1" class="com.csc.library.system.Task" scope="page" /> <jsp:useBean id="AS_ASSIGN_LIST" class="com.csc.library.system.Task" scope="page" /> <% CheckNull chkNull=new CheckNull(); ThaiUtilities thatUtils = new ThaiUtilities(); SIMASSIGN_KKB1.setChannel(request,response); AS_ASSIGN_LIST.setChannel(request,response); UIManager screen = (UIManager) SIMASSIGN_KKB1.process("SingleEntry","SIMASSIGN_KKB1"); HelpEntry screenHelp = (HelpEntry) AS_ASSIGN_LIST.process("HelpEntry", "AS_ASSIGN_LIST"); String whereClause=""; String qs_openwith = request.getParameter("__openwith"); String qs_employeeid = request.getParameter("__employeeid"); String qs_vote1id = request.getParameter("__vote1id"); if(qs_openwith.equals("AS_ASSIGN_KKB")){ //ยังไม่ลาออก และยังไม่เคย ถูกกำหนดให้เป็นผู้ Assign มาก่อน whereClause = " memployee.status in('A') " +" and memployee.employeeid not in (select employeeid from massign_kkb1 ) "; } else if(qs_openwith.equals("AS_VOTE1_KKB")){ //ยังไม่ลาออก และยังไม่เคย ถูกกำหนดให้เป็นผู้ถูกโหวตมาก่อน //และไม่ใช่ผู้ Assign (ตัวเอง) whereClause = " memployee.status in('A') " +" and memployee.employeeid not in (select vote1id from mvote_kkb1 where employeeid='"+ qs_employeeid+"') " +" and memployee.employeeid <> "+ qs_employeeid; }else if(qs_openwith.equals("AS_VOTE2_KKB")){ //ยังไม่ลาออก และยังไม่เคย ถูกกำหนดให้เป็นผู้โหวตมาก่อน //ตัวเอง และ บอสตัวเอง ถูก add ให้อนุมัติไปแล้ว ตอน add ผู้ถูกโหวต whereClause = " memployee.status in('A') " +" and memployee.employeeid not in (select vote2id from mvote_kkb2 where employeeid='"+ qs_employeeid+"' and vote1id='"+ qs_vote1id+"') "; }//end if String curBu1Id =""; String curBu2Id = ""; String curBu3Id = ""; String curPositionId = ""; String curEmployee_name = ""; String curNickName = ""; if(request.getParameter("__cmd") != null && request.getParameter("__cmd").equals("search")) { if(request.getParameter("__mbu1_id")!=null && !request.getParameter("__mbu1_id").equals("")){ curBu1Id = " and memployee.bu1 ='" + request.getParameter("__mbu1_id")+"'"; }//end if if(request.getParameter("__mbu2_id")!=null && !request.getParameter("__mbu2_id").equals("")){ curBu2Id = " and memployee.bu2 ='" + request.getParameter("__mbu2_id")+"'"; }//end if if(request.getParameter("__mbu3_id")!=null && !request.getParameter("__mbu3_id").equals("")){ curBu3Id = " and memployee.bu3 ='" + request.getParameter("__mbu3_id")+"'"; }//end if if(request.getParameter("__positionid")!=null && !request.getParameter("__positionid").equals("")){ curPositionId = " and memployee.emp_position='" + request.getParameter("__positionid")+"'"; }else{ //ผู้โหวต ไม่ต้อง กรอง position if(!qs_openwith.equals("AS_VOTE2_KKB")){ curPositionId =" and memployee.emp_position between 'P08' and 'P16' "; }//end if }//end if if(request.getParameter("Employee_name")!=null && !request.getParameter("Employee_name").equals("")){ curEmployee_name = " and memployee.fname like'%" + new String(request.getParameter("Employee_name").getBytes("ISO8859_1"),"UTF-8")+"%'"; }//end if if(request.getParameter("NickName")!=null && !request.getParameter("NickName").equals("")){ curNickName = " and memployee.nickname like'%" + new String(request.getParameter("NickName").getBytes("ISO8859_1"),"UTF-8")+"%'"; }//end if whereClause+=curBu1Id+curBu2Id+curBu3Id+curPositionId+curEmployee_name+curNickName; }else{ //ผู้โหวต ไม่ต้อง กรอง position if(!qs_openwith.equals("AS_VOTE2_KKB")){ curPositionId =" and memployee.emp_position between 'P08' and 'P16' "; }//end if whereClause+=curPositionId; }//end if //out.print("whereClause is:"+ whereClause); screenHelp.getInquiry().setFilter(whereClause); screenHelp.setMaxLine(13); screenHelp.process(); screenHelp.getInquiry().refresh(); //out.print("getFilter is:"+ screenHelp.getInquiry().getFilter()); //out.print("recCount is:"+ screenHelp.getInquiry().recCount()); CscCalendar today = new CscCalendar(); CscCalendar vote_date = new CscCalendar(); String whereClauseMgroupVote = " status = '1' "; UProfile up = new UProfile(); up =screen.getUProfile(); HashMap param = new HashMap(); DbInquiry inq = new InitialInquiry(up).getDbInquiry(); inq.setSchemaName(up.getSchemaName()); inq.setParam(param); inq.initMyTable("mgroup_vote", whereClauseMgroupVote, ""); inq.setColumn("GROUP_QUESID,COMPANYID,VOTE_DATE"); inq.refresh(); int row = 1 ; while (inq.next()) { vote_date = new CscCalendar(inq.getCurrentDbRecord().getString("VOTE_DATE")); }//end while /**================================================= *nuiss edit *06/11/2551 *check relation with boss and employee ==================================================*/ //get bossList String whereClauseSupervisor = " employeeid = '"+qs_vote1id+"'"; String bossList =""; DbInquiry inqSupervisor = new InitialInquiry(up).getDbInquiry(); inqSupervisor.setSchemaName(up.getSchemaName()); inqSupervisor.initMyTable("msupervisor", whereClauseSupervisor, ""); inqSupervisor.setColumn("employeeid,supervisor"); inqSupervisor.refresh(); while (inqSupervisor.next()) { bossList = inqSupervisor.getString("supervisor") ; }//end while //get subList String whereClauseSub = " supervisor like '%,"+qs_vote1id+",%'"; String strSubList =""; String employeeid =""; String supervisorList=""; DbInquiry inqSub = new InitialInquiry(up).getDbInquiry(); inqSub.setSchemaName(up.getSchemaName()); inqSub.initMyTable("msupervisor", whereClauseSub, ""); inqSub.setColumn("employeeid,supervisor"); inqSub.refresh(); int rowCount = 0 ; while (inqSub.next()) { rowCount++; employeeid = inqSub.getString("EMPLOYEEID"); supervisorList =inqSub.getString("SUPERVISOR"); if(strSubList.equals("")){ strSubList = employeeid+"#"+supervisorList; }else{ strSubList += "@"+employeeid+"#"+supervisorList; }//end if }//end while //มันไม่มี subList (ไม่มีลูกน้อง) //ถ้าไม่ set ให้มัน ใน class จะ error เพราะ array out of bound if (rowCount==0){ //default ค่าให้มันไป strSubList="UVWXYZ#,"+qs_vote1id+","; }// //out.print("<br><br>bossList is:>>>>"+bossList); //out.print("<br><br>strSubList is:>>>>"+strSubList); //================================================== %> <html> <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 type='text/javascript' src='../JS/SCREEN.js'></script> <script type='text/javascript' src='../JS/DATEINPUT.js'></script> <script type='text/javascript' src='../JS/VIEWCALENDAR.js'></script> <script type='text/javascript' src='../JS/ICONSMENU.js'></script> <script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script> <script language="javascript">getTitleName();</script> <script language='javascript' src='../JS/HOTKEY.js'></script> </head> <body leftmargin="0" topmargin="0"> <div id="toolTipLayer" style="position:absolute; visibility: hidden"></div> <!--set QuertString ทุกครั้งเมื่อมัน submit ด้วย page ของมันเอง จาก search หรือ add--> <form name="cscform" method="post" action="SIMASSIGN_KKB1.jsp?__openwith=<%=request.getParameter("__openwith")%>&__employeeid=<%=request.getParameter("__employeeid")%>&__vote1id=<%=request.getParameter("__vote1id")%>"> <!----------BEGIN CSC INITIAL ZONE ------------------------> <%=screen.InitialVariable()%> <!----------END CSC INITIAL ZONE --------------------------> <!---------------- HIDDEN FIELD ZONE ----------------------> <!-- Single Use --> <input type="hidden" name="__notNull" value="<%=screen.getRequire()%>"> <!-- All Use --> <input type="hidden" name="__screen" value="SIMASSIGN_KKB1"> <input type="hidden" name="__cmd" value=""> <input type="hidden" name="__help" value=""> <input type="hidden" name="__goPage" value=""> <input type="hidden" name="__orderBy" value=""> <input type="hidden" name="__helpReturn" value=""> <input type="hidden" name="__helpName" value=""> <input type="hidden" name="__pageCall" value=""> <input type="hidden" name="__fixCon" value="<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__fixCon")))%>"> <input type="hidden" name="__calendar"> <input type="hidden" name="__dateid" value=""> <input type="hidden" name="__time0id" value=""> <input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>"> <input type="hidden" name="__companyid" value="<%=screen.getUProfile().get("companyid")%>"> <input type="hidden" name="__addItem" value=""> <input type="hidden" name="__addItem_mvote_kkb1" value=""> <input type="hidden" name="__addItem_mvote_kkb2" value=""> <!--QueryString from Opener--> <input id='txtOpenWith' type='hidden' value='<%=request.getParameter("__openwith")%>'> <input id='txtEmployeeId' type='hidden' value='<%=request.getParameter("__employeeid")%>'> <input id='txtVote1Id' type='hidden' value='<%=request.getParameter("__vote1id")%>'> <!---------------- HIDDEN FIELD ZONE ----------------------> <script language="javascript">getInputFormatDate();</script> <script language="javascript">initToolTips();</script> <script language="JavaScript" type="text/JavaScript"> function goHelp(helpName,inputName){ var helpReturn; var fcon = document.cscform.__fixCon.value; with (document.cscform) { if(inputName=="__mbu1_id" ) { helpReturn="__mbu1_id:bu1id,__mbu1_tdesc:tdesc"; if (!conMBU1.checked) conMBU1.checked = true; document.cscform.__fixCon.value =""; }else if(inputName=="__mbu2_id" ) { helpReturn="__mbu2_id:bu2id,__mbu2_tdesc:tdesc"; if (!conMBU2.checked) conMBU2.checked = true; document.cscform.__fixCon.value =""; }else if(inputName=="__mbu3_id" ) { helpReturn="__mbu3_id:bu3id,__mbu3_tdesc:tdesc"; if (!conMBU3.checked) conMBU3.checked = true; document.cscform.__fixCon.value =""; }else if(inputName=="__positionid" ) { helpReturn="__positionid:positionid,__position:tdesc"; if (!conPosition.checked) conPosition.checked = true; //check condition with opener if(document.getElementById('txtOpenWith').value=="AS_ASSIGN_KKB"){ document.cscform.__fixCon.value =" (positionid>='P08') "; }else if(document.getElementById('txtOpenWith').value=="AS_VOTE1_KKB"){ document.cscform.__fixCon.value =" (positionid>='P08') "; }else if(document.getElementById('txtOpenWith').value=="AS_VOTE2_KKB"){ document.cscform.__fixCon.value =""; }//end if }//end if } linkHelp_Return(helpName,helpReturn); document.cscform.__fixCon.value = fcon; }//end function function checkAll(){ with(document.cscform){ for(i=0;i<elements.length;i++){ if(elements[i].type=="checkbox" && elements[i].name != "conMBU1" && elements[i].name != "conMBU2" && elements[i].name != "conMBU3" && elements[i].name != "conPosition" && elements[i].name != "conEmployee" && elements[i].name != "conNickName" ) 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 != "conMBU1" && elements[i].name != "conMBU2" && elements[i].name != "conMBU3" && elements[i].name != "conPosition" && elements[i].name != "conEmployee" && elements[i].name != "conNickName" ) elements[i].checked=false; }//end for }//end with }//end function function addMulti(){ chk = false; with(document.cscform){ //initial value __addItem.value = ""; __addItem_mvote_kkb1.value = ""; __addItem_mvote_kkb2.value = ""; for(i=0;i<elements.length;i++){ if( elements[i].name != "conMBU1" && elements[i].name != "conMBU2" && elements[i].name != "conMBU3" && elements[i].name != "conPosition" && elements[i].name != "conEmployee" && elements[i].name != "conNickName" ){ if (elements[i].checked) { chk = true; //set data 2 input for save แยกตาม page ที่เรียกมัน if(document.getElementById('txtOpenWith').value=="AS_ASSIGN_KKB"){ //data index to javaclass [employeeid,bu1,bu2,position,bossid] if (__addItem.value != ""){ __addItem.value = __addItem.value+","+elements[i].name; }else{ __addItem.value = elements[i].name; }//end if //alert("__addItem is: " + __addItem.value); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE1_KKB"){ //data index to javaclass [vote1id,bu1,bu2,position,bossid,employeeid] if (__addItem_mvote_kkb1.value != ""){ __addItem_mvote_kkb1.value = __addItem_mvote_kkb1.value+","+elements[i].name +":"+document.getElementById('txtEmployeeId').value; }else{ __addItem_mvote_kkb1.value = elements[i].name+":"+document.getElementById('txtEmployeeId').value; }//end if //alert("__addItem_mvote_kkb1 is: " + __addItem_mvote_kkb1.value); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE2_KKB"){ //data index to javaclass [vote2id,bu1,bu2,position,bossid,employeeid,vote1id] if (__addItem_mvote_kkb2.value != ""){ //ต้องเปลี่ยน sign split ใหม่ เพราะ ',' มันมีอยู่ใน data ของ bossList กับ strSubList __addItem_mvote_kkb2.value = __addItem_mvote_kkb2.value+"~~"+elements[i].name +":"+document.getElementById('txtEmployeeId').value +":"+document.getElementById('txtVote1Id').value +":" + '<%=bossList%>' +":" + "<%=strSubList%>"; }else{ __addItem_mvote_kkb2.value = elements[i].name +":"+document.getElementById('txtEmployeeId').value +":"+document.getElementById('txtVote1Id').value +":" + '<%=bossList%>' +":" + "<%=strSubList%>"; }//end if //alert("__addItem_mvote_kkb2 is: " + __addItem_mvote_kkb2.value); }//end if }//end if }//end if }//end for if (chk) { __cmd.value="save"; submit(); } else { //เมื่อไม่ระบุ รายการที่ต้องการ add if(document.getElementById('txtOpenWith').value=="AS_ASSIGN_KKB"){ alert("กรุณาเลือกผู้ Assign ที่ต้องการเพิ่ม"); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE1_KKB"){ alert("กรุณาเลือกผู้ถูกโหวต ที่ต้องการเพิ่ม"); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE2_KKB"){ alert("กรุณาเลือกผู้โหวต ที่ต้องการเพิ่ม"); }//end if }//end if }//end with }//end function function refreshMain(){ with(window.opener.cscform){ __cmd.value = 'search'; submit(); }//end with //user will be close with himself //window.close(); }//end function function clearCon(strCon) { with (document.cscform){ if (strCon=="__mbu1_id" && !conMBU1.checked) { __mbu1_id.value = ""; __mbu1_tdesc.value = ""; } if (strCon=="__mbu2_id" && !conMBU2.checked) { __mbu2_id.value = ""; __mbu2_tdesc.value = ""; } if (strCon=="__mbu3_id" && !conMBU3.checked) { __mbu3_id.value = ""; __mbu3_tdesc.value = ""; } if (strCon=="__positionid" && !conPosition.checked) { __positionid.value = ""; __position.value = ""; } if (strCon=="Employee_name" && !conEmployee.checked) { Employee_name.value = "";} if (strCon=="NickName" && !conNickName.checked) { NickName.value = "";} }//end with }//end function function nChkCondition(textBoxId,checkBoxId){ var _value = document.getElementById(textBoxId).value; if (_value.toString()!=""){ document.getElementById(checkBoxId).checked = true; }//end if }//end function function searchEmployee(){ with(document.cscform){ //var whereClause=" 1=1 "; //ทุกครั้งที่ submit เก็บ whereClause เก่าไว้ด้วย var whereClause="<%=whereClause%>"; var bu1 = document.getElementById('__mbu1_id').value; var bu2 = document.getElementById('__mbu2_id').value; var bu3 = document.getElementById('__mbu3_id').value; var position = document.getElementById('__positionid').value; var employee_name = document.getElementById('Employee_name').value; var nickname = document.getElementById('NickName').value; if(bu1!=""){ whereClause+= " and bu1='" + bu1 +"'"; }//end if if(bu2!=""){ whereClause+= " and bu2='" + bu2 +"'"; }//end if if(bu3!=""){ whereClause+= " and bu3='" + bu3 +"'"; }//end if if(position!=""){ whereClause+= " and emp_position='" + position +"'"; }//end if if(employee_name!=""){ whereClause+= " and fname like '%" + employee_name +"%'"; }//end if if(nickname!=""){ whereClause+= " and nickname like '%" + nickname +"%'"; }//end if //alert("in searchEmployee() whereClause is:"+ whereClause); document.cscform.__fixCon.value =whereClause; __cmd.value="search"; submit(); }//end with }//end funtion function checkedCheckBox(checkBoxId,isCheck){ document.getElementById(checkBoxId).checked = isCheck; }//end function </script> <br> <table id='headerTab' cellpadding="0" cellspacing="0" border="1" class = "largest"> <tr bgcolor="#3366CC"> <td height="20" class="header" colspan="9"> <div id='nameTab'> <script language="javascript"> if(document.getElementById('txtOpenWith').value=="AS_ASSIGN_KKB"){ document.getElementById('nameTab').innerText='SELECT_ASSIGN_LIST,'; swapLang("SELECT ASSIGN LIST"); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE1_KKB"){ document.getElementById('nameTab').innerText='SELECT_VOTE1_LIST,'; swapLang("SELECT VOTE1 LIST"); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE2_KKB"){ document.getElementById('nameTab').innerText='SELECT_VOTE2_LIST,'; swapLang("SELECT VOTE2 LIST"); }//end if </script> </div> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" class = "largest"> <tr><td> <table id='FindMemployee' border="0" cellpadding="0" cellspacing="0" bgcolor="#666666" align='center'> <tr> <td colspan="1" align="right"><b><script language="javascript">swapLang("Condition");</script>: </b></td> <td><INPUT TYPE="checkbox" NAME="conMBU1" ONCLICK="clearCon('__mbu1_id')"></td> <td align="right"><b><script language="javascript">swapLang("BU1");</script>: </b></td> <td><INPUT TYPE="text" id='__mbu1_id' NAME="__mbu1_id" SIZE="10" VALUE = '<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__mbu1_id")))%>' READONLY> <A href="javascript: goHelp('MBU1HELP','__mbu1_id');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('__group_quesid_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__group_quesid_image" width="20" height="20" border="0" align="absmiddle" > </a> <INPUT TYPE="text" NAME="__mbu1_tdesc" SIZE="50" VALUE = '<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__mbu1_tdesc")))%>' READONLY> </td> </tr> <tr> <td colspan="1" align="right"><b><script language="javascript">swapLang("Condition");</script>: </b></td> <td><INPUT TYPE="checkbox" NAME="conMBU2" ONCLICK="clearCon('__mbu2_id')"></td> <td align="right"><b><script language="javascript">swapLang("BU2");</script>: </b></td> <td><INPUT TYPE="text" id='__mbu2_id' NAME="__mbu2_id" SIZE="10" VALUE = '<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__mbu2_id")))%>' READONLY> <A href="javascript: goHelp('MBU2HELP','__mbu2_id');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('__group_quesid_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__group_quesid_image" width="20" height="20" border="0" align="absmiddle" > </a> <INPUT TYPE="text" NAME="__mbu2_tdesc" SIZE="50" VALUE = '<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__mbu2_tdesc")))%>' READONLY> </td> </tr> <tr> <td colspan="1" align="right"><b><script language="javascript">swapLang("Condition");</script>: </b></td> <td><INPUT TYPE="checkbox" NAME="conMBU3" ONCLICK="clearCon('__mbu3_id')"></td> <td align="right"><b><script language="javascript">swapLang("BU3");</script>: </b></td> <td><INPUT TYPE="text" id='__mbu3_id' NAME="__mbu3_id" SIZE="10" VALUE = '<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__mbu3_id")))%>' READONLY> <A href="javascript: goHelp('MBU3HELP','__mbu3_id');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('__group_quesid_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__group_quesid_image" width="20" height="20" border="0" align="absmiddle" > </a> <INPUT TYPE="text" NAME="__mbu3_tdesc" SIZE="50" VALUE = '<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__mbu3_tdesc")))%>' READONLY> </td> </tr> <tr> <td colspan="1" align="right"><b><script language="javascript">swapLang("Condition");</script>: </b></td> <td><INPUT TYPE="checkbox" id="conPosition" NAME="conPosition" ONCLICK="clearCon('__positionid')"></td> <td align="right"><b><script language="javascript">swapLang("Position");</script>: </b></td> <td><INPUT TYPE="text" id='__positionid' NAME="__positionid" SIZE="10" VALUE = '<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__positionid")))%>' READONLY> <A href="javascript: goHelp('MPOSITIONHELP','__positionid');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('__group_quesid_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> <img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__group_quesid_image" width="20" height="20" border="0" align="absmiddle" > </a> <INPUT TYPE="text" NAME="__position" SIZE="50" VALUE = '<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("__position")))%>' READONLY> </td> </tr> <tr> <td colspan="1" align="right"><b><script language="javascript">swapLang("Condition");</script>: </b></td> <td><INPUT TYPE="checkbox" id="conEmployee" NAME="conEmployee" ONCLICK="clearCon('Employee_name')"></td> <td align="right"><b><script language="javascript">swapLang("Employee_name");</script>: </b></td> <td colspan='1'><input id='Employee_name' name='Employee_name' type='text' style='width:400px' value='<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("Employee_name")))%>' onkeyup="nChkCondition('Employee_name','conEmployee')"></td> </tr> <tr> <td colspan="1" align="right"><b><script language="javascript">swapLang("Condition");</script>: </b></td> <td><INPUT TYPE="checkbox" id="conNickName" NAME="conNickName" ONCLICK="clearCon('NickName')"></td> <td align="right"><b><script language="javascript">swapLang("Nick Name");</script>: </b></td> <td colspan='1'><input id='NickName' name='NickName' type='text' style='width:400px' value='<%=chkNull.chkNullString(thatUtils.ASCII2Unicode(request.getParameter("NickName")))%>' onkeyup="nChkCondition('NickName','conNickName')"></td> </tr> </table> </td></tr> <tr><td> <div align="center" > <a href="javascript:searchEmployee();"><img src="../IMAGES/BUTTON/SEARCH.gif" border="0"></a> </div> </td></tr> <tr><td class="blankspace" colspan="4"> <!--Tab Page--> <div align="right"><<%=screenHelp.getPageTag()%> > </div> <!--Tab Page--> </td></tr> <tr><td> <!--Display data from Table Memployee--> <table id='tblMemployee' width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#666666" class='largest'> <thead> <tr> <td width="2%" class="row3"><div align="center"><B> <script language="javascript">swapLang("Select");</script></B></div> </td> <td width="3%" class="row3"><div align="center"><B> <script language="javascript">swapLang("Seq");</script></B></div> </td> <td width="7%" class="row3"> <div align="center"><B> <script language="javascript"> if(document.getElementById('txtOpenWith').value=="AS_ASSIGN_KKB"){ swapLang("ASSIGNID"); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE1_KKB"){ swapLang("VOTE1ID"); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE2_KKB"){ swapLang("VOTE2ID"); }//end if </script> </B></div> </td> <td width="20%" class="row3"><div align="center"><B> <script language="javascript"> if(document.getElementById('txtOpenWith').value=="AS_ASSIGN_KKB"){ swapLang("Full Name Assign"); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE1_KKB"){ swapLang("Full Name Vote1"); }else if(document.getElementById('txtOpenWith').value=="AS_VOTE2_KKB"){ swapLang("Full Name Vote2"); }//end if </script> </B></div> </td> <td width="7%" class="row3"><div align="center"><B> <script language="javascript">swapLang("Nick Name");</script></B></div> </td> <td width="20%" class="row3"><div align="center"><b> <script language="javascript">swapLang("BU1");</script></b></div></td> <td width="20%" class="row3"><div align="center"><b> <script language="javascript">swapLang("BU2");</script></b></div></td> <td width="20%" class="row3"><div align="center"><b> <script language="javascript">swapLang("Position");</script></b></div></td> <td width="10%" class="row3"><div align="center"><b> <script language="javascript">swapLang("Work Age");</script></b></div></td> <!--td>bossid</td--> </tr> </thead> <tbody> <% int i = 0; while(screenHelp.nextRec()){ //check row over flow in page if(screenHelp.checkLinePage()) { String thWorkAge = screenHelp.getDataLabel("MEMPLOYEE","empworkages"); String newWorkAge = thWorkAge.replace(" ",""); newWorkAge = newWorkAge.replace("ปี","/"); newWorkAge = newWorkAge.replace("เดือน","/"); newWorkAge = newWorkAge.replace("วัน",""); String[] workage= newWorkAge.split("/"); String status = screenHelp.getDataLabel("MEMPLOYEE","STATUS"); //อายุงานต้องมากกว่า หรือ เท่ากับ 6 เดือน //ไปเอา mgroup_vote.vote_date มาเป็นตัวตั้ง แล้ว คำนวนว่า จนถึงวันที่ vote แล้วอายุงาน >= 6 เดือน ? CscCalendar emp_StartDate = new CscCalendar(screenHelp.getString("MEMPLOYEE","STARTDATE")); Calendar startDate = new GregorianCalendar(today.getYear() ,today.getMonth(),today.getDayOfWeek()); Calendar endDate = new GregorianCalendar(vote_date.getYear() ,vote_date.getMonth(),vote_date.getDayOfWeek()); int[] dateSpan =new int[3]; int workageAllow = 6; if((startDate.compareTo(endDate)) == 0){ //out.print("startDate==endDate"); }else if((startDate.compareTo(endDate))<0){ dateSpan = today.getCountDMY(vote_date); //out.print("startDate < endDate " + (startDate.compareTo(endDate)) + " diff " +dateSpan[1]+ " เดือน"); workageAllow =(workageAllow-dateSpan[1]); }else if((startDate.compareTo(endDate))>0){ //out.print("startDate > endDate "+(startDate.compareTo(endDate)) ); }//end if //out.print("workageAllow is: "+workageAllow); if( (Integer.parseInt(workage[0])>=1 || Integer.parseInt(workage[1]) >=workageAllow) && (status.equals("A")) ) { i++; %> <tr> <td class="forborder"> <div align="center"> <input type="checkbox" name="<%=screenHelp.getString("EMPLOYEEID")%>:<%=screenHelp.getString("MEMPLOYEE","BU1")%>:<%=screenHelp.getString("MEMPLOYEE","BU2")%>:<%=screenHelp.getString("MEMPLOYEE","EMP_POSITION")%>:<%=screenHelp.getString("MEMPLOYEE","BOSSID")%>"> </div> </td> <td class="forborder"><div align="center"><%=i%></div></td> <td class="forborder"><div align="center"><%=screenHelp.getString("EMPLOYEEID")%></div></td> <td class="forborder"> <div align="center"> <%=screenHelp.getString("MPREFIX","TDESC")+screenHelp.getString("MEMPLOYEE","FNAME")%> <%=screenHelp.getString("MEMPLOYEE","LNAME")%> </div> </td> <td class="forborder"> <div align="center"> <% if(screenHelp.getString("MEMPLOYEE","NICKNAME").equals("")){ out.print(" "); }else{ out.print( screenHelp.getString("MEMPLOYEE","NICKNAME")); }//end if %> </div> </td> <td class="forborder"> <div align="center"> <% if(screenHelp.getString("MBU1","TDESC").equals("")){ out.print(" "); }else{ out.print( screenHelp.getString("MBU1","TDESC")); }//end if %> </div> </td> <td class="forborder"> <div align="center"> <% if(screenHelp.getString("MBU2","TDESC").equals("")){ out.print(" "); }else{ out.print( screenHelp.getString("MBU2","TDESC")); }//end if %> </div> </td> <td class="forborder"><div align="center"><%=screenHelp.getString("MPOSITION","TDESC")%></div></td> <td class="forborder"> <div align="center"> <% out.print(workage[0]+"/"+workage[1]); %> </div> </td> <!--td><%//=screenHelp.getString("MEMPLOYEE","STATUS")%></td--> <!--td><%//=screenHelp.getString("MEMPLOYEE","BOSSID")%></td--> <!--td><%//=screenHelp.getString("MEMPLOYEE","EMP_POSITION")%></td--> </tr> <% }//end if }//end if if(screenHelp.outLinePage()) { break; }//end if }//end while %> </tbody> </table> </td></tr> <tr><td> <div align='center'> <table> <tr bordercolor="0069B3"> <td class="blankspace"> <div align="center" > <a href="#" onClick="checkAll()"><img src="../IMAGES/BUTTON/SELECTALL.gif" border="0"></a> <a href="#" onClick="decheckAll()"><img src="../IMAGES/BUTTON/DESELECTALL.gif" border="0"></a> <a href="javascript:addMulti();"><img src="../IMAGES/BUTTON/ADD.gif" border="0"></a> </div> </td> </tr> </table> </div> </td></tr> <tr bordercolor="0069B3"> <td class="bottom"></td> </tr> </table> <!--todo after submit with add--> <% if((request.getParameter("__cmd")!=null)&&(request.getParameter("__cmd").equals("add")||request.getParameter("__cmd").equals("save"))) { %> <script language="javascript">refreshMain();</script> <% } %> <!--todo after submit with search--> <% //if((request.getParameter("__cmd")!=null)&&(request.getParameter("__cmd").equals("search"))) { //checked checkbox whereclause %> <%if(request.getParameter("__mbu1_id")!=null && !request.getParameter("__mbu1_id").equals("")){%> <script language="javascript">checkedCheckBox("conMBU1",true);</script> <%}//end if %> <%if(request.getParameter("__mbu2_id")!=null && !request.getParameter("__mbu2_id").equals("")){%> <script language="javascript">checkedCheckBox("conMBU2",true);</script> <%}//end if %> <%if(request.getParameter("__mbu3_id")!=null && !request.getParameter("__mbu3_id").equals("")){%> <script language="javascript">checkedCheckBox("conMBU3",true);</script> <%}//end if %> <%if(request.getParameter("__positionid")!=null && !request.getParameter("__positionid").equals("")){%> <script language="javascript">checkedCheckBox("conPosition",true);</script> <%}//end if %> <%if(request.getParameter("Employee_name")!=null && !request.getParameter("Employee_name").equals("")){%> <script language="javascript">checkedCheckBox("conEmployee",true);</script> <%}//end if %> <%if(request.getParameter("NickName")!=null && !request.getParameter("NickName").equals("")){%> <script language="javascript">checkedCheckBox("conNickName",true);</script> <%}//end if %> <% //}//end if %> <!--todo after submit with search--> <!----------BEGIN CSC ENDING ZONE ------------------------> <%=screen.endJSP()%> <!----------END CSC ENDING ZONE --------------------------> </form> </body> </html>