<%@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"-->
<!--#include file="../saveHTML/function.asp"-->
<%
Response.Buffer = True
dim pass,id
pass=request.querystring("pass")
id=int(request.querystring("id"))
if not idboolean(id) then
response.write errorback("珜醱堤渣＃＃")
response.end
else


		if pass <> "" then
			if pass = 0 then
				conn_data.begintrans
				conn_data.execute("update songs set songs_Pass=0 where songs_id="&id)
				if conn_data.errors.count > 0 then
				conn_data.rollbacktrans
				err.clear
				conn_data.close
				set conn_data=nothing
				response.write errorback("衄渣!")
				else
				conn_data.committrans


					dim song_label
					song_label=conn_data.execute("select songs_label,songs_lrc from songs where songs_id="&id)
					'-------------------- delete lrc txt ---------------------
					if song_label(1)<>" " then call DeletefileS("/lrc/"&song_label(0)&".txt")

					conn_data.close
				set conn_data=nothing
				response.redirect "songs_Manager.asp?nopass=1"
				end if
			else
				conn_data.begintrans
				conn_data.execute("update songs set songs_Pass=1 where songs_id="&id)
				if conn_data.errors.count > 0 then
				conn_data.rollbacktrans
				err.clear
				conn_data.close
				set conn_data=nothing
				response.write errorback("衄渣!")
				else
				conn_data.committrans


					dim song
					song=conn_data.execute("select songs_lrc,songs_label from songs where songs_id="&id)
					if song(0)<>" " then call save_html("/lrc/"&song(1)&".txt",song(0),"gb2312")
					'--------------------/ save lrc txt ---------------------
				conn_data.close
				set conn_data=nothing
				response.redirect "songs_Manager.asp?nopass=0"
				end if
			end if
		end if
end if
%>
