⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class_message.jsp

📁 计算机技术的快速发展
💻 JSP
字号:
<%@page contentType="text/html; charset=gb2312" language="java" errorPage="error.jsp"%>
<%@page import="com.suninformation.*,com.suninformation.user.*,com.suninformation.tools.*,com.suninformation.schoolmate.*,java.sql.Date"%>
<%request.setCharacterEncoding("gb2312");%>
<%
  String UserName = (String) session.getAttribute("userName");
  //String UserType = (String) session.getAttribute("userType");
  String LoginIp = (String) session.getAttribute("loginIp");
  String LoginCount = (String) session.getAttribute("loginCount");
  Date LoginTime = (Date) session.getAttribute("loginTime");
  int ClassId = ParamUtils.getIntParameter(request,"classid",-1);

  boolean errorLogin = false;
  if (UserName == "" || UserName == null) {
    errorLogin = true;
  }
  if(!errorLogin) {
    try {
      SMMember smm = new SMMember(UserName,ClassId);
        if(smm.getLastLoginIp()==null || smm.getLastLoginIp()=="") {
          smm.setLastLoginIp(LoginIp);
          smm.setLastLoginTime(LoginTime);
          smm.setLoginCount(smm.getLoginCount()+1);
          smm.save();
        }
        else if(!smm.getLastLoginIp().equals(LoginIp)) {
          smm.setLastLoginIp(LoginIp);
          smm.setLastLoginTime(new Date(System.currentTimeMillis()));
          smm.setLoginCount(smm.getLoginCount()+1);
          smm.save();
        }
        else if((LoginTime.getTime()-smm.getLastLoginTime().getTime())/(1000*60*60*24)>1) {
          smm.setLastLoginIp(LoginIp);
          smm.setLastLoginTime(new Date(System.currentTimeMillis()));
          smm.setLoginCount(smm.getLoginCount()+1);
          smm.save();
        }
    }catch(Exception e) {
      //throw new com.suninformation.user.UnacceptableException(e.getMessage(),e);
    }
  }
  SMSchool sms = null;
  SMClass[] smcl = null;
  SMClass[] smc = null;
  SMMember smm = null;
  int Page = ParamUtils.getIntParameter(request, "page", 1);
  int PageCount = 0;
  int RecordNo = 0;
  int MessageCount = 0;
%>

<html>
<head>
<title>校友录_班级主页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Includes/im.css" rel="stylesheet" type="text/css">
<link href="Includes/user.css" rel="stylesheet" type="text/css">
<script language="javascript" src="Includes/functionForUser.js"></script>
<script language="javascript" type="text/javascript">
<!--
	function sure() {
		if(confirm("真的确定要删除留言吗?")==true) {
			return true;
		}
		return false
	}
//-->
</script>
</head>
<body>
<table width="610" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="top">
      <br>
    <%
      SMClass smc_p = new SMClass(ClassId);
      sms = new SMSchool(smc_p.getSchoolId());
    %>
      <TABLE class=td_left_up_down_right cellSpacing=0 cellPadding=0 width=600 border=0>
        <TR>
          <TD align=middle width=43 bgColor=#f4f4f4>
            <IMG height=22 src="Images/pic_01.gif" width=18>
          </TD>
          <TD width=557 bgColor=#f4f4f4>
            <A href="sm_main.jsp">校友录首页</A>
            >
            <a href="class_search.jsp?schoolid=<%=sms.getSchoolId()%>"><%=sms.getSchoolName()%></a> >
<a href="class_index.jsp?classid=<%=ClassId%>"><%=smc_p.getClassName()%></a> > 留言本</TD>
        </TR>
      </TABLE>
      <TABLE width=600 border=0 cellPadding=0 cellSpacing=0 class="td_left_up_down_right" style="MARGIN-TOP: 5px; MARGIN-BOTTOM: 8px">
        <TR>
          <TD style="LINE-HEIGHT: 160%" align=center width=80 bgColor=#fff9f0 height=35>
            <FONT color=#ff6c00>
              <B>班级功能</B>
            </FONT>
          </TD>
          <TD align=center bgColor=#fff9f0><a href="class_message.jsp?classid=<%=ClassId%>"><IMG height=22 hspace=5 src="Images/fc2.gif" width=76 border=0></a><a href="class_addressbook.jsp?classid=<%=ClassId%>"><IMG height=22 hspace=5 src="Images/fc3.gif" width=76 border=0></a><IMG height=22 hspace=5 src="Images/fc4.gif" width=76 border=0><a href="class_manage.jsp?classid=<%=ClassId%>"><IMG height=22 hspace=5 src="Images/fc5.gif" width=76 border=0></a><IMG height=22 hspace=5 src="Images/fc6.gif" width=76 border=0><IMG height=22 hspace=5 src="Images/fc7.gif" width=76 border=0>
          </TD>
        </TR>
      </TABLE>
      <TABLE width=600 border=0 cellPadding=0 cellSpacing=0 class="td_left_up_down_right" style="MARGIN-TOP: 8px">
        <TR>
          <TD class=FONT03 width=435 bgColor=#a8cd13 height=22>            &nbsp;&nbsp;&nbsp;&nbsp;
            留言本
</TD>
          <TD align=right width=165 bgColor=#a8cd13>
            <A href="class_message.jsp?classid=<%=ClassId%>#wr"><IMG height=15 src="Images/bt_wt.gif" width=55 align=absMiddle border=0></A>
            <a href="class_message.jsp?classid=<%=ClassId%>"><IMG height=15 hspace=5 src="Images/bt_more.gif" width=34 align=absMiddle border=0></a>&nbsp;&nbsp;&nbsp;
          </TD>
        </TR>
        <TR>
          <TD style="PADDING-BOTTOM: 8px; PADDING-TOP: 8px" bgColor=#f8f8f8 colSpan=2>
<%
SMMessage[] smme_p = new SMClass(ClassId).getSMMeaages();
if(smme_p!=null) {
	MessageCount = smme_p.length;
	PageCount = MessageCount / 15;
	if (Page > PageCount || Page < 1) {
		Page = 1;
		RecordNo = 1;
	}
	else {
		RecordNo = Page * 15;
	}
	if(PageCount==0) {
		PageCount = 1;
	}
	for(int i=RecordNo-1;i<=RecordNo+14 && i<smme_p.length;i++) {
%>


            <TABLE cellSpacing=0 cellPadding=0 width=594 align=center border=0>
                 <TR bgColor=#f4f4f4>
                  <TD align=center width=34 bgColor=#ffffff height=22><IMG height=9 src="Images/pic05.gif" width=6></TD>
                  <TD width=422 bgColor=#ffffff>
                    <FONT color=#85a100><%=smme_p[i].getModifyTime()%></FONT>&nbsp;<FONT color=#dc5503><a href="../user/show_person_info.jsp?username=<%=smme_p[i].getUserName()%>" target="_blank"><%=new UserInfo(smme_p[i].getUserName()).getRealName()%></a></FONT>
                  </TD>
                  <TD align=center width=138 bgColor=#ffffff>
<%
if(!errorLogin) {
  try {
    smm = new SMMember(UserName,ClassId);
    if(UserName.equals(smme_p[i].getUserName()) || smm.getMemberType()==1) {
      %>
      [<a href="class_message_delete.jsp?classid=<%=ClassId%>&msgid=<%=smme_p[i].getMsgId()%>" onClick="return sure()">删除</a>]
      <%
      }
      if(UserName.equals(smme_p[i].getUserName())) {
        %>
        [<a href="class_message_edit.jsp?classid=<%=ClassId%>&msgid=<%=smme_p[i].getMsgId()%>">修改</a>]
        <%
        }
      }catch(Exception e) {}
    }
%>
                  </TD>

                </TR>
                <TR>
                  <TD></TD>
                  <TD style="PADDING-BOTTOM: 6px; WORD-BREAK: break-all; PADDING-TOP: 6px" colSpan=2>
                    <%=CheckValue.showClassMessage(smme_p[i].getMessageContent())%></TD>
                </TR>
            </TABLE>
<%}
}else {
  out.println("&nbsp;&nbsp;还没有人留言呢~!");
}
%>
          </TD>
        </TR>
        <TR bgColor=#f0f0f0>
          <TD align=right colSpan=2 height=22>
            <a href="class_message.jsp?classid=<%=ClassId%>#wr"><IMG height=15 src="Images/bt_wt.gif" width=55 align=absMiddle border=0></a>
            <a href="class_message.jsp?classid=<%=ClassId%>"><IMG height=15 hspace=5 src="Images/bt_more.gif" width=34 align=absMiddle border=0></a>&nbsp;&nbsp;&nbsp;
          </TD>
        </TR>
        <TR>
          <TD bgColor=#dcdcdc colSpan=2>
<%if (MessageCount > 0) { %>
            <SCRIPT language=JavaScript>
      function page_validate()
      {
        if(document.InputPageForm.page.value < 0) {
          document.InputPageForm.page.value = 0;
          return false;
        } else if(document.InputPageForm.page.value > <%=PageCount%>) {
          document.InputPageForm.page.value = <%=PageCount%>;
          return false;
        }
        return true;
      }
      function gotoPage(type) {
        if(type=="prev") {
          document.InputPageForm.page.value = <%=Page-1%>;
        }else if(type=="next") {
          document.InputPageForm.page.value = <%=Page+1%>;
        }
        document.InputPageForm.submit();
      }
            </SCRIPT>
            <TABLE style="MARGIN-TOP: 5px" cellSpacing=0 cellPadding=0 width=100% border=0>
              <FORM name=InputPageForm onsubmit="return page_validate();" action="class_message.jsp" method=get>
                <INPUT type=hidden value=<%=ClassId%> name=classid>
                <TR>
                  <TD height=24 align=right background=Images/bg_p_01.gif bgcolor="#999999"><a href="javascript:gotoPage('prev')">上一页</a> <a href="javascript:gotoPage('next')">下一页</a> &nbsp;&nbsp; 第<%=Page%>/<%=PageCount%>页 跳到
                      <INPUT maxLength=4 size=3 name=page>
                      页 </TD>
                  <TD align=center background=Images/bg_p_01.gif bgcolor="#999999" style="PADDING-TOP: 3px"><INPUT type=image height=17 width=23 src="Images/bt_go.gif" border=0 name=image>
                  </TD>
                </TR>
              </FORM>
            </TABLE>
          <%}%></TD>
        </TR>
      </TABLE>
      <TABLE width=600 border=0 cellPadding=0 cellSpacing=0 class="td_left_up_down_right" style="MARGIN-TOP: 8px">
        <TR>
          <TD class=FONT03 width=435 bgColor=#a8cd13 height=22>&nbsp;&nbsp;&nbsp;&nbsp; <a name="wr"></a>发表留言</TD>
          <TD align=right width=165 bgColor=#a8cd13>&nbsp;</TD>
        </TR>
        <TR align="center">
          <TD colSpan=2 bgColor=#f8f8f8 style="PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><form name="form1" method="post" action="class_message_sendnew.jsp">
            请输入留言内容:<br>
              <textarea name="msgbody" cols="50" rows="6" id="msgbody"></textarea>
              <script>showPic()</script><br>
              <input name="sendmessage" type="hidden" id="sendmessage" value="true">
              <input name="classid" type="hidden" id="classid" value="<%=ClassId%>">
              <input type="submit" name="Submit" value="提交">
              <input type="reset" name="Submit" value="重置">
                                        </form></TD>
        </TR>
        <TR>
          <TD height="2" colSpan=2 bgColor=#dcdcdc></TD>
        </TR>
      </TABLE></td>
  </tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" height="60" width="610">
  <tr>
    <td align="center">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td align="center" bgcolor="#999999" height="1">          </td>
        </tr>
        <tr>
          <td align="center">&nbsp;</td>
        </tr>
        <tr>
          <td align="center">
            <font color="#b1b1b1">
              <a href="../about_aoke_cn.htm" target="_blank" class="title">关于沈航</a>
              |服务条款|广告服务|沈航招聘|客服中心|联系我们
</font>
          </td>
        </tr>
      </table>
      <font style="font-size: 12px; line-height: 24px;" color="#b2b2b2">        
        <br>
        沈阳航空工业学院
        &nbsp;
        版权所有
</font>
    </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -