📄 title.asp
字号:
<!--#include file = "conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>投票标题管理</title>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body>
<%
If Request.QueryString("sid")="" Then
Response.Write "<script>alert('ID号不能为空!');history.back(1)</script>"
Response.End
End If
If not IsNumeric(Request.QueryString("sid")) Then
Response.Write "<script>alert('ID号为非数字!');history.back(1)</script>"
Response.End
End If
Dim yrs,Subject
Set yrs=Server.CreateObject("ADODB.RecordSet")
yrs.open "Select * from Subject where id="&Request.QueryString("sid"),conn,1,1
If (yrs.eof and yrs.bof) Then
Response.Write "<script>alert('此ID号不存在或已被删除!');history.back(1)</script>"
Response.End
Else
Subject=yrs("subject")
End If
yrs.close
Set yrs=nothing
%>
<div align="center">
<table border="0" width="100%" id="table1" cellspacing="1" cellpadding="3" class="tableborder">
<tr>
<th><font size="4"><a href="Title.asp?action=Add&sid=<%=Request.QueryString("sid")%>">添加投票标题</a> |
<a href="Title.asp?action=Modify&sid=<%=Request.QueryString("sid")%>">修改投票标题</a> | <a href="Title.asp?action=Delete&sid=<%=Request.QueryString("sid")%>">删除投票标题</a> | <a href="admin.asp?action=ChangeMsg">信息修改</a> | <a href="admin.asp?action=Logout">退出管理</a></font></th>
</tr>
</table>
</div>
<%
Dim sid
sid=Request.QueryString("sid")
If Request.QueryString("action")="Add" Then
Call Add()
ElseIf Request.QueryString("action")="Modify" Then
Call Modify()
ElseIf Request.QueryString("action")="Delete" Then
Call Delete()
Else
Call Add()
End If
Sub Add()
%>
<div align="center">
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open "Select * from Title where sid="&sid&" order by id desc",conn,1,1
%>
<table border="0" width="70%" id="table1" cellspacing="0" cellpadding="3" class="tableborder">
<tr>
<td class="tablebody" width="10%" align="center"><b>ID</b></td>
<td class="tablebody" width="40%" align="center"><b>投票标题</b></td>
<td class="tablebody" width="35%" align="center"><b>投票主题</b></td>
</tr>
<%
Dim i
If not (rs.eof and rs.bof) Then
Do While not rs.eof
%>
<tr>
<td class="tablebody1" width="10%" align="center"><%=rs("id")%></td>
<td class="tablebody1" width="40%" align="center"><a href="Question.asp?action=Add&sid=<%=sid%>&tid=<%=rs("id")%>"><%=rs("title")%></a></td>
<td class="tablebody1" width="35%" align="center"><a href="Admin.asp"><%=Subject%></a></td>
</tr>
<%
i=i+1
rs.MoveNext
loop
Else
%>
<tr>
<td class="tablebody1" width="10%" align="center"></td>
<td class="tablebody1" width="40%" align="center">还没有任何标题!</td>
<td class="tablebody1" width="35%" align="center"><a href="Admin.asp"><%=Subject%></a></td>
</tr>
<%
End if
%>
</table>
<%
rs.close
Set rs=nothing
%>
</div>
<br>
<div align="center">
<table border="0" width="50%" cellspacing="1" cellpadding="3" class="tableborder">
<tr>
<th>添加投票标题</th>
</tr>
<form action="DoTitle.asp?act=add&sid=<%=sid%>" method="post" name="addtitle">
<tr>
<td align="center" class="tablebody1">
标题:<input type="text" name="newtitle" size="30">
模式:
<select size="1" name="ms">
<option value="1">单选</option>
<option value="2">复选</option>
</select>
<input type="submit" name="submit" value="添加" onclick="if(addtitle.newtitle.value==''){alert('标题名不能为空!');addtitle.newtitle.focus();return false;}return true;"></td>
</tr>
</form>
</table>
</div>
<%
End Sub
Sub Modify()
%>
<div align="center">
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open "Select * from Title where sid="&sid&" order by id desc",conn,1,1
%>
<table border="0" width="70%" id="table1" cellspacing="0" cellpadding="3" class="tableborder">
<tr>
<td class="tablebody" width="10%" align="center"><b>ID</b></td>
<td class="tablebody" width="40%" align="center"><b>投票标题</b></td>
<td class="tablebody" width="35%" align="center"><b>投票主题</b></td>
<td class="tablebody" width="35%" align="center"><b>操作</b></td>
</tr>
<%
Dim i
If not (rs.eof and rs.bof) Then
Do While not rs.eof
%>
<tr>
<td class="tablebody1" width="10%" align="center"><%=rs("id")%></td>
<td class="tablebody1" width="40%" align="center"><a href="Question.asp?action=Modify&sid=<%=sid%>&tid=<%=rs("id")%>"><%=rs("title")%></a></td>
<td class="tablebody1" width="35%" align="center"><a href="Admin.asp"><%=Subject%></a></td>
<td class="tablebody1" width="35%" align="center"><a href="title.asp?action=Modify&sid=<%=sid%>&tid=<%=rs("id")%>&option=show" onclick="if(confirm('\n真的要修改该标题?')){return true;}return false;">修改</a></td>
</tr>
<%
i=i+1
rs.MoveNext
loop
Else
%>
<tr>
<td class="tablebody1" width="10%" align="center"></td>
<td class="tablebody1" width="40%" align="center">还没有任何标题!</td>
<td class="tablebody1" width="35%" align="center"><a href="Admin.asp"><%=Subject%></a></td>
<td class="tablebody1" width="35%" align="center">删除</td>
</tr>
<%
End if
%>
</table>
<%
rs.close
Set rs=nothing
If Request.QueryString("option") = "show" Then
Dim Showrs
Set Showrs=Server.CreateObject("ADODB.RecordSet")
Showrs.open "select * from Title where id="&Request.QueryString("tid"),conn,1,1
If not (Showrs.eof and Showrs.bof) Then
%>
<div align="center">
<table border="0" width="50%" id="table2" cellspacing="1" cellpadding="3" class="tableborder">
<tr>
<th>修改投票标题</th>
</tr>
<form action="DoTitle.asp?act=Modify&sid=<%=Request.QueryString("sid")%>&tid=<%=Showrs("id")%>" method="post" name="modifytitle">
<tr>
<td align="center" class="tablebody1">
标题:<input type="text" name="oldtitle" size="30" value="<%=Showrs("title")%>">
模式:
<select size="1" name="ms">
<option value="1">单选</option>
<option value="2">复选</option>
</select>
<input type="submit" name="submit" value="修改" onclick="if(modifytitle.oldtitle.value==''){alert('标题名不能为空!');modifytitle.oldtitle.focus();return false;}return true;"></td>
</tr>
</form>
</table>
</div>
<%
Showrs.close
Set Showrs=nothing
Else
Response.Redirect "Title.asp?sid="&sid
End If
End If
End Sub
Sub Delete()
%>
<div align="center">
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open "Select * from Title where sid="&sid&" order by id desc",conn,1,1
%>
<table border="0" width="70%" id="table1" cellspacing="0" cellpadding="3" class="tableborder">
<tr>
<td class="tablebody" width="10%" align="center"><b>ID</b></td>
<td class="tablebody" width="40%" align="center"><b>投票标题</b></td>
<td class="tablebody" width="35%" align="center"><b>投票主题</b></td>
<td class="tablebody" width="35%" align="center"><b>操作</b></td>
</tr>
<%
Dim i
If not (rs.eof and rs.bof) Then
Do While not rs.eof
%>
<tr>
<td class="tablebody1" width="10%" align="center"><%=rs("id")%></td>
<td class="tablebody1" width="40%" align="center"><a href="Question.asp?action=Delete&sid=<%=sid%>&tid=<%=rs("id")%>"><%=rs("title")%></a></td>
<td class="tablebody1" width="35%" align="center"><a href="Admin.asp"><%=Subject%></a></td>
<td class="tablebody1" width="35%" align="center"><a href="dotitle.asp?act=delete&tid=<%=rs("id")%>" onclick="if(confirm('\n真的要删除该标题及其下面的投票项?')){return true;}return false;">删除</a></td>
</tr>
<%
i=i+1
rs.MoveNext
loop
Else
%>
<tr>
<td class="tablebody1" width="10%" align="center"></td>
<td class="tablebody1" width="40%" align="center">还没有任何标题!</td>
<td class="tablebody1" width="35%" align="center"><a href="Admin.asp"><%=Subject%></a></td>
<td class="tablebody1" width="35%" align="center">删除</td>
</tr>
<%
End if
%>
</table>
<%
rs.close
Set rs=nothing
End Sub
%>
<table border="0" width="100%" id="table1" cellspacing="1" cellpadding="3" class="tableborder">
<tr>
<td class="tablebody" align="center">Powered By : 网上投票 2005<br>CopyRight 2004-2006 </td>
</tr>
</table>
<%Call EndConnection()%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -