<!-- #include file="include/con_music.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<%
tit_fir="音乐频道"
tit="音乐搜索"

dim nummer,nums,page,rssum,thepages,viewpage,pageurl,sqladd,keyword,sea_type,sea_name,topic,topic2,sql1,sql2,sql3,linkurl,keywords,tims,m_sid
pageurl="?"
sqladd=""
topic=""
linkurl=""
keywords=""
sea_name="搜索"
nummer=dim_num(0)
nums=nummer
viewpage=1
thepages=0

call web_head(0,0,0,0,0)
call music_load()
%>
<TABLE width=770 border=0 align="center" cellPadding=0 cellSpacing=0 
background="image/music/j7.gif">
  <TBODY>
    <TR> 
      <TD width=58 height=38><IMG height=38 
      src="image/music/j8.gif" width=107 border=0> 
      <TD vAlign=center align=middle width=672> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD vAlign=center align=middle width="100%"> 
                <%
			  call music_head()
			  %>
              </td>
            </tr>
          </TBODY>
        </TABLE>
      <TD width=10 height=38> <P align=right><IMG height=38 src="image/music/j9.gif" 
      width=6 border=0></P></TR>
  </TBODY>
</TABLE>
<TABLE width=770 border=0 align=center cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR> 
      <TD width=176 vAlign=top bgcolor="#eef7fd"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD> </TD>
            </TR>
            <TR> 
              <TD bgColor=#eef7fd><IMG height=52 
            src=image/music/left02.jpg width=176 
            border=0> <TABLE  cellSpacing=4 cellPadding=0 width="86%" 
            align=center bgColor=EEF7FD border=0>
                  <TBODY>
                    <TR> 
                      <TD> 
                        <%
					  call music_sea( )
					  %>
                      </TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
            <TR> 
              <TD bgColor=#eef7fd><IMG height=52 
            src=image/music/left06.jpg width=176 
            border=0><BR> <TABLE height=134 cellSpacing=4 cellPadding=0 width="86%" 
            align=center bgColor=EEF7FD border=0>
                  <TBODY>
                    <TR> 
                      <TD height=76> <DIV align=center><IMG class=imgb height=60 
                  src="image/music/foto.gif" width=140 
                  border=0></DIV></TD>
                    </TR>
                    <TR> 
                      <TD height=46> 
                        <%
					  call music_top(10,10)
					  %>
                      </TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
            <TR> 
              <TD><IMG height=57 src="image/music/left03.jpg" 
            width=176 border=0></TD>
            </TR>
            <TR> 
              <TD> <TABLE cellSpacing=0 cellPadding=0 width=173 bgColor=#eef7fd 
            border=0>
                  <TBODY>
                    <TR> 
                      <TD> <TABLE height=117 cellSpacing=4 cellPadding=0 width="87%" 
                  align=center bgColor=EEF7FD border=0>
                          <TBODY>
                            <TR> 
                              <TD height="66" valign="top"><div align="center"><IMG class=imgb height=60 
                        src="image/music/newcd.jpg" 
                        width=140></div></TD>
                            </TR>
                            <TR> 
                              <TD> 
                                <%
					  call disk_top(10,10)
					  %>
                              </TD>
                            </TR>
                          </TBODY>
                        </TABLE></TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
          </TBODY>
        </TABLE></TD>
      <TD vAlign=top bgcolor="A0CAED"> 
        <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD bgColor=#ffffff height=5></TD>
            </TR>
          </TBODY>
        </TABLE>
        <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff 
        border=0>
          <TBODY>
            <tr> 
              <TD width=593><div align="right"><IMG src="image/music/m10.gif" width=593 height=37 border=0></div></TD>
            </tr>
            <TR> 
              <TD> <TABLE width="593" border=0 align="right" cellPadding=0 cellSpacing=0>
                  <TBODY>
                    <TR> 
                      <TD 
                background="image/music/middlebg02.gif" 
                height=182> 
                        <%
call sea_types()
call sql_add2()
response.write vbcrlf&music_bar_top("center_search_main",1)
if sqladd="" then
  call search_error()
else
  call search_main()
end if
response.write vbcrlf&music_bar_end()
   %>
                      </TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
          </TBODY>
        </TABLE>
        <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD bgColor=A0CAED 
height=5></TD>
            </TR>
          </TBODY>
        </TABLE></TD>
    </TR>
  </TBODY>
</TABLE>
<%
call web_end(0,0)
sub search_error()
response.write "<tr><td height=160 align=center>"
response.write "  <table border=0>"
response.write "  <tr><td height=30><b>您可能没有填写“搜索关键字”，请查看以下帮助说明：</b></td></tr>"
response.write "  <tr><td><li>在搜索时必须填写“搜索关键字”；</li></td></tr>"
response.write "  <tr><td><li>如要搜索多个关键字请用<font class=red>空格</font>将多个关键字隔开，如：<font class=blue>音乐&nbsp;点歌</font>；</li></td></tr>"
response.write "  <tr><td><li>“关键字”中不能含有单引号（'）；</li></td></tr>"
response.write "  <tr><td><li>“关键字”中含有的加号（+）将被视为空格处理；</li></td></tr>"
response.write "  <tr><td><li>祝您在使用本站的“音乐搜索”时轻松愉快。</li></td></tr>"
response.write "  </table>"
response.write "</td></tr>"
end sub

sub search_main()
response.write "<tr align=center><td>"
response.write "<table border=0 cellspacing=1 cellpadding=1 class=mtable>"
response.write "<tr height=24 align=center>"
response.write "<td class=mtd width='6%'>序号</td>"
response.write "<td class=mtd width='94%'>相关内容（您查询的关键字是："&keywords&"每页 <font class=red>"&nummer&"</font> 条 <font class=red>"&sea_name&"</font> 查询结果）</td>"
response.write "</tr>"
  tims=timer()
  sql=sql3&sqladd
  set rs=joekoe_cms.exec(sql,1)
  'response.write sql
  'response.end
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql=sql1&sqladd&sql2
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,1
  if int(viewpage)>1 then rs.move (viewpage-1)*nummer
  if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
  for i=1 to nums

response.write "<tr height=24 align=center class=mbg_td>"
response.write "<td class=tims>"&(viewpage-1)*nummer+i&"</td>"
if sea_type="singer" then 
  m_sid="&s_id="&rs(3)&"&c_id="&rs(4)
else
  m_sid=""
end if
response.write "<td align=left><a href='"&linkurl&rs(0)&"' target=_blank>"&joekoe_cms.code_html(rs(1),1,32)&"</a>&nbsp;<font class=tims>"&joekoe_cms.time_type(rs(2),3)&"</font>&nbsp;</td>"
response.write "</tr>"
    rs.movenext
  next
  rs.close
response.write "<tr><td colspan=2>"
response.write "  <table border=0 width='100%' cellspacing=0 cellpadding=0>"
response.write "  <tr>"
response.write "  <td>共&nbsp;<font class=red>"&rssum&"</font>&nbsp;条结果&nbsp;"
response.write "页次：<font class=red>"&viewpage&"</font>/<font class=red>"&thepages&"</font>&nbsp;"
response.write "分页："&jk_pagecute(nummer,thepages,viewpage,pageurl,3,"#ff0000")&"</td>"
response.write "  <td align=right><font class=gray>查询用时：<font class=red2>"&FormatNumber((timer()-tims)*1000,3) &"</font> 毫秒</font></td>"
response.write "  </tr>"
response.write "  </table>"
response.write "</td></tr>"
response.write "</table>"
response.write "</td></tr>"
end sub

sub sql_add2()
  dim ddim,dnum,i
  keyword=joekoe_cms.code_form(request.querystring("keyword"))
  if len(keyword)<1 then sqladd="":exit sub
  keyword=replace(keyword,"&"," ")
  pageurl=pageurl&"keyword="&server.urlencode(keyword)&"&"
  ddim=split(keyword," ")
  dnum=ubound(ddim)
  for i=0 to dnum
    keywords=keywords&"<font class=red2><b>"&ddim(i)&"</b></font>&nbsp;&nbsp;"
    sqladd=sqladd&" and name like '%"&ddim(i)&"%'"
  next
  erase ddim
  if sqladd<>"" then
    sqladd=right(sqladd,len(sqladd)-4)
  end if
end sub

sub sea_types()
  sea_type=trim(request.querystring("sea_type"))
  select case sea_type
  case "song"
    linkurl="music_pass.asp?id="
    sea_name="歌曲"
    sql1="select id,name,tim from music_song where"
    sql2=" order by id desc"
    sql3="select count(id) from music_song where"
  case "disk"
    linkurl="music_"&sea_type&"_view.asp?id="
    sea_name="专辑"
    sql1="select id,name,tim from music_disk where"
    sql2=" order by id desc"
    sql3="select count(id) from music_disk where"
case "singer"
    linkurl="music_"&sea_type&"_view.asp?n_id="
    sea_name="歌手"
    sql1="select id,name,tim,s_id,c_id from music_singer where"
    sql2=" order by id desc"
    sql3="select count(id) from music_singer where"
  end select
  pageurl=pageurl&"sea_type="&sea_type&"&"
end sub
%>