ViewVoteResult.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:5k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin1.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <%
  5. Request m_request = new Request(request);
  6. int iVoteID = m_request.GetInt("VoteID");
  7. int iSysDirID = m_request.GetInt("SysDirID");
  8. String sVoteOptionIDs = m_request.GetString("voteoptionid");
  9. Vector vt = VoteManager.getRecordByID(iVoteID);
  10. if(vt.size()==1)
  11. {
  12. if(("," + iSysDirID + "," + SystemDirectoryManager.getSubSystemDirectoryIDs(iSysDirID) + ",").indexOf("," + ((Vector)vt.get(0)).get(5).toString() + ",")>=0)
  13. {
  14.   VoteManager.UpdateReocordView(iVoteID,sVoteOptionIDs);
  15.   vt = VoteManager.getRecordByID(iVoteID);
  16. %>
  17. <html>
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  20. <title><%=((Vector)vt.get(0)).get(1).toString()%>-- GForce OA 2.0</title>
  21. <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
  22. <style type="text/css">
  23. <!--
  24. .imgtd {
  25.     border: 1px solid #0A0A0A;
  26. }
  27. -->
  28. </style>
  29. </head>
  30. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  31. <table width="90%" height="100%" border="0" cellspacing="1" align="center">
  32.   <tr>
  33.     <td align="right">
  34.       <input type="button" value="关闭窗口" onclick="window.close()" style="background-color: #FFFFFF; border: 1 solid #000000">
  35.     </td>
  36.   </tr>
  37.   <tr>
  38.     <td align="center" class="newTitle"><%=((Vector)vt.get(0)).get(1).toString()%></td>
  39.   </tr>
  40.   <tr>
  41.     <td align="right">
  42. <%
  43. if(StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"yyyy年MM月dd日").length()>3)
  44. out.println("开始时间:" + StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"yyyy年MM月dd日") + "");
  45. if(StringNew.GetDateString(((Vector)vt.get(0)).get(3).toString(),"yyyy年MM月dd日").length()>3)
  46. out.println("&nbsp;&nbsp;&nbsp;结束时间:" + StringNew.GetDateString(((Vector)vt.get(0)).get(3).toString(),"yyyy年MM月dd日") + "");
  47. out.println("&nbsp;&nbsp;&nbsp;有效票数:" + ((Vector)vt.get(0)).get(6).toString() + "");
  48. if(((Vector)vt.get(0)).get(4).toString().equalsIgnoreCase("true"))
  49. {
  50.   out.println("(单选)");
  51. }
  52. else
  53. {
  54.   out.println("(多选)");
  55. }
  56. %>
  57.         </td>
  58.   </tr>
  59.   <tr>
  60.     <td align="center" valign="top">
  61.       <table width="90%" height="100%" border="0" cellspacing="1" align="center">
  62.         <%
  63.         Vector vtVoteOptions = VoteOptionManager.getAllRecord(iVoteID);
  64.         int iTotalVotes = Integer.parseInt(((Vector)vt.get(0)).get(6).toString());
  65.         if(iTotalVotes<1)
  66.         {
  67.           for(int i=0;i<vtVoteOptions.size();i++)
  68.           {
  69.             out.println("<tr><td align="left" valign="top" nowrap width="100">" + ((Vector)vtVoteOptions.get(i)).get(2).toString() + "(" + ((Vector)vtVoteOptions.get(i)).get(3).toString() + "票)</td>");
  70.             out.println("<td align="left" valign="top" nowrap width="100%"><img height="10" src="/images/redvert.gif" width="1"></td></tr>");
  71.           }
  72.         }
  73.         else
  74.         {
  75.           for(int i=0;i<vtVoteOptions.size();i++)
  76.           {
  77.             float fPicWidth = (Float.parseFloat(((Vector)vtVoteOptions.get(i)).get(3).toString()) / (float)iTotalVotes);
  78.             int iPicWidth=(int)(fPicWidth * 100);
  79.             out.println("<tr><td align="left" valign="top">" + ((Vector)vtVoteOptions.get(i)).get(2).toString() + "(" + ((Vector)vtVoteOptions.get(i)).get(3).toString() + "票)</td>");
  80.             if(iPicWidth<1)
  81.             {
  82.               out.println("<td align="left" valign="top"><img height="10" src="/images/redvert.gif" width="1" style="width:1">" + iPicWidth + "%</td></tr>");
  83.             }
  84.             else
  85.             {
  86.               out.println("<td align="left" valign="top"><img height="10" src="/images/redvert.gif" width="" + iPicWidth + "%" style="width:" + iPicWidth + "%">" + iPicWidth + "%</td></tr>");
  87.             }
  88.           }
  89.         }
  90.         %>
  91.       </table>
  92.     </td>
  93.   </tr>
  94.   <tr>
  95.     <td align="right">
  96.       <input type="button" value="关闭窗口" onclick="window.close()" style="background-color: #FFFFFF; border: 1 solid #000000">
  97.     </td>
  98.   </tr>
  99. </table>
  100. </body>
  101. </html>
  102. <%
  103. }
  104. else
  105. {
  106. %>
  107. <script language="JavaScript" type="text/JavaScript">
  108. alert("您没有权限查看此记录,请与管理员联系!");
  109. window.close();
  110. </script>
  111. <%
  112. }
  113. }
  114. else
  115. {
  116. %>
  117. <script language="JavaScript" type="text/JavaScript">
  118. alert("此记录已被删除,请与管理员联系!");
  119. window.close();
  120. </script>
  121. <%
  122. }
  123. %>