<!--#include file="articleconn.asp"-->
<!--#include file="INC/fun.inc"-->
<script language="javascript">
function popwin2(id,path)
{		window.open("openarticle.asp?id="+id+"&ppath="+path,"","");
}
</script>
<script language="JavaScript">
<!--
function checkinput()
{
	if (document.search.keyword.value=="")
	 {
		alert("请输入想查询的内容！");
		document.search.keyword.focus();

		return false;
	 }
	 return true;
}
-->
</script>

<%
   dim rstype
   dim typesql
   dim typeid,typename1
   if not isEmpty(request("typeid")) then
   typeid=request("typeid")
   else
   typeid=0
   end if
 set rstype=server.createobject("adodb.recordset")
  typesql="select * from type where typeid="&typeid&""
 rstype.open typesql,conn,1,1
 if not rstype.eof then
	typename1=rstype("type")
 else typename1="全部歌曲"	
 end if
rstype.close

'---------------------------search----------------------
name=trim(request("keyword"))
name=replace(name,"'","''")
if typeid=0 then
    sql="select learning.*,type.type from learning,type where learning.typeid=type.typeid and learning.title Like '%"& name &"%' order by learning.articleid desc"
else
    sql="select learning.*,type.type from learning,type where (learning.typeid=type.typeid) and (learning.typeid="&typeid&") and (learning.title Like '%"& name &"%') order by learning.articleid desc"
end if  
set rs=conn.execute(sql)
if name="" then
   response.write"查找字符不能为空串，请重输入查找的信息<a href=""javascript:history.go(-1)"">返回重查</a>"
   response.end
 elseif rs.eof then
   response.write"<br><br>对不起，没有你要查找的歌曲，请重新输入查询条件..."
   response.end
else   
  Set rs= Server.CreateObject("ADODB.Recordset")
  rs.open sql,conn,1,1
end if  

   const MaxPerPage=10
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
         
  if rs.eof and rs.bof then
       response.write "<p align='center'> 还 没 有 任 何 歌 曲</p>"
  else
      totalPut=rs.recordcount
      if currentpage<1 then
          currentpage=1
      end if
      if (currentpage-1)*MaxPerPage>totalput then
	   if (totalPut mod MaxPerPage)=0 then
	     currentpage= totalPut \ MaxPerPage
	   else
	      currentpage= totalPut \ MaxPerPage + 1
	   end if

      end if
       if currentPage=1 then
           showpage totalput,MaxPerPage,"search.asp"
            showContent
            showpage1 totalput,MaxPerPage,"search.asp"
       else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
           showpage totalput,MaxPerPage,"search.asp"
            showContent
             showpage1 totalput,MaxPerPage,"search.asp"
        else
	        currentPage=1
           showpage totalput,MaxPerPage,"search.asp"
           showContent
           showpage1 totalput,MaxPerPage,"search.asp"
	      end if
	   end if
   rs.close
   end if
	        
   set rs=nothing  
   conn.close
   set conn=nothing
   
   
sub showContent
       dim i
	   i=0

%>
<table width="777" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#5A5A2E"> 
<tr> <td bgcolor="#FFFFFF"> <table width="748" border="0" cellspacing="0" cellpadding="0"> 
<tr> <td width="200" bgcolor="#EFEFEF" valign="top" background="IMAGES/line.gif"> 
<br> <table width="180" border="0" cellspacing="0" cellpadding="0" align="center"> 
<tr> <td> <div align="center"><a href="index.asp?typeid=1"><img src="IMAGES/guo.gif" width="130" height="30" border="0"></a></div></td></tr> 
<tr> <td> <div align="center"><a href="index.asp?typeid=2"><img src="IMAGES/yue.gif" width="130" height="30" border="0"></a></div></td></tr> 
<tr> <td> <div align="center"><a href="index.asp?typeid=3"><img src="IMAGES/eng.gif" width="130" height="30" border="0"></a></div></td></tr> 
<tr> <td> <div align="center"><a href="index.asp?typeid=4"><img src="IMAGES/other.gif" width="130" height="30" border="0"></a></div></td></tr> 
<tr> <td> <div align="center"><a href="/music"><img src="IMAGES/all.gif" width="130" height="30" border="0"></a></div></td></tr> 
</table><br> <TABLE WIDTH="130" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="center"> 
<TR> <TD HEIGHT="90"> <TABLE WIDTH="120" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="center"> 
<TR> <TD> <DIV ALIGN="center"><A HREF="../gallery.asp" TARGET="_blank"><IMG SRC="IMAGES/pic.gif" WIDTH="120" HEIGHT="60" BORDER="0"></A></DIV></TD></TR> 
</TABLE></TD></TR> </TABLE><DIV ALIGN="center"> <A HREF="http://www.myl8.com/down_view.asp?id=4" TARGET="_blank"><IMG SRC="IMAGES/realplay.gif" WIDTH="77" HEIGHT="28" BORDER="0"></A><BR> 
<BR> <A HREF="http://www.myl8.com/down_view.asp?id=4" TARGET="_blank">播放器下载</A></DIV><br> 
</td><td valign="top" bgcolor="#E8EAEF"> <br> 　 <b><font color="#4D4D2F">歌曲搜索结果</font></b><br>    
<br> <table border="0" cellspacing="0" cellpadding="0" width="490" align="center"> 
<tr> <%
	  i=0
	  do while not rs.eof
%> <td> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="120" valign="top"> 
<table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td height="4"></td></tr> 
</table><TABLE WIDTH="100" BORDER="0" CELLSPACING="1" CELLPADDING="0" BGCOLOR="#FFFFFF"><TR><TD BGCOLOR="#E8EAEF"><%
if not isnull(rs("images")) and rs("images")<> "" then
   response.write "<img src=" + rs("images") + " width=100 height=75>"
end if
%></TD></TR></TABLE></td><td width="5">&nbsp;&nbsp;</td><td> <table border="0" cellspacing="0" cellpadding="0" width="152"> 
<tr> <td>[<%=rs("title")%>]</td></tr> <tr> <td><img src="IMAGES/play.gif" width="15" height="15"> 
<a href="<%=rs("images1")%>" target="_blank">免费试听</a></td></tr> <tr> <td> <img src="IMAGES/send.gif" width="16" height="16">    
<a href="write.asp?id=<%response.write rs("articleid") & addtion %>" target="_blank">我要点播</a></td></tr> 
</table></td></tr> </table><%
 if i mod 2 <> 0 then
%> </tr> <tr> <td height="15" width="50%"></td><td height="15" width="50%"></td></tr> 
<tr> <%end if%> <%
	      i=i+1
	      if i>=MaxPerPage  then exit do
	      rs.movenext
	      if rs.eof then exit do
	      loop
		  %> <%
end sub
   
   

function showpage1(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  Response.Write  "<table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""490"" align=""center"" height=30>"
%> <form action=<%response.write ""&filename&"?keyword="&request("keyword")&"&typeid="&typeid&""%> method="POST"> 
<%
  response.write "<tr><td>"
  if CurrentPage<2 then
    response.write "首页 上一页&nbsp;"
  else
    response.write "<a href="&filename&"?keyword="&request("keyword")&"&typeid="&typeid&"&page=1&>首页</a>&nbsp;"
    response.write "<a href="&filename&"?keyword="&request("keyword")&"&typeid="&typeid&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "下一页 末页"
  else
    response.write "<a href="&filename&"?keyword="&request("keyword")&"&typeid="&typeid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?keyword="&request("keyword")&"&typeid="&typeid&"&page="&n&">末页</a></td>"
  end if
%> </form><td align=right> 转到 <input type="Text" name="page" value="<%=CurrentPage%>" size="3" maxlength="3" class="put"> 
页 </td></tr> <%  
end function
%> <%
Function RmHtml(fString)
	fString = Replace(fString, CHR(13), " ")
	fString = Replace(fString, CHR(10) & CHR(10), " ")
	fString = Replace(fString, CHR(10), " ")
	fString = Replace(fString, "<br>", " ")
	fString = Replace(fString, "<BR>", " ")
	fString = Replace(fString, "<Br>", " ")
	fString = Replace(fString, "<bR>", " ")
	fString = Replace(fString, "<p>", " ")
	fString = Replace(fString, "<P>", " ")
	fString = replace(fString, ">", "&gt;")
	fString = replace(fString, "<", "&lt;")
        RmHtml=fString
End Function
%>











