📄 songword.asp
字号:
<%PageName="list"%>
<!--#include file="function.asp"-->
<%CheckAdmin1%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="system.asp"-->
<!--#include file="top.asp"-->
<%
dim rs,sql,MaxPerPage,PageUrl,currentPage,action
if not isempty(request.QueryString("page")) and request.QueryString("page")<>"" then
currentPage=cint(request.QueryString("page"))
else
currentPage=1
end if
action=request.QueryString("action")
AddUser=trim(request.QueryString("AddUser"))
Select Case action
Case "isshow"
conn.execute("update [MusicWord] set isshow=true where Id="&request.QueryString("ID"))
Response.Write "审核完成"
If AddUser<>"" Then
conn.execute("update [user] set boxnum=boxnum+"&Default_AddBoxNum&" where UserName='"&AddUser&"'")
Response.Write ",并为用户"&AddUser&"增加了"&Default_AddBoxNum&"个音乐盒位置"
End If
showlist
Case "del"
conn.execute("delete from [MusicWord] where Id="&request.QueryString("ID"))
Response.Write "删除完成"
showlist
Case "saveedit"
MusicWord=trim(request.form("MusicWord"))
addbox=trim(request.form("addbox"))
If addbox="" or not IsNumeric(addbox) Then
addbox=0
End IF
If MusicWord<>"" Then
conn.execute("update [MusicWord] set isshow=true ,MusicWord='"&MusicWord&"' where Id="&request.QueryString("ID"))
Response.Write "修改/审核完成"
If AddUser<>"" Then
conn.execute("update [user] set boxnum=boxnum+"&addbox&" where UserName='"&AddUser&"'")
Response.Write ",并为用户"&AddUser&"增加了"&addbox&"个音乐盒位置"
End If
showlist
Else
Response.Write ("<script>alert(' 修改审核失败!\n\n 必须输入歌词内容。');history.back();</script>")
End If
Case "edit"
EditSongWord
Case else
showlist
End Select
%>
<head>
<style>
body,td{font-size:12px}
</style>
</head>
<body>
<center>
<%sub showlist%>
<table border="0" width="96%" cellspacing="1" cellpadding="1">
<tr>
<td align=center width="100%" valign=top>
<%
set rs=server.createobject("adodb.recordset")
sql="select id,MusicId,MusicWord,AddUser,AddTime from [MusicWord] where isshow=false order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>暂时没有未审核歌词</p>"
else
MaxPerPage=20
'MaxPerPage=MaxSpecialList
PageUrl="songword.asp"
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
currentPage=1
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
end if
end if
end if
rs.close
%>
</td>
</tr>
</table>
<br><br>
<%
end sub
sub showContent
i=0
%>
<table border="1" width="100%" cellspacing="0" cellpadding="5" class="TableLine" bordercolor="#A4CEE4" bordercolordark="#FFFFFF">
<tr>
<td width="21%" height=22 align=center bgcolor="#96C5DE"><font color="#FFFFFF">歌曲名称</font></td>
<td width="15%" height=22 align=center bgcolor="#96C5DE"><font color="#FFFFFF">所属歌手</font></td>
<td width="11%" height=22 align=center bgcolor="#96C5DE"><font color="#FFFFFF">添加时间</font></td>
<td width="5%" height=22 align=center bgcolor="#96C5DE"><font color="#FFFFFF">审核</font></td>
<td width="5%" height=22 align=center bgcolor="#96C5DE"><font color="#FFFFFF">修改</font></td>
<td width="5%" height=22 align=center bgcolor="#96C5DE"><font color="#FFFFFF">删除</font></td>
</tr>
<%
do while not rs.eof
Set Music_rs=conn.execute("select MusicName,Singer from [MusicList] where ID="&rs(1))
i=i+1
%>
<tr>
<td width="21%" title="歌词内容:
<%=rs(2)%>"> <%=Music_rs(0)%></td>
<td width="15%" align=center><%=Music_rs(1)%></td>
<td width="11%" align=center><%=month(rs("AddTime"))&"月"&day(rs("AddTime"))&"日"&hour(rs("AddTime"))&"时"%></td>
<td width="5%" align=center><a href="?action=isshow&id=<%=rs(0)%>&AddUser=<%=rs(3)%>">审核</a></td>
<td width="5%" align=center><a href="?action=edit&id=<%=rs(0)%>">修改</a></td>
<td width="5%" align=center><a href="?action=del&id=<%=rs(0)%>">删除</a></td>
</tr>
<%
Music_rs.close
Set Music_rs=nothing
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
%>
<form method=get action="<%=filename%>?">
<center>共有<b><%=totalnumber%></b>首未审核歌词
<%if CurrentPage<2 then%>
首页 上一页
<%else%>
 <a href="<%=filename%>?page=1">首页</a>
<a href="<%=filename%>?page=<%=CurrentPage-1%>">上一页</a>
<%
end if
if n-currentpage<1 then
%>
下一页 末页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage+1%>">下一页</a>
<a href="<%=filename%>?page=<%=n%>">末页</a>
<%end if%>
页次:<strong><%=CurrentPage%>/<%=n%></strong>页
转到:<select name="page" size="1" onchange="javascript:submit()">
<%for i = 1 to n%>
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select>
</form>
<%end function
Sub EditSongWord
Dim Word_rs,Music_rs
Set Word_rs=conn.execute("select MusicId,MusicWord,AddUser,addtime from [MusicWord] where ID="&request.QueryString("ID"))
Set Music_rs=conn.execute("select MusicName,Singer from [MusicList] where ID="&Word_rs(0))
%>
<br><br><br><br>
<center>
<form method=post action="?action=saveedit&id=<%=request.QueryString("ID")%>&AddUser=<%=Word_rs(2)%>">
<table border="1" width="70%" cellspacing="0" cellpadding="5" class="TableLine" bordercolor="#A4CEE4" bordercolordark="#FFFFFF" height="35">
<tr>
<td width="100%" colspan="4" align=center bgcolor="#96C5DE" height="9"><font color="#FFFFFF">审核/修改歌词</font></td>
</tr>
<tr>
<td width="19%" height="12">歌曲名称:</td>
<td width="33%" height="12"> 《<%=Music_rs(0)%>》</td>
<td width="19%" height="12">歌手名称:</td>
<td width="31%" height="12"> <%=Music_rs(1)%></td>
</tr>
<tr>
<td width="19%" height="12">添加会员:</td>
<td width="33%" height="12"> <%=Word_rs(2)%></td>
<td width="19%" height="12">添加时间:</td>
<td width="31%" height="12"> <%=Word_rs(3)%></td>
</tr>
<tr>
<td width="19%" height="12">歌词内容:</td>
<td width="83%" height="12" colspan="3"> <textarea rows="5" name="MusicWord" cols="41"><%=Word_rs(1)%></textarea></td>
</tr>
<tr>
<td width="19%" height="12">奖励设置:</td>
<td width="83%" height="12" colspan="3"> <input type="text" name="addbox" size="3" value="<%=Default_AddBoxNum%>">个音乐盒位置
(<font color="#FD590B">输入负数减音乐盒位置</font>)</td>
</tr>
<tr>
<td width="100%" height="1" colspan="4">
<p align="center">
<input type="submit" name="Submit" value="确定"> <input type="reset" value="重写" name="B1"> <input type="button" value="返回" name="B2" onclick="javascript:history.back();"></p>
</td>
</tr>
</table>
</form>
</center>
<%end sub%>
</center>
</body>
<%
set rs=nothing
conn.close
set conn=nothing%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -