<!--#include file="articleconn.asp"-->
<!--#include file="home1.asp"-->
<script language="JavaScript">
<!--
function checkinput()
{
	if (document.search.keyword.value=="")
	 {
		alert("请输入想查询的内容！");
		document.search.keyword.focus();

		return false;
	 }
	 return true;
}
-->
</script>
<link rel="stylesheet" href="style.css" type="text/css">

<%
   dim rs
   MaxPerPage=rs("duo")
   dim totalPut
   dim CurrentPage
   dim TotalPages
   dim i,j

   dim typename
   dim ty
   
   if isempty(request("youid")) or request("youid")="" then
      addtion=""
   else
      addtion="&youid=" & request("youid")
   end if   
   typeid=request("typeid")
   typename="图吧"
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
      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
set rst=server.CreateObject("ADODB.RecordSet")
%>
<%
dim sql

if typeid=0 then
   sql="select learning.*,type.type from learning,type where learning.typeid=type.typeid order by learning.articleid desc"
else
   sql="select learning.*,type.type from learning,type where learning.typeid=type.typeid and learning.typeid="&typeid&" order by learning.articleid desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
 if rs.eof and rs.bof then
       response.write "<p align='center'> 还 没 有 任 何 歌 曲 </p>"
   else
	  totalPut=rs.recordcount
      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,"index.asp"
	    showContent
	    showpage1 totalput,MaxPerPage,"index.asp"
       else
	  if (currentPage-1)*MaxPerPage<totalPut then
	    rs.move  (currentPage-1)*MaxPerPage
	    dim bookmark
	    bookmark=rs.bookmark
	    showpage totalput,MaxPerPage,"index.asp"
	    showContent
	    showpage1 totalput,MaxPerPage,"index.asp"
	else
		currentPage=1
	  showpage totalput,MaxPerPage,"index.asp"
	   showContent
	   showpage1 totalput,MaxPerPage,"index.asp"
	      end if
	   end if
   rs.close
   end if

   set rs=nothing
   conn.close
   set conn=nothing


sub showContent
       dim i
	   i=0

%>
</table><table width="777" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#686F51"> 
<tr> <td> <table width="777" border="0" cellspacing="0" cellpadding="0"> <tr> 
<td> <table width="777" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="200" bgcolor="#EFEFEF" valign="top" background="IMAGES/line.gif"> 
<table width="170" border="0" cellspacing="0" cellpadding="0" align="center"> 
<tr> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> 
<td valign="middle" height="120"> <div align="center"><img src="IMAGES/pic.gif" width="150" height="41">

<table border=0 cellpadding=0 cellspacing=0 width='100%' align=center>
<tr><td background='../images/top1bg.gif' height=1></td><tr>
</table>
 
</div><table width="150" border="0" cellspacing="0" cellpadding="0" align="center"> 
<tr> <td> <form action="search.asp" method="post" name="search" onSubmit="return checkinput()"> 
<input type="text" name="keyword" size="16" maxlength="30" onFocus=this.value='' class="put"> 
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td height="3"></td></tr> 
</tbody> </table><select name="typeid" class="put"> <option selected value="0">全部歌曲</option> 
<%
    rst.open "select * from type",conn,1
    do while NOT rst.EOF
%> <option value="<%=rst("typeid")%>"><%=rst("type")%></option> <%
	    rst.MoveNext
	    loop
    rst.close
%> </select> 
<input type="image" src="images/search-ico.gif" align="absmiddle" width="51" height="22" title="查询" id=Image1 name=Image1> 
</form></td></tr> </table></td></tr> </table></td></tr> </table><table width='100%' height=2><tr><td></td></tr></table>
<table border=0 width=180 cellspacing=0 cellpadding=0>
<tr><td><img src='images/left_sort.gif' border=0></td></tr>
<tr><td background='images/left_bg.gif' align=center>
  <table border=0>
  <tr><td height=5></td></tr>

  <tr>
  <td><img border=0 src='images/fk00.gif' align=absmiddle>&nbsp;&nbsp;<a href='index.asp?typeid=1'>国语歌曲</a></td>
  <td><img border=0 src='images/fk00.gif' align=absmiddle>&nbsp;&nbsp;<a href='index.asp?typeid=2'>粤语歌曲</a></td>
  </tr>
  <tr>
  <td><img border=0 src='images/fk00.gif' align=absmiddle>&nbsp;&nbsp;<a href='index.asp?typeid=3'>英文歌曲</a></td>
  <td><img border=0 src='images/fk00.gif' align=absmiddle>&nbsp;&nbsp;<a href='index.asp?typeid=4'>其它歌曲</a></td>
  </tr>
  <tr>
  <td><img border=0 src='images/fk00.gif' align=absmiddle>&nbsp;&nbsp;<a href='index.asp?typeid=5'>全部歌曲</a></td>
  </tr>
  </table>
</td></tr>
<tr><td><img src='images/left_end.gif' border=0></td></tr><br> <table width="180" border="0" cellspacing="0" cellpadding="0" align="center" height="160"> 
<tr> <td> <table width="180" border="0" cellspacing="0" cellpadding="0" align="center" height="160"> 
<tr> <td> <table width="190" border="0" cellspacing="0" cellpadding="0" align="center" height="160"> 

<tr><td><img src='images/left_end0.gif' border=0>
<tr> <td height="160"><iframe src=movie.asp noresize scrolling=no frameborder=0 width=180 height=165 hspace="0" vspace="0" marginheight="0"></iframe>

<tr><td><img src='images/left_end.gif' border=0>
</td></tr> </table></td></tr> </table></td></tr> </table><TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER"><TR><TD HEIGHT="30"><DIV ALIGN="CENTER"></DIV></TD></TR></TABLE>
                   <BR><div align="center"> 
  <a target="_blank" href="../down_view.asp?id=7"><img src="IMAGES/realplay.gif" width="77" height="28" border="0"></a><br> 
<br> 播放器下载<br> 
</div></td><td bgcolor="#E8EAEF" valign="top"> <TABLE WIDTH="548" BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD>
    <a target="_blank"><IMG SRC="IMAGES/163smnet.jpg" WIDTH="548" HEIGHT="80" BORDER="0"></a></TD></TR></TABLE><table width="460" border="0" cellspacing="0" cellpadding="0" align="center"> 
<tr> <td width="530" colspan="2"> <table border="0" cellspacing="0" cellpadding="1" width="100%" align="center">
<tbody> <tr> <tr> <%
	  i=0
	  do while not rs.eof
%> <td> <table border="0" cellspacing="0" cellpadding="5" width="100%"> <tbody> 
<tr> <td width="100" valign="top"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> 
<tbody> <tr> <td height="7"></td></tr> </tbody> </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> <table border="0" cellspacing="0" cellpadding="0" width="130"> 
<tbody> <tr> <td height="22">[<%=rs("title")%>]</td></tr> <tr> <td height="22"><img src="IMAGES/play.gif" width="15" height="15"> 
<a href="<%=rs("images1")%>" target="_blank">免费试听</a></td></tr> <tr> <td height="22"><img src="IMAGES/send.gif" width="16" height="16"> 
<a href="write.asp?id=<%response.write rs("articleid") & addtion %>" target="_blank">我要点播</a></td></tr> 
</tbody> </table></td></tr> </tbody> </table><%
 if i mod 2 <> 0 then
%> </tr> <tr> <%end if%> <%
	      i=i+1
	      if i>=MaxPerPage  then exit do
	      rs.movenext
	      if rs.eof then exit do
	      loop
		  %> </tr> </tbody> </table><%
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=""530"" align=""center"" height=30><tbody>"
%> <tr> <td width="300"> <form action=<%response.write ""&filename&"?typeid="&typeid&""%> method="POST"> 
<%
  response.write "<tr>"
  Response.Write  "共有歌曲: <b><font color=""red"">"&totalnumber&"</font></b> 首　页次: <font color=""red""><b>"&CurrentPage&"</b> / <b>"&n&"</b></font> 页&nbsp;&nbsp;&nbsp;"
  if CurrentPage<2 then
    response.write "首页 上一页&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&page=1&>首页</a>&nbsp;"
    response.write "<a href="&filename&"?typeid="&typeid&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "下一页 末页"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&page="&n&">末页</a>"
  end if
%> 转到 <input type="Text" name="page" value="<%=CurrentPage%>" size="3" maxlength="3" class="put"> 
页 </form></table></td></tr> </table></td></tr> 
</center>
<%  
end function
%>