📄 vote_edit.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="admin.asp"-->
<%
dim id,Title,voteTime,isselected
dim rs,sql
id=request("id")
Title=trim(request.form("Title"))
voteTime=trim(request.form("voteTime"))
if voteTime="" then voteTime=now()
isselected=trim(request("isselected"))
if isselected="True" then
conn.execute "Update [vote] set isselected=0 where isselected=1"
end if
dim i
if id="" then
Response.Redirect "voteManage.asp"
end if
sql="select * from vote where id="&Cint(id)
set rs= server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if not rs.eof then
if Title<>"" then
rs("Title")=Title
for i=1 to 8
if trim(request("select"&i))<>"" then
rs("select"&i)=trim(request("select"&i))
if request("answer"&i)="" then
rs("answer"&i)=0
else
rs("answer"&i)=clng(request("answer"&i))
end if
else
rs("select"&i)=""
rs("answer"&i)=0
end if
next
rs("voteTime")=voteTime
rs("voteType")=request("voteType")
if isselected="" then isselected
rs("isselected")=isselected
rs.update
rs.close
set rs=nothing
response.write"<script>alert('修改投票成功!');location.href='vote_admin.asp'</script>"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="500" border="1" align="center" cellpadding="4" cellspacing="0" Class="table-line">
<form method="POsT" action="vote_edit.asp">
<tr align="center" bgcolor="#FFFFFF" class="tdbg">
<td colspan="4" class="td-title-color"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="shadow">修改投票</td>
</tr>
</table></td>
</tr>
<tr class="tdbg">
<td width="15%" align="right">主题:</td>
<td width="85%" colspan="3">
<input name="Title" type="text" value="<%=rs("Title")%>" size="40"></td>
</tr>
<%
for i=1 to 8%>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="right">选项<%=i%>:</td>
<td>
<input name="select<%=i%>" type="text" value="<%=rs("select"& i)%>" size="40">
</td>
<td align="right">票数:</td>
<td width="80">
<input name="answer<%=i%>" type="text" value="<%=rs("answer"&i)%>" size="5"></td>
</tr>
<%next%>
<tr class="tdbg">
<td align="right">调查类型:</td>
<td colspan="3">
<select name="voteType" id="voteType">
<option value="single" <% if rs("voteType")="single" then %> selected <% end if%>>单选</option>
<option value="Multi" <% if rs("voteType")="Multi" then %> selected <% end if%>>多选</option>
</select></td>
</tr>
<tr class="tdbg">
<td align="right"> </td>
<td colspan="3">
<input name="isselected" type="checkbox" id="isselected" value="True" <% if rs("isselected")=true then response.write "checked"%>>
设为最新调查</td>
</tr>
<tr class="tdbg">
<td colspan=4 align=center>
<input name="id" type="hidden" id="id" value="<%=rs("id")%>">
<input name="submit" type="submit" id="submit" value="保存修改结果"> </td>
</tr></form>
</table>
</body>
</html>
<%
end if
rs.close
set rs=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -