<!-- #include file="include/admin_onlogin.asp" -->
<!-- #InclUDE file="include/jk_pagecute.asp" -->
<!--#include file="include/con_music_conn.asp"-->
<%
tit="专辑管理"  
index_url="music"
call admin_master(0,0)
call admin_header(0,0)

dim askclassid,asksclassid,asknclassid,Specialid,act,founerr
dim name,classid,sclassid,nclassid,sclass,nclass,founderr,yuyan,gongsi,times,pic,intro,gong
askclassid=request.QueryString("askclassid")
asksclassid=request.QueryString("asksclassid")
asknclassid=request.QueryString("asknclassid")
Specialid=request.QueryString("Specialid")
Page=request.QueryString("Page")
act=request("act")
set rs=server.createobject("adodb.recordset")

founerr=false
if act<>"" then
	if trim(Request.Form ("name"))="" then
		founderr=true
		response.write"<scRIPT language=Javascript>alert('专辑名称不能为空');javascript:history.go(-1);</scRIPT>"
	else
		Name=trim(Request.Form ("Name"))
	end if
	if trim(request.form("classid"))="" then
		founderr=true
		response.write"<scRIPT language=Javascript>alert('请选择一级分类');javascript:history.go(-1);</scRIPT>"
	else
		classid=Request.Form("classid")
	end if
	if trim(request.form("sclassid"))="" then
		founderr=true
		response.write"<scRIPT language=Javascript>alert('请选择二级分类');javascript:history.go(-1);</scRIPT>"
	else
		sclassid=trim(Request.Form ("sclassid"))
	end if
	if trim(request.form("nclassid"))="" then
		founderr=true
		response.write"<scRIPT language=Javascript>alert('请选择三级分类');javascript:history.go(-1);</scRIPT>"
	else
		nclassid=trim(Request.Form ("nclassid"))
	end if

	sql="select sclass from mv_sclass where sclassid="&sclassid
	rs.open sql,conn_mv,1,1
	if not rs.EOF then
		sclass=rs("sclass")
	else
		founderr=true
		response.write"<scRIPT language=Javascript>alert('二级栏目选择错误');javascript:history.go(-1);</scRIPT>"
	end if
	rs.close

	sql="select nclass from mv_nclass where nclassid="&nclassid
	rs.open sql,conn_mv,1,1
	if not rs.EOF then
		nclass=rs("nclass")
	else
		founderr=true
		response.write"<scRIPT language=Javascript>alert('三级栏目选择错误');javascript:history.go(-1);</scRIPT>"
	end if
	rs.close
end if

if founderr=true then
	call error()
else
	if act<>"" then
		Name=request("name")
		if trim(Request.Form("yuyan"))="" then	
			yuyan="www.52093.com"
		else
			yuyan=request.form("yuyan")	
		end if

		if trim(Request.Form("gongsi"))="" then
			gongsi="秋月家园"
		else
			gongsi=request.form("gongsi")
		end if

		if trim(Request.Form("times"))="" then
			times=now()
		else
			times=request.form("times")
		end if

		if trim(Request.Form("pic"))="" then
			pic="images/nophoto.gif"
		else
			pic=request.form("pic")		
		end if
      
                
		if trim(Request.Form("gong"))="" then
			gong="大陆地区"
		else
			gong=request.form("gong")		
		end if

		if trim(Request.Form("intro"))="" then
			intro="本站的发展全靠有您的支持，如果您喜欢本站音乐频道，请把本站介绍给您的好友，例如QQ里的朋友吧:) 请紧记本站首页地址：http://qiuyue.uumuu.com 有您的支持，我们一定继续把免费音乐做得更好！"
		else
			intro=request.form("intro")
		end if
	end if

	if act="edit" and Specialid<>"" then
'-----------------------------------修改专辑-----------------------------------
		sql="select * from mv_Special where Specialid="&Specialid 
		rs.open sql,conn_mv,1,3
		rs("name")=trim(name)
		rs("yuyan")=trim(yuyan)
		rs("gongsi")=trim(gongsi)
		rs("times")=trim(times)
		rs("pic")=trim(pic)
                rs("gong")=trim(gong)
		rs("classid")=classid
		rs("sclassid")=sclassid
		rs("sclass")=sclass
		rs("nclassid")=nclassid
		rs("nclass")=nclass
		rs("intro")=intro
		rs.update
		rs.close
'-----------------------------------结束修改-----------------------------------
'-----------------------------------添加专辑-----------------------------------
	elseif act="add" then
		sql="select * from mv_Special where (Specialid=0)" 
		rs.open sql,conn_mv,1,3
		rs.addnew
		rs("name")=trim(name)
		rs("yuyan")=trim(yuyan)
		rs("gongsi")=trim(gongsi)
		rs("times")=trim(times)
		rs("pic")=trim(pic)
                rs("gong")=trim(gong)
		rs("classid")=classid
		rs("sclass")=sclass
		rs("sclassid")=sclassid
		rs("nclassid")=nclassid
		rs("nclass")=nclass
		rs("intro")=intro
		rs.update
		rs.close
		conn_mv.close
		set conn_mv=nothing
'-----------------------------------添加修改-----------------------------------
	end if
	set rs=nothing
end if

'sub upload_pic
'sql="select * from upload where url="&request("pic")
'rs.open sql,conn_mv,1,3
'rs("iid")=rs("iid")+1
'rs("nsort")="音乐图片"
'rs.update
'rs.close
'conn_mv.close
'set conn_mv=nothing
'end sub

response.write"<scRIPT language=Javascript>alert('操作成功！');"
response.write"javascript:history.go(-2);</scRIPT>"
Response.End

%>