<%@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,java.util.Hashtable"%> <jsp:useBean id="VW_VOTE2_RSLT" class="com.csc.library.system.Task" scope="page" /> <% CheckNull chkNull=new CheckNull(); ThaiUtilities thatUtils = new ThaiUtilities(); VW_VOTE2_RSLT.setChannel(request,response); HelpEntry screenHelp = (HelpEntry) VW_VOTE2_RSLT.process("HelpEntry", "AS_VW_VOTE2_RSLT_HELP"); //out.print("<br><br>>>>>>"+screen.getRecord()); screenHelp.getInquiry(); screenHelp.setMaxLine(12); screenHelp.process(); %> <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('<%=screenHelp.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> <form name="cscform" method="post" action="AS_VOTE2_RESULT.jsp"> <!----------BEGIN CSC INITIAL ZONE ------------------------> <%=screenHelp.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="AS_VW_VOTE2_RSLT_HELP"> <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="<%=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="<%=screenHelp.getUProfile().get("lang")%>"> <input type="hidden" name="__companyid" value="<%=screenHelp.getUProfile().get("companyid")%>"> <!---------------- 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 tmpFixcon = document.cscform.__fixCon.value ; document.cscform.__fixCon.value =""; with (document.cscform) { if(inputName=="__mbu1_id" ) { helpReturn="__mbu1_id:bu1id,__mbu1_tdesc:tdesc"; if (!conMBU1.checked) conMBU1.checked = true; }else if(inputName=="__mbu2_id" ) { helpReturn="__mbu2_id:bu2id,__mbu2_tdesc:tdesc"; if (!conMBU2.checked) conMBU2.checked = true; }else if(inputName=="__mbu3_id" ) { helpReturn="__mbu3_id:bu3id,__mbu3_tdesc:tdesc"; if (!conMBU3.checked) conMBU3.checked = true; }else if(inputName=="__positionid" ) { helpReturn="__positionid:positionid,__position:tdesc"; if (!conPosition.checked) conPosition.checked = true; }//end if } linkHelp_Return(helpName,helpReturn); document.cscform.__fixCon.value = tmpFixcon; }//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 = ""; } }//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 checkedCheckBox(checkBoxId,isCheck){ document.getElementById(checkBoxId).checked = isCheck; }//end function function searchVote2List(){ with(document.cscform){ var whereClause=" 1=1 "; 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; 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 document.cscform.__fixCon.value =whereClause; //alert("whereClause:"+whereClause); __cmd.value="search"; submit(); }//end with }//end funtion function linkList(vote2id){ //alert("vote2id is:" +vote2id ); with(document.cscform){ window.open("AS_VOTE2_RESULT_LIST.jsp?__vote2id="+vote2id ,"","width=700,height=300,left=5,top=10,width=1000,height=600,toolbar=no,status=yes,scrollbars=yes,resizable=no"); }//end with }//end function </script> <br> <table id='headerTab' cellpadding="0" cellspacing="0" border="1" class = "largest" align='center'> <tr bgcolor="#3366CC"> <td height="20" class="header" colspan="9"> <div id='nameTab'>VOTE2 RESULT, <script language="javascript"> swapLang("AS VOTE2 RESULT"); </script> </div> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" class = "largest" align='center'> <tr><td> <table id='FindVote2List' 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"></td> <td colspan="3"> <a href="javascript:searchVote2List();"><img src="../IMAGES/BUTTON/SEARCH.gif" border="0"></a> </td> </tr> </table> </td></tr> <tr><td class="blankspace"></td></tr> <%if(request.getParameter("__screen")!=null && request.getParameter("__screen").equals("AS_VW_VOTE2_RSLT_HELP")){%> <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="3%" class="row3"><div align="center"><b> <script language="javascript">swapLang("Seq");</script></b></div> </td> <td width="10%" class="row3"> <div align="center"><b> <script language="javascript"> swapLang("VOTE2ID"); </script> </B></div> </td> <td width="20%" class="row3"><div align="center"><b> <script language="javascript"> swapLang("Full Name Vote2"); </script> </B></div> </td> <td width="10%" class="row3"><div align="center"><b> จำนวนผู้ถูกโหวต</b></div> </td> <td width="10%" class="row3"><div align="center"><b> โหวตแล้ว</b></div> </td> <!--For Debug--> <!--td width="10%" class="row3"><div align="center"><b> bu1</b></div> </td> <td width="10%" class="row3"><div align="center"><b> bu2</b></div> </td> <td width="10%" class="row3"><div align="center"><b> bu3</b></div> </td> <td width="10%" class="row3"><div align="center"><b> emp_position</b></div> </td--> </tr> </thead> <tbody> <% int i = 0; while(screenHelp.nextRec()){ //check row over flow in page if(screenHelp.checkLinePage()) { i++; %> <tr> <td class="forborder"><div align="center"><%=i%></div></td> <td class="forborder"><div align="center"><%=screenHelp.getString("APSASSESSOR")%></div></td> <td class="forborder"> <div id='fullname<%=screenHelp.getString("APSASSESSOR")%>' align="center"> <% String apsassessor = screenHelp.getString("APSASSESSOR"); String prefix = screenHelp.getString("PREFIX"); String fname = screenHelp.getString("FNAME"); String lname = screenHelp.getString("LNAME"); String voteTotal = screenHelp.getString("VOTETOTAL"); String votedCount = screenHelp.getString("VOTEDCOUNT"); if(voteTotal.trim().equals(votedCount)){ out.print(prefix+""+fname+" "+lname); }else{ out.print("<a style='color:red' "+ "href=javascript:linkList('"+apsassessor+"');>"+prefix+""+fname+" "+lname+"</a>"); }//end if %> </div> </td> <td> <div id='votetotal<%=screenHelp.getString("APSASSESSOR")%>' align="center"> <%=screenHelp.getString("VOTETOTAL")%> </div> </td> <td> <div id='voted<%=screenHelp.getString("APSASSESSOR")%>' align="center"> <%=screenHelp.getString("VOTEDCOUNT")%> </div> </td> <!--For Debug--> <!--td> <div align="center"> <%=screenHelp.getString("BU1")%> </div> </td> <td> <div align="center"> <%=screenHelp.getString("BU2")%> </div> </td> <td> <div align="center"> <%=screenHelp.getString("BU3")%> </div> </td> <td> <div align="center"> <%=screenHelp.getString("EMP_POSITION")%> </div> </td--> </tr> <% }//end if if(screenHelp.outLinePage()) { break; }//end if }//end while %> </tbody> </table> <%}//end if %> </td></tr> <tr><td class="blankspace"></td></tr> <tr bordercolor="0069B3"><td class="bottom"></td></tr> </table> <!--todo after submit with search--> <!--set checked to checkbox--> <%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 %> <!--todo after submit with search--> <!----------BEGIN CSC ENDING ZONE ------------------------> <%=screenHelp.endJSP()%> <!----------END CSC ENDING ZONE --------------------------> </form> </body> </html>