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

电子政务应用

开发平台:

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="leaveWordProxy" scope="application" class="com.vnex.intranet.communication.leaveword.proxy.LeaveWordProxyBean" />
  7. <jsp:useBean id="lvb" scope="request" class="com.vnex.intranet.communication.leaveword.value.LeaveWordValueBean" />
  8. <%
  9.     lvb = leaveWordProxy.getLeaveWordDetail(Integer.parseInt(request.getParameter("leaveWordId")));
  10.     String year = "0";
  11.     String month = "0";
  12.     String day = "0";
  13.     String endDate = "";
  14.     if(lvb.getEndDate() != null)
  15.     {
  16.         Calendar cal = lvb.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.     String deleteSuffix = "/mainctrl/leaveword/deleteLeaveWordSuccess";
  32.     if(request.getParameter("history") != null)
  33.        deleteSuffix += "?history";
  34. %>
  35. <script Language="JavaScript" src="/vnex/util/Popup.js"></script>
  36. <script language="javascript" src="/vnex/util/strUtil.js"></script>
  37. <script language=JavaScript>
  38. function modifyLeaveWord(form)
  39. {
  40.    if(checkIt(form))
  41.    {
  42.       form.action="/mainctrl/leaveword/modifyLeaveWordSuccess?start=<%=request.getParameter("start")%>";
  43.       form.submit();
  44.    }   
  45. }
  46. function deleteLeaveWord(form)
  47. {
  48.    if(confirm("是否删除此条留言?"))
  49.    {
  50.       form.action="<%=deleteSuffix%>";
  51.       form.submit();
  52.    }   
  53. }
  54. function checkIt(form)
  55. {
  56.    if(isEmpty(form.msgBody.value) || isEmptyStr(form.msgBody.value))
  57.    {
  58.       alert("请输入留言信息");
  59.       form.msgBody.focus();
  60.       return false;
  61.    }
  62.    else
  63.    {
  64.       if(isInvalidateLen(form.msgBody.value, 1000))
  65.       {
  66.          alert("留言内容不能超过250个汉字或1000个英文字符");
  67.          form.msgBody.focus();
  68.          return false;
  69.       }
  70.    }
  71.    if(!isEmpty(form.endDate.value))
  72.    {
  73.       if(form.endDate.value < "<%=current%>")
  74.       {
  75.         alert("截止日期必须在本日之后");
  76.         return false;
  77.       }
  78.    }      
  79.    
  80.    return true;
  81. }
  82. </script>
  83. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  84. <HTML>
  85. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  86. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  87. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_communicate.js"></script>
  88. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  89. <DIV align=center>
  90. <form name="form1" method="post">
  91. <input type="hidden" name="leaveWordId" value="<%=request.getParameter("leaveWordId")%>">
  92.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  93.     <TBODY> 
  94.       <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  95.     <TR> 
  96.         <TD colSpan=3 align="center" class="iframestyle" valign="top"><br>
  97.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  98.             <tr valign="top" bgcolor="#fafafa"> 
  99.               <td > 
  100.                 <table width="600" border="0" cellspacing="0" cellpadding="0">
  101.                   <tr valign="top" bgcolor="#fafafa"> 
  102.                     <td> 
  103.                       <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  104.                   <tr bgcolor="#666666"> 
  105.                       <td colspan="2"><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/leaveword/home"><font color="#ffffff">留言板</font></a>&gt;&gt;修改留言内容</font>
  106.                       </td>
  107.                   </tr>
  108.             <tr bgcolor="#e0e0e0"> 
  109.                <td width="100"><strong>&nbsp;留言时间:</strong></td>
  110.                <td><%=TimeStamp.toString(TimeStamp.convertCalendarToTimestamp(lvb.getWriteDate()))%></td>
  111.             </tr>
  112.             <tr bgcolor="#fafafa">
  113.                <td width="100"><strong>&nbsp;内容:</strong></td>
  114.                <td>
  115.                  <textarea name="msgBody" rows="5" cols="39"><%=lvb.getMsgBody()%></textarea>&nbsp;*&nbsp;(注:带*为必填内容)
  116.               </td>
  117.             </tr>
  118.             <tr bgcolor="#e0e0e0"> 
  119.               <td width="100"><strong>&nbsp;截止日期:</strong></td>
  120.               <td>
  121.                <input type="text" name="endDate" readonly size="30" class="text" value="<%=endDate%>">&nbsp;
  122.            <img src="/vnex/util/datetime.gif" style="cursor:hand;" align="absmiddle" alt="选择借阅档案日期" onClick="fPopUpCalendarDlg(endDate);return false">
  123.          </td>                
  124.            </tr>
  125.            <tr bgcolor="#fafafa">
  126.              <td colspan="2" align="center" height="30">
  127.                     <input type="button" value="保存" name="B1" onClick="modifyLeaveWord(this.form)" class="text">
  128.                     &nbsp;&nbsp; 
  129.                     <input type="button" value="删除" name="B2" onClick="deleteLeaveWord(this.form)" class="text">
  130.                     &nbsp;&nbsp;
  131.                     <input type="reset" value="重置" name="B3" class="text">
  132.                     &nbsp;&nbsp;
  133.                     <input type="button" value="放弃" name="B4" class="text" onclick="history.back()">
  134.              </td>
  135.            </tr>       
  136.         </table>
  137.       </td>
  138.             </tr>   
  139.         </table>
  140.         </td>
  141.         </tr>
  142.         </table>
  143.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  144.        </TD>
  145.      </TR>
  146.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  147.     </TBODY> 
  148.   </TABLE>
  149.     <BR>
  150.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  151. </form>
  152. </DIV>
  153. </BODY>
  154. </HTML>