📄 vote_admin.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="admin.asp"-->
<%
dim sql,rs,Action,id
Action=Trim(Request("Action"))
id=Trim(Request("voteid"))
if Action="set" and id<>"" then
conn.execute "Update [vote] set isselected=0 where isselected=1"
conn.execute "Update [vote] set isselected=1 Where id=" & id
response.Write "<script language='Javascript' type='text/Javascript'>alert('设置成功!');</script>"
end if
if request("delid")<>"" then
sql="delete from [Vote] where id="&request("delid")&""
conn.Execute sql
response.write"<script>alert('删除投票成功!');location.href='vote_admin.asp'</script>"
end if
sql="select * from [vote] order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
<script language=JavaScript>
function del()
{
if (confirm("真的要删除这条记录吗?删除后将无法恢复!"))
{
return true;
}
else
{
return false;
}
}
</script>
</head>
<body>
<table width="500" border="1" align="center" cellpadding="4" cellspacing="0" Class="table-line">
<form method="POsT" action="vote_admin.asp">
<tr class="title">
<td colspan="4" align="center" class="td-title-color"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="shadow">投票管理</td>
</tr>
</table> </td>
</tr>
<tr class="title">
<td height="25" colspan="4"><a href="vote_add.asp"><img src="images/addnew.jpg" border="0"></a></td>
</tr>
<tr class="td-title-color">
<td width="37" height="25" align="center">选择</td>
<td width="37" align="center">id</td>
<td width="328" align="center">主题</td>
<td width="88" align="center">操作</td>
</tr>
<%
if not (rs.bof and rs.eof) then
do while not rs.eof
%>
<tr bgcolor="#E3E3E3" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td width="37" height="22" align="center" bgcolor="#FFFFFF"> <input type="radio" value=<%=rs("id")%><%if rs("isselected")=true then%> checked<%end if%> name="voteid"> </td>
<td width="37" height="22" align="center" bgcolor="#FFFFFF"><%=rs("id")%></td>
<td height="22" bgcolor="#FFFFFF"> <%=rs("Title")%></td>
<td width="88" height="22" align="center" bgcolor="#FFFFFF"><a href="vote_edit.asp?id=<%=rs("id")%>">修改</a>
<a href="?delid=<%=rs("id")%>" onclick="return del();">删除</a></td>
</tr>
<%
rs.movenext
loop
%>
<tr bgcolor="#FFFFFF" class="tdbg">
<td height="25" colspan=4 align=center> <strong>
<input name="Action" type="hidden" id="Action" value="set">
<input type="submit" value="将选定的调查设为最新调查" name="submit">
</td>
</tr>
<% end if%>
</form>
</table>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -