📄 add_choice.asp
字号:
<!--#include file="conn.inc"-->
<style type="text/css">
<!--
body,td,th {
font-family: 宋体;
font-size: 12px;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
a {
font-family: 宋体;
color: #000000;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #666666;
}
a:hover {
text-decoration: underline;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #333333;
}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css">
<% if request("actions")="1" then
choice=trim(request("choice"))
if choice="" then
response.write "<script language='javascript'>alert('选项内容不能为空!');history.go(-1);</script>"
else
if request("IsDefault")="1" then
def=true
else
def=false
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from choice where id=null"
rs.open sql,connstr,1,3
rs.addnew
rs("choice")=choice
rs("IsDefault")=def
rs("extends")=request("ids")
rs.update
rs.close
set rs=nothing
response.write "<meta http-equiv='refresh' content='0;url=add_choice.asp?id="&request("ids")&"'>"
end if
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from title where id="&request("id")
rs.open sql,connstr
if rs("choice")=true then
con="多选"
else
con="单选"
end if
if rs("current")=true then
curr="激活"
else
curr="未激活"
end if
%>
<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="63" valign="bottom"><div align="center">请在当前主题下添加选项:</div></td>
</tr>
</table>
<form name="form1" method="post" action="edit.asp">
<table width="70%" height="74" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000">
<tr>
<td height="20" bgcolor="#FFF4C8"><div align="center">当前主题内容</div></td>
</tr>
<tr>
<td valign="middle" bgcolor="#D7F2FF"><%=rs("title")%></td>
</tr>
<tr>
<td valign="middle" bgcolor="#D7F2FF"><div align="right">选择类型:<%=con%>
<a href="edit.asp?id=<%=rs("id")%>">修改</a>
<input name="id" type="hidden" id="id" value="<%=rs("id")%>">
</div></td>
</tr>
</table>
</form>
<div align="center">
<%rs.close
set rs=nothing%>
<font color=red>注意:请确保每个主题只有一个默认选项,否则将出现不可预料的结果!</font>
</div>
<form name="form2" method="post" action="">
<table width="70%" height="47" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#D7F2FF"><div align="center">选项内容</div></td>
<td bgcolor="#D7F2FF"><div align="center">是否默认选中</div></td>
<td bgcolor="#D7F2FF"> </td>
</tr>
<tr>
<td width="53%" valign="middle" bgcolor="#FFF4C8"><div align="center">
<input name="choice" type="text" class="input" id="choice" size="30">
</div></td>
<td width="25%" valign="middle" bgcolor="#FFF4C8"><div align="center">
<input type="radio" name="IsDefault" value="1">
是
<input name="IsDefault" type="radio" value="2" checked>
否</div></td>
<td width="22%" valign="middle" bgcolor="#FFF4C8"><div align="center">
<input name="ids" type="hidden" id="ids" value="<%=request("id")%>">
<input name="actions" type="hidden" id="actions" value="1">
<input type="submit" name="Submit" value="提交">
</div></td>
</tr>
</table>
</form>
<%set rs1=server.CreateObject("adodb.recordset")
sql1="select * from choice where extends="&request("id")
rs1.open sql1,connstr%>
<table width="70%" height="44" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000">
<tr>
<td width="53%" height="20" bgcolor="#FFF4C8"><div align="center">选项内容</div></td>
<td width="25%" height="20" bgcolor="#FFF4C8"><div align="center">是否默认</div></td>
<td width="22%" height="20" bgcolor="#FFF4C8"><div align="center">操作</div></td>
</tr>
<%if rs1.eof and rs1.bof then
else
do while not rs1.eof
if rs1("IsDefault")=true then
Def="是"
else
Def="否"
end if%> <tr>
<td height="21" valign="middle" bgcolor="#D7F2FF"><%=rs1("choice")%></td>
<td valign="middle" bgcolor="#D7F2FF"><%=Def%></td>
<td valign="middle" bgcolor="#D7F2FF"><div align="center"><a href="edit_choice.asp?cid=<%=rs1("id")%>&id=<%=request("id")%>">修改</a> <a href="del_choice.asp?cid=<%=rs1("id")%>&id=<%=request("id")%>" onClick="return test()">删除</a></div></td>
</tr>
<%rs1.movenext
loop
rs1.close
set rs1=nothing
end if%>
</table>
<p>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -