<!--#include file="function.asp"-->
<%CheckAdmin3%>
<!--#include file="conn.asp"-->
<!--#include file="Star.inc"-->
<!--#include file="top.asp"-->
<%
page=trim(request.querystring("page"))
AskClassid=trim(request.querystring("AskClassid"))
AskSClassid=trim(request.querystring("AskSClassid"))
AskNClassid=trim(request.querystring("AskNClassid"))
Wma=trim(request.form("Wma"))
Wma2=trim(request.form("Wma2"))
MusicName=trim(request.form("MusicName"))
Sclassid=trim(request.form("Sclassid"))
urlid=trim(request.form("urlid"))

founerr=false
act=request("act")
	if MusicName="" then
		errmsg=errmsg+"歌曲名称不能为空"
		founderr=true
	end if
	
		if trim(Request.Form("Wma"))="" then
			Wma=""
		else
			Wma=request.form("Wma")
		end if

if founderr=true then
	call error()
else
	set rs=server.createobject("adodb.recordset")
	
	if act="edit" and request("id")<>"" then
		sql="select * from MusicList where id="&request("id")
		rs.open sql,conn,1,3
		rs("Wma")=trim(Wma)
		rs("Wma2")=trim(Wma2)
		rs("MusicName")=MusicName
		rs("Sclassid")=Sclassid
		rs("url")=urlid
		rs("isCheck")=1 '审核
		rs.update
		rs.close

		sql="select * from Box where Musicid="&request("id")
		rs.open sql,conn,1,3
		if not rs.eof then
			rs("MusicName")=MusicName
			rs.update
		end if
		rs.close

		call Success
		Response.End 
		
	elseif act="add" then
		sql="select * from MusicList where (id is null)" 
		rs.open sql,conn,1,3
		rs.addnew
		rs("Wma")=Wma
		rs("Wma2")=Wma2
		rs("MusicName")=MusicName
		rs("Sclassid")=Sclassid
		rs("classid")=1
		rs("Url")=0

		rs.update
		rs.close
		call Success
		Response.End 
		errmsg=errmsg+"<li>操作错误！请联系管理员</li>"
		call error()
		Response.End
	end if
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Redirect "888wang_song_main.asp?SClassid="+AskSClassid+"&Page="+Page
end if
sub Success
%>

<div align="center">
<center>
<table border="0" width="80%" cellspacing="1" cellpadding="1">
  <tr>
    <td>　
      <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" class="bordercolor">
         <tr align="center">
        <td width="100%" height="20" colspan=2 background="tt90/bgleft.gif" align=center><b>歌曲<%if act="add" then%>添加<%else%>修改<%end if%>成功</b></td>
        </tr>
        <tr>
          <td>
           <table border="1" width="100%" cellspacing="0" cellpadding="3" class="bordercolor" bordercolordark="#FFFFFF">
             <tr>
              <td width="25%" align="right">歌曲：</td>
              <td width="75%"><%=MusicName%>　</td>
            </tr>
            <tr>
              <td align="right">分类：</td>
              <td><%=sclassid%>　</td>
            </tr>
            <tr>
              <td align="right">Wma地址：</td>
              <td><%=Wma%>　</td>
            </tr>
			
			 <tr>
              <td align="right">路径ID：</td>
              <td><%=url%>　</td>
            </tr>
            <tr>
              <td colspan="2" height="15" align=center><input class=input type="button" name="button2" value=" 继续<%if act="add" then%>添加<%else%>修改<%end if%> " onClick="javascript:history.go(-1)">&nbsp;&nbsp;&nbsp;&nbsp;<input class=input type="button" name="button1" value=" 完成<%if act="add" then%>添加<%else%>修改<%end if%>  " onClick="javascript:history.go(-2)"></td>
            </tr>
          </table>
          </td>
        </tr>
     </table>
 　 </td>
  </tr>
</table>
</div>
</body>
</html>
<%
end sub
%>





