<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<!--#include file="Star.INC"-->
<!--#include file="style.asp"-->
<%
founderr=false
if isnull(session("UserName")) or session("UserName")="" or isnull(session("PassWord")) or session("PassWord")="" then
	errmsg=errmsg+"<SCRIPT language=JavaScript>alert(' 对不起, 只有会员才可以使用音乐盒! ');javascript:top.window.close();</SCRIPT>"
	call error()
	Response.End 
end if
%>
<!--#include file="Top11.asp"-->
<%
action=request("action")
set rs=server.createobject("adodb.recordset")
if action="add" then
	Musicid=request.QueryString("id")
	sql="select * from Box where UserName='"&session("UserName")&"' and Musicid="&Musicid
	rs.open sql,conn,1,3
	if not rs.EOF then
		errmsg=errmsg+"<SCRIPT language=JavaScript>alert(' 你已经收藏了此歌曲了! ');javascript:top.window.close();</SCRIPT>"
		call error()
		response.end
	else
		set rs2=server.createobject("adodb.recordset")
		sql2="select * from MusicList where id="&Musicid
		rs2.open sql2,conn,1,1
		if (rs2.EOF and rs2.BOF) then
			errmsg=errmsg+"<SCRIPT language=JavaScript>alert(' 请正确选择歌曲! ');javascript:top.window.close();</SCRIPT>"
			call error()
			response.end
		else
			Wma=rs2("Wma")
			MusicName=rs2("MusicName")
			Singer=rs2("Singer")
			Classid=rs2("Classid")
			SClassid=rs2("SClassid")
			NClassid=rs2("NClassid")
		end if
		rs2.close
		set rs2=nothing
		rs.AddNew
		rs("UserName")=session("UserName")
		rs("Musicid")=Musicid
		rs("MusicName")=MusicName
		rs("Singer")=Singer
		rs("Wma")=Wma
		if Wma<>"" then
			rs("Wma")=true
		end if
		rs("Classid")=Classid
		rs("SClassid")=SClassid
		rs("NClassid")=NClassid
		rs.Update
	end if
	rs.Close
	Response.Redirect "Box.asp?action=show"
elseif action="del" then
	id=request("id")
	set rs=conn.execute("delete FROM Box where UserName='"&session("UserName")&"' and id="&id)
	Response.Redirect "Box.asp?action=show"
elseif action="show" or action="" then
%>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="200" valign="top" bgcolor="F7F7F7"><table width="100%" border="0" cellspacing="4" cellpadding="0">
        <tr>
          <td align="center">&nbsp;</td>
        </tr>
        
<!--#include file="vipleft.asp"-->
          <td align="center">&nbsp;</td>
        </tr>
      </table> </td>
    <td width="576" valign="top"><table width="100%" border="0" cellspacing="3" cellpadding="0">
        <tr> 
          <td align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td><img src="indeximg/liebiao_bg1.gif" width="546" height="35"></td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="1" bgcolor="#CCCCCC"><img src="indeximg/1x1.gif" width="1" height="1"></td>
                            <td><table width="100%" border="0" cellspacing="4" cellpadding="0">
                                <tr>
                                  <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolordark="#FFFFFF" bgcolor="#eeeeee">
                                      <tr bgcolor="#eeeeee"> 
                                        <td height=25 align=center colspan=7>音乐收藏列表</td>
                                      </tr>
<form name="form" onsubmit="javascript:return ting2008();" target="ting2008" action="playsong.asp">                                      
<%
'/////////////////////////////////////////////////////////////////////////////
'##############################################################################
%>                                   
                                        <tr bgcolor="#FFFFFF"> 
                                          <td width="40" height=25 align=center><font color="#333333">选择</font></td>
                                          <td width="266" height=25 align=center><font color="#333333">歌曲名字</font></td>
                                          <td width="80" height=25 align=center><font color="#333333">歌手</font></td>
                                          <td width="40" height=25 align=center><font color="#333333">试听</font></td>
                                          <td width="80" height=25 align=center><font color="#333333">VIP下载</font></td>
                                          <td width="40" height=25 align=center><font color="#333333">点歌</font></td>
                                          <td width="40" height=25 align=center><font color="#333333">删除</font></td>
<%
	sql="select * from Box where UserName='"&session("UserName")&"'"
	rs.open sql,conn,1,1
	if rs.EOF and rs.BOF then
%>
                                        
                                        <tr bgcolor="#FFFFFF"> 
                                          <td height="25" colspan=8 align=center><font color="#000000">你尚未收藏任何歌曲</font></td>
                                        </tr>
<%
	else
    do while not rs.EOF 
	i=i+1
%>
<tr bgcolor="#FFFFFF"> 
                                          <td height="25" align="center"> <input type="checkbox" name="checked" value="<%=rs("musicid")%>"></td>
                                          <td height="25" ><font color="#333333"><%=i%>.<a href="javascript:Wmaplay('<%=rs("musicid")%>')"><font color="#333333"><%=rs("MusicName")%></font></a></font></td>
                                          <td height="25" align=center><a href="Albumlist.asp?Name=51y&ID=<%=rs("SClassid")%>&ArtID=<%=rs("NClassid")%>"><font color="#FFFFFF"><%=rs("Singer")%></font></a></td>
                                          <td height="25" align=center><a href="javascript:Wmaplay('<%=rs("musicid")%>')"><font color="#333333">试听</font></a></td>
                                          <td height="25" align=center><a href="#" onClick="window.open('Yxdown.asp?id=<%=rs("musicid")%>','yxdown','scrollbars=no,resizable=no,width=610,height=302,menubar=no,top=250,left=250')"><font color="#333333">VIP下载</font></a></td>
                                          <td height="25" align=center><a href="#" onClick="window.open('Mailsong.asp?id=<%=rs("musicid")%>','','scrollbars=no,resizable=no,width=419,height=151,menubar=no,top=98,left=198')"><font color="#333333">送友</font></a></td>
                                          <td height="25" align=center><a href="Box.asp?action=del&id=<%=rs("id")%>"><font color="#333333">删除</font></a></td>
                                        </tr>
<%
'####################################################################
'//////////////////////////////////////////////////////////////////////
%> 
<%
	rs.MoveNext
    loop
%>
<tr bgcolor="#FFFFFF"> 
                                          <td height="30" colspan="7" align="center"> 
                                            <input type="button" name="chkall" value="全 选" onclick="CheckAll(this.form)" title="选择显示的所有歌曲" class="anniou"> 
                                            &nbsp; <input type="button" name="chkOthers" value="反 选" onclick="CheckOthers(this.form)" title="反向选择歌曲" class="anniou"> 
                                            &nbsp; <input type="submit" name="B1" value="播 放" title="请先选择你想听的歌曲后再点击播放" class="anniou"> 
                                          </td>
                                        </tr>
                                    </form>
<%
end if
%>   
  
                                   </table></td>
                                </tr>
                              </table></td>
                            <td width="1" bgcolor="#CCCCCC"><img src="indeximg/1x1.gif" width="1" height="1"></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td valign="top" bgcolor="#CCCCCC"><img src="indeximg/1x1.gif" width="1" height="1"></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>

 <!--#include file="bottom1.asp"-->
<% 
	
	rs.Close
else
	errmsg=errmsg+"<SCRIPT language=JavaScript>alert(' 操作错误! 请联系管理员. ');javascript:top.window.close();</SCRIPT>"
	founderr=true
end if
set rs=nothing
conn.close
set conn=nothing
if founderr=true then
	call error()
end if
%>