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. <script language=javascript src="/vnex/util/popup.js"></script>
  33. <script language="javascript" src="/vnex/util/strUtil.js"></script>
  34. <script language=JavaScript>
  35. function modifyBulletin(form)
  36. {
  37.    if(checkIt(form))
  38.    {
  39.       form.action="/mainctrl/bulletin/modifyBulletinSuccess?bulletinId=<%=request.getParameter("bulletinId")%>&start=<%=request.getParameter("start")%>";
  40.       form.submit();
  41.    }   
  42. }
  43. function checkIt(form)
  44. {
  45.    if(isEmpty(form.bulletinTitle.value) || isEmptyStr(form.bulletinTitle.value))
  46.    {
  47.       alert("请输入公告板标题");
  48.       form.bulletinTitle.focus();
  49.       return false;
  50.    }
  51.    if(isInvalidateLen(form.bulletinTitle.value,100))
  52.    {
  53.       alert("公告信息标题不能超过25个汉字或100个英文字符");
  54.       form.bulletinTitle.focus();
  55.       return false;
  56.    }
  57.    if(!isEmpty(form.bulletinBody.value) && isInvalidateLen(form.bulletinBody.value,1000))
  58.    {
  59.       alert("公告信息内容不能超过250个汉字或1000个英文字符 ");
  60.       form.bulletinBody.focus();
  61.       return false;
  62.    }
  63.    if(!isEmpty(form.endDate.value))
  64.    {
  65.       if(form.endDate.value < "<%=current%>")
  66.       {
  67.         alert("截止日期必须在本日之后");
  68.         form.endDate.focus();
  69.         return false;
  70.       }
  71.    }      
  72.    
  73.    return true;
  74. }
  75. </script>
  76. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  77. <HTML>
  78. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  79. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  80. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_communicate.js"></script>
  81. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  82. <DIV align=center>
  83. <form name="form1" method="post">
  84.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  85.     <TBODY> 
  86.       <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  87.     <TR> 
  88.         <TD colSpan=3 align="center" class="iframestyle" valign="top"><br>
  89.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  90.             <tr valign="top" bgcolor="#fafafa"> 
  91.               <td > 
  92.                 <table width="600" border="0" cellpadding="2" cellspacing="0">
  93.                   <tr bgcolor="#666666"> 
  94.                       <td colspan="2"><font class="strongw"><font class="strongw"><a href="/mainctrl/home/index"><font color="#ffffff">首页</font></a>&gt;&gt;<a href="/mainctrl/communication/main"><font color="#ffffff">通信</font></a>&gt;&gt;<a href="/mainctrl/bulletin/home?home"><font color="#ffffff">公告板</font></a>&gt;&gt;修改公告板信息</font>
  95.                     </td>
  96.                   </tr>
  97.                 </table>
  98.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  99.                      <tr bgcolor="#e0e0e0"> 
  100.                         <td width="15%">&nbsp;<strong>标题:</strong></td>
  101.                         <td> 
  102.                            <input type="text" name="bulletinTitle" value="<%=bvb.getBulletinTitle()%>" size="24" class="text" maxlength="100">&nbsp;&nbsp;*(注:带*为必填内容)
  103.                         </td>
  104.                      </tr>
  105.                      <tr bgcolor="#fafafa"> 
  106.                         <td width="15%">&nbsp;<strong>内容:</strong></td>
  107.                         <td> 
  108.                             <textarea name="bulletinBody" rows="5" cols="59" class="text"><%=bvb.getBulletinBody()%></textarea>
  109.                         </td>
  110.                      </tr>
  111.                      <tr bgcolor="#e0e0e0"> 
  112.                        <td width="15%">&nbsp;<strong>截止日期:</strong></td>
  113.                          <td> 
  114.                           <input type="text" name="endDate" readonly size="24" class="text" value="<%=endDate%>">
  115.                           &nbsp;
  116.                       <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择借阅档案日期" onClick="fPopUpCalendarDlg(endDate);return false">
  117.                          </td>
  118.                      </tr>
  119.                      <tr bgcolor="#fafafa"> 
  120.                         <td width="15%"><strong>&nbsp;发布人:</strong></td>
  121.                         <td><%=bvb.getCreator()%></td>
  122.                      </tr>
  123.                      <tr bgcolor="#e0e0e0">
  124.                         <td width="15%"><strong>&nbsp;发布日期:</strong></td>
  125.                         <td><%=TimeStamp.toString(TimeStamp.convertCalendarToTimestamp(bvb.getCreateDate()))%>
  126.                         </td>
  127.                      </tr>
  128.               <tr bgcolor="#fafafa">
  129.                  <td colspan="2" height="30" align="center">
  130.                    <input type="button" name="Button2" value="保存" onClick="modifyBulletin(this.form)" class="text">
  131.                    &nbsp;&nbsp;
  132.                    <input type="reset" name="Button2" value="重置" class="text">
  133.                    &nbsp;&nbsp;
  134.                    <input type="button" name="Button2" value="放弃" class="text" onclick="history.back()">
  135.                  </td>
  136.               </tr>
  137.                  </table>
  138.                </td>
  139.             </tr>
  140.          </table>
  141.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  142.        </TD>
  143.      </TR>
  144.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  145.     </TBODY> 
  146.   </TABLE>
  147.     <BR>
  148.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  149. </form>
  150. </DIV>
  151. </BODY>
  152. </HTML>