📄 vote_add.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="admin.asp"-->
<%
dim title,votetime,action,isselected
dim rs,sql
title=trim(request.form("title"))
votetime=trim(request.form("votetime"))
if votetime="" then votetime=now()
action=trim(request("action"))
isselected=trim(request("isselected"))
dim i
if title<>"" then
set rs= server.CreateObject("aDODB.Recordset")
sql="select * from vote"
rs.open sql,conn,1,3
rs.addnew
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
end if
next
rs("votetime")=votetime
rs("votetype")=request("votetype")
if isselected="" then isselected=0
if isselected=1 then conn.execute "Update [vote] set isselected=0 where isselected=1"
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_add.asp">
<tr align="center" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td height="22" colspan="4" class="td-title-color">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="shadow">添加投票</td>
</tr>
</table></td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td width="81" height="22" align="right" bgcolor="#FFFFFF">主题:</td>
<td colspan="3" bgcolor="#FFFFFF"> <input name="title" type="text" size="45" maxlength="50">
</td>
</tr>
<%
for i=1 to 8%>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td height="22" align="right" bgcolor="#FFFFFF">选项<%=i%>:</td>
<td width="281" bgcolor="#FFFFFF"> <input type="text" name="select<%=i%>" size="36">
</td>
<td width="41" align="right" bgcolor="#FFFFFF">票数:</td>
<td width="87" bgcolor="#FFFFFF"> <input type="text" name="answer<%=i%>" size="5">
</td>
</tr>
<%next%>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td height="22" align="right" bgcolor="#FFFFFF">调查类型:</td>
<td colspan="3" bgcolor="#FFFFFF"> <select name="votetype" id="votetype">
<option value="single" selected>单选</option>
<option value="multi">多选</option>
</select> </td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td height="22" align="right" bgcolor="#FFFFFF"> </td>
<td colspan="3" bgcolor="#FFFFFF"> <input name="isselected" type="checkbox" id="isselected" value="1" checked>
设为最新调查</td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td height="25" colspan=4 align=center bgcolor="#FFFFFF">
<input name="submit" type="submit" id="submit" value=" 添 加 ">
<input name="back" type="button" value=" 取 消 " onClick="history.back()">
</td>
</tr>
</form>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -