ShowVote.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:4k
- <%@ 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("ID");
- int iSysDirID = m_request.GetInt("SysDirID");
- Vector vt = VoteManager.getRecordByID(iVoteID);
- if(vt.size()==1)
- {
- if(("," + iSysDirID + "," + SystemDirectoryManager.getSubSystemDirectoryIDs(iSysDirID) + ",").indexOf("," + ((Vector)vt.get(0)).get(5).toString() + ",")>=0)
- {
- %>
- <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">
- <script language="JavaScript" type="text/javascript">
- function checkVote()
- {
- for(var i=0;i<document.vote.voteoptionid.length;i++)
- {
- if(document.vote.voteoptionid[i].checked==true)
- {
- return true;
- }
- }
- alert("请选择您的选择!");
- if(document.vote.voteoptionid.length>0)
- {
- document.vote.voteoptionid[0].focus();
- }
- return false;
- }
- </script>
- <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="left" class="newTitle"><strong><%=((Vector)vt.get(0)).get(1).toString()%></strong></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() + "");
- %>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <form name="vote" action="ViewVoteResult.jsp?SysDirID=<%=iSysDirID%>&VoteID=<%=iVoteID%>" method="post" onSubmit="javascript:return checkVote();">
- <%
- Vector vtVoteOptions = VoteOptionManager.getAllRecord(iVoteID);
- if(((Vector)vt.get(0)).get(4).toString().equalsIgnoreCase("true"))
- {
- for(int i=0;i<vtVoteOptions.size();i++)
- {
- out.println("<input type="radio" name="voteoptionid" value="" + ((Vector)vtVoteOptions.get(i)).get(0).toString() + "">" + ((Vector)vtVoteOptions.get(i)).get(2).toString() + "<br>");
- }
- }
- else
- {
- for(int i=0;i<vtVoteOptions.size();i++)
- {
- out.println("<input type="checkbox" name="voteoptionid" value="" + ((Vector)vtVoteOptions.get(i)).get(0).toString() + "">" + ((Vector)vtVoteOptions.get(i)).get(2).toString() + "<br>");
- }
- }
- %>
- <p align="center"><input type="submit" name="submit1" value="投票上我的一票" style="background-color: #FFFFFF; border: 1 solid #000000"> <input type="button" name="view" value="查看投票结果" onclick="self.location='ViewVoteResult.jsp?SysDirID=<%=iSysDirID%>&VoteID=<%=iVoteID%>'" style="background-color: #FFFFFF; border: 1 solid #000000"></p>
- </form>
- </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>
- <%
- }
- %>