|
|
|
| |
out&bookid=" _
& request.querystring("bookid") & """>借这本书</a>"
如果图书已经借出,就创建一个不同的消息,并将链接设置为指向library menu 页面:
linktext = "<a href=""../html/library_menu.asp"">图书已出借,返回主菜单。</a>"
最后根据是否是管理员,显示管理员菜单链接。
<% if session("manager") = 1 then %><a href="../html/management_menu.asp?title=<% response.write rsbooks("title") %>&bookid=<% response.write rsbooks("bookid") %>">管理员菜单</a><% end if %>
3.3网上评优投票系统
3.3.1功能:
能实现全校性的评选,快捷、公平,且有效,不允许做票。
3.3.2组成构造
这个系统由3个部分组成――投票页面vote.htm ,处理投票结果的脚本,显示投票页面 。
3.3.3数据表的设计:
3.3.4界面设计与重点、难点代码设计
投票页面
该页面是一个纯html文件,它让用户选择自己想选举的候选人,并填写自己的详细资料,以确认投票的有效性。页面显示如图所示。
表单处理脚本
在vote.htm中各项数据都填写完毕后,单击确定投票按钮,表单的数据就被提交,
本次评优共有4个候选人,但只能选两个。故用复选框。
投票的有效性通过是否是本校学生,且是否投过票来判断。
if request("passno")<>"" then
sql="select * from stud where password="&"''"&request("passno")&"''" &"and yitu=0"
set rs=cn.execute(sql)
if rs.eof then%>
<h2 align=center><%response.write"你无权投票"%></h2>
本设计允许少选,不允许多选。通过判断vote投票界面传递过来的复选按纽值的长度看是否多选。
vo=request("cand")
if len(vo)>4 then%>
<h2 align=center><%response.write "多选了,无效"%></h2>
然后根据所投的票将对应候选人的投票结果字段加1,同时将该投票人的已投字段置为1。
sqq="update stud set yitu=1 where password="&"''"&request("passno")&"''"
cn.execute(sqq)
if instr(vo,"1") then
cn.execute("update stud set result=result+1 where name=''李宁''")
end if
if instr(vo,"2") then
cn.execute("update stud set result=result+1 where name=''杨兰''")
end if
if instr(vo,"3") then
cn.execute("update stud set result=result+1 where name=''江道明''")
end if
if instr(vo,"4") then
cn.execute("update stud set result=result+1 where name=''段启文''")
end&nbs上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >> |
|
|
|
|
|