<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Board_Popfun.asp -->
<!-- #include file=../../inc/UbbCode.asp -->

<!--#include file="conn.asp"-->
<%
'---------------------
' write by 绿水青山 for 动网6.0
' 本插件经由 gafc 修改适应leadbbs3.14
'---------------------
DEF_BBS_HomeUrl = "../../"
opendatabase

dim rs,sql
dim id,candeletedg,Founderr
candeletedg=false
Founderr=false
dim Errmsg
Errmsg=""

'头部信息
If GBL_TableHeadString <> "" Then 
   response.write "<table width="&DEF_BBS_ScreenWidth&" border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"& GBL_TableHeadString &"</td></tr></table>"
End If
	
if GBL_CHK_User="" then
   Errmsg=Errmsg&"<li>客人不可以删除点歌列表。</li>"
   Errmsg=Errmsg&"<li>请先<a href="&DEF_BBS_HomeUrl&"user/userjoin.asp>注册</a>或<a href="&DEF_BBS_HomeUrl&"user/login.asp>登录</a>。</li>"
   Founderr=true
end if	
if request("id")="" or (not isnumeric(request("id"))) then
	errmsg=errmsg&"<li>参数非法，请确认您是从有效连接进入</li>"
	Founderr=true
else
	id=clng(request("id"))
end if
'==========判断是否可以删除点歌 开始
if not Founderr then
	set rs=connDG.execute("select sender,incept from [media] where id="&id)
	if rs.bof and rs.eof then
		errmsg=errmsg&"<li>参数非法，请确认您是从有效连接进入</li>"
		Founderr=true
	elseif rs(0)=GBL_CHK_User or rs(1)=GBL_CHK_User or CheckSupervisorUserName = 1 then
		candeletedg=true
	else
		errmsg=errmsg&"<li>您没有删除此点歌的权限</li>"
		Founderr=true
	end if	
end if		
'==========判断是否可以删除点歌 结束	
if Founderr=true or (not candeletedg) then
   dim stats
   stats="<a href=listme.asp>点歌控制面板</a>"
   BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID," >> "&stats

   call Errormsg()
   call CloseDB()
  '尾部信息
   If GBL_TableBottomString <> "" Then %>
      <table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center>
      <tr><td><%=GBL_TableBottomString%></td></tr>
      </table>
<% 
   End If 
   SiteBottom 
   If GBL_SiteBottomString <> "" Then Response.Write GBL_SiteBottomString
else	
	sql="delete * from [media] where id="&id
	connDG.Execute(sql)
	
	call CloseDB()
	response.redirect Request.ServerVariables("HTTP_REFERER")
end if
%>