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

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  7. <title>在线投票管理-- GForce OA 2.0</title>
  8. <link href="/css/txt.jsp" rel="stylesheet" type="text/css">
  9. <script language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></script>
  10. <script language="JavaScript" src="/js/changestyle.js"></script>
  11. <script language="JavaScript" type="text/javascript">
  12. function checkAddVote()
  13. {
  14.     if(document.addvote.VoteName.value=="")
  15.     {
  16.         alert("请输入投票名称!");
  17.         document.addvote.VoteName.focus();
  18.         return false;
  19.     }
  20.     if(document.addvote.StartTime.value!="")
  21.     {
  22.       if(!isDate(document.addvote.StartTime.value))
  23.       {
  24.           alert("日期格式错误,请按照“2002-02-18”重新输入!");
  25.           document.addvote.StartTime.focus();
  26.           return false;
  27.       }
  28.     }
  29.     if(document.addvote.EndTime.value!="")
  30.     {
  31.       if(!isDate(document.addvote.EndTime.value))
  32.       {
  33.           alert("日期格式错误,请按照“2002-02-18”重新输入!");
  34.           document.addvote.EndTime.focus();
  35.           return false;
  36.       }
  37.     }
  38. }
  39. </script>
  40. </head>
  41. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  42.  <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  43.     <tr>
  44.     <td align="center" valign="top">
  45.       <table width="100%" border="0" cellpadding="0" cellspacing="0">
  46.         <tr>
  47.           <td height="50" valign="top" background="../images/dy-back.gif">
  48.             <table width="100%" border="0" cellpadding="0" cellspacing="0">
  49.               <tr valign="middle">
  50.                 <td width="61" align="center" height="20"><img src="../images/dy-01.gif" width="38" height="36"></td>
  51.                 <td width="118" nowrap="nowrap" valign="middle"><strong><font color="#000000">投票管理</font></strong></td>
  52.                 <td align="right" nowrap="nowrap" valign="bottom">&nbsp;
  53.                    <!-- 群增<img src="../images/MulAdd.gif" onMouseOver="this.src='../images/MulAdd_a.gif';" onMouseOut="this.src='../images/MulAdd.gif';" border="0" height="22" width="59">&nbsp;-->
  54.                   <!--单增<img src="../images/Single.gif" onMouseOver="this.src='../images/Single_a.gif';" onMouseOut="this.src='../images/Single.gif';" border="0" height="22" width="59">&nbsp;-->
  55.                   <!-- 修改<img src="../images/Update.gif" onMouseOver="this.src='../images/Update_a.gif';" onMouseOut="this.src='../images/Update.gif';" border="0" height="22" width="59">&nbsp;-->
  56.                   <!-- 删除<img src="../images/Del.gif" onMouseOver="this.src='../images/Del_a.gif';" onMouseOut="this.src='../images/Del.gif';" border="0" height="22" width="59">&nbsp;-->
  57.                   <!-- 查看<img src="../images/Query.gif" onMouseOver="this.src='../images/Query_a.gif';" onMouseOut="this.src='../images/Query.gif';" border="0" height="22" width="59">&nbsp;-->
  58.                   <!-- 组合查询<img src="../images/GroupQuery.gif" onMouseOver="this.src='../images/GroupQuery_a.gif';" onMouseOut="this.src='../images/GroupQuery.gif';" border="0" height="22" width="79">&nbsp;-->
  59.                 </td>
  60.               </tr>
  61.             </table><br>
  62.           </td>
  63.         </tr>
  64.       </table>
  65. <%
  66. Request m_request = new Request(request);
  67. int iSysDirID = m_request.GetInt("SysDirID");
  68. int iPageSize = 18;
  69. int iPage = m_request.GetInt("Page");
  70. Vector vt = VoteManager.getRecordBySysDirID(iSysDirID);
  71. if(iPage<1)iPage=1;
  72. int iPageCount = StringNew.getPageCount(vt.size(),iPageSize);
  73. if(iPage>iPageCount) iPage=1;
  74. %>
  75.             <table width="90%" border="1" cellpadding="3" cellspacing="0" bordercolordark="#ffffff" bordercolorlight="#0a0a0a" style="">
  76.                 <tr align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
  77.                     <th width="6%" height="24" nowrap><img src="/images/white.gif" width="12"></th>
  78.                     <th width="6%" nowrap><font color="#000000">序号</font></th>
  79.                     <th width="30%" nowrap><font color="#000000">投票名称</font></th>
  80.                     <th width="8%" nowrap><font color="#000000">开始时间</font></th>
  81.                     <th width="8%" nowrap><font color="#000000">结束时间</font></th>
  82.                     <th width="8%" nowrap><font color="#000000">是否单选</font></th>
  83.                     <th width="8%" nowrap><font color="#000000">投票次数</font></th>
  84.                     <th width="8%" nowrap><font color="#000000">发布时间</font></th>
  85.                     <th width="8%" nowrap><font color="#000000">发布用户</font></th>
  86.                     <th width="8%" nowrap><font color="#000000">修改</font></th>
  87.                     <th width="8%" nowrap><font color="#000000">删除</font></th>
  88.                 </tr>
  89. <%
  90. for(int i=(iPage-1)*iPageSize;i<vt.size()&&i<iPage*iPageSize;i++)
  91. {
  92.     String strID = ((Vector)vt.get(i)).get(0).toString();
  93.     if(i % 2 == 0)
  94.         out.println("<tr id="Row"+ i+ "" class="DataRowsSingle" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsSingle');">");
  95.     else
  96.     out.println("<tr id="Row"+ i+ "" class="DataRowsDouble" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsDouble');">");
  97.     out.println("<td align="right" valign="middle"><img id="image" + i + "" src="../images/lastpost1.gif" style="display:none;"> </td>");
  98.     out.println("<td align="right" valign="middle">" + (i+1) + "</td>");
  99.     out.println("<td align="left" valign="middle" nowrap title="" + ((Vector)vt.get(i)).get(1).toString() + "" onclick="window.open('VoteOptionManage.jsp?SysDirID=" + iSysDirID + "&VoteID=" + strID + "','_blank','height=380,top='+((screen.height-380)/2)+',left='+((screen.width-400)/2)+',width=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes')"><a href="" onclick="return false;">" + ((Vector)vt.get(i)).get(1).toString() + "</a></td>");
  100.     out.println("<td align="center" valign="middle" nowrap>" + StringNew.GetDateString(((Vector)vt.get(i)).get(2).toString(),"yyyy-MM-dd") + "</td>");
  101.     out.println("<td align="center" valign="middle" nowrap>" + StringNew.GetDateString(((Vector)vt.get(i)).get(3).toString(),"yyyy-MM-dd") + "</td>");
  102.     String t_IsRadio = ((Vector)vt.get(i)).get(4).toString();
  103.     if (t_IsRadio.equalsIgnoreCase("true"))  t_IsRadio = "是";
  104.        else t_IsRadio = "否";
  105.     out.println("<td align="center" valign="middle" nowrap>" + t_IsRadio + "</td>");
  106.     out.println("<td align="center" valign="middle" nowrap>" + ((Vector)vt.get(i)).get(6).toString() + "</td>");
  107.     out.println("<td align="center" valign="middle" nowrap>" + StringNew.GetDateString(((Vector)vt.get(i)).get(7).toString(),"yyyy-MM-dd") + "</td>");
  108.     out.println("<td align="center" valign="middle" nowrap>" + ((Vector)vt.get(i)).get(9).toString() + "&nbsp;</td>");
  109.     out.println("<td align="center" valign="middle" nowrap><a href="EditVote.jsp?SysDirID="+iSysDirID + "&ID=" + strID + "">修改</a></td>");
  110.     out.println("<td align="center" valign="middle" nowrap><a href="DelVote.jsp?SysDirID="+iSysDirID + "&ID=" + strID + "" onclick="return confirm('您确实要删除该投票吗?\n要删除该投票,请先删除属于该投票的投票选项。');">删除</a></td>");
  111.     out.println("</tr>");
  112. }
  113. %>
  114.                 <tr>
  115.                     <th align="center" valign="top" colspan="11">
  116. <%
  117. String strCurrentPageURL = request.getRequestURI();
  118. if(iPage<2)
  119. out.print("首页&nbsp;&nbsp;上页");
  120. else
  121. out.print("<a href=""+ strCurrentPageURL+"?SysDirID=" + iSysDirID + "&Page=" + 1 + "">首页</a>&nbsp;&nbsp;<a href=""+ strCurrentPageURL+"?SysDirID=" + iSysDirID + "&Page=" + (iPage-1) + "">上页</a>");
  122. out.print("&nbsp;&nbsp;当前是第" + iPage + "页,共" + vt.size() + "条记录" + iPageCount + "页&nbsp;&nbsp;");
  123. if(iPage>=iPageCount)
  124. out.print("下页&nbsp;&nbsp;末页");
  125. else
  126. out.print("<a href=""+ strCurrentPageURL+"?SysDirID=" + iSysDirID + "&Page=" + (iPage+1) + "">下页</a>&nbsp;&nbsp;<a href=""+ strCurrentPageURL+"?SysDirID=" + iSysDirID + "&Page=" + iPageCount + "">末页</a>");
  127. %>
  128.                     </th>
  129.                 </tr>
  130.             </table>
  131.             <form name="addvote" action="AddVoteAction.jsp?SysDirID=<%=iSysDirID%>" method="post" onSubmit="javascript:return checkAddVote();">
  132.             <table align="center"  border="1" cellpadding="0" cellspacing="0" width="90%">
  133.                 <tr>
  134.                   <th colspan="2" align="center"><font color="#0A0A0A">新&nbsp;增&nbsp;投&nbsp;票&nbsp;</font></th>
  135.                 </tr>
  136.                 <tr>
  137.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">投&nbsp;票&nbsp;名&nbsp;称:&nbsp;</font></td>
  138.                     <td align="left" valign="middle" nowrap>
  139.                         &nbsp;<input name="VoteName" type="text" maxlength="60" size="40">
  140.                     </td>
  141.                 </tr>
  142.                 <tr>
  143.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">开&nbsp;始&nbsp;时&nbsp;间:&nbsp;</font></td>
  144.                     <td align="left" valign="middle" nowrap>
  145.                         &nbsp;<input name="StartTime" type="text" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="20" size="40" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">
  146.                    </td>
  147.                 </tr>
  148.                 <tr>
  149.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">结&nbsp;束&nbsp;时&nbsp;间:&nbsp;</font></td>
  150.                     <td align="left" valign="middle" nowrap>
  151.                         &nbsp;<input name="EndTime" type="text" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="20" size="40" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">
  152.                    </td>
  153.                 </tr>
  154.                 <tr>
  155.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">是&nbsp;否&nbsp;单&nbsp;选:&nbsp;</font></td>
  156.                     <td align="left" valign="middle" nowrap>
  157.                        <font color="#0A0A0A">&nbsp;<input name="IsRadio" type="radio" value="1" checked>单选&nbsp; <input name="IsRadio" type="radio" value="0">多选</font>
  158.                        <input name="VoteTimes" type="hidden" value="0">
  159.                        <%java.util.Date t_Date = new java.util.Date();%>
  160.                        <input name="PublishTime" type="hidden" value="<%=StringNew.GetDateString(t_Date,"yyyy-MM-dd")%>">
  161. <%
  162. Session t_session = new Session(session);
  163. %>
  164.                        <input name="PublishUserID" type="hidden" value="<%=t_session.GetInt("UserID")%>">
  165.                    </td>
  166.                 </tr>
  167.                 <tr>
  168.                     <td align="center" valign="middle" colspan="2">
  169.                         <input type="submit" value="新 增" style="background-color: #FFFFFF; border: 1 solid #000000">&nbsp;&nbsp;&nbsp; <input type="reset" value="重 填" style="background-color: #FFFFFF; border: 1 solid #000000">
  170.                     </td>
  171.                 </tr>
  172.             </table>
  173.             </form>
  174.         </td>
  175.     </tr>
  176. </table>
  177. </body>
  178. </html>