pe="多选" else stype="单选" end if stime=rs("survey_stime") etime=rs("survey_etime") ''判断状态 if now()<stime then stat="未开始" else if now<etime then stat="进行中" else stat="已结束" end if end if
''定义SQL语句,得到答案的数量总和 sql="select sum(vote_count) as total from survey_vote where vote_id="& id searchtable my,sql,tmprs ''查询 total=tmprs("total") closetable tmprs ''关闭表 ''下面输出一条记录 %> <tr > <td align="center" height="20"><%=id%></td> <td height="20"> <a href="survey.asp?id=<%=id%>"><%=question%></a> </td> <td align="center" height="20"><%=stype%></td> <td align="center" height="20"><%=stime%></td> <td align="center" height="20"><%=etime%></td> <td align="center" height="20"><%=stat%></td> <td align="center" height="20"><%=total%></td> <td align="center" height="20"> <a href="survey_vote.asp?id=<%=id%>" target="_blank">查看</a> </td> </tr> <% rs.movenext ''移动到下一条,循环 loop %> </table> <% closetable rs ''关闭表 closedb my ''关闭数据库 end sub ''---------------------- %> </body> </html>
九、后台管理
在后台管理页面survey_manage.asp中,前面我们已经列出来它所要实现的管理功能。管理的流程是先显示出所有调查,对于还没有开始的调查,可以进行修改、删除;对于已经结束的调查,可以删除,不能修改;对于正在进行的调查,只能修改它的结束时间。用一个参数action来表示动作,含义如下:
1、无参数。表示第一次进入,显示登录表单
2、login 表示执行登录
3、logout 表示执行退出登录
4、showaddquestion 表示显示增加一个调查
5、showsurvey 表示显示一个调查
6、doaddsurvey 表示执行增加一个调查
7、doaddanswer 表示执行增加一个答案
8、dodelsurvey 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页 |