<!--#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)
	else
		call main()
		set rs=nothing
		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>
<%
if request("action")="update" then
	call updateboard()
else
	call boardform()
end if
%></font>
	      </td>
            </tr>
        </table>
        </td>
    </tr>
</table>
<%
end sub
sub boardform()
%><form method="POST" action=admin_boardadd.asp name=boardform>
<input type=hidden name=action value=update>
  <table width=90% cellspacing=1  cellpadding=5 align=center Class=TableBorder >

<tr> 
      <th colspan=2><div align="center">校友录论坛添加版面</div></th>
    </tr>
    <tr> 
      <td width="40%" Class=forumrowhighlight><font color="#000000"><B>版面名称</B></font></td>
      <td width="60%" Class=forumrowhighlight> 
        <input type="text" name="boardname" size="35"> 
      </td>
    </tr>
    <tr> 
      <td width="40%" class=forumrow><font color="#000000"><B>版面说明</B>（不能超过120个字）</font></td>
      <td width="60%" class=forumrow> 
        <textarea name="boardinfo" cols="35" rows="3"></textarea> 
      </td>
    </tr>
    <tr> 
      <td width="40%" Class=forumrowhighlight><font color="#000000"><B>版面版主</B><br>
        （请用$分开，如：admin$you）</font></td>
      <td width="60%" Class=forumrowhighlight> 
        <input type="text" name="boardmaster" size="50"> 
      </td>
    </tr>
    <tr>
      <td class=forumrow><font color="#000000"><b>版面图片</b><br>
        （将出现在版面的左方，保留默认）</font></td>
      <td class=forumrow><input name="boardpic" type="text" id="boardpic" value="images/bbs/news.gif" size="50"></td>
    </tr>
    <tr> 
      <td height="23" colspan="3" align=right Class=forumrowhighlight> 
        <input type="submit" name="submit" value="添 加"> 
      </td>
    </tr>
  </table>
</form>
<br>
<%
end sub

sub updateboard()
	
set rs=server.createobject("adodb.recordset")
sql="Select * from [bbs]" 
rs.open sql,conn,1,3

rs.addnew

if Request("boardname")="" then 
errmsg = errmsg + "<br>" + "<li>请填入版面名称！</li>"
Founderr=true
else
rs("boardname") = trim(Request("boardname"))
end if

if Request("boardinfo")="" then 
errmsg = errmsg + "<br>" + "<li>请填写版面说明！</li>"
Founderr=true
elseif len(request("boardinfo"))>120 then
errmsg=errmsg+"<br>"+"<li>版面说明不能超过120个字!</li>"
else
rs("boardinfo") = trim(Request("boardinfo"))
end if

if Request("boardmaster")="" then 
errmsg = errmsg + "<br>" + "<li>请填写版面版主！</li>"
Founderr=true
else
rs("boardmaster") = trim(Request("boardmaster"))
end if
rs("boardpic") = trim(Request("boardpic"))

if founderr=true then
	response.write errmsg
	exit sub
end if
	rs.update
    rs.close
	set rs=nothing

response.write ("<script language=javascript>alert('添加版面成功！');document.location.href='admin_boardadd.asp';</script>")


end sub


%>



