<!--#include file="chkhk.asp" -->
<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<!--#include file="style.asp"-->
<!--#include file="sql.asp"-->
<!--#include file="inc/noip.asp"--> 
<%
action=request("action")
set rs=server.createobject("adodb.recordset")
if action="add" then
	albumid=request.QueryString("id")
	sql="select * from albumbox where Userid='"&session("Userid")&"' and albumid="&albumid
	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 special where specialid="&albumid
		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
			
			Name=rs2("Name")
			NClass=rs2("NClass")
			NClassid=rs2("NClassid")
			pic=rs2("pic")
			info=rs2("intro")
		end if
		rs2.close
	        set rs2=nothing 
		rs.AddNew
		rs("Userid")=session("Userid")
		rs("albumid")=albumid
		rs("albumName")=name
		rs("Singer")=NClass
		rs("NClassid")=NClassid
		rs("pic")=pic
		rs("info")=info
		rs.Update
	end if
	rs.Close
		Response.Redirect "albubox.asp?action=show"
elseif action="del" then
	id=request("id")
	set rs=conn.execute("delete FROM albumbox where Userid='"&session("Userid")&"' and id="&id)
	Response.Redirect "albubox.asp?action=show"
	
elseif action<>"del" and action<>"add" then
%>
<!--#include file="top11.asp"-->

<table width="770" 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" bgcolor="eeeeee">
                                      <tr> 
                                        <td height="25" align="center"><font color="#333333">专辑收藏列表</font></td>
                           </tr>            
<%
'///////////////////////////////////////////////////////////////////////////////////////
'#####################################################################################
%>
<%
	sql="select * from albumbox where Userid='"&session("Userid")&"'"
	rs.open sql,conn,1,1
	if rs.EOF and rs.BOF then
%>
<tr>
                                        <td height="25" align="center" bgcolor="#FFFFFF"><font color="#333333">你尚未收藏任何专辑</font></td>
                                      </tr>
<%
'///////////////////////////////////////////////////////////////////////////////////////
'#####################################################################################
%>
 <%
	else
    do while not rs.EOF 
	i=i+1
%>
<tr>
                                        <td height="25" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="4" cellpadding="0">
                                            <tr>
                                              <td width="72%"><table>
                                                  <tr> 
                                                    <td> <font color="#333333"><b><font face=Verdana, Arial, Helvetica, sans-serif size=4><%=i%></font></b></font></td>
                                                  </tr>
                                                  <tr> 
                                                    <td><font color="#333333">专辑名字：<A href="Musiclist.asp?AlbumID=<%=rs("albumid")%>"><%=rs("albumName")%></a> 
                                                      * 点击进入欣赏此专辑</font></td>
                                                  </tr>
                                                  <tr> 
                                                    <td><font color="#333333">演唱歌手：<%=rs("Singer")%></font></td>
                                                  </tr>
                                                  <tr> 
                                                    <td><font color="#333333">网际传情：<a href="#" onClick="window.open('Mailalbum.asp?id=<%=rs("albumid")%>','','scrollbars=no,resizable=no,width=419,height=151,menubar=no,top=98,left=198')">送友</a></font></td>
                                                  </tr>
                                                  <tr> 
                                                    <td><font color="#333333">删除收藏：<a href="albubox.asp?action=del&id=<%=rs("id")%>">删除</a></font></td>
                                                  </tr>
                                                </table></td>
                                              <td width="28%"><font color="#333333"><a href="Musiclist.asp?AlbumID=<%=rs("albumid")%>"><img src="<%=rs("pic")%>" width="100" height="100"></a></font></td>
                                            </tr>
                                          </table></td>
                                      </tr>
<%
'###########################################################################                 ' ///////////////////////////////////////////////////////////////////////////////
%>
<%
	rs.MoveNext
    loop
%>
                                          </table>
<%
end if
%>
</td>
                                      </tr>
                                      <tr>
                                        <td height="25" bgcolor="#FFFFFF">&nbsp;</td>
                                      </tr>
                                        </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
%>
