<!-- #include file="share.asp" -->
<% checkauthority %>
<%
dim isok
isok=request.form("isok")
if isok="yes" then
	addboard request.form("bdname"),request.form("bddetail"),request.form("bdlogo")
else
	showcreateform
end if
conn.close
set conn=nothing
%>

<%
function addboard(bdname,bddetail,bdlogo)
	dim emsg
	emsg=""
	if trim(bdname)="" then
		emsg="版面名字不能为空。"
		if trim(bdlogo)="" then
			emsg=emsg&"版面logo不能为空。"
		end if
	else
		dim rs
		dim sql
		sql="select * from board"
		set rs=server.createobject("adodb.recordset")
		rs.open sql,conn,1,3
		rs.addnew
		rs("bdname")=bdname
		rs("bddetail")=bddetail
		rs("bdlogo")=bdlogo
		rs.update
		rs.close
		set rs=nothing
	end if
	if emsg="" then
		showok
	else
		showerr emsg
	end if
end function
%>

<% sub showerr(emsg) %>
	<script language="javascript">
		alert("<%=emsg%>");
		history.back();
	</script>
<% end sub %>

<% sub showok%>
	<script language="javascript">
	if(confirm("添加操作完成！继续添加吗？")){
		location="bd_create.asp";
	}else{
		location="index.asp";
	}
	</script>
<% end sub %>


<% sub showcreateform %>
<html>
<head>
<!-- #include file="top.asp" -->
<title>3鸟设社[色彩连视版]T恤论坛管理-版面添加</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../blue.css" type="text/css">
<style type="text/css">
<!--
.hand { cursor: hand }
-->
</style>
</head>
<body bgcolor=#ffffff leftmargin="0" topmargin="0">
<table width="760" height="647" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
      
    <td width="20" height="9" bgcolor="#FFFFFF"></td>
      
    <td width="719" height="9"></td>
      
    <td width="21" height="9" bgcolor="#FFFFFF"></td>
    </tr>
    <tr>
        <td width="25" height="455" background="images/bg.gif"><p>&nbsp;</p>
      <p>&nbsp;</p></td>
        
    <td width="719" height="455" valign="top"><table width="720" border="0" cellspacing="0">
        <tr> 
          <td height="49"> <div align="center"><a href=".."><br>
              <br>
              <br>
              <br>
              <!-- TemplateBeginEditable name="atthere" --> [<a href="..">返回论坛</a>] 
              [<a href="index.asp">返回管理首页</a><!-- TemplateEndEditable --></a><br>
              <br>
            </div></td>
        </tr>
        <tr> 
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="left" valign="top"> <!-- TemplateBeginEditable name="edithere" --> 
                  <table width="62%" height="73" border="0" align="center" cellpadding="0" cellspacing="3">
                    <tr align="left" valign="top"> 
                      <td width="80%"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="13%" height="20" align="left" valign="middle"><div align="right"><font class="subtitle"><img src="../images/frame_forum2.gif" align="absmiddle"></font></div></td>
                            <td width="87%" align="left" valign="middle" background="../images/frame_bg.gif"><font class="subtitle">创建新的论坛版面</font></td>
                          </tr>
                        </table>
                        <form name="createfrm" action="bd_create.asp" method="post">
                          <table width="360" border="0" cellspacing="1" cellpadding="0">
                            <tr> 
                              <td align="right" width="180">新版面的名字： </td>
                              <td align="left"> <input type="text" name="bdname" value=""> 
                              </td>
                            </tr>
                            <tr> 
                              <td align="right" width="180" valign="top">新版面的介绍： 
                              </td>
                              <td> <textarea cols="30" rows="5" name="bddetail"></textarea> 
                              </td>
                            </tr>
                            <tr> 
                              <td align="right" width="180" valign="top">新版面的logo图片： 
                              </td>
                              <td> <input type="text" name="bdlogo" value=""> 
                              </td>
                            </tr>
                            <tr> 
                              <td colspan="2" align="center"> <input type="submit" name="submitbtn" value="执行"> 
                                &nbsp;&nbsp; <input type="button" name="cancelbtn" value="取消" onclick="location='index.asp';"> 
                                <input type="hidden" name="isok" value="yes"> 
                              </td>
                            </tr>
                          </table>
                        </form></td>
                      <td width="20%"> </td>
                    </tr>
                  </table>
                  <!-- TemplateEndEditable --></td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
        </tr>
      </table></td>
        
    <td width="25" height="451" background="images/bg.gif"></td>
    </tr>
    <tr>
      <td height="12" colspan="3"><div align="center">
        <table width="760" border="0" align="center" cellspacing="0">
          <tr background="images/footbg.gif"> 
            <td height="35" colspan="2"> 
              <div align="center">3鸟设社[v1.2色彩连视]T恤论论坛 www.3niao.com</div></td>
          </tr>
          <tr> 
            <td width="392" background="http://www.3niao.com/v2/down1/images/footgb1.gif">&nbsp;</td>
            <td width="362"><div align="right"><img src="http://www.3niao.com/v2/down1/images/foot.jpg"></div></td>
          </tr>
        </table>
      </div></td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>
<% end sub %>