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

📄 class_search.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.*"%>
<%request.setCharacterEncoding("gb2312");%>
<%
  String UserName = (String) session.getAttribute("userName");
  boolean errorLogin = false;
  if (UserName == "" || UserName == null) {
    errorLogin = true;
  }
  SMSchool sms = null;
  SMClass[] smcl = null;
  SMClass[] smc = null;
  SMMember smm = null;
  int SchoolId = ParamUtils.getIntParameter(request, "schoolid", 1);
  String ClassName = ParamUtils.getParameter(request, "classname");
  String BeginYear = ParamUtils.getParameter(request, "beginyear");
  int Page = ParamUtils.getIntParameter(request, "page", 1);
  int PageCount = 0;
  int RecordNo = 0;
  int ClassCount = 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></head>
<body>
<table width="610" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="top">
      <br>
<%
sms = new SMSchool(SchoolId);
%>
      <TABLE class=td_left_up_down_right cellSpacing=0 cellPadding=0 width=600 border=0>
          <TR>
            <TD align=center 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="school_search.jsp?prov=<%=sms.getProvinceId()%>&city=<%=sms.getCityId()%>&lvid=<%=sms.getLvId()%>"><%=Province.getProvName(sms.getProvinceId())%>-<%=City.getCityName(sms.getCityId())%></a> > <%=sms.getSchoolName()%>班级列表</TD>
          </TR>
      </TABLE>
      <TABLE width=600 border=0 cellPadding=0 cellSpacing=0 bgcolor="#f4f4f4" class="td_left_up_down_right" style="MARGIN-TOP: 4px">
		  <TR>
		    <TD vAlign=top width=460><TABLE class=TD02 cellSpacing=0 cellPadding=0 width=452 border=0>
        <FORM action="class_search.jsp" method="get" name="classsearch">
          <INPUT type=hidden value=<%=SchoolId%> name="schoolid">
            <TR>
              <TD style="PADDING-LEFT: 26px; LINE-HEIGHT: 160%"
                bgColor=#f1fce9 colSpan=2
                  height=37>如果下面列表过于庞大而不便查找,请在下面区域按条件搜索班级:</TD>
            </TR>
            <TR>
              <TD
                width=300 height=38 vAlign=top bgColor=#f1fce9 style="PADDING-LEFT: 26px; LINE-HEIGHT: 160%">入学年份:
                  <INPUT name=beginyear id="beginyear" size=5 maxLength=10>&nbsp;&nbsp;班级名称:
                <INPUT name=classname id="classname" size=8 maxLength=10>
                 </TD>
              <TD vAlign=top width=152 bgColor=#f1fce9><INPUT type=image height=21 width=49 src="Images/bt_ser.gif" name=image2></TD>
            </TR>
        </FORM>
      </TABLE>
        </TD>
    <TD align="center" vAlign=middle><img src="Images/pic_00.gif" width="37" height="37"></TD>
  </TR>
</TABLE>
<%
      smcl = sms.searchSMClass(BeginYear,ClassName);
      if (smcl != null) {
        ClassCount = smcl.length;
        PageCount = ClassCount / 15;
        if (Page > PageCount || Page < 1) {
          Page = 1;
          RecordNo = 1;
        }
        else {
          RecordNo = Page * 15;
        }
        if(PageCount==0) {
          PageCount = 1;
        }
      }
    %>
      <TABLE style="BORDER-RIGHT: #7eb704 1px solid; BORDER-TOP: #7eb704 1px solid; MARGIN-TOP: 5px; BORDER-LEFT: #7eb704 1px solid; BORDER-BOTTOM: #7eb704 1px solid" cellSpacing=0 cellPadding=0 width=600 border=0>
          <TR>
            <TD align=right width=25 bgColor=#b0d810 height=25><IMG height=18 src="Images/pic_03.gif" width=18></TD>
            <TD class=FONT02 width=300 bgColor=#b0d810>如果确认您的班级没有出现在以上列表中,请在此</TD>
            <TD width=275 bgColor=#b0d810><A href="#1"><IMG height=16 src="Images/bt_ct.gif" width=67 border=0></A></TD>
          </TR>
          <TR>
            <TD align=center bgColor=#7eb704 colSpan=3 height=1></TD>
          </TR>
          <TR>
            <TD colSpan=3 height=3>
				<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TR>
                    	<TD align=center width=110 bgColor=#e1e1e1 height=20><B>入学年份</B></TD>
                    	<TD bgColor=#e1e1e1><B>班级名</B></TD>
                    	<TD align=center width=170 bgColor=#e1e1e1><B>加入班级</B></TD>
					</TR>
					<TR>
                    	<TD align=right bgColor=#ffffff colSpan=3 height=1></TD>
					</TR>
                    <%
                    if (ClassCount > 0) {
                      SMClass[] smc_a = new SMClass[15];
                      for(int j=RecordNo;j<=RecordNo+14 && j<=smcl.length;j++) {
                        smc_a[j-1] = smcl[j-1];
                      }
                      int flag = 0;
                      try{
                        for (int i = 0; i <= smc_a.length; i++) {
                          if (flag == 0) {
                            out.println("<TR><TD align=center>" + smc_a[i].getBeginYear() + "</TD><TD style=\"PADDING-BOTTOM: 3px; PADDING-TOP: 3px\"><A href=class_index.jsp?classid=" + smc_a[i].getClassId() + ">" + smc_a[i].getClassName() + " (有" + smc_a[i].getSMMemberCount() + "位同学)</A></TD><TD align=center><A href=class_join.jsp?jointype=4&classid=" + smc_a[i].getClassId() + "><FONT color=#ff6c00>成员申请</FONT></A>&nbsp;<A href=class_join.jsp?jointype=5&classid=" + smc_a[i].getClassId() + ">客人加入</A></TD></TR>");
                            flag = 1;
                          } else if (flag == 1) {
                            out.println("<TR><TD align=center>" + smc_a[i].getBeginYear() + "</TD><TD style=\"PADDING-BOTTOM: 3px; PADDING-TOP: 3px\"><A href=class_index.jsp?classid=" + smc_a[i].getClassId() + ">" + smc_a[i].getClassName() + " (有" + smc_a[i].getSMMemberCount() + "位同学)</A></TD><TD align=center><A href=class_join.jsp?jointype=4&classid=" + smc_a[i].getClassId() + "><FONT color=#ff6c00>成员申请</FONT></A>&nbsp;<A href=class_join.jsp?jointype=5&classid=" + smc_a[i].getClassId() + ">客人加入</A></TD></TR>");
                            flag = 0;
                          }
                        }
                      } catch (Exception e) {out.print("</td>");}
                    } else {
                      out.println("<TR><TD align=center colSpan=3>没有符合条件的班级记录存在!</TD></TR>");
                    }
                    %>
              </TABLE>
			</TD>
          </TR>
          <TR>
            <TD colSpan=3 height=10></TD>
          </TR>
      </TABLE>
<%if (ClassCount > 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=600 border=0>
        <FORM name=InputPageForm onsubmit="return page_validate();" action="class_search.jsp" method=get>
          <input type=hidden value=<%=SchoolId%> name=schoolid>
          <input type=hidden value=<%=BeginYear%> name=beginyear>
          <input type=hidden value=<%=ClassName%> name=classname>
          <TR>
            <TD width="553" 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 width="47" 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>
<%}%>
      <A name=1></A>
<SCRIPT language="javascript">
function validate_and_submit()
{
	if (document.create.classname.length <= 2)
	{
		alert("班级名称太短,请不要少于两个字");
		return false;
	}
	if ((document.create.beginyear.value <1900) || (document.create.beginyear.value>2010))
	{
		alert("请正确填写入学时间");
		return false;
	}
	return true;
}
</SCRIPT>
<FORM name="create" action="class_create.jsp" method="post" onSubmit="return validate_and_submit()">
      <TABLE width=600 border=0 cellPadding=0 cellSpacing=0 class="td_left_up_down_right" style="MARGIN-TOP: 15px">

            <TR>
              <TD align=right width=90 bgColor=#f1fce9 height=90 rowSpan=2><FONT color=#ff6c00><B>创建新班级</B></FONT></TD>
              <TD width=25 rowSpan=2 align=center bgColor=#f1fce9><IMG src="Images/pic_05.gif" width=6 height=90 align="absmiddle"></TD>
              <TD width=25 height=45 valign="middle" bgColor=#f1fce9><IMG height=17 src="Images/pic11.gif" width=17></TD>
              <TD colSpan=2 valign="middle" bgColor=#f1fce9>如果确认搜索信息无误且您的班级没有出现在以上列表中,请在此创建班级。</TD>
            </TR>
            <TR>
              <TD height=45 bgColor=#f1fce9>&nbsp;</TD>
              <TD width=288 valign="middle" bgColor=#f1fce9>班级名称:
                  <INPUT style="WIDTH: 60px" maxLength=40 size=15 name=classname>&nbsp;&nbsp;入学年份:<SELECT name=beginyear size=1 id="beginyear">
<SCRIPT language="javascript">
	for(i=2005;i>1940;i--){
       document.write ("<option value="+i+">"+i);
       document.write("</option>");
    }
</SCRIPT>
          </SELECT>年 </TD>
              <TD width=172 valign="middle" bgColor=#f1fce9><input name="Submit" type="image" value="提交" src="Images/bt_reg.gif">
                <input name="createclass" type="hidden" id="createclass" value="true">
              <input name="schoolid" type="hidden" id="schoolid" value="<%=SchoolId%>"></TD>
            </TR>
    </TABLE></FORM></td>
  </tr>
</table>
<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>   <font color="#b1b1b1">|</font>   <font color="#b1b1b1">服务条款</font>   <font color="#b1b1b1">|</font>   <font color="#b1b1b1">广告服务</font>   <font color="#b1b1b1">|</font>   <font color="#b1b1b1">沈航招聘</font>   <font color="#b1b1b1">|</font>   <font color="#b1b1b1">客服中心</font>   <font color="#b1b1b1">|</font>   <font color="#b1b1b1">联系我们</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 + -