userReMessage.jsp
上传用户:u_thks
上传日期:2022-07-31
资源大小:1910k
文件大小:8k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

Java

  1. <%@ page language="java" contentType="text/html;charset=UTF-8"
  2.  session="true" errorPage="err.jsp" %>
  3. <%@ include file="GVinc/gvImport.jsp" %>
  4. <jsp:useBean id="cmt" scope="page" class="com.gamvan.club.message.ClubMessageTake"/>
  5. <jsp:useBean id="cms" scope="page" class="com.gamvan.club.message.ClubMessageSend"/>
  6. <%
  7. if(gvUserID<=0){
  8. out.print(prtCenter("您尚未登陆,无权进行此项操作!","userLogin.jsp",1));
  9. out.close();
  10. if(true) return;
  11. }
  12. int reID = ParamUtils.getIntParameter(request,"cmReID");
  13. int iPage = ParamUtils.getIntParameter(request,"iPage");
  14. if(iPage<1){iPage=1;}
  15. int cmReID=0;
  16. int cmID = ParamUtils.getIntParameter(request,"cmID");
  17. String cmTakeUser=""
  18. , cmSendUser=""
  19. , cmSendUser1=""
  20. , cmAddTime=""
  21. , cmTopic=""
  22. , cmContent="";
  23. boolean  bea = false;
  24. boolean  cmIsTake= false, cmIsSend= false;
  25. int cmSendID = 0, cmTakeID = 0;
  26. ClubMessageTakeItem cmti = null;
  27. String userNames = "";
  28. if(request.getMethod().equals("POST")){
  29. userNames = request.getParameter("utTakeUser").trim();
  30. if(session.getAttribute("gvPost")==null){
  31. session.setAttribute("gvPost",now);
  32. }else{
  33. String isNow1 = FormatDateTime.dateAdd("s", -15);
  34. String isNow2 = String.valueOf(session.getAttribute("gvPost")); //第一次提交时间
  35. if(FormatDateTime.secondCompare(isNow1, isNow2)){
  36. out.print(prtCenter("短消息发送过于频繁,请稍候再发!","",2));
  37. out.close();
  38. if(true)return;
  39. }else{
  40. session.setAttribute("gvPost",now);
  41. }
  42. }
  43. cms.setIsPost(TypeChange.stringToInt(request.getParameter("isPost")));
  44. //cms.setCmTakeUser(request.getParameter("utTakeUser").trim());
  45. cms.setCmSendUser(gvUserName);
  46. cms.setCmSendID(gvUserID);
  47. cms.setCmTopic(request.getParameter("utTopic").trim());
  48. cms.setCmContent(request.getParameter("utContent"));
  49. cms.setCmUserIp(request.getRemoteAddr());
  50. cms.setCmIsSend(true);
  51. cms.setCmOrder((short)0);
  52. if(reID>0){
  53. cms.setCmReID(reID);
  54. }else{
  55. cms.setCmReID(cmID);
  56. }
  57. cms.sendMessages(request.getParameter("utTakeUser").trim());
  58. response.setHeader("Refresh", "2; URL=");
  59. out.print(prtCenter(cms.getMessage(),"",2));
  60. out.close();
  61. if(true)return;
  62. }
  63. if(cmID>0){
  64. cmti = cmt.takeMessageInfo(cmID);
  65. if(cmti!=null){
  66. cmTakeUser = cmti.getCmTakeUser();
  67. cmSendUser1 = cmti.getCmSendUser();
  68. cmTopic = cmti.getCmTopic();
  69. cmContent = cmti.getCmContent();
  70. cmAddTime = cmti.getCmAddTime();
  71. cmIsTake = cmti.getCmIsTake();
  72. cmSendID = cmti.getCmSendID();
  73. cmTakeID = cmti.getCmTakeID();
  74. if(!cmIsTake){
  75. cmt.takeUpdate(cmID); //更新短信状态为已查阅。
  76. }
  77. bea = true;
  78. }
  79. if(gvUserID!=cmTakeID){
  80. out.print(prtCenter("请不要越权查阅他人短消息!","",2));
  81. out.close();
  82. if(true) return;
  83. }
  84. cmt.takeUpdate(cmID);
  85. }
  86. %>
  87. <html xmlns="http://www.w3.org/1999/xhtml">
  88. <head>
  89. <title><%=clubTitle%></title>
  90. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  91. <link href="./GVimgs/favicon.ico" rel="Bookmark"> 
  92. <link rel="icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
  93. <link rel="shortcut icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
  94. <link href="./GVinc/main.css" rel="stylesheet" type="text/css" />
  95. <style type="text/css">
  96. <!--
  97. .style1 {color: #FF0000}
  98. -->
  99. </style>
  100. </head>
  101. <body>
  102. <DIV id="waitDiv" style="LEFT: 40%; VISIBILITY: hidden; POSITION: absolute; TOP: 30%; TEXT-ALIGN: center">
  103. <TABLE cellPadding=6 border=0>
  104. <TBODY><TR><TD align=middle>
  105. <IMG  src="GVimgs/loading.gif" alt="请稍候..." width="30" height="30">
  106. <BR>
  107. <FONT color="red">数据载入中,请稍候...</FONT></TD></TR></TBODY></TABLE></DIV>
  108. <script language="javascript" type="text/javascript" src="GVscript/GVtopCode.js"></script>
  109. <script language="javascript" type="text/javascript" src="GVscript/GVpost.js"></script>
  110. <SCRIPT language="javascript">
  111. //提交表单
  112. function postMsg(){
  113. var o=event.srcElement;
  114. o.gvSubmit.value="正在提交...";
  115. o.gvSubmit.disabled=true;
  116. o.gvBack.disabled=true;
  117. }
  118. function checkForm(){
  119. if (document.Gforms.utTopic.value.length == 0) {
  120. alert("短消息标题不能为空!");
  121. document.Gforms.utTopic.focus();
  122. return false;
  123. }
  124. if (document.Gforms.utTopic.value.length > 180) {
  125. alert("短消息标题字数不能大于200个字符!");
  126. document.Gforms.utTopic.focus();
  127. return false;
  128. }
  129. if (document.Gforms.utContent.value.length > 5000) {
  130. alert("短消息标题字数不能大于5000个字符!");
  131. document.Gforms.utContent.focus();
  132. return false;
  133. }
  134. postMsg();
  135. return true;
  136. }
  137. gv_showWait('waitDiv', 1);
  138. </SCRIPT>
  139. <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tab">
  140.   <tr class="tab1">
  141.     <td>
  142. <strong>您的位置</strong>&gt;&gt;<a href="default.jsp" target="_parent">社区首页</a>&gt;&gt;
  143. <a href="main.jsp">进站画面</a>&gt;&gt;
  144. <a href="userBox.jsp">我的工具箱</a>&gt;&gt;
  145. 回复短消息
  146. </td>
  147.   </tr>
  148. </table>
  149. <table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" class="tab">
  150. <%
  151. if(reID>0){
  152. cmt.setCmReID(reID);
  153. int totalPage = cmt.takeReCount();
  154. ///out.print(totalPage);
  155. %>
  156. <c:forEach var="mt" items="<%=cmt.takeReList(iPage,25)%>">
  157. <tr class="tr">
  158. <td width="120">
  159. <club:users type="userName" idIs="${mt.cmSendID}" value="${mt.cmSendUser}"/>
  160. </td>
  161. <td>
  162. <strong>
  163. <club:message type="topic" idIs="${mt.cmID}" linkId="${mt.cmReID}" value="${mt.cmTopic}" property="take"/>
  164. <strong>
  165. </td>
  166. </tr>
  167. <tr class="tab2"><td valign="top">
  168. <club:message type="datetime"  value="${mt.cmAddTime}"/>
  169. </td><td>
  170. <club:message type="content" value="${mt.cmContent}" />
  171. </td>
  172. </tr>
  173. </c:forEach>
  174. <tr class="bg0">
  175. <td colspan="6" height="25">
  176. <%=OutPrint.pageJump(totalPage,25, iPage, "userReMessage.jsp?cmID="+cmID+"&cmReID="+reID+"&")%> 
  177. </td>
  178. </tr>
  179. <%
  180. }else if(cmID>0){
  181. %>
  182. <tr class="tr">
  183. <td width="120">
  184. <club:users type="userName" idIs="<%=cmSendID%>" value="<%=cmSendUser1%>"/>
  185. </td>
  186. <td>
  187. <strong>
  188. <club:message type="topic" idIs="<%=cmID%>" linkId="<%=0%>" value="<%=cmTopic%>" property="take"/>
  189. <strong>
  190. </td>
  191. </tr>
  192. <tr class="tab2"><td valign="top">
  193. <club:message type="datetime"  value="<%=cmAddTime%>"/>
  194. </td><td>
  195. <club:message type="content" value="<%=cmContent%>" />
  196. </td>
  197. </tr>
  198. <%
  199. }
  200. %>
  201. </table>
  202. <a name=re></a>
  203. <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tab">
  204. <form name="Gforms" id="Gforms" method="post" action="" onSubmit="return checkForm();">
  205. <tr class="tab2">
  206. <td width="100"><strong>收信人</strong></td>
  207. <td height="22">
  208. <input name="utTakeUser" type="text" id="utTakeUser" value="<%=cmSendUser1%>" readOnly="true" size="40" maxlength="100" />
  209. <span class="style1">*</span>  </td>
  210. </tr>
  211. <tr class="tab2">
  212. <td height="25"><strong>主题</strong></td>
  213. <td width="#">
  214. <input name="utTopic" type="text" id="utTopic" size="40" maxlength="200"  onkeydown="keyForm();"/>
  215. <span class="style1">*</span></td>
  216. </tr>
  217. <tr class="tab2">
  218.   <td height="12"><strong>内容</strong></td>
  219.   <td>
  220. <textarea name="utContent" cols="60" rows="8" id="utContent" onkeydown="keyForm();" ></textarea></td>
  221. </tr>
  222. <tr class="tab2">
  223.   <td height="12"><strong>发送方式</strong></td>
  224.   <td>
  225. <input name="isPost" type="radio" value="0" checked="checked" />直接发送
  226. &nbsp;&nbsp;
  227. <input name="isPost" type="radio" value="1" checked />发送同时保存到发件箱
  228. &nbsp;&nbsp;
  229. <input type="radio" name="isPost" value="2" />暂不发送保存到草稿箱</td>
  230. </tr>
  231. <tr class="tab2">
  232. <td height="25">&nbsp;</td>
  233. <td>
  234. <input name="gvSubmit" type="submit" class="btn" id="gvSubmit" value="确定提交" />
  235. &nbsp;&nbsp;&nbsp;&nbsp;
  236. <input name="gvBack" type="button" class="btn"  onClick="javascript:self.close();" value="关闭窗口"/>
  237. &nbsp;&nbsp;(Ctrl+Enter)
  238. </td>
  239. </tr></form>
  240. </table>
  241. <%=Gfoot()%>
  242. </body>
  243. </html>