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

📄 search.jsp

📁 小虫新闻管理系统 V1.0(jsp+javabean+mysql)
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="inc/incdb.jsp"%>
<HTML><HEAD><TITLE><%=title%></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<LINK href="css/css.css" rel=stylesheet type=text/css>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 text=#000000 topMargin=0>
<script Language="JavaScript">
<!--
function isspacestring(mystring)
{ var istring=mystring;
  var temp,i,strlen;
  temp=true;
  strlen=istring.length;
  for (i=0;i<strlen;i++)
  {
    if ((istring.substring(i,i+1)!=" ")&(temp))
     { temp=false;  }
  }
 return temp;
}

function firstisspace(mystring)
{ var istring=mystring;
  var temp,i,strlen;
  temp=false;
    if (istring.substring(0,1)==" ")
     { temp=true;  }
 return temp;
}

function check_input(theForm)
{

   if ((theForm.content.value == "")|(firstisspace(theForm.content.value)))
  {
    alert("请输入查询的条件.不能以空格开头");
    theForm.content.focus();
    return (false);
  }

  if ((theForm.content.value == "")|(isspacestring(theForm.content.value)))
  {
    alert("请输入查询的条件.");
    theForm.content.focus();
    return (false);
  }
}
//-->
</script>
<CENTER>
<TABLE border=0 cellPadding=0 cellSpacing=0 height=81 width=776>
  <TBODY>
  <TR>
    <TD width=776>
      <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
        <TBODY>
        <TR>
          <TD height=82 background="img/index/b-banner.jpg"><FONT SIZE="5" COLOR="ffffff"><B>新闻管理系统</B></FONT></TD>
				</TR>
        <TR>
          <TD height=23>
            <TABLE border=0 cellPadding=0 cellSpacing=0 class=font-12 
            height="100%" width="100%" background="img/index/nav1.jpg">
              <TBODY>
              <TR>
                <TD align=middle width=50><A class=w href="index.jsp">首   页</A></TD>
                <%	Vector listclass = new Vector();
								DispClass dispclass = new DispClass();
								listclass = dispclass.allClass();
								for(int i=0;i<listclass.size();i++) {
								IClass classinfo = (IClass)listclass.elementAt(i);	%>
                <TD align=middle width=50><A class=w href="list.jsp?id=<%=classinfo.getID()%>"><%=classinfo.getName()%></A></TD>
								<%}%>
                </TR></TBODY></TABLE></TD>
							</TR>
							</TBODY>
						</TABLE>
					</TD>
				</TR>
				</TBODY>
		</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 height=26 width=776>
  <TBODY>
  <TR>
    <TD background="img/index/nav.jpg" vAlign=center>
      <TABLE align=center border=0 cellPadding=0 cellSpacing=0 
      style="FONT-SIZE: 12px" width="100%">
        <FORM action="search.jsp" method=post name=form1 onsubmit="return check_input(this)">
        <TBODY>
        <TR>
          <TD align=middle vAlign=center width=170>
            <SCRIPT language=JavaScript>
  					today=new Date();                                                                                      function initArray(){
						this.length=initArray.arguments.length
						for(var i=0;i<this.length;i++)
						this[i+1]=initArray.arguments[i] }
						var d=new initArray("<font color=RED>星期日</font>","星期一","星期二","星期三","星期四","星期五","<font color=GREEN>星期六</font></font>"); document.write(today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日"," ",d[today.getDay()+1]);
   					</SCRIPT>
          </TD>
          <TD align=middle width=322>&nbsp;</TD>
          <TD align=middle width=284>本站搜索: <INPUT name=content size=16   
            style="FONT-SIZE: 12px"><INPUT name=Submit type=submit value=GO>   
    </TD></TR></FORM></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=776>
  <TBODY>
  <TR>
    <TD bgColor=#999999>&nbsp;</TD>
    <TD width=180><IMG border=0 height=22 src="img/index/code-top.gif" 
      width=180></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=3 cellSpacing=0 width=776>
  <TBODY>
  <TR bgColor=#996633>
    <TD colSpan=4 height=5></TD></TR>
  <TR>
    <TD align=middle bgColor=#eeeeee rowSpan=2 vAlign=top width=150>
       
      <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
        <TBODY>
        <TR>
          <TD width=30><IMG height=22 src="img/index/l-1.gif" 
          width=30></TD>
          <TD background="img/index/l-2.gif">撰稿人排行</TD>
          <TD width=30><IMG height=22 src="img/index/l-3.gif" 
          width=45></TD></TR></TBODY></TABLE>
      <TABLE bgColor=#000000 border=0 cellPadding=5 cellSpacing=1 
        width="100%"><TBODY>
        <TR>
          <TD bgColor=#eeeeee>
					<%	Vector listmaster = new Vector();
							DispMaster dispmaster = new DispMaster();
							listmaster = dispmaster.allMaster();
							for(int i=0;i<listmaster.size();i++) {
							Master masterinfo = (Master)listmaster.elementAt(i);
							if(i>5){continue;}
							%>
					<%=i+1%>.&nbsp;&nbsp;<%=masterinfo.getUserName()%>&nbsp;&nbsp;&nbsp;
				共<%=masterinfo.getTotal()%>篇新闻<BR><%}%>
					</TD></TR></TBODY></TABLE></TD>
    <TD align=middle rowSpan=2 vAlign=top>
      <TABLE border=0 cellPadding=3 width="100%">
        <TBODY>
					<%String content = new String(request.getParameter("content").getBytes("ISO8859_1"),"GBK");
					//System.out.println("content="+content);
					Vector searchnews = new Vector();
					DispNews dispnews = new DispNews();
					dispnews.setSearch(content);
					searchnews = dispnews.searchNews();
					if(searchnews.size()==0){%>
						<TR><TD width='50%'>没有你所要的记录</TD></TR>
						<%}//结束if;
					for(int j=0;j<searchnews.size();j++) {
					News searnews = (News)searchnews.elementAt(j);	%>
        <TR>
          <TD width="50%">
					<A href="news.jsp?id=<%=searnews.getID()%>" target=_blank   
							title=<%=searnews.getTopic()%>><%=searnews.getTopic()%></A>
          </TD></TR><%}%></TBODY></TABLE>
			</TD>
    <TD align=middle bgColor=#996633 rowSpan=2 vAlign=top width=180>
      <TABLE border=0 cellPadding=0 cellSpacing=0 width=170>
        <TBODY>
        <TR>
          <TD><IMG height=20 src="img/index/2002.gif" width=170></TD></TR>
        <TR>
          <TD bgColor=#333333>
            <TABLE border=0 cellPadding=3 width="100%">
              <TBODY>
              <TR>
                <TD>
								<%	Vector allnews = new Vector();
								//DispNews dispnews = new DispNews();
								allnews = dispnews.allNews();
								int maxhit=dispnews.maxHit();%>
						<%  for(int j=0;j<allnews.size();j++) {
								News allnewsinfo = (News)allnews.elementAt(j);
								if(j>9){continue;}%>
									
									<FONT color=#ffffff>■ <A class=w 
                  href="news.jsp?id=<%=allnewsinfo.getID()%>" 
                  target=_blank title="<%=allnewsinfo.getTopic()%>"><%=allnewsinfo.getTopic()%>
									</A></FONT><BR><FONT color=#ffffff>
									<%}%>
									</FONT><BR></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD><IMG height=20 src="img/index/2001.gif" 
        width=170></TD></TR></TBODY></TABLE>
    </TD></TR></TBODY></TABLE>
<TABLE bgColor=#eeeeee border=0 height=108 width=776>
  <TBODY>
  <TR>
    <TD align=middle> 
    <%@ include file="foot.jsp"%>
		</TD></TR></TBODY></TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

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