ViewVoteResult.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:5k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312"%>
- <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
- <jsp:include page="/CheckLogin1.jsp" flush="true"/> <% Session m_session = new Session(session); %>
- <%
- Request m_request = new Request(request);
- int iVoteID = m_request.GetInt("VoteID");
- int iSysDirID = m_request.GetInt("SysDirID");
- String sVoteOptionIDs = m_request.GetString("voteoptionid");
- Vector vt = VoteManager.getRecordByID(iVoteID);
- if(vt.size()==1)
- {
- if(("," + iSysDirID + "," + SystemDirectoryManager.getSubSystemDirectoryIDs(iSysDirID) + ",").indexOf("," + ((Vector)vt.get(0)).get(5).toString() + ",")>=0)
- {
- VoteManager.UpdateReocordView(iVoteID,sVoteOptionIDs);
- vt = VoteManager.getRecordByID(iVoteID);
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
- <title><%=((Vector)vt.get(0)).get(1).toString()%>-- GForce OA 2.0</title>
- <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
- <style type="text/css">
- <!--
- .imgtd {
- border: 1px solid #0A0A0A;
- }
- -->
- </style>
- </head>
- <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
- <table width="90%" height="100%" border="0" cellspacing="1" align="center">
- <tr>
- <td align="right">
- <input type="button" value="关闭窗口" onclick="window.close()" style="background-color: #FFFFFF; border: 1 solid #000000">
- </td>
- </tr>
- <tr>
- <td align="center" class="newTitle"><%=((Vector)vt.get(0)).get(1).toString()%></td>
- </tr>
- <tr>
- <td align="right">
- <%
- if(StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"yyyy年MM月dd日").length()>3)
- out.println("开始时间:" + StringNew.GetDateString(((Vector)vt.get(0)).get(2).toString(),"yyyy年MM月dd日") + "");
- if(StringNew.GetDateString(((Vector)vt.get(0)).get(3).toString(),"yyyy年MM月dd日").length()>3)
- out.println(" 结束时间:" + StringNew.GetDateString(((Vector)vt.get(0)).get(3).toString(),"yyyy年MM月dd日") + "");
- out.println(" 有效票数:" + ((Vector)vt.get(0)).get(6).toString() + "");
- if(((Vector)vt.get(0)).get(4).toString().equalsIgnoreCase("true"))
- {
- out.println("(单选)");
- }
- else
- {
- out.println("(多选)");
- }
- %>
- </td>
- </tr>
- <tr>
- <td align="center" valign="top">
- <table width="90%" height="100%" border="0" cellspacing="1" align="center">
- <%
- Vector vtVoteOptions = VoteOptionManager.getAllRecord(iVoteID);
- int iTotalVotes = Integer.parseInt(((Vector)vt.get(0)).get(6).toString());
- if(iTotalVotes<1)
- {
- for(int i=0;i<vtVoteOptions.size();i++)
- {
- 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>");
- out.println("<td align="left" valign="top" nowrap width="100%"><img height="10" src="/images/redvert.gif" width="1"></td></tr>");
- }
- }
- else
- {
- for(int i=0;i<vtVoteOptions.size();i++)
- {
- float fPicWidth = (Float.parseFloat(((Vector)vtVoteOptions.get(i)).get(3).toString()) / (float)iTotalVotes);
- int iPicWidth=(int)(fPicWidth * 100);
- out.println("<tr><td align="left" valign="top">" + ((Vector)vtVoteOptions.get(i)).get(2).toString() + "(" + ((Vector)vtVoteOptions.get(i)).get(3).toString() + "票)</td>");
- if(iPicWidth<1)
- {
- out.println("<td align="left" valign="top"><img height="10" src="/images/redvert.gif" width="1" style="width:1">" + iPicWidth + "%</td></tr>");
- }
- else
- {
- out.println("<td align="left" valign="top"><img height="10" src="/images/redvert.gif" width="" + iPicWidth + "%" style="width:" + iPicWidth + "%">" + iPicWidth + "%</td></tr>");
- }
- }
- }
- %>
- </table>
- </td>
- </tr>
- <tr>
- <td align="right">
- <input type="button" value="关闭窗口" onclick="window.close()" style="background-color: #FFFFFF; border: 1 solid #000000">
- </td>
- </tr>
- </table>
- </body>
- </html>
- <%
- }
- else
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("您没有权限查看此记录,请与管理员联系!");
- window.close();
- </script>
- <%
- }
- }
- else
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("此记录已被删除,请与管理员联系!");
- window.close();
- </script>
- <%
- }
- %>