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

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"><p>&nbsp;</p>
  45.           <table width="90%" border="0" cellpadding="0" cellspacing="0">
  46.                 <tr align="center" valign="middle">
  47.                 <th nowrap colspan=2 align="center"><font color="#000000">投&nbsp;票&nbsp;管&nbsp;理</font></th>
  48.               </tr>
  49.                <tr><td>&nbsp;</td>
  50.                 </tr>
  51.               </table>
  52. <%
  53. Request m_request = new Request(request);
  54. int iSysDirID = m_request.GetInt("SysDirID");
  55. int iPageSize = 18;
  56. int iPage = m_request.GetInt("Page");
  57. Vector vt = VoteManager.getRecordBySysDirID(iSysDirID);
  58. if(iPage<1)iPage=1;
  59. int iPageCount = StringNew.getPageCount(vt.size(),iPageSize);
  60. if(iPage>iPageCount) iPage=1;
  61. %>
  62.             <table width="90%" border="1" cellpadding="3" cellspacing="0" bordercolordark="#ffffff" bordercolorlight="#0a0a0a" style="">
  63.                 <tr align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
  64.                     <th width="6%" height="24" nowrap><img src="/images/white.gif" width="12"></th>
  65.                     <th width="6%" nowrap><font color="#000000">序号</font></th>
  66.                     <th width="30%" nowrap><font color="#000000">投票名称</font></th>
  67.                     <th width="8%" nowrap><font color="#000000">开始时间</font></th>
  68.                     <th width="8%" nowrap><font color="#000000">结束时间</font></th>
  69.                     <th width="8%" nowrap><font color="#000000">是否单选</font></th>
  70.                     <th width="8%" nowrap><font color="#000000">投票次数</font></th>
  71.                     <th width="8%" nowrap><font color="#000000">发布时间</font></th>
  72.                     <th width="8%" nowrap><font color="#000000">发布用户</font></th>
  73.                     <th width="8%" nowrap><font color="#000000">修改</font></th>
  74.                     <th width="8%" nowrap><font color="#000000">删除</font></th>
  75.                 </tr>
  76. <%
  77. for(int i=(iPage-1)*iPageSize;i<vt.size()&&i<iPage*iPageSize;i++)
  78. {
  79.     String strID = ((Vector)vt.get(i)).get(0).toString();
  80.     if(i % 2 == 0)
  81.         out.println("<tr id="Row"+ i+ "" class="DataRowsSingle" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsSingle');">");
  82.     else
  83.     out.println("<tr id="Row"+ i+ "" class="DataRowsDouble" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsDouble');">");
  84.     out.println("<td align="right" valign="middle"><img id="image" + i + "" src="../images/lastpost1.gif" style="display:none;"> </td>");
  85.     out.println("<td align="right" valign="middle">" + (i+1) + "</td>");
  86.     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>");
  87.     out.println("<td align="center" valign="middle" nowrap>" + StringNew.GetDateString(((Vector)vt.get(i)).get(2).toString(),"yyyy-MM-dd") + "</td>");
  88.     out.println("<td align="center" valign="middle" nowrap>" + StringNew.GetDateString(((Vector)vt.get(i)).get(3).toString(),"yyyy-MM-dd") + "</td>");
  89.     String t_IsRadio = ((Vector)vt.get(i)).get(4).toString();
  90.     if (t_IsRadio.equalsIgnoreCase("true"))  t_IsRadio = "是";
  91.        else t_IsRadio = "否";
  92.     out.println("<td align="center" valign="middle" nowrap>" + t_IsRadio + "</td>");
  93.     out.println("<td align="center" valign="middle" nowrap>" + ((Vector)vt.get(i)).get(6).toString() + "</td>");
  94.     out.println("<td align="center" valign="middle" nowrap>" + StringNew.GetDateString(((Vector)vt.get(i)).get(7).toString(),"yyyy-MM-dd") + "</td>");
  95.     out.println("<td align="center" valign="middle" nowrap>" + ((Vector)vt.get(i)).get(9).toString() + "&nbsp;</td>");
  96.     out.println("<td align="center" valign="middle" nowrap><a href="EditVote.jsp?SysDirID="+iSysDirID + "&ID=" + strID + "">修改</a></td>");
  97.     out.println("<td align="center" valign="middle" nowrap><a href="DelVote.jsp?SysDirID="+iSysDirID + "&ID=" + strID + "" onclick="return confirm('您确实要删除该投票吗?\n要删除该投票,请先删除属于该投票的投票选项。');">删除</a></td>");
  98.     out.println("</tr>");
  99. }
  100. %>
  101.                 <tr>
  102.                     <th align="center" valign="top" colspan="11">
  103. <%
  104. String strCurrentPageURL = request.getRequestURI();
  105. if(iPage<2)
  106. out.print("首页&nbsp;&nbsp;上页");
  107. else
  108. out.print("<a href=""+ strCurrentPageURL+"?SysDirID=" + iSysDirID + "&Page=" + 1 + "">首页</a>&nbsp;&nbsp;<a href=""+ strCurrentPageURL+"?SysDirID=" + iSysDirID + "&Page=" + (iPage-1) + "">上页</a>");
  109. out.print("&nbsp;&nbsp;当前是第" + iPage + "页,共" + vt.size() + "条记录" + iPageCount + "页&nbsp;&nbsp;");
  110. if(iPage>=iPageCount)
  111. out.print("下页&nbsp;&nbsp;末页");
  112. else
  113. out.print("<a href=""+ strCurrentPageURL+"?SysDirID=" + iSysDirID + "&Page=" + (iPage+1) + "">下页</a>&nbsp;&nbsp;<a href=""+ strCurrentPageURL+"?SysDirID=" + iSysDirID + "&Page=" + iPageCount + "">末页</a>");
  114. %>
  115.                     </th>
  116.                 </tr>
  117.             </table>
  118.             <form name="addvote" action="AddVoteAction.jsp?SysDirID=<%=iSysDirID%>" method="post" onSubmit="javascript:return checkAddVote();">
  119.             <table align="center"  border="1" cellpadding="0" cellspacing="0" width="90%">
  120.                 <tr>
  121.                   <th colspan="2" align="center"><font color="#0A0A0A">新&nbsp;增&nbsp;投&nbsp;票&nbsp;</font></th>
  122.                 </tr>
  123.                 <tr>
  124.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">投&nbsp;票&nbsp;名&nbsp;称:&nbsp;</font></td>
  125.                     <td align="left" valign="middle" nowrap>
  126.                         &nbsp;<input name="VoteName" type="text" maxlength="60" size="40">
  127.                     </td>
  128.                 </tr>
  129.                 <tr>
  130.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">开&nbsp;始&nbsp;时&nbsp;间:&nbsp;</font></td>
  131.                     <td align="left" valign="middle" nowrap>
  132.                         &nbsp;<input name="StartTime" type="text" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="20" size="40" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">
  133.                    </td>
  134.                 </tr>
  135.                 <tr>
  136.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">结&nbsp;束&nbsp;时&nbsp;间:&nbsp;</font></td>
  137.                     <td align="left" valign="middle" nowrap>
  138.                         &nbsp;<input name="EndTime" type="text" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="20" size="40" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">
  139.                    </td>
  140.                 </tr>
  141.                 <tr>
  142.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">是&nbsp;否&nbsp;单&nbsp;选:&nbsp;</font></td>
  143.                     <td align="left" valign="middle" nowrap>
  144.                        <font color="#0A0A0A">&nbsp;<input name="IsRadio" type="radio" value="1" checked>单选&nbsp; <input name="IsRadio" type="radio" value="0">多选</font>
  145.                        <input name="VoteTimes" type="hidden" value="0">
  146.                        <%java.util.Date t_Date = new java.util.Date();%>
  147.                        <input name="PublishTime" type="hidden" value="<%=StringNew.GetDateString(t_Date,"yyyy-MM-dd")%>">
  148. <%
  149. Session t_session = new Session(session);
  150. %>
  151.                        <input name="PublishUserID" type="hidden" value="<%=t_session.GetInt("UserID")%>">
  152.                    </td>
  153.                 </tr>
  154.                 <tr>
  155.                     <td align="center" valign="middle" colspan="2">
  156.                         <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">
  157.                     </td>
  158.                 </tr>
  159.             </table>
  160.             </form>
  161.         </td>
  162.     </tr>
  163. </table>
  164. </body>
  165. </html>