📄 newvote.asp
字号:
<!--#include file="MarcosCB.asp"-->
<%
getConn()
isIn()
isManager()
dim str,theAct,mood,title,content,isMulti,contentArray,contentStr
theAct=getPost("theAct")
mood=getPost("mood")
title=trim(getPost("title"))
content=trim(getPost("content"))
isMulti=getPost("isMulti")
if theAct="add" then
if title="" or content="" then
echo "<script>alert('请完整填写标题和内容!');history.back();</script>"
closeConn()
response.end
end if
contentStr=""
contentArray=split(content,vbNewLine)
for i=0 to uBound(contentArray)
if trim(contentArray(i))<>"" then
contentStr=contentStr&"$$$"&contentArray(i)
voteResult=voteResult&"$$$0"
end if
next
if contentStr="" then
echo "<script>alert('无法探测到有效的投票选项!');history.back();</script>"
closeConn()
response.end
else
contentStr=mid(contentStr,4)
voteResult=mid(voteResult,4)
end if
if instr(contentStr,"$$$")<=0 then
echo "<script>alert('无法新建该投票\n有效的投票选项少于两个!');history.back();</script>"
closeConn()
response.end
end if
rs.open "Marcos_Vote",conn,1,3
rs.addNew
rs("userName")=getValue("userName")
rs("addTime")=now()
rs("lastVoteTime")=now()
rs("voteMood")=mood
rs("voteTitle")=title
rs("voteContent")=contentStr
rs("voteResult")=voteResult
if lcase(isMulti)="true" then
rs("isMulti")=true
end if
rs.update
rs.close
delPageIndex()
locate "voteList.asp"
end if
str=getMainCode(mySkinId)
pageTitle="<a href=""voteList.asp"">投票列表</a> » <a href=""javascript:location.reload();"">新建投票</a>"
pageOther="<script>document.title+=' - 新建投票';</script>"
nowWhere "新建投票","newVote.asp"
showHead str,pageTitle,pageOther
showBody()
showFoot(str)
sub showBody()
pageCode=getPageCode(mySkinId,"PageFormX")
PageSMS=split(pageCode,"$$$")
body="<tr><td align=right height=22>类型:</td><td> <input type=radio name=isMulti value=""false"" checked> "&_
"单项选投<input type=radio name=isMulti value=""true""> 多项选投</td></tr>"
body=PageSMS(0)&body&PageSMS(2)
body=replace(body,"{$formTitle}","新建投票")
body=replace(body,"{$title}","")
body=replace(body,"{$moodSelected}","")
body=replace(body,"{$content}","")
body=replace(body,"{$theAct}","add")
body=replace(body,"帖子内容:","投票正文:<br>(每一项用回车分隔)")
echo body
end sub
closeConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -