guestbook_mod.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:5k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="java.util.*"%>
  3. <%@ page import="cn.js.fan.util.*"%>
  4. <%@ page import="cn.js.fan.db.*"%>
  5. <%@ page import="cn.js.fan.web.*"%>
  6. <%@ page import="cn.js.fan.module.guestbook.*"%>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  8. <HTML><HEAD><TITLE>留言簿管理</TITLE>
  9. <META http-equiv=Content-Type content="text/html; charset=utf-8">
  10. <link rel="stylesheet" href="default.css" type="text/css">
  11. <META content="MSHTML 6.00.2600.0" name=GENERATOR>
  12. <style type="text/css">
  13. <!--
  14. .style1 {
  15. font-size: 16px;
  16. font-weight: bold;
  17. }
  18. body {
  19. margin-top: 0px;
  20. }
  21. -->
  22. </style>
  23. </HEAD>
  24. <BODY bgColor=#ffffff leftMargin=0 marginwidth="0">
  25. <table width='100%' cellpadding='0' cellspacing='0' >
  26.   <tr>
  27.     <td class="head">管理<a href="guestbook.jsp">留言簿</a></td>
  28.   </tr>
  29. </table>
  30. <br>
  31. <table width="98%" height="227" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  32.   <tr>
  33.     <td height=20 align="left" class="thead">修改内容</td>
  34.   </tr>
  35.   <tr>
  36.     <td valign="top"><table width="79%" border="0" align="center" cellpadding="0" cellspacing="0">
  37.       <tr>
  38.         <td width="100%" height="23" align="center" valign="bottom">&nbsp;</td>
  39.       </tr>
  40.       <tr>
  41.         <td valign="top" background="../images/tab-b-back.gif"><jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  42.           
  43.             <%
  44. if (!privilege.isUserLogin(request))
  45. {
  46. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  47. return;
  48. }
  49. String id = request.getParameter("id");
  50. if (id==null || !StrUtil.isNumeric(id))
  51. {
  52. out.println(StrUtil.makeErrMsg("未选择留言标识!"));
  53. return;
  54. }
  55. String opType = ParamUtil.get(request, "opType");
  56. if (!opType.equals("shop")) {
  57. out.print(StrUtil.Alert_Back("缺少类型!"));
  58. }
  59. %>
  60. <%
  61. MessageDb msg = new MessageDb();
  62. String dowhat = ParamUtil.get(request, "dowhat");
  63. msg = msg.getMessageDb(Integer.parseInt(id));
  64. if (dowhat.equals("modify"))
  65. {
  66. String content = ParamUtil.get(request, "content");
  67. if (content.equals(""))
  68. {
  69. out.println(StrUtil.Alert("留言内容不能为空!"));
  70. }
  71. else
  72. {
  73. String reply = ParamUtil.get(request, "reply");
  74. boolean re = false;
  75. try {
  76. msg.setContent(content);
  77. msg.setReply(reply);
  78. re = msg.save();
  79. }
  80. catch (ErrMsgException e) {
  81. out.print(StrUtil.makeErrMsg(e.getMessage()));
  82. }
  83. if (re)
  84. out.print(StrUtil.Alert("更新留言成功!"));
  85. }
  86. }
  87. %>
  88.             <br>
  89.             <table width="94%" border="0" align="center" cellpadding="0" cellspacing="0" class="frame_gray">
  90.               <form name="form1" action="guestbook_mod.jsp" method="post" onSubmit="">
  91.                 <tr bgcolor="#D5DADB">
  92.                   <td width="15%" height="21" align="center" class="stable">用&nbsp;户&nbsp;名</td>
  93.                   <td width="20%" height="21" class="stable"><%=StrUtil.toHtml(msg.getUserName())%></td>
  94.                   <td width="65%" height="21" class="stable">留言时间 <%=DateUtil.format(msg.getLydate(), "yy-MM-dd HH:mm:ss")%>
  95.                       <input name="opType" type=hidden id="opType" value="<%=opType%>">
  96.                       <input type=hidden name="id" value="<%=id%>">
  97.                       <input type=hidden name=dowhat value="modify"></td>
  98.                 </tr>
  99.                 <tr>
  100.                   <td width="15%" height="17" align="center" bgcolor="#eeeeee" class="stable">内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容</td>
  101.                   <td height="17" colspan="2" bgcolor="#eeeeee" class="stable"><textarea name=content rows=10 cols="65"><%=StrUtil.toHtml(msg.getContent())%></textarea>
  102.                       <br>
  103.                   </td>
  104.                 </tr>
  105.                 <tr>
  106.                   <td width="15%" height="58" align="center" bgcolor="#eeeeee" class="stable">回&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;复</td>
  107.                   <td height="58" colspan="2" bgcolor="#eeeeee" class="stable"><textarea name=reply rows=10 cols="65"><%=msg.getReply()%></textarea>
  108.                   </td>
  109.                 </tr>
  110.                 <tr>
  111.                   <td height="22" align="center" bgcolor="#eeeeee" class="stable">回复时间</td>
  112.                   <td height="22" colspan="2" align="left" bgcolor="#eeeeee" class="stable"><%
  113. if (msg.getRedate()!=null) {
  114. out.print(DateUtil.format(msg.getRedate(), "yy-MM-dd HH:mm:ss"));
  115. }%>
  116. &nbsp;</td>
  117.                 </tr>
  118.                 <tr>
  119.                   <td colspan="3" align="center"><input type=submit value="发送" name="submit">
  120. &nbsp;&nbsp;
  121.               <input type=reset value="取消" name="reset">
  122.                   </td>
  123.                 </tr>
  124.               </form>
  125.           </table></td>
  126.       </tr>
  127.       <tr>
  128.         <td height="9">&nbsp;</td>
  129.       </tr>
  130.     </table></td>
  131.   </tr>
  132. </table>
  133. </BODY></HTML>