📄 toupiao_start.asp
字号:
<!--#include file=conn.asp-->
<!--#include file="Function_QT.asp"-->
<!--#include file="Config.asp"-->
<!--#include file="md5.asp"-->
<%
if session("person")="" then
response.redirect "Login.asp"
end if
if not IsNumeric(request("id")) or request("id")="" then
Response.Write ("<script>alert('友情提示!\n\参数错误!');history.back();</script>")
Response.end
end if
if request("id")<>"" then
id=CLNG(request("id"))
end if
rs.open"select * from question where id="&id,conn,1,1
if rs.eof then
Response.Write ("<script>alert('友情提示!\n\参数错误!');history.back();</script>")
Response.end
else
rs2.open"select * from person where name='"&rs("sender")&"'",conn,1,1
touxian=rs2("touxian")
rs2.close
rs2.open"select * from assort where topic='"&rs("topic")&"'",conn,1,1
shuxing=rs2("shuxing")
rs2.close
rs2.open"select * from class where id="&shuxing&"",conn,1,1
topic0=rs2("topic")
id0=rs2("id")
rs2.close
if rs("jie")=4 then
Response.Write ("<script>alert('友情提示!\n\该问题已经进入投票流程!');history.back();</script>")
Response.end
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=rs("title")%>_发起投票</title>
<!--#include file=top.asp-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25"><a href="wen"><%=webname%></a> > <a href="List_Big.asp?id=<%=id0%>&topic=<%=topic0%>"><%=topic0%></a> > <a href=List_Little.asp?id=<%=rs("fenleiid")%>&topic=<%=rs("topic")%>><%=rs("topic")%></a></td>
</tr>
</table>
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" height="100">
<tr>
<td valign="top" width="200">
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="t1">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td height="36" align="center" onmouseover="this.className='tbb'" onmouseout="this.className='taa'" class="taa"><strong><%if session("person")<>"" then%>用户信息<%else%>用户登录<%end if%></strong></td>
</tr>
<tr>
<td align=center><br>
<table border="0" width="95%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="magBtm12">
<tr>
<td class="bgtle"></td>
</tr>
<tr>
<td class="bgcntBor3">
<%if request("login")="登录" then
jiance=request("name")
if InStr(jiance,"or")<>0 or InStr(jiance,"'")<>0 or InStr(jiance,"`")<>0 or InStr(jiance,"=")<>0 or InStr(jiance,"-")<>0 or InStr(jiance,",")<>0 or InStr(jiance,"and")<>0 then
Response.Write "<script language=JavaScript>{alert('用户名非法!');history.back();}</script>"
Response.End
end if
if not IsNumeric(request("verifycode")) then
Response.Write ("<script>alert('友情提示!\n\n验证编码必须是数字!');history.back();</script>")
Response.end
end if
if (int(session("SafeCode"))<>int(request("verifycode"))) then
Response.Write ("<script>alert('友情提示!\n\n验证编码输入错误!');history.back();</script>")
Response.end
end if
if request("name")="" then
response.write"<script>alert('用户名不能为空!');history.back();</script>"
elseif request("pwd")="" then
response.write"<script>alert('密码不能为空!');history.back();</script>"
else
name=request("name")
pwd=request("pwd")
rs2.open"select * from person where name='"&name&"' and pwd='"&md5(pwd)&"'",conn,1,1
if rs2.eof then
response.write"<script>alert('用户名或密码错误!');history.back();</script>"
else
rs3.open"select * from person where name='"&name&"'",conn,1,3
rs3("logintime")=now
rs3.update
rs3.close
session("person")=name
end if
rs2.close
end if
end if%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="zhtable"><%if session("person")<>"" then%>
<tr>
<td >您好:<%=session("person")%> </td>
</tr>
<tr>
<td><%rs2.open"select * from person where name='"&session("person")&"'",conn,1,1%>
<a href="Help.asp#n5" target=_blank><%=rs2("touxian")%></a> ( <%=rs2("jifen")%> )</td>
</tr>
</table>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr>
<td height=22>• <a href="user.asp?lei=mywen" target=_blank>我的提问</a></td>
<td>• <a href="user.asp" target=_blank>个人中心</a></TD>
</tr>
<tr>
<td>• <a href="user.asp?lei=myda" target=_blank>我的回答</a></td>
<td>• <a href="Exit.asp">退出</a><%rs2.close%></td>
</tr>
<%end if%><%if session("person")="" then%><tr><form method=post action=Show_Question.asp?id=<%=id%>><td align="center" valign="top">
<p>用 户:<input name="name" type="text" id="name" size="12" class="ip22"><br>密 码:<input name="pwd" type="password" id="pwd" size="12" class="ip22"><br>
验证码:<input type="text" size=3 maxlength=4 name=verifycode class="ip22"> <%Call GetSafeCode%><br><FONT color=#666666>(请输入图中数字)</FONT><br><input name="login" type="submit" id="login" value="登录" class="ip2">
<a href="Reg.asp">注册</a>
</td></form><%end if%></tr>
</table>
</table></td>
</tr>
</table>
<br></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="t1">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td height="36" align="center" onmouseover="this.className='tbb'" onmouseout="this.className='taa'" class="taa"><strong>同类热点问题</strong></td>
</tr>
<tr>
<td align=center><br>
<table border="0" width="95%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <td>
<%
rs2.open"select top 5 * from question where fenleiid="&rs("fenleiid")&" order by views desc",conn,1,1
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed;word-wrap:break-word;"><%while NOT rs2.EOF%>
<tr><td width=10 valign="top">• </td>
<td><a href="Show_Question.asp?id=<%=rs2("id")%>" target="_blank"><%=rs2("title")%></a></td></tr>
<%
rs2.movenext
wend
rs2.close
%>
<tr><td> </td><td height="22" >
<p align="right"><a href="List_Little.asp?id=<%=rs("fenleiid")%>&topic=<%=rs("topic")%>" class="lmore">更多>></a></td></tr></table>
</td></tr></table>
</td>
</tr>
</table>
<br></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="t1">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td height="36" align="center" onmouseover="this.className='tbb'" onmouseout="this.className='taa'" class="taa"><strong>公告区</strong></td>
</tr>
<tr>
<td align=center><br>
<table border="0" width="95%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <td class="bgcntBor4"><%rs2.open"select top 5 * from gonggao where flid=3 order by time desc",conn,1,1
if rs2.eof then%>暂时没有公告<%else
while not rs2.eof
%>☆<%=rs2("text")%><hr size="1" color="#999999">
<%rs2.movenext
wend
end if
rs2.close%>
</td>
</tr></table>
</td>
</tr>
</table>
<br></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</td>
<td width="8" valign="top"></td>
<td valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="t1">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td height="36" align="center" onmouseover="this.className='tbb'" onmouseout="this.className='taa'" class="taa"><strong>将问题转入投票流程</strong></td>
</tr>
<tr>
<td align=center><br>
<table border="0" width="98%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="bgcntLn"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="zhtable">
<tr>
<td class="t11" height="24"> 问题名字:<font color="#FF0000"><%=rs("title")%></font></td>
</tr>
<tr>
<td class="f12b" height="24"><b>投票流程说明:</b></td>
</tr>
<tr>
<td> 当投票时间达到3天,投票自动结束,此时:<br>
1) 如果投票人数多于5人,则系统自动将票数最多的回答选为正确答案;<br>
2) 如果投票人数不足5人,则问题将被自动关闭。 </td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<br></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<%
if request("submit")="转入投票流程" then
if request("check")="" then
response.write"<script>alert('对不起,您至少要选择两个以上的候选答案!');history.back();</script>"
response.End()
end if
if InStr(request("check"),",")=0 then
response.write"<script>alert('对不起,您至少要选择两个以上的候选答案!');history.back();</script>"
response.End()
end if
touid=replace(request("check")," ","")
rs1.open"select * from reply where id in ("&touid&")",conn,1,1
while not rs1.eof
rs2.open"select * from toupiao where wenid="&rs1("replyid")&" and daid="&rs1("id")&"",conn,1,1
if not rs2.eof then
response.write"<script>alert('对不起,您不能重复设置!');history.back();</script>"
response.End()
end if
if rs1.recordcount>3 then
response.write"<script>alert('对不起,您最多可设置3个候选答案!');history.back();</script>"
response.End()
end if
rs2.close
rs2.open"select * from question where id="&id&"",conn,1,3
rs2("jie")=4
rs2("toutime")=now
rs2.update
rs2.close
rs2.open"select * from reply where id="&rs1("id")&"",conn,1,3
rs2("tou")=1
rs2.update
rs2.close
rs2.open"select * from toupiao",conn,1,3
rs2.addnew
rs2("wenid")=rs1("replyid")
rs2("daid")=rs1("id")
rs2("dauser")=rs1("replyer")
rs2("daco")=rs1("replycontent")
rs2("datime")=rs1("replytime")
rs2.update
rs2.close
response.write"<script>alert('恭喜您,您已经成功将问题转入投票流程!');window.navigate('Show_Question.asp?id="&id&"');</script>"
rs1.movenext
wend
rs1.close
end if
rs2.open"select * from reply where replyid="&id&" order by replytime",conn,1,1
if rs2.eof then
maxnum=0
else
maxnum=rs2.recordcount
end if
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="t1">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td height="36" align="center" onmouseover="this.className='tbb'" onmouseout="this.className='taa'" class="taa">
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>设定候选答案</b></td>
<td><div align="right">共 <%=maxnum%> 条</div></td>
</tr>
</table></td>
</tr>
<tr>
<td align=center><br>
<table border="0" width="98%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="zhtable">
<form name="form_vote_list" method="get" action="TouPiao_Start.asp">
<tr><td class=bgcntLn>
<input type="hidden" name="id" value="<%=id%>">
<%
if rs2.eof then
%>暂时没有候选答案!<%
else
while not rs2.eof
i=i+1
rs3.open"select * from person where name='"&rs2("replyer")&"'",conn,1,1
touxian=rs3("touxian")
rs3.close
%>
<div><%=i%>.<font id="1_tit"><%=ubb(rs2("replycontent"))%></font></div>
<div align="right">回答者:<a href="Show_User.asp?name=<%=rs2("replyer")%>" target=_blank><%=rs2("replyer")%></a> - <a href="Help.asp#n5" target=_blank><%=touxian%></a> <%=rs2("replytime")%></div>
<div><input type="checkbox" name="check" value="<%=rs2("id")%>">候选<div><div style=\"padding-top:5px;padding-bottom:5px;\">
<hr size=1 class="hr1"></div>
<%rs2.movenext
wend%>
<br><input type="submit" name="submit" value="转入投票流程" class="ip2">
<%end if
rs2.close%>
<a href="javascript:history.go(-1);"><span>返回</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</form>
</table></td>
</tr>
</table>
<br></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</td>
</tr>
</table><br>
<%
end if
rs.close
%><!--#include file=end.asp-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -