<%@language=vbscript codepage=936 %>
<%path="../basedata"%>
<!--#include file="../inc/function.asp"-->
<%call Loginpower%>
<%call legalpower%>
<!--#include file="../conn/conn_data.asp"-->
<!--#include file="../inc/config.asp"-->
<%
 '--------------------------------RLCodeTOHTML
 function RLCodeTOHTML(reString)
 	Dim Str:Str=reString
	If Not IsNull(Str) Then
		Str = Replace(Str, "。", "")
		Str = Replace(Str, "，", " ")
		Str = Replace(Str, ",", " ")
		'Str = Replace(Str, ".", "")
		Str = Replace(Str, "~", " ")
		Str = Replace(Str, "!", "")
		Str = Replace(Str, "！", "")
		Str = Replace(Str, "？", "")
		Str = Replace(Str, "?", "")
		Str = Replace(Str, CHR(60), "")
		Str = Replace(Str, CHR(62), "")
		Str = Replace(Str, CHR(34), "")
		Str = Replace(Str, CHR(39), "")
		RLCodeTOHTML = Str
	End If
 end function
 function SpecialCodeTOHTML(reString)
 	Dim Str:Str=reString
	If Not IsNull(Str) Then
		Str = Replace(Str, CHR(32), "")
		Str = Replace(Str, CHR(9), "")
		Str = Replace(Str, CHR(34), "")
		Str = Replace(Str, CHR(39), "")
		Str = Replace(Str, CHR(13), "")
		Str = Replace(Str, "<", "")
		Str = Replace(Str, ">", "")
		SpecialCodeTOHTML = Str
	End If
 end function


dim id
id=Request.QueryString("id")
if not idboolean(id) then response.write errorback("有错，请返回刷新页面后再操作！！"):response.end

dim song_label,Class_id,ClassName,song_user,song_type,song_url_type1,song_url_type2,song_src,song_bak,song_lrc

song_label=SpecialCodeTOHTML(request.form("song_label"))
Class_id=clng(int(request.form("Class_id")))
ClassName=SpecialCodeTOHTML(request.form("ClassName"))
song_user=SpecialCodeTOHTML(request.form("song_user"))
song_type=SpecialCodeTOHTML(request.form("song_type"))
song_url_type1=SpecialCodeTOHTML(request.form("song_url_type1"))
song_url_type2=SpecialCodeTOHTML(request.form("song_url_type2"))
song_src=SpecialCodeTOHTML(request.form("song_src"))
song_bak=SpecialCodeTOHTML(request.form("song_bak"))
song_lrc=RLCodeTOHTML(request.form("song_lrc"))


if Validate("[/\\""`~!@#$%^&*()=+|:;',.<>?{}]",song_label) then response.write errorback("歌曲名称请不要有以下字符! \n/\""`~!@#$%^&*()=+|:;\',.<>?{}"):response.end

	dim sqlchk
	sqlchk="Select * from songs where songs_id not in("&int(id)&") and songs_label='"&song_label&"'"
	set rschk=conn_data.execute(sqlchk)
	if not rschk.eof and not rschk.bof then
		conn_data.close
		set conn_data=nothing
		response.write errorback("本条歌曲以存在")
		response.end
	else
		dim rs,sql
		set rs=server.createobject("adodb.recordset")
		sql="Select * from songs where songs_id="&int(id)
		rs.open sql,conn_data,2,3


		'-------------------- delete lrc txt ---------------------
		if rs("songs_lrc") <> " " then call DeletefileS("/lrc/"&rs("songs_label")&".txt")

		rs("songs_label")=song_label
		rs("songs_Class_id")=Class_id
		rs("songs_Class_Name")=ClassName
		rs("songs_user")=song_user
		rs("songs_type")=song_type
		rs("songs_url_type1")=song_url_type1
		rs("songs_url_type2")=song_url_type2
		rs("songs_src")=song_src
		rs("songs_bak")=song_bak
		rs("songs_lrc")=song_lrc
		rs("songs_time1")=date()
		rs("songs_pass")=0
		rs.update


		rs.close
		set rs=nothing
		conn_data.close
		set conn_data=nothing
		response.write msgok("歌曲修改成功……","Songs_Manager.asp?nopass=0")
	end if
%>


