bulletin_modify.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:7k
源码类别:

电子政务应用

开发平台:

Java

  1. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  2. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  3. <%@ page import="java.util.Calendar" %>
  4. <%@ page import="com.vnex.intranet.util.TimeStamp" %>
  5. <%@ page import="com.vnex.intranet.pub.BaseJdbcDAO" %>
  6. <jsp:useBean id="bulletinProxy" scope="application" class="com.vnex.intranet.communication.bulletin.proxy.BulletinProxyBean" />
  7. <jsp:useBean id="bvb" scope="request" class="com.vnex.intranet.communication.bulletin.value.BulletinValueBean" />
  8. <%
  9.     bvb = bulletinProxy.getBulletinDetail(Integer.parseInt(request.getParameter("bulletinId")));
  10.     String year = "0";
  11.     String month = "0";
  12.     String day = "0";
  13.     String endDate = "";
  14.     if(bvb.getEndDate() != null)
  15.     {
  16.         Calendar cal = bvb.getEndDate();
  17.         year = ""+cal.get(Calendar.YEAR);
  18.         if((cal.get(Calendar.MONTH)+1)<10)
  19.           month = "0"+(cal.get(Calendar.MONTH)+1);
  20.         else  
  21.           month = ""+(cal.get(Calendar.MONTH)+1);
  22.         if(cal.get(Calendar.DAY_OF_MONTH)<10)
  23.           day = "0"+cal.get(Calendar.DAY_OF_MONTH);
  24.         else    
  25.           day = ""+cal.get(Calendar.DAY_OF_MONTH);
  26.         endDate = year+"-"+month+"-"+day;   
  27.     }    
  28.     java.sql.Timestamp ts = BaseJdbcDAO.getDBSystemDate();
  29.     String current = ts.toString();
  30.     current = current.substring(0, current.indexOf(" ")); 
  31.     
  32. %>
  33. <script language=javascript src="/vnex/util/popup.js"></script>
  34. <script language="javascript" src="/vnex/util/strUtil.js"></script>
  35. <script language=JavaScript>
  36. function modifyBulletin(form)
  37. {
  38.    if(checkIt(form))
  39.    {
  40.       form.action="/mainctrl/personal/bulletin/modifyBulletinSuccess?bulletinId=<%=request.getParameter("bulletinId")%>&start=<%=request.getParameter("start")%>";
  41.       form.submit();
  42.    }   
  43. }
  44. function publishIt(form)
  45. {
  46.    form.action="/mainctrl/personal/bulletin/publishToScrollText?bulletinId=<%=request.getParameter("bulletinId")%>";
  47.    form.submit();
  48. }
  49. function unpublishIt(form)
  50. {
  51.    form.action="/mainctrl/personal/bulletin/unpublishFromScrollText?bulletinId=<%=request.getParameter("bulletinId")%>";
  52.    form.submit();
  53. }
  54. function checkIt(form)
  55. {
  56.    if(isEmpty(form.bulletinBody.value) || isEmptyStr(form.bulletinBody.value))
  57.    {
  58.       alert("请输入滚动信息内容");
  59.       form.bulletinBody.focus();
  60.       return false;
  61.    }
  62.    if(!isEmpty(form.bulletinBody.value) && isInvalidateLen(form.bulletinBody.value,1000))
  63.    {
  64.       alert("公告信息内容不能超过250个汉字或1000个英文字符 ");
  65.       form.bulletinBody.focus();
  66.       return false;
  67.    }
  68.    if(!isEmpty(form.endDate.value))
  69.    {
  70.       if(form.endDate.value < "<%=current%>")
  71.       {
  72.         alert("截止日期必须在本日之后");
  73.         form.endDate.focus();
  74.         return false;
  75.       }
  76.    }      
  77.    
  78.    return true;
  79. }
  80. </script>
  81. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  82. <HTML>
  83. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  84. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  85. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
  86. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  87. <DIV align=center>
  88. <form name="form1" method="post">
  89.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  90.     <TBODY> 
  91.       <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  92.     <TR> 
  93.         <TD colSpan=3 align="center" class="iframestyle" valign="top"><br>
  94.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  95.             <tr valign="top" bgcolor="#fafafa"> 
  96.               <td > 
  97.                 <table width="600" border="0" cellpadding="2" cellspacing="0">
  98.                   <tr bgcolor="#666666"> 
  99.                       <td colspan="2"><font class="strongw">
  100.                        <a href="/mainctrl/home/index"><font color="#ffffff">首页</font></a>&gt;&gt;
  101.                        <a href="/mainctrl/personal/main"><font color="#ffffff">个从办公</font></a>&gt;&gt;
  102.                        <a href="/mainctrl/personal/bulletin/home"><font color="#ffffff">滚动消息管理</font></a>&gt;&gt;
  103.                        修改滚动信息
  104.                        </font>
  105.                     </td>
  106.                   </tr>
  107.                 </table>
  108.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  109.                      <tr bgcolor="#fafafa"> 
  110.                         <td width="15%">&nbsp;<strong>内容:</strong></td>
  111.                         <td> 
  112.                             <textarea name="bulletinBody" rows="5" cols="50" class="text"><%=bvb.getBulletinBody()%></textarea>&nbsp;*&nbsp;(注:带*为必填内容)
  113.                         </td>
  114.                      </tr>
  115.                      <tr bgcolor="#e0e0e0"> 
  116.                        <td width="15%">&nbsp;<strong>截止日期:</strong></td>
  117.                          <td> 
  118.                           <input type="text" name="endDate" readonly size="24" class="text" value="<%=endDate%>">
  119.                           &nbsp;
  120.                       <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择借阅档案日期" onClick="fPopUpCalendarDlg(endDate);return false">
  121.                          </td>
  122.                      </tr>
  123.                      <tr bgcolor="#fafafa"> 
  124.                         <td width="15%"><strong>&nbsp;发布人:</strong></td>
  125.                         <td><%=bvb.getCreator()%></td>
  126.                      </tr>
  127.                      <tr bgcolor="#e0e0e0">
  128.                         <td width="15%"><strong>&nbsp;发布日期:</strong></td>
  129.                         <td><%=TimeStamp.toString(TimeStamp.convertCalendarToTimestamp(bvb.getCreateDate()))%>
  130.                         </td>
  131.                      </tr>
  132.               <tr bgcolor="#fafafa">
  133.                  <td colspan="2" height="30" align="center">
  134.                    <input type="button" name="Button2" value="保存" onClick="modifyBulletin(this.form)" class="text">
  135.                    &nbsp;&nbsp;
  136. <%            if(bvb.getIsScrollText() == 0)
  137.               {
  138. %>                                 
  139.                    <input type="button" name="button22" value="设为滚动消息" onclick="publishIt(this.form)" class="text" style="width:80px">
  140.                    &nbsp;&nbsp;
  141. <%            }
  142.               else
  143.               {
  144. %>
  145.                    <input type="button" name="button23" value="不在滚动消息中显示" onclick="unpublishIt(this.form)" class="text" style="width:115px">&nbsp;&nbsp;
  146. <%            }%>                                                    
  147.                    <input type="reset" name="Button2" value="重置" class="text">
  148.                    &nbsp;&nbsp;
  149.                    <input type="button" name="Button2" value="放弃" class="text" onclick="history.back()">
  150.                  </td>
  151.               </tr>
  152.                  </table>
  153.                </td>
  154.             </tr>
  155.          </table>
  156.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  157.        </TD>
  158.      </TR>
  159.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  160.     </TBODY> 
  161.   </TABLE>
  162.     <BR>
  163.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  164. </form>
  165. </DIV>
  166. </BODY>
  167. </HTML>