userReMessage.jsp
上传用户:u_thks
上传日期:2022-07-31
资源大小:1910k
文件大小:8k
- <%@ page language="java" contentType="text/html;charset=UTF-8"
- session="true" errorPage="err.jsp" %>
- <%@ include file="GVinc/gvImport.jsp" %>
- <jsp:useBean id="cmt" scope="page" class="com.gamvan.club.message.ClubMessageTake"/>
- <jsp:useBean id="cms" scope="page" class="com.gamvan.club.message.ClubMessageSend"/>
- <%
- if(gvUserID<=0){
- out.print(prtCenter("您尚未登陆,无权进行此项操作!","userLogin.jsp",1));
- out.close();
- if(true) return;
- }
- int reID = ParamUtils.getIntParameter(request,"cmReID");
- int iPage = ParamUtils.getIntParameter(request,"iPage");
- if(iPage<1){iPage=1;}
- int cmReID=0;
- int cmID = ParamUtils.getIntParameter(request,"cmID");
- String cmTakeUser=""
- , cmSendUser=""
- , cmSendUser1=""
- , cmAddTime=""
- , cmTopic=""
- , cmContent="";
- boolean bea = false;
- boolean cmIsTake= false, cmIsSend= false;
- int cmSendID = 0, cmTakeID = 0;
- ClubMessageTakeItem cmti = null;
- String userNames = "";
- if(request.getMethod().equals("POST")){
- userNames = request.getParameter("utTakeUser").trim();
- if(session.getAttribute("gvPost")==null){
- session.setAttribute("gvPost",now);
- }else{
- String isNow1 = FormatDateTime.dateAdd("s", -15);
- String isNow2 = String.valueOf(session.getAttribute("gvPost")); //第一次提交时间
- if(FormatDateTime.secondCompare(isNow1, isNow2)){
- out.print(prtCenter("短消息发送过于频繁,请稍候再发!","",2));
- out.close();
- if(true)return;
- }else{
- session.setAttribute("gvPost",now);
- }
- }
-
- cms.setIsPost(TypeChange.stringToInt(request.getParameter("isPost")));
- //cms.setCmTakeUser(request.getParameter("utTakeUser").trim());
- cms.setCmSendUser(gvUserName);
- cms.setCmSendID(gvUserID);
- cms.setCmTopic(request.getParameter("utTopic").trim());
- cms.setCmContent(request.getParameter("utContent"));
- cms.setCmUserIp(request.getRemoteAddr());
- cms.setCmIsSend(true);
- cms.setCmOrder((short)0);
- if(reID>0){
- cms.setCmReID(reID);
- }else{
- cms.setCmReID(cmID);
- }
- cms.sendMessages(request.getParameter("utTakeUser").trim());
- response.setHeader("Refresh", "2; URL=");
- out.print(prtCenter(cms.getMessage(),"",2));
- out.close();
- if(true)return;
-
- }
-
- if(cmID>0){
- cmti = cmt.takeMessageInfo(cmID);
- if(cmti!=null){
- cmTakeUser = cmti.getCmTakeUser();
- cmSendUser1 = cmti.getCmSendUser();
- cmTopic = cmti.getCmTopic();
- cmContent = cmti.getCmContent();
- cmAddTime = cmti.getCmAddTime();
- cmIsTake = cmti.getCmIsTake();
- cmSendID = cmti.getCmSendID();
- cmTakeID = cmti.getCmTakeID();
- if(!cmIsTake){
- cmt.takeUpdate(cmID); //更新短信状态为已查阅。
- }
- bea = true;
- }
- if(gvUserID!=cmTakeID){
- out.print(prtCenter("请不要越权查阅他人短消息!","",2));
- out.close();
- if(true) return;
- }
- cmt.takeUpdate(cmID);
- }
- %>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><%=clubTitle%></title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link href="./GVimgs/favicon.ico" rel="Bookmark">
- <link rel="icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
- <link rel="shortcut icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
- <link href="./GVinc/main.css" rel="stylesheet" type="text/css" />
- <style type="text/css">
- <!--
- .style1 {color: #FF0000}
- -->
- </style>
- </head>
- <body>
- <DIV id="waitDiv" style="LEFT: 40%; VISIBILITY: hidden; POSITION: absolute; TOP: 30%; TEXT-ALIGN: center">
- <TABLE cellPadding=6 border=0>
- <TBODY><TR><TD align=middle>
- <IMG src="GVimgs/loading.gif" alt="请稍候..." width="30" height="30">
- <BR>
- <FONT color="red">数据载入中,请稍候...</FONT></TD></TR></TBODY></TABLE></DIV>
- <script language="javascript" type="text/javascript" src="GVscript/GVtopCode.js"></script>
- <script language="javascript" type="text/javascript" src="GVscript/GVpost.js"></script>
- <SCRIPT language="javascript">
- //提交表单
- function postMsg(){
- var o=event.srcElement;
- o.gvSubmit.value="正在提交...";
- o.gvSubmit.disabled=true;
- o.gvBack.disabled=true;
- }
- function checkForm(){
- if (document.Gforms.utTopic.value.length == 0) {
- alert("短消息标题不能为空!");
- document.Gforms.utTopic.focus();
- return false;
- }
- if (document.Gforms.utTopic.value.length > 180) {
- alert("短消息标题字数不能大于200个字符!");
- document.Gforms.utTopic.focus();
- return false;
- }
- if (document.Gforms.utContent.value.length > 5000) {
- alert("短消息标题字数不能大于5000个字符!");
- document.Gforms.utContent.focus();
- return false;
- }
- postMsg();
- return true;
- }
- gv_showWait('waitDiv', 1);
- </SCRIPT>
- <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tab">
- <tr class="tab1">
- <td>
- <strong>您的位置</strong>>><a href="default.jsp" target="_parent">社区首页</a>>>
- <a href="main.jsp">进站画面</a>>>
- <a href="userBox.jsp">我的工具箱</a>>>
- 回复短消息
- </td>
- </tr>
- </table>
- <table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" class="tab">
- <%
- if(reID>0){
- cmt.setCmReID(reID);
- int totalPage = cmt.takeReCount();
- ///out.print(totalPage);
- %>
- <c:forEach var="mt" items="<%=cmt.takeReList(iPage,25)%>">
- <tr class="tr">
- <td width="120">
- <club:users type="userName" idIs="${mt.cmSendID}" value="${mt.cmSendUser}"/>
- </td>
- <td>
- <strong>
- <club:message type="topic" idIs="${mt.cmID}" linkId="${mt.cmReID}" value="${mt.cmTopic}" property="take"/>
- <strong>
- </td>
- </tr>
- <tr class="tab2"><td valign="top">
- <club:message type="datetime" value="${mt.cmAddTime}"/>
- </td><td>
- <club:message type="content" value="${mt.cmContent}" />
- </td>
- </tr>
- </c:forEach>
- <tr class="bg0">
- <td colspan="6" height="25">
- <%=OutPrint.pageJump(totalPage,25, iPage, "userReMessage.jsp?cmID="+cmID+"&cmReID="+reID+"&")%>
- </td>
- </tr>
- <%
- }else if(cmID>0){
- %>
- <tr class="tr">
- <td width="120">
- <club:users type="userName" idIs="<%=cmSendID%>" value="<%=cmSendUser1%>"/>
- </td>
- <td>
- <strong>
- <club:message type="topic" idIs="<%=cmID%>" linkId="<%=0%>" value="<%=cmTopic%>" property="take"/>
- <strong>
- </td>
- </tr>
- <tr class="tab2"><td valign="top">
- <club:message type="datetime" value="<%=cmAddTime%>"/>
- </td><td>
- <club:message type="content" value="<%=cmContent%>" />
- </td>
- </tr>
- <%
- }
- %>
- </table>
- <a name=re></a>
- <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tab">
- <form name="Gforms" id="Gforms" method="post" action="" onSubmit="return checkForm();">
- <tr class="tab2">
- <td width="100"><strong>收信人</strong></td>
- <td height="22">
- <input name="utTakeUser" type="text" id="utTakeUser" value="<%=cmSendUser1%>" readOnly="true" size="40" maxlength="100" />
- <span class="style1">*</span> </td>
- </tr>
- <tr class="tab2">
- <td height="25"><strong>主题</strong></td>
- <td width="#">
- <input name="utTopic" type="text" id="utTopic" size="40" maxlength="200" onkeydown="keyForm();"/>
- <span class="style1">*</span></td>
- </tr>
- <tr class="tab2">
- <td height="12"><strong>内容</strong></td>
- <td>
- <textarea name="utContent" cols="60" rows="8" id="utContent" onkeydown="keyForm();" ></textarea></td>
- </tr>
- <tr class="tab2">
- <td height="12"><strong>发送方式</strong></td>
- <td>
- <input name="isPost" type="radio" value="0" checked="checked" />直接发送
-
- <input name="isPost" type="radio" value="1" checked />发送同时保存到发件箱
-
- <input type="radio" name="isPost" value="2" />暂不发送保存到草稿箱</td>
- </tr>
- <tr class="tab2">
- <td height="25"> </td>
- <td>
- <input name="gvSubmit" type="submit" class="btn" id="gvSubmit" value="确定提交" />
-
- <input name="gvBack" type="button" class="btn" onClick="javascript:self.close();" value="关闭窗口"/>
- (Ctrl+Enter)
- </td>
- </tr></form>
- </table>
- <%=Gfoot()%>
- </body>
- </html>