📄 vote.asp
字号:
<!--#include file="conn.asp"--><!--#include file="Check.asp"-->
<HTML>
<HEAD>
<TITLE> main </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE>BODY {
FONT-SIZE: 10pt
}
TD {
FONT-SIZE: 10pt; LINE-HEIGHT: 150%
}
A {
TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: underline
}
</STYLE></HEAD>
<BODY background="../pic/user/bg.jpg">
<%
up=request.querystring("up")
select case up
case "addvote"
call addvote
case "delxx"
call delxx
case "editxx"
call editxx
case "upda"
call upda
case "edittitle"
call edittitle
case "uptit"
call uptit
case else
call vote
end select
sub addvote
vname=request.form("vname")
if vname<>"" then
set adv=server.createobject("adodb.recordset")
adv.open "select * from vote",conn,1,3
adv.addnew
adv("vname")=vname
adv.update
adv.close:set adv=nothing
response.write"<script>window.location.href='vote.asp?up=vote';</script>"
else
response.write"<script>alert('添加的项目名称不能为空!');javascript:history.back(1);</script>"
end if
end sub
sub delxx
idd=request.querystring("idd")
conn.execute("delete * from vote where id=cint('"&idd&"')")
response.write"<script>window.location.href='vote.asp?up=vote';</script>"
end sub
sub upda
idd=request.querystring("idd")
vname=trim(request.form("vname2"))
vcount=trim(request.form("vcount"))
if vname<>"" and IsNumeric(vcount) then
set vvvs=server.createobject("adodb.recordset")
vvvs.open "select * from vote where id=cint('"&idd&"')",conn,1,3
if not vvvs.eof then
vvvs("vname")=vname
vvvs("vcount")=vcount
vvvs.update
vvvs.close
set vvvs=nothing
end if
response.write"<script>window.location.href='vote.asp?up=vote';</script>"
else
response.write"<script>alert('修改的项目名称不能为空且投票数只能为数字!');javascript:history.back(1);</script>"
end if
end sub
sub uptit
votename=trim(request.form("votename"))
if votename<>"" then
conn.execute("update manager set votename='"&votename&"'")
response.write"<script>window.location.href='vote.asp?up=vote';</script>"
else
response.write"<script>alert('项目标题不能为空!');javascript:history.back(1);</script>"
end if
end sub
%>
<%sub vote%>
<div align="center"><strong>
<%
set Tc=server.createobject("adodb.recordset")
Tc.open "select votename from manager",conn,1,1
if not Tc.eof then
votename=Tc("votename")
response.write votename
end if
Tc.close:set Tc=nothing
%>
</strong>(<a href="vote.asp?up=edittitle">修改</a>)<br>
</div>
<TABLE width="420" border="1" align="center" cellpadding="2" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#ffffff">
<TR>
<TD width="53" height="27" align="center" bgcolor="#f7f7f7">序号</TD>
<TD width="89" height="27" align="center" bgcolor="#f7f7f7">项目名称</TD>
<TD width="68" height="27" align="center" bgcolor="#f7f7f7">投票数</TD>
<TD width="46" height="27" align="center" bgcolor="#f7f7f7">修改</TD>
<TD width="46" height="27" align="center" bgcolor="#f7f7f7">删除</TD>
</TR>
<%
set vvo=server.createobject("adodb.recordset")
vvo.open "select * from vote",conn,1,1
if not vvo.eof then
do while not vvo.eof
i=i+1
%>
<tr>
<td align="center"><%=i%>、</td>
<td ><%=vvo("vname")%></td>
<td align="center"><%=vvo("vcount")%></td>
<td align="center"><a href="vote.asp?up=editxx&idd=<%=vvo("id")%>">修改</a></td>
<td align="center"><a href="vote.asp?up=delxx&idd=<%=vvo("id")%>">删除</a></td>
</tr>
<%
vvo.movenext
loop
end if
vvo.close:set vvo=nothing
%>
<tr align="center">
<form method="post" action="vote.asp?up=addvote">
<td colspan="5">添加投票项目:
<input type="text" name="vname" class="inputt">
<input name="submit" type="submit" class="buttonn" value="添加">
</td>
</form>
</tr>
</TABLE>
<%end sub%>
<%
sub editxx
idd=request.querystring("idd")
set vvvs=server.createobject("adodb.recordset")
vvvs.open "select * from vote where id=cint('"&idd&"')",conn,1,3
%>
<div align="center"><strong>项目名称修改</strong> <a href="vote.asp">返回>></a><br>
</div>
<TABLE width="420" border="1" align="center" cellpadding="2" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#ffffff" bgcolor="#f7f7f7">
<form method="post" action="vote.asp?up=upda&idd=<%=idd%>">
<TR>
<TD height="27" align="center">项目名称:</TD>
<TD align="center">
<input name="vname2" type="text" value="<%=vvvs("vname")%>"></TD>
<TD height="27" align="center">投票数:</TD>
<TD align="center">
<input name="vcount" type="text" value="<%=vvvs("vcount")%>" size="4" maxlength="6"></TD>
<TD height="27" align="center">
<input name="submit2" type="submit" class="buttonn" value="修改"></TD>
</TR>
</form>
</TABLE>
<%
vvvs.close:set vvvs=nothing
end sub
%>
<%
sub edittitle
set Tc=server.createobject("adodb.recordset")
Tc.open "select votename from manager",conn,1,1
if not Tc.eof then
votename=Tc("votename")
end if
%>
<div align="center"><strong>标题名称修改</strong> <a href="vote.asp">返回>></a><br>
</div>
<TABLE width="420" border="1" align="center" cellpadding="2" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#ffffff" bgcolor="#f7f7f7">
<form method="post" action="vote.asp?up=uptit">
<TR>
<TD height="27" align="center">名称:</TD>
<TD align="center"> <input name="votename" type="text" value="<%=votename%>" size="30"></TD>
<TD height="27" align="center"> <input name="titsub" type="submit" class="buttonn" value="修改"></TD>
</TR>
</form>
</TABLE>
<%
Tc.close:set Tc=nothing
end sub
%>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -