<!--#include file="mdb.asp"-->
<!--#Include File="Check_hx.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/format.asp"-->
<!--#include file="inc/inc.asp"-->
<%
dim keyWord,SearchType
keyWord = checkspace(trim(request.QueryString("keyWord")))
SearchType = checkspace(trim(request.QueryString("SearchType")))
if keyWord="" then
Response.Write "<script>alert('搜索关键字不能为空');window.close();</script>"
Response.End
end if
If Len(keyWord)>8 Then
Response.Write "<script>alert('搜索关键字超出系统限定<8个字符范围');window.close();</script>"
Response.End
end if
if request("page")<>"" then
  if not isInteger(request("page")) then
    Response.Write "<script language=javascript>alert('分页参数非法');javascript:history.back();</script>"
    Response.End
  end if
end if
start="全站搜索"
call head()
call menu()
select case SearchType
case"新闻"
sql="select * from news where news_title like '%"&Jencode(keyWord)&"%' order by news_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"音乐"
sql="select * from dj where passed=0 and dj_name like '%"&Jencode(keyWord)&"%' order by dj_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"文章"
sql="select * from art where passed=0 and art_title like '%"&Jencode(keyWord)&"%' order by art_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"资源"
sql="select * from soft where passed=0 and soft_name like '%"&Jencode(keyWord)&"%' order by soft_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"图片"
sql="select * from pic where passed=0 and pic_name like '%"&Jencode(keyWord)&"%' order by pic_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"特效"
sql="select * from js where js_name like '%"&Jencode(keyWord)&"%' order by js_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"影视"
sql="select * from vid where title like '%"&Jencode(keyWord)&"%' order by vid_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
end select
%>

<!--导航栏-->
<TABLE cellSpacing=0 cellPadding=0 width=958 border=0 align="center">
    <TR>
      <TD width=4></TD>
      <TD width=950 class="a3" height=24>&nbsp;&nbsp;&nbsp;&nbsp;</TD>
      <TD width=4></TD>
    </TR>
    <TR>
      <TD width=4></TD>
      <TD width=950 class="a4" height=9></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<!--导航栏-->

<!--广告位A-->
<TABLE width=958 border=0 align="center" cellPadding=0 cellSpacing=0>
    <TR>
      <TD width=4></TD>
      <TD align=middle width=950 bgColor=#ffffff height=24><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TR>
            <TD width="100%" bgColor=#da251d height=2></TD>
          </TR>
          <TR>
            <TD width="100%"><%Call hx66_AD(1)%></TD>
          </TR>
          <TR>
            <TD width="100%" bgColor=#da251d height=2></TD>
          </TR>
      </TABLE></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<!--广告位A-->

<!--倒计时-->
<TABLE cellSpacing=0 cellPadding=0 width=958 border=0 align="center">
    <TR>
      <TD width=4></TD>
      <TD align=middle width=950 bgColor=#ffffff height=24><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TR>
            <TD width="100%" class="a5" height=9></TD>
          </TR>
          <TR>
            <TD align=middle width="100%" class="a6" height=31>
<table width="100%" border=0 cellpadding=0 cellspacing=0>
 <TR>
   <TD width="65" align="center"><img src="skin/1/login_title.gif" width="37" height="31"><TD>你的位置：<a href='index.asp'><%=webname%></a> >> <%=start%><td height="25" align="right"><%call djs()%>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</TD>
 </TR>
</TABLE>
            </TD>
          </TR>
      </TABLE></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<!--倒计时-->


<TABLE width=958 border=0 align="center" cellPadding=0 cellSpacing=0>
    <TR>
      <TD width=4></TD>
      <TD align=middle width=950 bgColor=#ffffff height=24><TABLE cellSpacing=0 cellPadding=0 width=950 border=0>
          <TR>
            <TD align=middle vAlign=top width=198><TABLE height=51 cellSpacing=0 cellPadding=0 
width="100%" border=0>
                <TR>
                  <TD align=middle width=30 class="a1" height=34><IMG height=20 src="skin/1/gu1.gif" width=24 border=0></TD>
                    <TD class="a1" height=34 width=170><a href="#" class="STYLE1">会员登录</a></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=150><%call userlogin()%></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
            </TABLE>
              <TABLE height=51 cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TR>
                  <TD align=middle width=30 class="a1" height=34><IMG height=20 src="skin/1/gu1.gif" width=24 border=0></TD>
                    <TD class="a1" height=34 width=170><a href="#" class="STYLE1">本站申明</a></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=50><div style="LINE-HEIGHT: 180%">&nbsp;<font color=#FF0000>·</font>本站的大部分资料，文章都来自网上收集，其版权归作者本人所有，如果有任何侵犯您权益的地方，请联系我们，我们将马上进行整理，谢谢。</TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
            </TABLE></TD>
            <TD vAlign=top align=middle width=1 bgColor=#cecccc></TD>
            <TD vAlign=top align=middle><table border="0" width="100%" align="center" cellpadding="0" cellspacing="1" style="border-collapse: collapse">
   <tr>
    <td height="34"  class="a1">&nbsp;&nbsp;&nbsp;&nbsp;您输入的关键字为<font color='#FF0000'><%=request("keyword")%></font>，相关的 <font color='#FF0000'><%=SearchType%></font> 信息(<%=rs.recordcount%>条)如下：</td>
   </tr>
<tr>
<td valign="top">
<table width="100%" border="1" align="center" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#f0f0f0" style="border-collapse: collapse">
<%
const MaxPerPage=20 '单独页最大记录数 const 用来申明常量
dim totalPut
dim CurrentPage
dim TotalPages
dim i
if not Rs.eof then
	Rs.MoveFirst
end if
Rs.pagesize=MaxPerPage
	If trim(Request("Page"))<>"" then
		CurrentPage= CLng(request("Page")) 
		If CurrentPage> Rs.PageCount then
			CurrentPage = Rs.PageCount 
		End If 
Else 
	CurrentPage= 1 
End If 
totalPut=Rs.recordcount
if CurrentPage<>1 then
	if (currentPage-1)*MaxPerPage<totalPut then
		Rs.move(currentPage-1)*MaxPerPage
		dim bookmark
		bookmark=Rs.bookmark
	end if 
end if
dim n,k
if (totalPut mod MaxPerPage)=0 then
	n= totalPut \ MaxPerPage
else  
	n= totalPut \ MaxPerPage + 1  
end if

	If Not Rs.Eof Then
i=0
Do While Not Rs.Eof and i<maxperpage
if request("SearchType")="新闻" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a href="shownews.asp?news_id=<%=rs("news_id")%>" Title="新闻名称：<%=rs("news_title")%>&#13&#10上传时间：<%=rs("news_date")%>&#13&#10浏览指数：<%=rs("news_count")%>" target=_blank><%=rs("news_title")%></a>
</TD><td width=10% align=center><%=rs("news_count")%></td><td width=25%>
&nbsp;<%=rs("news_date")%></td></TR>
<%elseif request("SearchType")="音乐" then%>
<TR>
<TD width="65%">
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a title="娱乐名称：<%=rs("dj_name")%>&#13&#10视听次数：<%=rs("dj_count")%>&#13&#10上传时间：<%=rs("dj_date")%>"  href='showdj.asp?dj_id=<%=rs("dj_id")%>'><%=rs("dj_name")%></a>
</td>
<td width="10%" align=Center><%=rs("dj_count")%></TD>
<TD width="25%" align=Center><%=rs("dj_date")%></TD></TR>
<%elseif request("SearchType")="文章" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a Title='文章标题：<%=rs("art_title")%>&#13&#10发表时间：<%=rs("art_date")%>&#13&#10阅读次数：<%=rs("art_count")%>次' href="showart.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>"
target=_blank><%=rs("art_title")%></a></td><td align=center width=10%><%=rs("art_count")%></td><td width=25%>&nbsp;<%=rs("art_date")%></td></tr>
<%elseif request("SearchType")="资源" then%>
<TR>
<TD width="65%">
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a href="showdown.asp?soft_id=<%=rs("soft_id")%>" target="_blank" title="程序名称：<%=rs("soft_name")%>&#13&#10文件大小：<%=rs("soft_size")%>&#13&#10下载次数：<%=rs("soft_dcount")%>&#13&#10查看次数：<%=rs("soft_rcount")%>&#13&#10上传时间：<%=rs("soft_joindate")%>" ><%=rs("soft_name")%></a>
</td>
<td width="10%" align=Center><%=rs("soft_dcount")%></TD>
<TD width="25%" align=Center><%=rs("soft_joindate")%></TD></TR>
<%elseif request("SearchType")="图片" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a title="图片名称：<%=rs("pic_name")%>&#13&#10文件大小：<%=rs("pic_url")%>&#13&#10点击次数：<%=rs("pic_count")%>次&#13&#10上传时间：<%=rs("pic_date")%>" href="showpic.asp?pic_id=<%=rs("pic_id")%>"
target=_blank><%=rs("pic_name")%></a></td><td align=center width=10%><%=rs("pic_count")%></td><td width=25%>&nbsp;<%=rs("pic_date")%></td></tr>
<%elseif request("SearchType")="特效" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a href='showjs.asp?js_id=<%=rs("js_id")%>' Title='特效名称：<%=rs("js_name")%>&#13&#10查看次数：<%=rs("js_count")%>&#13&#10上传时间：<%=rs("js_date")%>'><%=rs("js_name")%></a></td><td align=center width=10%><%=rs("js_count")%></td><td width=25%>&nbsp;<%=rs("js_date")%></td></tr>
<%elseif request("SearchType")="影视" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a href='showvid.asp?vid_id=<%=rs("vid_id")%>' Title='影片名称：<%=rs("title")%>&#13&#10查看次数：<%=rs("hits")%>&#13&#10上传时间：<%=rs("dateandtime")%>'><%=rs("title")%></a></td><td align=center width=10%><%=rs("hits")%></td><td width=25%>&nbsp;<%=rs("dateandtime")%></td></tr>
<%else
Response.Write "<script>alert('非法操作，参数错误 ！');window.close();</script>"
response.end
		End if
		Rs.MoveNext
		i=i+1
		Loop
%>
<tr><td align=middle height="60" colSpan=4>
<center><%
	Response.Write "您输入的关键字为<font color='#FF0000'>"&request("keyword")&"</font>，共<font color='#FF0000'>"&totalPut&"</font>条信息 <BR>" 
          k=currentPage
		if k<>1 then
			response.write "[<b>"+"<a href='Search.asp?keyWord="&keyWord&"&SearchType="&SearchType&"&page=1'>首页</a></b>] "
			response.write "[<b>"+"<a href='Search.asp?keyWord="&keyWord&"&SearchType="&SearchType&"&page="&cstr(k-1)&"'>上一页</a></b>] "
		else
			Response.Write "[首页] [上一页]"
		end if
		if k<>n then
			response.write "[<b>"+"<a href='Search.asp?keyWord="&keyWord&"&SearchType="&SearchType&"&page="&cstr(k+1)&"'>下一页</a></b>] "
			response.write "[<b>"+"<a href='Search.asp?keyWord="&keyWord&"&SearchType="&SearchType&"&page="&cstr(n)&"'>尾页</a></b>] "
		else
			Response.Write "[下一页] [尾页]"
		end if	
		Response.Write " 页次：<font color='#ff0000'>"&currentpage&"</font>/"&n&"页 20条信息/页"
		%>
        转到：
        <select name="select" onchange="javascript:window.location='Search.asp?keyWord=<%=keyWord%>&SearchType=<%=SearchType%>&page='+this.options[this.selectedIndex].value;">
          <option>跳转</option>
          <%
Dim z
For z=1 To n%>
          <option value="<%=z%>">第<%=z%>页</option>
          <%
Next
%>
        </select>
         </div></td>
          </tr></table><BR>
<%Else%>
<tr><td align=middle height="60" colSpan=4>
<center><font color=red><b><%if request("keyword")<>"" then%>没有找到标题包含关键字[<b><font color=red><%=request("keyword")%></font></b>]的<%=SearchType%> ！<%else%>没有任何<%=SearchType%>，请管理员到后台添加！<%end if%>
</b></font></center></td></td></tr>
</TD></TR></TABLE><BR>
<%End If
Rs.Close%>
</TD></TR></table></TD>
          </TR>
      </TABLE></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<%
set rs=nothing
call footer()%>

