📄 modify.asp
字号:
<!--#include file="YZ_login.asp"-->
<!--#include file="cls_DB.asp"-->
<%
mdfid=request("mdfid") '从admin.asp传入的主题id
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改投票</title>
</head>
<body>
<h3 align="center">在线投票管理</h3>
<table width="600" border="0" align="center" cellpadding="0"
cellspacing="1" bgcolor="#000000" >
<tr bgcolor="#C3CDDE">
<td width="746" height="30">
<table width="100%" border="0">
<tr>
<td width="433"> 修改投票</td>
<td width="155"><a href="admin.asp">投票管理</a>-
<a href="index.asp">首页</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="746" height="349" bgcolor="#F0F0F0"><br>
<% '读取主题和其他数据
openDB
set rst=Server.CreateObject("ADODB.Recordset")
sql="select * from titles where id="&mdfid
rst.open sql,conn,1,1
%>
<form method="POST" action="do.asp" name="form1">
<table width="70%" height="191" border="0" align="center" cellpadding="0"
cellspacing="1" bgcolor="#666666" >
<tr>
<td height="25" bgcolor="#F0F0F0">投票主题:
<input type="text" name="ZhuTi" size="38" value=<%=rst("ZhuTi")%>>
</td>
</tr>
<tr>
<td height="19" bgcolor="#F0F0F0">投票方式:
<input type="radio" value="radio" name="XuanZe"
<%if rsT("XuanZe")="radio" then response.Write"checked"%>>单选
<input type="radio" value="checkbox" name="XuanZe"
<%if rst("XuanZe")="checkbox" then response.Write"checked"%>>多选
</td>
</tr>
<tr>
<td height="25" bgcolor="#F0F0F0">投票开始时间:
<select size="1" name="nian">
<option value="<%=year(rst("KaiShiTime"))%>" selected>
<%=year(rst("KaiShiTime"))%></option>
<%
for i=4 to 8
response.Write "<option value=200"&i&">200"&i&"</option>"
next
%>
</select>年
<select size="1" name="yue">
<option value="<%=month(rst("KaiShiTime"))%>" selected>
<%=month(rst("KaiShiTime"))%></option>
<%
for i=1 to 12
response.Write "<option value="&i&">"&i&"</option>"
next
%>
</select>月
<select size="1" name="ri">
<option value="<%=day(rst("KaiShiTime"))%>" selected>
<%=day(rsT("KaiShiTime"))%></option>
<%
for i=1 to 31
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>日
</td>
</tr>
<tr>
<td height="25" bgcolor="#F0F0F0">投票结束时间:
<select size="1" name="nian1">
<option value=<%=year(rst("JieShuTime"))%> selected>
<%=year(rsT("JieShuTime"))%></option>
<%
for i=4 to 8
response.Write "<option value=200"&i&">200"&i&"</option>"
next
%>
</select>年
<select size="1" name="yue1">
<option value=<%=month(rst("JieShuTime"))%> selected>
<%=month(rsT("JieShuTime"))%></option>
<%
for i=1 to 12
response.Write "<option value="&i&">"&i&"</option>"
next
%>
</select>
月
<select size="1" name="ri1">
<option value=<%=day(rst("JieShuTime"))%> selected>
<%=day(rst("JieShuTime"))%></option>
<%
for i=1 to 31
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>日
</td>
</tr>
<tr>
<td height="25" bgcolor="#F0F0F0" >设为当前投票项目?
<input type="radio" name="ShiFou" value="1"
<%if rst("ShiFou")=true then response.Write "checked"%>>是
<input name="ShiFou" type="radio" value="0"
<%if rst("ShiFou")=false then response.Write "checked"%>>否
</td>
</tr>
<%
rst.close
set rst=nothing
'读取主题所属选项
set rs=Server.CreateObject("ADODB.Recordset")
sql="select oid,options,votes from options where TID="&mdfid
rs.open sql,conn,1,1
xx=rs.recordcount 'xx时所属选项的个数,这个值也要传入处理模块
for i=1 to xx
%>
<tr>
<td height="25" bgcolor="#F0F0F0">投票选项<%=i%>:
<input type="text" name="option<%=i%>" value=<%=rs("options")%>
size="20">
<!--传递action动作为deloption即删除选项,并传递相应选项id和选项投票数-->
<a href=do.asp?action=deloption&deloid=<%=rs("oid")%>&delvote=<%=rs("votes")%>&mdfid=<%=mdfid%>
onclick="javascript:return confirm('您确定删除?')">删除</a>
</td>
<input type="hidden" name="oid<%=i%>" value=<%=rs("oid")%>>
<!--用隐藏域传递选项id值,供处理模块对相应选项进行修改处理-->
</tr>
<%
rs.movenext
next
rs.close
set rs=nothing
closeDB
%>
<tr> <!--添加选项-->
<td height="25" bgcolor="#F0F0F0">添加投票选项:
<input type="text" name="addoption" value="" size="20">
</td>
</tr>
<tr> <!--选择是否继续添加选项-->
<td height="25" bgcolor="#F0F0F0">继续添加选项?
<input type="radio" name="continue" value="yes">
</td>
</tr>
<tr>
<td align="center" bgcolor="#F0F0F0">
<input type="submit" value="提交" name="submit" >
<input type="reset" value="取消" name="reset" >
<input type="hidden" name="x" value="<%=xx%>">
<input type="hidden" name="mdfid" value="<%=mdfid%>">
<!--用隐藏域传递已有选项个数和主题id值-->
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -