<!--#include file="conn.asp"-->
<%
if request.Form("action")="news_add" then
call news_add
end if
sub news_add()
news_title=trim(request.form("news_title"))
types=request.form("types")
pic=trim(request.form("pic"))
news_content=trim(request.form("news_content"))
if pic="" then pic="-" end if
if news_content="" then news_content="-" end if

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from news"
rs.open sql,conn,1,3
rs.addnew
rs("news_title")=news_title
rs("types")=types
rs("pic")=pic
rs("news_content")=news_content
rs("idate")=now()
rs.update
rs.close
set rs=nothing
response.redirect "addok.asp?url=news_add.asp&n_url=news.asp"
response.end
end sub %>

<script language="JavaScript">
<!--
function  check() {
  if (news_add.news_title.value=="") {
		alert("请填写标题！");
		news_add.news_title.focus();		
		    return (false);
  }
 else
	document.news_add.submit();
}// -->
</script>
<HTML><HEAD><TITLE>PCBaoJia.com</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<LINK href="style.css" rel=stylesheet type=text/css>
</HEAD>
<BODY leftmargin="0" topmargin="0">
<div align="center"> 
<FORM action="" method=post name=news_add>
          <p>&nbsp;</p>
          <TABLE width="600" border=0 align=center cellPadding=0 cellSpacing=0>
            <TBODY>
  <TR align=middle>
    <TD>
      <TABLE width="600" border=0 align=center cellPadding=5 cellSpacing=1 
      borderColorLight=#cccccc borderColorDark=white bgColor=#999999 class=para1>
                    <TBODY>
                      <TR align="center" bgcolor="FBFED7"> 
                        <TD colSpan=2 class=title><font style="font-size:15px;font-weight:bold">添加新闻</font></TD>
                      </TR>
					  <TR bgcolor="FBFED7"> 
                        <TD width="115" align="right" bgcolor="#FDFEF5" class=para1>* 新闻标题</TD>
                        <TD width="462" bgcolor="#FFFFFF"> <INPUT name=news_title id="news_title" size="45"></TD>
                      </TR>
					  <TR bgcolor="FBFED7"> 
                        <TD width="115" align="right" bgcolor="#FDFEF5" class=para1>* 新闻类型</TD>
                        <TD width="462" bgcolor="#FFFFFF">
						<input type="radio" name="types" value="消费导购">
						消费导购
						<input name="types" type="radio" value="新闻热点" checked>
						新闻热点
						<input type="radio" name="types" value="硬件评测">
						硬件评测
						<input type="radio" name="types" value="电脑维护">
						电脑维护                        
                        </TD>
                      </TR>
					  <TR bgcolor="FBFED7"> 
                        <TD align="right" bgcolor="#FDFEF5" class=para1>图片</TD>
                        <TD bgcolor="#FFFFFF"> <INPUT name=pic id="pic" size="30"> 
          <input type="button" name="Submit2" value="上传图片" onClick="window.open('../upload_flash.asp?formname=news_add&editname=pic&uppath=uppic','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">                         
                        <font 
            color=#ff0000>（没有可以不填）</font></TD>
                      </TR>
					  <TR bgcolor="FBFED7"> 
                        <TD align="right" bgcolor="#FDFEF5" class=para1>内容</TD>
                        <TD bgcolor="#FFFFFF"> <textarea name="news_content" cols="60" rows="20"></textarea></TD>
                      </TR>
                    </TBODY>
            </TABLE></TD></TR>
  <TR align=middle>
                <TD height=30 align="center" bgcolor="#999999"><br>
<INPUT name=B1 type=button onClick="check()" value="提 交">
<INPUT name=Reset type=reset value=重新填写>
<INPUT name=action type=hidden value=news_add>
                  <br>
                <br>    </TD>
  </TR></TBODY></TABLE>
  </FORM>
</div>
</BODY>
</HTML>
