📄 admin_index.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="const.asp"-->
<!--#include file="conn.asp"-->
<% if session("admin")<>"tfot" then
response.Redirect("admin.asp")
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=schoolname%><%=schoolvote%>管理后台</title>
<style type="text/css">
<!--
.STYLE2 {
color: #FF0000;
font-weight: bold;
}
.STYLE3 {color: #FF99CC}
.STYLE4 {color: #FF6666}
-->
</style>
</head>
<body>
<a href="admin_index.asp"> </a>
<table width="485" border="0">
<tr>
<th width="485" height="31" background="images/backg.gif" scope="col"><a href="admin_index.asp">后台首页</a>||<a href="?action=hxrtj">候选人添加</a>||<a href="?action=hxrgl">候选人管理</a>||<a href="?action=usermanage">用户管理</a>||<a href="?action=tuichu">退出后台</a></th>
</tr>
</table>
<% select case request.QueryString("action")
case "hxrgl"
call hxrgl
case "hxrtj"
call hxrtj
case "tuichu"
call tuichu
case "delpl"
call delpl
case "delhxr"
call delhxr
case "hxrbj"
call hxrbj
case "usermanage"
call usermanage
case "useredit"
call useredit
case "deluser"
call deluser
case "adduser"
call adduser
case "addusername"
call addusername
case else
call main
end select
sub main%>
<p class="STYLE3">-------------------------------------------------------------</p>
<table width="485" border="0">
<tr>
<td width="50%" height="31" background="images/backg.gif"><div align="center">最新评论</div></td>
</tr>
<tr>
<td valign="top"><div align="center"><table width="100%" border="0">
<tr><td width="13%">评论人</td>
<td width="13%">候选人</td>
<td width="64%">评论内容</td>
<td width="10%">处理</td>
</tr>
<% set rs=conn.execute("select top "&pinglunshu&" * from pinlun order by id desc")
if not rs.eof then
while not rs.eof
%>
<tr><td><%=rs("pname")%></td><td>
<% set rss=conn.execute("select stuname from stu where id="&rs("uid")&"")
stuname=rss("stuname")
response.Write(stuname)
set rss=nothing%></td><td><%=rs("content")%></td><td><a href="?action=delpl&id=<%=rs("id")%>">删除</a></td>
<% rs.movenext
wend
set rs=nothing
else
set rs=nothing
response.Write("<tr><td colspan=4 align=center>目前还没有评论信息!</td></tr>")
end if%></table></div></td>
</tr>
</table>
<table width="485" height="58" border="0">
<tr>
<th height="31" background="images/backg.gif" scope="col"><div align="center">投票排行榜</div></th>
</tr>
<tr>
<th scope="col"><div align="center">
<table width="100%" border="0">
<tr>
<td width="13%">名次</td>
<td width="14%">候选人</td>
<td width="17%">得票数</td>
<td width="46%">所属单位</td>
<td width="10%">处理</td>
</tr>
<% set rs=conn.execute("select top "&mingci&" * from stu order by vote desc")
if not rs.eof then
dim i
i=1
while not rs.eof
%>
<tr>
<td><%=i%></td>
<td><a href="view.asp?id=<%=rs("id")%>" target="_blank"><%=rs("stuname")%></a></td>
<td><%=rs("vote")%></td>
<td><%=rs("yuanxi")%></td>
<td><a href="?action=hxrbj&id=<%=rs("id")%>">编辑</a></td>
<% rs.movenext
i=i+1
wend
set rs=nothing
else
set rs=nothing
response.Write("<tr><td colspan=5 align=center>目前还没名次信息!</td></tr>")
end if%>
</tr>
</table>
</div></th>
</tr>
</table>
<%
set conn=nothing
end sub%>
<% sub tuichu
session("admin")=""
set conn=nothing
response.Redirect("index.asp")
end sub
sub delpl
set rs=conn.execute("delete * from pinlun where id="&request.QueryString("id")&"")
set rs=nothing
response.Redirect("admin_index.asp")
end sub
sub hxrgl%>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DCE5" width="660">
<tbody> <tr>
<td bgcolor="#f7f7f7"><div align="center">序号</div></td>
<td bgcolor="#f7f7f7"><div align="center">候选人</div></td>
<td bgcolor="#f7f7f7"><div align="center">院系</div></td>
<td bgcolor="#f7f7f7"><div align="center">专业</div></td>
<td bgcolor="#f7f7f7"><div align="center">班级</div></td>
<td bgcolor="#f7f7f7"><div align="center">候选人主题</div></td>
<td bgcolor="#f7f7f7"><div align="center">得票</div></td>
<td width="20%" bgcolor="#f7f7f7"><div align="center">操作</div></td>
</tr>
<%
dim sql,page
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "Select * FROM stu Order By id Desc"
rs.open sql,conn,1,3
IF not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Then
page=1
Else
Page=Int(Abs(Request("page")))
End if
If not rs.eof then
rs.pagesize =pagegl
total = rs.RecordCount
mypagesize=rs.pagesize
rs.absolutepage = page
end if
i=1
do while not rs.eof and mypagesize>0
%>
<tr>
<td width="5%" bgcolor="#f7f7f7"><div align="center"><%=rs("id")%></div></td>
<td width="10%" bgcolor="#f7f7f7"><div align="center"><a href="view.asp?id=<%=rs("id")%>" target="_blank"><%=rs("stuname")%></a></div></td>
<td width="17%" bgcolor="#f7f7f7"><div align="center"><%=rs("yuanxi")%></div></td>
<td width="11%" bgcolor="#f7f7f7"><div align="center"><%=rs("zhuanye")%></div></td>
<td width="9%" bgcolor="#f7f7f7"><div align="center"><%=rs("banji")%></div></td>
<td width="17%" bgcolor="#f7f7f7"><div align="center"><%=rs("zhuti")%></div></td>
<td width="11%" bgcolor="#f7f7f7"><div align="center"><%=rs("vote")%></div></td>
<td bgcolor="#f7f7f7"><div align="center"><a href="moreview.asp?id=<%=rs("id")%>" target="_blank">评论</a>/<a href="?action=hxrbj&id=<%=rs("id")%>">编辑</a>/<a href="?action=delhxr&id=<%=rs("id")%>" onclick="return confirm('这个操作将删除这位候选人及其相关的信息\n 你确定吗?');">删除</a></div></td>
</tr>
<%
mypagesize=mypagesize-1
i=i+1
rs.movenext
loop
%>
<tr bgcolor="#FF99CC">
<td colspan="9" height="18" valign="bottom"><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form action="?action=hxrgl" method="post" name="form2" id="form2">
<tr>
<td height="22" align="right" bgcolor="#FFFFFF"><font class="td STYLE3"><span class="STYLE4">共<b><%=rs.pagecount%></b>页<b><%=total%></b>条 当前第<b><%=page%></b>页 <a href="?page=1&action=hxrgl" class="td">首页</a>
<%if page>1 then%>
<a href="?page=<%=page-1%>&action=hxrgl" class="td">上一页</a>
<%else%>
上一页
<%end if%>
<%if page<rs.pagecount then%>
<a href="?page=<%=page+1%>&action=hxrgl" class="td">下一页</a>
<%else%>
下一页</span>
<%end if%>
<a href="?page=<%=rs.pagecount%>&action=hxrgl" class="td">尾页</a>
<select name="page" class="td">
<%for i=1 to rs.pagecount%>
<option value="<%=i%>"
<%
if i=page then
response.write" selected"
end if
%>><%=i%></option>
<%next%>
</select>
<input type="submit" name="Submit22" value="转向" class="td" />
</font></td>
</tr>
</form>
</table>
</div></td>
</tr>
</tbody>
</table>
<% set rs=nothing
set conn=nothing
end sub
sub delhxr
set rs=conn.execute("delete * from stu where id="&request.QueryString("id")&"")
set rs=conn.execute("delete * from pinlun where uid='"&request.QueryString("id")&"'")
set rs=nothing
set conn=nothing
response.Write("<script>window.alert('删除成功!');window.location.href='./admin_index.asp?action=hxrgl'</script>")
response.end()
end sub
sub hxrtj%>
<FORM method="POST" name="myform" action="hxrtj.asp?action=add" enctype="multipart/form-data">
<TABLE width="100%" border="0" cellpadding="2" cellspacing="1">
<TR>
<TD colspan="2"><div align="center">添加候选人:</div></TD>
</TR>
<tr>
<td width="13%">候选人姓名:</td>
<td width="87%"><div align="left">
<label>
<input name="stuname" type="text" id="stuname" />
</label>
<span class="STYLE2">(提交后不可修改!)</span></div></td>
</tr>
<tr>
<td>所属院系:</td>
<td><div align="left">
<input name="yuanxi" type="text" id="yuanxi" />
</div></td>
</tr>
<tr>
<td>所属专业:</td>
<td><input name="zhuanye" type="text" id="zhuanye" /></td>
</tr>
<tr>
<td>所属班级:</td>
<td><div align="left">
<input name="banji" type="text" id="banji" />
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -