www.gusucode.com > 星云DJ舞曲 4.5a源码程序 > admin/admin_songsave.asp

    <!--#include file="function.asp"-->
<%CheckAdmin1%>
<!--#include file="conn.asp"-->
<!--#include file="inc/char.inc"-->
<%
page=trim(request.querystring("page"))
AskClassid=trim(request.querystring("AskClassid"))
ListenUrl=trim(request.form("ListenUrl"))
Musictype=trim(request.form("Musictype"))
LS_ID=request.form("LS_ID")
DownUrl=trim(request.form("DownUrl"))
Mp3DownID=request.form("Mp3DownID")
MusicName=trim(request.form("MusicName"))
classid=trim(request.form("classid"))
Specialid=trim(request.form("Specialid"))
songwords=trim(request.form("songwords"))
Music_Points=trim(request.form("Music_Points"))
Rm_Points=trim(request.form("Rm_Points"))
ZzGood=trim(request.form("ZzGood"))
IsGood=trim(request.form("IsGood"))
bfqlb=trim(request.form("bfqlb"))
DjRen=trim(request.form("DjRen"))
Level=trim(request("Level"))
founerr=false
act=request("act")
sub isChecked(a,b)
  if a = b then
  	  response.write " checked"
  end if
end sub
'if act<>"SetIsGood" then
'	if ListenUrl="" then
'		errmsg="<li>试听的路径不能为空</li>"
'		founderr=true
'	end if
'	if MusicName="" then
'		errmsg=errmsg+"<li>显示名称不能为空</li>"
'		founderr=true
'	end if
'end if
if founderr=true then
	call error()
else
	set rs=server.createobject("adodb.recordset")		
	if LS_ID<>"" then
		sql="select ListenServerUrl from DJServer where LServerID="&LS_ID
		rs.open sql,conn,1,1
		ListenServerUrl=rs("ListenServerUrl")
		rs.close
        end if
        if Mp3DownID<>"" then
		sql="select Mp3DownServerUrl from Mp3DownServer where Mp3DownID="&Mp3DownId
		rs.open sql,conn,1,1
		Mp3DownServerUrl=rs("Mp3DownServerUrl")
		rs.close
        end if
	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("ListenUrl")=trim(ListenUrl)
		if LS_ID<>"" then
		rs("LS_ID")=LS_ID
		else
		rs("LS_ID")=null
		end if
		rs("DownUrl")=trim(DownUrl)
		if Mp3DownId<>"" then
		rs("Mp3DownID")=Mp3DownId
		else
		rs("Mp3DownID")=null
		end if
                rs("MusicName")=MusicName
		rs("classid")=classid
		rs("Specialid")=Specialid
                rs("Music_Points")=Music_Points
		rs("Rm_Points")=Rm_Points
                rs("DjRen")=DjRen
                rs("Level")=Level
                rs("ZzGood")=ZzGood
		rs("IsGood")=IsGood
                rs("musictype")=trim(request("musictype"))
		if songwords<>"" then
		rs("songwords")=songwords
		else
		rs("songwords")=null
		end if
		rs.close
		sql="select * from collection where Musicid="&request("id")
		rs.open sql,conn,1,3
		if not rs.eof then
			rs("MusicName")=MusicName
			rs("djmix")=djmix
			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("ListenUrl")=ListenUrl
		if LS_ID<>"" then
		rs("LS_ID")=LS_ID
		else
		rs("LS_ID")=null
		end if
		rs("DownUrl")=DownUrl
		if Mp3DownId<>"" then
		rs("Mp3DownID")=Mp3DownId
		else
		rs("Mp3DownID")=null
		end if
                rs("MusicName")=MusicName
		rs("DjRen")=DjRen
                rs("djmix")=djmix
		if songwords<>"" then
		rs("songwords")=songwords
		else
		rs("songwords")=null
		end if
		rs("classid")=classid
		rs("musictype")=trim(request("musictype"))
		rs("Music_Points")=trim(request("Music_Points"))
		rs("Rm_Points")=trim(request("Rm_Points"))
                if Specialid<>"" then rs("Specialid")=Specialid
		rs("Level")=Level
                rs("ZzGood")=ZzGood
                rs("IsGood")=IsGood
                rs("Music_Points")=Music_Points
		rs("Rm_Points")=Rm_Points
                rs("DjRen")=DjRen
                rs("IsChecked")=true
		rs("dateandtime")=now()
		rs.update
		rs.close
		call Success
		Response.End 
	elseif act="SetIsGood" then
		sql="select IsGood from MusicList where id="&request("id") 
		rs.open sql,conn,1,3
		if not rs.EOF then
			if rs("IsGood")=true then
				rs("IsGood")=false
			else
				rs("IsGood")=true
			end if
			rs.update
		end if
		rs.close 
	elseif act="bfqlb" then
		sql="select bfqlb from MusicList where id="&request("id") 
		rs.open sql,conn,1,3
		if not rs.EOF then
			if rs("bfqlb")=true then
				rs("bfqlb")=false
			else
				rs("bfqlb")=true
			end if
			rs.update
		end if
		rs.close 
		
	else
		errmsg=errmsg+"<li>操作错误!请联系管理员</li>"
		call error()
		Response.End
	end if
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Redirect "admin_SongMana.asp?Classid="+AskClassid+"&Page="+Page
end if
sub Success
%>
<html>
<head>
<title>迪吧后台管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<form method="POST" action="admin_SongSave.asp">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="topbg"> 
    <td height="22" colspan="2" align="center"><strong>舞 曲 <%if act="add" then%>添 加 <%else%>修 改 <%end if%>成 功</strong></td>
  </tr>
</table>
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
   <tr class="tdbg"> 
      <td width="20%" align="right"><strong>舞曲作者:</strong></td>
      <td width="80%"><%=DjRen%></td>
    </tr> 
    <tr class="tdbg"> 
      <td width="20%" align="right"><strong>舞曲等级:</strong></td>
      <td width="80%"><%=Level%>[<font color=#ff0000>级</font>]</td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" align="right"><strong>播放类型:</strong></td>
      <td width="80%"><%=Musictype%>[<font color=#ff0000>1为默认播放,2为视频播放,3为MTV播放,4为FLASH播放</font>]</td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" align="right"><strong>站长推荐:</strong></td>
      <td width="80%"><%=ZzGood%>[<font color=#ff0000>1为是,0为否</font>]</td>
    </tr>
      <tr class="tdbg"> 
      <td width="20%" align="right"><strong>RM下载积分:</strong></td>
      <td width="80%"><%=Rm_Points%>[<font color=#ff0000>分</font>]</td>
    </tr>
      <tr class="tdbg"> 
      <td width="20%" align="right"><strong>Mp3下载积分:</strong></td>
      <td width="80%"><%=Music_points%>[<font color=#ff0000>分</font>]</td>
    </tr>
   <tr class="tdbg"> 
      <td width="20%" align="right"><strong>舞曲名:</strong></td>
      <td width="80%"><%=MusicName%></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" align="right"><strong>Rm地址:</strong></td>
      <td width="80%"><%=ListenServerUrl%><%=ListenUrl%></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" align="right"><strong>Mp3地址:</strong></td>
      <td width="80%"><%=Mp3DownServerUrl%><%=DownUrl%></td>
    </tr>
      <tr class="tdbg"> 
      <td width="20%" align="right"><strong>添加歌词:</strong></td>
      <td width="80%"><%=songwords%></td>
    </tr>
   <tr class="tdbg"> 
      <td height="22" colspan="2" align="center" class="title"><input type="button" name="button1" value="返回" onClick="javascript:history.go(-2)">&nbsp;<input type="button" name="button2" value="继续<%if act="add" then%>添加<%else%>修改<%end if%>" onClick="javascript:history.go(-1)">
        </td>
    </tr>
  </table>
</body> 
</html> 
<%end sub%>