<!--#include file="../conn2.asp"-->
<!--#include file="set.asp"-->
<%
if request("act")="add" then
logo=request.form("logo")
bidname=request.form("bidname")
bidinfo=request.form("bidinfo")
px=request.form("px")
rzh=request.form("advshow")
username=request.form("username")

set rs=server.createobject("adodb.recordset")
sql="select * from board where bidname='"&bidname&"'"
rs.open sql,conn,3,2
if not rs.eof then
response.write"<script language='javascript'>alert('论坛名称重复！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
rs.addnew
rs("bidname")=bidname
rs("logo")=logo
rs("px")=px
rs("bidinfo")=bidinfo
rs("rzh")=rzh
rs("username")=username
rs.update
set rs=nothing
set conn=nothing
response.redirect "boardman.asp"
end if
if request("act")="del" then
conn.execute"delete from board where bid="&request("bid")
conn.execute"delete from bbs_class2 where class2_class1_id="&request("bid")
conn.execute"delete from bbs_class3 where class3_class1_id="&request("bid")
conn.execute"delete from book where bid="&request("bid")
response.redirect "boardman.asp"
end if
%>

<head>
<LINK href="css.css" type=text/css rel=stylesheet>

<title></title>
<style type="text/css">
<!--
.style1 {color: #000000}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>

<body topmargin="2" leftmargin="2">
<br>
<div align="center">
<center>
    <table width="609" border="0" cellpadding="2" cellspacing="1" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
      <tr bgcolor="f1f1f1"> 
        <td height="25" colspan="3" bgcolor="f1f1f1" class="norightbuttonborder2"><div align="center" class="style1"><strong>一级栏目管理</strong></div></td>
      </tr>
      <tr bgcolor="#FFFFFF"> 
        <td width="75" height="25"> <p align="center"><strong>排序</strong></td>
        <td width="324" height="25"> 
          <p align="center"><b>论坛名称</b></td>
        <td height="25"> <p align="center"><b>管理操作</b></p></td>
      </tr>
      <%
    	set bidreco=server.createobject("adodb.recordset")
    	sqlstr="select * from board order by px"
    	bidreco.open sqlstr,conn,1,1
		i=1
        do while not bidreco.eof
	%>
      <tr bgcolor="#FFFFFF"> 
        <td width="75" height="25" align="center"><%=bidreco("px")%>　</td>
        <td width="324" height="25" align="center"><%=bidreco("bidname")%>　</td>
        <td height="25" align="center" bgcolor="#FFFFFF"><a href="edit_board.asp?bid=<%=bidreco("bid")%>&action=edit">修改</a>  <a href="#" onClick="if(confirm('真的要删除吗？')){window.location.href='boardman.asp?bid=<%=bidreco("bid")%>&act=del'}">删除</a></td>
      </tr> 
      <%  i=i+1
			bidreco.movenext  
			loop  
			set bidreco=nothing  
			set conn=nothing %> 
    </table> 
  </center> 
</div> 
<br>
<table width="609" border="0" align="center" cellpadding="2" cellspacing="1" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
  <form method="post" name="form" action="boardman.asp?act=add" onSubmit="return ck1()">
    <tr bgcolor="#FFFFFF"> 
      <td height="23" colspan="2" align="center" bgcolor="f1f1f1" class="norightbuttonborder2"><span class="style1"><strong>新增栏目</strong></span></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="30%" height="23" align="center"><div align="right">论坛名称：</div></td>
      <td width="70%" height="23"> <input type="text" name="bidname" size="49" maxlength="60" class=wenbenkuang> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="30%" height="23" align="center"><div align="right">论坛logo：</div></td>
      <td width="70%"> <input type="text" name="logo" size="49" maxlength="60" class=wenbenkuang value="images/boy_1.gif"> 
        <a href=# onClick="window.open('/upload.asp?formname=form&editname=logo&infoname=bbs&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=35')">上传图片</a></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="30%" height="23" align="center"><div align="right">论坛排序：</div></td>
      <td width="70%" height="23"> <input name="px" type="text" class=wenbenkuang value="<%=i%>" size="17" maxlength="60" onKeyPress="return event.keyCode>=48&&event.keyCode<=57">
        请填写数字 </td>
    </tr><tr bgcolor="#FFFFFF">
          <td height="11" align="center"><div align="right"> 是否认证论坛：</div></td>
          <td width="70%" height="11"><INPUT id=advcheck name=advshow type=checkbox value=1  onclick=showadv()>
          <label for=advcheck> 是（选中即必需是认证会员才能进入）</label></td>
        </tr> <tr bgcolor="#FFFFFF" id=adv style=DISPLAY:none> 
    <td height="25" colspan="2">  
      <table border="0" width="100%" cellpadding="2" cellspacing="1" bordercolordark="#FFFFFF" >
        <tr>
          <td width="30%">
            <p align="right">认证用户：</td>
          <td width="70%"><font color="#336699"> 
          <textarea name="username" cols="60" rows="5" class="wenbenkuang" id="username"></textarea><br>
          请用,号分开，如“用户一,用户二”</font></td>
        </tr>
    </table>    </td>
  </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="30%" height="79" align="center"><div align="right">论坛介绍：</div></td>
      <td width="70%" height="79"> <textarea name="bidinfo" cols="48" rows="5" class="wenbenkuang" ></textarea> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="29" colspan="2" align="center"> <p align="center"> 
          <input name="B12" type="submit" class="go-wenbenkuang" value=" 提 交">
        </p></td>
    </tr>
  </form>
</table>
 
</body> 
<script>
function showadv(){
if (document.form.advshow.checked == true) {
adv.style.display = "";
}else{
adv.style.display = "none";
}
}
function ck1()
{




if(form.bidname.value=="")
{
alert("请输入名称")
form.bidname.focus()
return false
}
if(form.logo.value=="")
{
alert("请输入logo")
form.logo.focus()
return false
}
if(form.px.value=="")
{
alert("请输入排序")
form.px.focus()
return false
}
if(form.bidinfo.value=="")
{
alert("请输入介绍")
form.bidinfo.focus()
return false
}

}


</script>
 

 
