⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin.asp

📁 功能完善网站统计系统,网络编程从入门到精通
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>投票管理</title>
<link rel="stylesheet" type="text/css" href="css.css">
<script language="VBScript">
function check()
	If form4.username.value="" Then
		alert("登录名不能为空!")
		form4.username.focus() 
		return false
	End If
	If form4.password.value<>"" and form4.password1.value="" Then
		alert("密码已填,重复密码必须填!")
		form4.password.focus()
		return false
	End If
	If form4.password1.value<>form1.password.value Then
		alert("两次密码不一致!")
		form4.password1.focus()
		return false
	End If
	return true
End Function			
</script>
</head>

<body>
<div align="center">
	<table border="0" width="100%" id="table1" cellspacing="1" cellpadding="3" class="tableborder">
		<tr>
			<th><font size="4"><a href="admin.asp?action=Set">设置当前投票主题</a> | <a href="admin.asp?action=AddSubject">添加投票主题</a> |                                                                      
			<a href="admin.asp?action=Modify">修改投票主题</a> | <a href="admin.asp?action=Delete">删除投票主题</a> | <a href="admin.asp?action=ChangeMsg">信息修改</a> | <a href="admin.asp?action=Logout">退出管理</a></font></th>                                                                      
		</tr>                               
	</table>                               
</div>                               
                             
<table border="0" width="100%" id="table1" height="200" cellspacing="1" cellpadding="3" class="tableborder">                               
	<tr>                               
		<td align="center">                             
		<%                             
		If Request.QueryString("action") = "Set" Then                             
			Call SetCurrent()                             
		ElseIf Request.QueryString("action") = "AddSubject" Then                             
			Call Add()                             
		ElseIf Request.QueryString("action") = "Modify" Then                             
			Call Modify()                             
		ElseIf Request.QueryString("action") = "Delete" Then                             
			Call Delete()                             
		ElseIf Request.QueryString("action") = "ChangeMsg" Then                             
			Call ChangeMsg()                           
		ElseIf Request.QueryString("action") = "Logout" Then                             
			Call Logout()                             
		Else                              
			Call SetCurrent()                             
		End If                             
		%>                             
		</td>                              
	</tr>                              
</table>                              
                            
<%                             
Sub SetCurrent()                             
%>                             
<div align="center">                             
<%
If Request.QueryString("result") = "Successful" Then
%>
<tabel border=0 width=70% id=table1 cellspacing=0 cellpadding=3 class=tableborder>
	设置成功!<br><br>
	当前主题:<font color=red>
<%
Response.Write Request.QueryString("subject")
%>
</font><br><br>
<a href="admin.asp?action=Set">返回</a>
<%  
Else                            
Set rs=Server.CreateObject("ADODB.RecordSet")                             
rs.open "Select * from Subject order by id desc",conn,1,1                             
%>                             
 <form name = form1 action = do.asp?act=SetCurrent method = post>                             
  <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="75%" align="center"><b>投票主题</b></td>                             
		<td class="tablebody" align="center"p><b>是否当前主题</b></td>                             
	</tr>                             
	<%                             
	Dim i                             
	If not (rs.eof and rs.bof) Then                             
		Do while not rs.eof                             
	%>                             
			<tr>                             
				<td width="10%" align="center" class="tablebody1"><%=rs("id")%></td>                             
				<td width="75%" align="left" class="tablebody1"><%=rs("subject")%></td>                             
				<td align="center" class="tablebody1"><input type="radio" value=<%=rs("id")%> name="subject"></td>                            
			</tr>                            
	<%                            
			i=i+1                            
			rs.MoveNext                            
		Loop                                                    
	Else                            
		Response.Write "<tr><td class=tablebody1 align=center colspan=4><font color=red>还没有任何主题!</font></td></tr>"                            
	End If                            
	%>                            
	<tr>                            
		<td width="85%" align="center" class="tablebody1" colspan="3"><input type = submit name = setcurrentbutton value = "确定"></td>                            
	</tr>                            
  </table>                            
 </form>                           
<%                            
rs.close                            
Set rs = nothing 
End If                           
End Sub                 
                
Sub Add()                
%> 
<div align="center">                             
<%                             
Set rs=Server.CreateObject("ADODB.RecordSet")                             
rs.open "Select * from Subject order by id desc",conn,1,1                             
%>                  
<form name = form2 action = do.asp?act=Add method = post>                             
<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="75%" align="center"><b>投票主题</b></td>                             
		<td class="tablebody" align="center" nowrap><b>是否当前主题</b></td>                             
	</tr>                             
	<%                             
	Dim i                             
	If not (rs.eof and rs.bof) Then                         
	Do while not rs.eof                         
	%>                         
	<tr>                         
		<td width="10%" align="center" class="tablebody1"><%=rs("id")%></td>                         
		<td width="75%" align="left" class="tablebody1"><a href = "Title.asp?action=Add&sid=<%=rs("id")%>" title = "添加投票标题"><%=rs("subject")%></a></td>                         
		<% If rs("process") Then%>                        
		<td align="center" class="tablebody1" nowrap>是</td>                        
		<%Else%>                         
		<td align="center" class="tablebody1" nowrap>否</td>                        
		<%End If%>                        
	</tr>                         
	<%                         
	i=i+1                         
	rs.MoveNext                         
	Loop                                                 
	Else  	                      
	Response.Write "<tr><td class='tablebody1' align='center' colspan='4'><font color='red'>还没有任何主题!</font></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="do.asp?act=add" method="post" name="addsubject">                        
	<tr>                        
		<td align="center" class="tablebody1"><input type="text" name="newsubject" size="30">&nbsp; <input type="submit" name="submit" value="添加" onclick="if(addsubject.newsubject.value==''){alert('主题名不能为空!');addsubject.newsubject.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 Subject where id is not null 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="75%" align="center"><b>投票主题</b></td>                        
		<td class="tablebody" align="center" nowrap><b>是否当前投票主题</b></td>
		<td class="tablebody" align="center" nowrap><b>操作</b></td>                        
	</tr>                        
	<%                        
	Dim i                        
	If not (rs.eof and rs.bof) Then                        
	Do while not rs.eof                        
	%>                        
	<tr>                        
		<td width="10%" align="center" class="tablebody1"><%=rs("id")%></td>                        
		<td width="75%" align="center" class="tablebody1"><a href="Title.asp?action=Modify&sid=<%=rs("id")%>" title="修改投票标题"><%=rs("subject")%></a></td>                        
		<% If rs("process") Then%>                        
		<td align="center" class="tablebody1" nowrap>是</td>                        
		<%Else%>                         
		<td align="center" class="tablebody1" nowrap>否</td>                        
		<%End If%> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -