<%@ codepage ="936" %>
<%charset="gb2312"%>
<%Session.CodePage=936%>
<!--#include file="Admin.asp"-->
<!--#include file="Conn.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim Action,BigClassName,rs,FoundErr,ErrMsg
Action=trim(Request("Action"))
BigClassName=trim(request("BigClassName"))
logo=trim(request("logo"))
title=trim(request("title"))
keywords=trim(request("keywords"))
sitedesc=trim(request("sitedesc"))
target=trim(request("target"))
orders=trim(request("orders"))
If orders="" Then orders=0
show=trim(request("show"))
If show="" Then show=0
if Action="Add" then
	if BigClassName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>频道大类名不能为空！</li>"
	end if
	if FoundErr<>True then
		Set rs=Server.CreateObject("Adodb.RecordSet")
		rs.open "Select * From NewsBigClass Where BigClassName='" & BigClassName & "'",conn,1,3
		if not (rs.bof and rs.EOF) then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>频道大类“" & BigClassName & "”已经存在！</li>"
		else
    	 	rs.addnew
     		rs("BigClassName")=BigClassName
     		rs("logo")=logo
     		rs("title")=title
     		rs("keywords")=keywords
     		rs("sitedesc")=sitedesc
     		rs("target")=target
     		rs("orders")=orders
			rs("show")=show
    	 	rs.update
     		rs.Close
	     	set rs=Nothing
    	 	call CloseConn()
			Response.Redirect "News_ClassManage.asp"  
		end if
	end if
end if
if FoundErr=True then
	call WriteErrMsg()
else
%>
<script language="JavaScript" type="text/JavaScript">
function checkBig()
{
  if (document.form1.BigClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.BigClassName.focus();
    return false;
  }
}

function InsertImage()
{
	var toph = screen.availHeight/2-90;
	var left = screen.availWidth/2-200;	window.open("insertfile.asp?Mode=Link","","width=400,height=130,top="+toph+",left="+left);
}
</script>
<!-- #include file="Inc/Head.asp" -->
<div align=center>
<TABLE class=tableBorder1 style="WIDTH: 100%" cellSpacing=0 cellPadding=3 
align=center border=0>
  <TBODY>
  <TR>
    <TD height=50></TD></TR></TBODY></TABLE>
<TABLE class=tableBorder cellSpacing=0 cellPadding=0 width="85%" align=center border=0>
	<tr> 
		<TH align=left height=23 class="tableHeaderText"><div align="center"><font color=white>频 道 类 别 设 置</font></div></TH>
	</tr>
	<tr> 
	  <td height="25" class=forumrow>
        <form name="form1" method="post" action="News_ClassAddBig.asp" onsubmit="return checkBig()">
		<input type="hidden" name="changed" value="no">
        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="2">
          <tr> 
            <td class=forumHeaderBackgroundAlternate height="25" colspan="2" align="center"><strong>添加大类</strong></td>
          </tr>
          <tr> 
            <td class=forumRow_shui width="15%" height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>大类名称：</strong></div></td>
            <td width="85%" bgcolor="#E3E3E3"> 
              <input name="BigClassName" type="text" size="30" maxlength="30">
            </td>
          </tr>

          <tr style="display:none;"> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>Logo地址：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
              <input type="text" name="logo" size="30" maxlength="100" value="http://">&nbsp;<input type=button onclick="InsertImage()" value="上 传">　宽313 px : 高76 px
            </td>

          <tr> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>页面标题：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
              <input name="title" type="text" size="80" maxlength="250">
            </td>
          </tr>

          <tr> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>页面关键字：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
			  <textarea name="keywords" rows="3" cols="80"></textarea>
            </td>
          </tr>

          <tr> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>页面描述：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
              <textarea name="sitedesc" rows="3" cols="80"></textarea>
            </td>
          </tr>

          <tr> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>打开方式：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
              <input name="target" type="radio" value="0" checked>本窗口   <input name="target" type="radio" value="1">新窗口
            </td>
          </tr>

          <tr> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>排序值：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
              <input name="orders" type="text" size="5" maxlength="5" value="0">
            </td>
          </tr>

          <tr style="display:none;"> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>首页推荐值：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
              <input name="show" type="text" size="5" maxlength="5" value="0">　　<font color=#777777>(说明：值越大越靠前显示，最多显示4个)</font>
            </td>
          </tr>

          <tr> 
            <td height="22" align="center" class=forumRow_shui>&nbsp; </td>
            <td height="22" align="center" bgcolor="#E3E3E3"> 
              <div align="left">
                <input name="Action" type="hidden" id="Action" value="Add">
                <input name="Add" type="submit" value=" 添 加 ">
				&nbsp;&nbsp;&nbsp;
				<input name="back" type="button" id="back" value=" 返 回 " onclick="history.go(-1);">
              </div></td>
          </tr>
        </table>
</form> </td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
</div>
<%
end if
call CloseConn()
%>
