📄 bjsong.asp
字号:
<!--#include file="config.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!--#include file="head.asp"-->
<%bid=clng(request("bid"))
if bid="" or bid<1 then ShowError("访问的班级不存在")
rs.open "select * from bj where id="&bid&"",conn,1,1
If Rs.eof Then ShowError("访问的班级不存在")
if rs("isopen")=1 and session("xyluserid")="" then ShowError("你访问的班级禁止游客访问")
if rs("isopen")=2 then
if session("xyluserid")="" then ShowError("你访问的班级禁止非班级成员访问")
if obj.inbj(session("xyluserid"),bid,SiteDatabase)<>1 then ShowError("你访问的班级禁止非班级成员访问")
end if
adminid=rs("adminid")
adminid2=rs("adminid2")
bjname=rs("bjname")
rs.close%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=Sitename%>-<%=bjname%>-点歌台</title>
<LINK href="css.css" type=text/css rel=stylesheet>
<script language="javascript">
function wzxylsong(url,width,height,openname)
{
var Win = window.open(url,openname,'width=' + width + ',height=' + height +',left=10,top=10,resizable=1,scrollbars=yes,menubar=no,status=no' );
Win.focus();
}
</script>
</head>
<body>
<%call bjhead(bid,bjname)%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr>
<td height="291" valign="top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr>
<td width="83%" height="25"> <img src="skins/1/xb3.gif"> 当前位置:<a href="bjindex.asp?bid=<%=bid%>">班级首页</a> >> <a href="bjsong.asp?bid=<%=bid%>">班级点歌台</a></td>
<td width="17%"> <%if session("xyluser")<>"" then%><a href="#add">我要点歌</a><%end if%></td>
</tr>
</table>
<br>
<%Select Case request("type2")
Case "edit":
Call edit
Case "edit2":
Call edit2
Case "del":
Call del
Case "add":
Call add
Case Else:
call show
End Select
sub show
rs.open "select * from [song] where bjid="&bid&" order by id desc",conn,1,1
If Rs.eof and Rs.bof Then
Response.Write("暂无点歌")
else
dim strFileName,i,j,totalPut,CurrentPage,TotalPages
totalPut=rs.recordcount
const MaxPerPage=20
strFileName="?"
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
if currentPage<>1 and (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
else
currentPage=1
end if
i=0
do while not rs.eof%>
<table width="90%" border="0" align="center" cellpadding="1" cellspacing="2" class="border">
<tr bgcolor="#F7F7F7">
<td width="9%" height="20">ID:<%=rs(0)%><a name="<%=rs(0)%>"></a></td>
<td width="19%">发送:<A href="datum.asp?userid=<%=rs("userid")%>"><%=obj.getname(rs("userid"),1,SiteDatabase)%></a></td>
<td width="19%">接受:<%=rs("accept")%></td>
<td width="34%">歌曲:<a href="#" onclick="window.open('songplay.asp?id=<%=rs(0)%>','110','scrollbars=no,resizable=no,width=400,height=220,menubar=no,top=98,left=198')" title="听歌吧"><font color="#FF0000"><%=rs("songname")%></font></a></td>
<td width="19%">时间:<%=rs("date")%></td>
</tr>
<tr valign="top">
<td height="50" colspan="5">寄语:<%=rs("meg")%></td>
</tr>
<tr bgcolor="#F7F7F7">
<td height="20" colspan="5"><%if session("sitejob")=3 or rs("userid")=session("xyluserid") or adminid=session("xyluserid") or adminid2=session("xyluserid") then%><div align="right">操作:<a href="?type2=edit&id=<%=rs(0)%>&bid=<%=bid%>">编辑</a> <a href="?type2=del&id=<%=rs(0)%>&bid=<%=bid%>" onclick="return confirm('确定要删除吗?')">删除</a></div><%end if%></td>
</tr>
</table>
<br>
<%i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
end if%>
<table width="90%" align="center" cellpadding="1" cellspacing="1" bordercolor="#CCCCCC" class="border">
<tr>
<td height="25" bgcolor="#f9f8f2"><div align="center"><%=obj.showpage(strFileName,totalput,MaxPerPage,true,true,"条",currentPage)%></div></td>
</tr>
</table>
<%rs.close
set rs=nothing
if session("xyluser")<>"" then%>
<br>
<table width="90%" border="0" align="center" cellpadding="1" cellspacing="2" class="border">
<form name="form1" method="post" action="?type2=add&bid=<%=bid%>">
<tr bgcolor="#F7F7F7">
<td width="11%" height="20"><a name="add"></a></td>
<td width="89%">新赠点歌</td>
</tr>
<tr valign="top">
<td height="20">赠送给:</td>
<td><input name="accept" type="text" class="formtext" id="accept" maxlength="10">
填写对方姓名</td>
</tr>
<tr valign="top">
<td height="20">歌曲名称:</td>
<td><input name="songname" type="text" class="formtext2" id="songname" maxlength="20">
请填写正确,否则无法收听</td>
</tr>
<tr>
<td height="20">保留天数:</td>
<td valign="top"><select name="passdate" id="passdate">
<% for i=1 to songsaveday
Response.write "<option value='"&i&"'>"&i&"天</option>"
next%>
</select></td>
</tr>
<tr valign="top">
<td height="20">歌曲寄语:</td>
<td><textarea name="meg" cols="50" rows="7" id="meg"></textarea></td>
</tr>
<tr valign="top">
<td height="20"> </td>
<td><input name="Submit" type="submit" class="bottom" value="提交"></td>
</tr></form>
</table><br>
<%end if
end sub
sub add
if session("xyluserid")="" then ShowError("请先登录!")
accept=obj.HtmlEncode(request.form("accept"))
songname=obj.HtmlEncode(request.form("songname"))
passdate=obj.HtmlEncode(request.form("passdate"))
meg=obj.HtmlEncode(request.form("meg"))
if accept="" or songname="" or passdate="" or meg="" then ShowError("缺少参数!")
rs.open "select sitemoney from user where id="&session("xyluserid")&"",conn,1,3
if rs(0)<3 then ShowError("你的积分不够,点歌需要3个积分!")
rs("sitemoney")=rs("sitemoney")-3
rs.update
rs.close
rs.open "select * from song where 1=2",conn,1,3
rs.addnew
rs("songname")=songname
rs("accept")=accept
rs("date")=date
rs("passdate")=passdate
rs("userid")=session("xyluserid")
rs("meg")=meg
rs("bjid")=bid
rs.update
rs.close
set rs=nothing
a=obj.gourl(" 页面三秒后将自动返回您提交的页面,可以继续选择以下操作:<br><br> 返回<A href='bjsong.asp?bid="&bid&"'>[点歌台]</a><br><br> 到<A href='bjsong.asp?bid="&bid&"'>[刚点的歌曲]</a>","bjsong.asp?bid="&bid&"")
end sub
sub edit
id=clng(obj.regstr(request("id")))
if id="" or id<1 then ShowError("缺少必要的参数")
rs.open "select * from song where id="&id&" and bjid="&bid&"",conn,1,1
if rs.eof then ShowError("点歌不存在")
if rs("userid")=session("xyluserid") or session("sitejob")=3 or adminid=session("xyluserid") or adminid2=session("xyluserid") then%>
<table width="90%" border="0" align="center" cellpadding="1" cellspacing="2" class="border">
<form name="form1" method="post" action="?type2=edit2&id=<%=rs("id")%>&bid=<%=bid%>">
<tr bgcolor="#F7F7F7">
<td width="11%" height="20"> </td>
<td width="89%">编辑点歌</td>
</tr>
<tr valign="top">
<td height="20">赠送给:</td>
<td><input name="accept" type="text" class="formtext" id="accept" value="<%=rs("accept")%>" maxlength="10">
填写对方姓名</td>
</tr>
<tr valign="top">
<td height="20">歌曲名称:</td>
<td><input name="songname" type="text" class="formtext2" id="songname" value="<%=rs("songname")%>" maxlength="20">
请填写正确,否则无法收听</td>
</tr>
<tr>
<td height="20">保留天数:</td>
<td valign="top"><select name="passdate" id="passdate">
<%for i=1 to songsaveday
if i=rs("passdate") then
Response.write "<option value='"&i&"' selected>"&i&"天</option>"
else
Response.write "<option value='"&i&"'>"&i&"天</option>"
end if
next%>
</select></td>
</tr>
<tr valign="top">
<td height="20">歌曲寄语:</td>
<td><textarea name="meg" cols="50" rows="7" id="meg"><%=obj.HtmlDecode(rs("meg"))%></textarea></td>
</tr>
<tr valign="top">
<td height="20"> </td>
<td><input name="Submit" type="submit" class="bottom" value="提交"></td>
</tr></form>
</table>
<%rs.close
end if
end sub
sub edit2
id=clng(obj.regstr(request("id")))
if id="" or id<1 then ShowError("缺少必要的参数")
accept=obj.HtmlEncode(request.form("accept"))
songname=obj.HtmlEncode(request.form("songname"))
passdate=obj.HtmlEncode(request.form("passdate"))
meg=obj.HtmlEncode(request.form("meg"))
if accept="" or songname="" or passdate="" or meg="" then ShowError("缺少参数!")
rs.open "select * from song where id="&id&" and bjid="&bid&"",conn,1,3
if rs.eof then ShowError("点歌不存在")
if rs("userid")=session("xyluserid") or session("sitejob")=3 or adminid=session("xyluserid") or adminid2=session("xyluserid") then
rs("songname")=songname
rs("accept")=accept
rs("passdate")=passdate
rs("meg")=meg
rs.update
rs.close
set rs=nothing
a=obj.gourl(" 页面三秒后将自动返回您修改的歌曲,可以继续选择以下操作:<br><br> 返回<A href='bjsong.asp?bid="&bid&"'>[点歌台]</a><br><br> 到<A href='bjsong.asp?bid="&bid&"#"&id&"'>[刚修改的歌曲]</a>","bjsong.asp?bid="&bid&"#"&id&"")
else
ShowError("你无权限编辑,请先登录!")
end if
end sub
sub del
id=clng(obj.regstr(request("id")))
if id="" or id<1 then ShowError("缺少必要的参数")
rs.open "select * from song where id="&id&" and bjid="&bid&"",conn,1,3
if rs.eof then ShowError("点歌不存在")
if rs("userid")=session("xyluserid") or session("sitejob")=3 or adminid=session("xyluserid") or adminid2=session("xyluserid") then
rs.close
rs.open "delete from song where id="&id&"",conn,1,3
set rs=nothing
a=obj.gourl(" 页面三秒后将自动返回您删除的歌曲,可以继续选择以下操作:<br><br> 返回<A href='bjsong.asp?bid="&bid&"'>[点歌台]</a><br><br> 到<A href='bjindex.asp?bid="&bid&"'>[到班级首页]</a>","bjsong.asp")
else
ShowError("你无权限编辑,请先登录!")
end if
end sub%>
</td></tr>
</table>
<%sitebottom%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -