📄 song.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"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=Sitename%>-点歌台</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>
<%sitehead%>
<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 height="25"> <img src="skins/1/xb3.gif"> 当前位置:<a href="index.asp">首页</a> >> <a href="song.asp">点歌台</a> </td>
</tr>
</table>
<br>
<%Select Case request("type2")
Case "edit":
Call edit
Case "edit2":
Call edit2
Case "del":
Call del
Case Else:
call show
End Select
sub show
rs.open "delete from [song] where datediff('d',date,now())>passdate",conn,1,3
rs.open "select * from [song] 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="35" colspan="5">寄语:<%=rs("meg")%></td>
</tr>
<tr bgcolor="#F7F7F7">
<td height="20" colspan="5"><div align="right"><%if session("sitejob")<>"" then
if session("sitejob")=3 or rs("userid")=session("xyluserid") then%>操作:<a href="?type2=edit&id=<%=rs(0)%>">编辑</a> <a href="?type2=del&id=<%=rs(0)%>" onclick="return confirm('确定要删除吗?')">删除</a><%end if
end if%></div></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
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&"",conn,1,1
if rs.eof then ShowError("点歌不存在")
if rs("userid")=session("xyluserid") or session("sitejob")=3 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&"",conn,1,3
if rs.eof then ShowError("点歌不存在")
if rs("userid")=session("xyluserid") or session("sitejob")=3 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='song.asp'>[点歌台]</a><br><br> 到<A href='song.asp#"&id&"'>[刚修改的歌曲]</a>","song.asp#"&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&"",conn,1,3
if rs.eof then ShowError("点歌不存在")
if rs("userid")=session("xyluserid") or session("sitejob")=3 then
rs.close
rs.open "delete from song where id="&id&"",conn,1,3
set rs=nothing
a=obj.gourl(" 页面三秒后将自动返回您删除的歌曲,可以继续选择以下操作:<br><br> 返回<A href='song.asp'>[点歌台]</a><br><br> 到<A href='index.asp'>[到网站首页]</a>","song.asp")
else
ShowError("你无权限编辑,请先登录!")
end if
end sub%>
</td></tr>
</table>
<%sitebottom%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -