<!--#INCLUDE FILE="conn.asp" -->
<!--#include file="admin_Checkuser.asp"-->
<HTML><HEAD><title><%=StrVar(1)%>--管理页面</title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<!--#include file="inc/admin_main.css"-->
</HEAD>
<BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<%
if  not sysadmin or session("adminlogin")<>"0K" Then
	Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用，请<a href=admin_index.asp target=_top>登陆</a>后进入。"
	Call Error("Information",ErrMsg)
	elseif request("action")="update" then
	    call updatechi()
    else
		call main()
		call endconnection()
end if

	sub main()
%>
<table cellpadding=5 cellspacing=1 border=0 width=90% Class=TableBorder align=center>
  <tr>
	<th>欢迎<b><%=membername%></b>进入管理页面</th>
</tr></table>
<br>
  <table width="100%" border="0" cellspacing="1" cellpadding="3" align=center Class=TableBorder>
  <form name="form1" method="post" action="admin_boardchi.asp">
  <input type="hidden" name="action" value="update">
  <tr>
  <th colspan="2">
  校友录论坛管理中心-版面排序</th>
  </tr>
  <tr>
  <td width="25%" align="center" Class=forumrowhighlight><font color="#FF0000">版面名称</font></td>
  <td width="75%" align="center" Class=forumrowhighlight><font color="#FF0000">排序顺序</font></td>
  </tr>
  <%
dim rs,sql,boardid
	set rs=server.createobject("adodb.recordset")
	sql="select * from bbs order by boardchi,boardid desc"
	rs.open sql,conn,1,1
if rs.bof and rs.eof then%>
  <tr>
  <td colspan="2" align="center" class=forumrow>还没有任何版面</td>
  </tr>
  <%else
  do until rs.eof%>

  <tr>
  <td width="25%" align="center" class=forumrow><img src="images/nofollow.gif" width="15" height="15" border="0">&nbsp;<%=rs("boardname")%></td>
  <td width="75%" class=forumrow>
  <input type="text" name=boardchi<%=rs("boardid")%> size="5" value="<%=rs("boardchi")%>">
  </td>
  </tr>

  <%rs.movenext
 loop
 %>
  <tr>
  <td colspan="2" align="center" Class=forumrowhighlight>
  <input type="submit" name="Submit" value="排 序">
  </td>
  </tr>
  <tr>
  <td width="25%" align="center" class=forumrow><font color="#FF0000">操作说明</font></td>
  <td width="75%" class=forumrow>
  <p>在右边的输入框里输入相应的顺序。（1排在最上面，2次之...)</p>
  <p>注意：不能输入小于0的数字.</p>
  </td>
  </tr>
  <%end if%></form>
  </table>

<%
rs.close
set rs=nothing
end sub

sub updatechi()
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from bbs order by boardid desc"
rs.open sql,conn,1,3

dim boardchi

do while not rs.eof
boardchi=request("boardchi"&rs("boardid"))
'response.write boardchi
'response.end
sql="update bbs set boardchi="&boardchi&" where boardid="&rs("boardid")
conn.execute(sql)

rs.movenext
loop

response.write "<script language=javascript>alert('论坛排序成功！');document.location.href='admin_boardchi.asp';</script>"

rs.close
set rs=nothing
end sub
%>