📄 ordersong.asp
字号:
<!--#include file=../INC/txlconst.asp-->
<!--#include file=../INC/txlfun.asp-->
<!--#include file=nav.asp-->
<%
dim const_txl_HomeUrl,errstr,i,page
dim con_maxorderreceive '接收的最多人数
dim con_keepday '保存的最大天数
dim con_maxcontentlength '祝福的最多字符
con_maxorderreceive=const_ordersong_renum
con_keepday=const_ordersong_saveday
con_maxcontentlength=const_ordersong_contentnum
errstr=""
const_txl_HomeUrl="../"
OpenDatabase
txl_SiteHead const_txlname&"-点歌台"
call online
call main
CloseDatabase
SiteBottom
sub main
If session("username")="" Then
errstr=errstr&"<li>你现在还没有登录或者会话超时,点<a href='../user/login.asp'>这里登录</a>!</li>"
errstr=errstr&"<li>如果还有疑问请与管理员联系!</li>"
Call printerror("点歌出错!",errstr,779)
Exit Sub
End If
If Request.QueryString("action")="saveorder" then
Call saveorder
Else
Call showordersongform
End IF
End Sub
%>
<%sub showordersongform
%>
<script>
var submitflag=false
var nowordertonum=0
var maxordernum=<%=con_maxorderreceive%>
var noworderuser=new Array(maxordernum-1)
for(i=0;i<maxordernum-1;i++)
noworderuser[i]=""
function addorderto(ord){
for (i=0;i<maxordernum-1;i++){
if (ord==noworderuser[i]){
alert("已经添加了该名单")
return false
}
}
noworderuser[nowordertonum]=ord
if (nowordertonum>maxordernum-1) {
alert("最多添加"+maxordernum+"个接收者")
return
}
nowordertonum++;
if (document.form1.orderto.value=="")
{
document.form1.orderto.value=ord
}
else
{
document.form1.orderto.value=document.form1.orderto.value+","+ord
}
}
function changeselect(sel){
document.form1.orderto.value=""
if (sel=="1"){
document.form1.select2.style.display=''
document.form1.select.style.display='none'}
else{
document.form1.select.style.display=''
document.form1.select2.style.display='none'
}
for(i=0;i<maxordernum-1;i++)
noworderuser[i]=""
}
function check_walkman_form(walkman_frm)
{
//walkman编写
if (walkman_frm.orderto.value==""){
alert("送给谁呢?");
walkman_frm.orderto.focus();
return false
}
if (walkman_frm.musicname.value==""){
alert("此项目不能为空!");
walkman_frm.musicname.focus();
return false
}
if (walkman_frm.musicurl.value==""){
alert("此项目不能为空!");
walkman_frm.musicurl.focus();
return false
}
if (walkman_frm.content.value==""){
alert("此项目不能为空!");
walkman_frm.content.focus();
return false
}
if (walkman_frm.content.value.length><%=con_maxcontentlength%>){
alert("内容不能超过<%=con_maxcontentlength%>,当前字符"+walkman_frm.content.value.length+"!");
walkman_frm.content.focus();
return false
}
if(!submitflag){
walkman_frm.submit();
walkman_frm.Submit.disabled=true
submitflag=true
return true
}
else
{
alert("请不要重复提交");
return false;
}
}
</script>
<table width="779" border="0" align="center" cellpadding="0" cellspacing="8">
<tr>
<td><b>网站导航:<a href="<%=const_homepageurl%>">首页</a>
>> <a href="<%=const_txl_HomeUrl&const_txlurl%>"><%=const_txlname%></a>
>> <a href="?">我来点歌</a></b></td>
<td align="right">娱乐导航:
<%Call shownav()%>
</td>
</tr>
</table>
<form name="form1" method="post" action="?action=saveorder" onsubmit="return check_walkman_form(this);" onkeydown="if(event.keyCode==13 && event.ctrlKey){if(check_walkman_form(this)){return true}}">
<table width=772 border="1" align=center cellpadding=1 bgcolor="#FFFFFF" cellspacing=0 bordercolor="#666666" style="border-collapse:collapse;">
<tr>
<td colspan="2" class="title">请完整输入下列信息</td>
</tr>
<tr>
<td width="190" class="tar"><b>送给谁呢:</b></td>
<td width="572" class="content"><input name="orderto" type="text" id="orderto" size="48" maxlength="100" readonly="true">
<table width="100%" border="0" cellspacing="8" cellpadding="0">
<tr>
<td><input name="radiobutton" type="radio" value="0" checked onClick="changeselect(this.value)">
普通用户 <br>
<input type="radio" name="radiobutton" value="1" onClick="changeselect(this.value)">
特殊用户群 <br>
</td>
<td>
<select name="select" size="5" onClick="addorderto(this.value)">
<%Call showalluser%>
</select>
<select name="select2" style="display:'none'" onchange="document.form1.orderto.value=this.options[this.selectedIndex].value">
<option value="所有成员">所有成员</option>
<option value="所有班级成员">所有班级成员</option>
<option value="所有成员">所有准班级成员</option>
<option value="所有班级好友">所有班级好友</option>
<option value="所有班级好友">所有班级嘉宾</option>
<option value="所有男生">所有男生</option>
<option value="所有女生">所有女生</option>
</select>
</td>
<td>注:双击所列名单添加接收者<br>
最多可以有<font color="#FF0000"><%=con_maxorderreceive%></font>个接收者</td>
</tr>
</table></td>
</tr>
<tr>
<td class="tar"><b>歌曲名字:</b></td>
<td class="content"><input name="musicname" type=text id="musicname" size=35 maxlength=50>
</td>
</tr>
<tr>
<td class="tar"><b>音乐地址:</b></td>
<td class="content"><input name="musicurl" type="text" id="musicurl" value="http://" size="50" maxlength="255">
<br>
[<a href="music.asp" target="_blank"><font color=red>点击此处搜音乐</font></a>,支持格式:<font color="#FF0000"><%=const_ordersong_songfmt%></font>] </td>
</tr>
<tr>
<td class="tar"><strong>保留日期:</strong></td>
<td class="content"><select name="passdate" id="passdate">
<%
for i=1 to con_keepday
if i=1 then
Response.write "<option value='"&i&"' selected>"&i&"天</option>"
else
Response.write "<option value='"&i&"'>"&i&"天</option>"
end if
next
%>
</select></td>
<tr>
<td class="tar"><b>祝福内容:</b>
</td>
<td class="content"><textarea name="content" cols="60" rows="5" id="content"></textarea>
请不要超过<font color=red><%=con_maxcontentlength%></font>字! </td>
<tr>
<td height="70" colspan=2 align=center valign=middle><INPUT TYPE="submit" NAME="Submit" VALUE="送出点歌祝福">
<INPUT TYPE="reset" NAME="Submit2" VALUE="重新填写内容">
<BR>
<BR>
【<a href=showordersong.asp?action=myorder >我发布的祝福单</a>】 | 【<a href="showordersong.asp">查看所有点歌</a>】</td>
</tr>
</table>
</form>
<%End Sub%>
<%
function showalluser
dim rs
set rs=conn.execute ("select sname from ec ")
while not rs.eof
Response.Write "<option value='"&rs(0)&"'>"&rs(0)&"</option>"
rs.movenext
wend
rs.close
set rs=nothing
end function
sub saveorder
dim str_succ
if outsitesubmit then
printerror "发布信息出错","<li>请不要外部提交数据!</li>",779
Exit sub
End if
dim rs,sql,id
sql="select top 1 * from ordersong order by id desc"
set rs=Server.CreateObject("Adodb.Recordset")
rs.open sql,conn,1,3
If rs.eof then
Id=1
Else
Id=rs("id")+1
End If
dim musicname,musicurl,content
musicname=Trim(Request.Form("musicname"))
musicurl=Trim(Request.Form("musicurl"))
content=Trim(Request.Form("content"))
If musicname="" or musicurl="" or musicurl="http://" or content="" Then
printerror "发布点歌祝福信息出错","<li>该填写的信息还是要填写!</li>",779
Exit sub
End If
If not CheckSongFrm(lcase(right(musicurl,len(musicurl)-Instrrev(musicurl,".")))) Then
printerror "发布点歌祝福信息出错","<li>当前同学录设置不接受该类型格式的音乐文件!</li>",779
Exit sub
End If
content=Replace(content,"<","<")
content=Replace(content,">",">")
content=Replace(content,vbcrlf,"<br>")
Rs.addnew()
rs("id")=id
rs("username")=Session("username")
rs("orderto")=Trim(Request.Form("orderto"))
rs("username")=Session("username")
rs("musicname")=musicname
rs("musicurl")=musicurl
rs("content")=content
rs("adddate")=now()
rs("passdate")=date()+Request.Form("passdate")
Rs.Update
Set rs=nothing
str_succ="<li>恭喜你,发布点歌成功!"&Vbcrlf
str_succ=str_succ&"<li><a href='showordersong.asp' title='浏览你刚才发布的点歌信息'>点这里浏览你刚才发布的点歌信息</a>,系统5秒转到新点歌信息!</li>"&Vbcrlf
Call printsuc("发布点歌信息成功",str_succ,779)
Response.write "<meta http-equiv=""refresh"" content='5;URL=showordersong.asp'>"
end sub
Function CheckSongFrm(songformat)
Dim format,i
CheckSongFrm=False
If Instr(lcase(const_ordersong_songfmt),"|")>0 Then
format=Split(const_ordersong_songfmt,"|")
Else
format=lcase(const_ordersong_songfmt)
End If
If Isarray(format) Then
for i=0 to ubound(format)
if songformat=format(i) Then
CheckSongFrm=True
Exit For
End If
next
Else
If format=songformat Then
CheckSongFrm=True
Exit Function
End If
End If
end Function
%>
aaa
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -