<%@language=vbscript codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<!--#include file="zmwbk.asp"-->
<!--#include file="bfdy.asp"-->
<!-- #include file="Inc/Head.asp" -->
<!--#include file="ys.asp"-->
<script language="javascript" type="text/javascript" src="js/getdate/WdatePicker.js"></script>
<style type="text/css">
table{ border:1px solid #D4D4D4; line-height:26px;font-family: Arial, Helvetica, sans-serif;font-size: 12px; background-color:#faf9d1}
table td{BORDER-bottom: #D4D4D4 1px dashed;}
.maintop{ padding-left:20px;width:auto;  font-weight:bold;background:url(images/lin.gif);line-height:30px;font-size:14px;}
</style>
<%
If request.Form("submit") = "提交" Then
Title=Trim(request.form("Title"))
zmone=trim(request.form("zmone"))
zmtwo=trim(request.form("zmtwo"))
zmthree=trim(request.form("zmthree"))
btcolor=trim(request.form("btcolor"))
Content=trim(request.form("Content"))
User=Trim(request.form("User"))
bfnr=Trim(request.form("bfnr"))
ly=Trim(request.form("ly"))
newkey=Trim(request.form("newkey"))
newms=Trim(request.form("newms"))
wlurl=Trim(request.form("wlurl"))
adddate=trim(request("adddate"))
Hits=trim(request.form("Hits"))
zdfy=trim(request.form("zdfy"))
tj=trim(request("tj"))
tt=trim(request("tt"))
gg=trim(request("gg"))
sytj=trim(request("sytj"))

if Title="" then
response.Write "<script language=javascript>alert(""新闻标题不能为空"");window.history.back();</script>"
response.End
end if
if zmone="" then
response.Write "<script language=javascript>alert(""新闻大类不能为空"");window.history.back();</script>"
response.End
end if
if Content="" then
response.Write "<script language=javascript>alert(""新闻内容不能为空"");window.history.back();</script>"
response.End
end if
if zmone="" then 
zmone=0
end if
if zmtwo="" then 
zmtwo=0 
end if
if zmthree="" then 
zmthree=0  
end if
if Hits<>"" then
Hits=CLng(Hits)
else
Hits=0
end if
dim title
title=trim(request("title"))
Set rs = server.CreateObject("adodb.recordset")
rs.open "Select * From news Where title='" & title & "'",conn,1,3
if not (rs.bof and rs.EOF) then
response.Write "<script language=javascript>alert(""新闻名称已经存在"");window.history.back(-1);</script>"
response.End
end if
rs.addnew
rs("Title")=Title
rs("Content")=Content
rs("bfnr")=bfnr
rs("User")=User
rs("btcolor")=btcolor
rs("zmone")=zmone
rs("zmtwo")=zmtwo
rs("zmthree")=zmthree
rs("newkey")=newkey
rs("newms")=newms
rs("adddate")=adddate
rs("ly")=ly
rs("Hits")=Hits
rs("zdfy")=zdfy
rs("wlurl")=wlurl
if tj="yes" then
rs("tj")=True
else
rs("tj")=False
end if
if tt="1" then
rs("tt")=1
else
rs("tt")=0
end if
if gg="yes" then
rs("gg")=True
else
rs("gg")=False
end if
if sytj="yes" then
rs("sytj")=True
else
rs("sytj")=False
end if
rs.update
rs.close
response.Write "<script language=javascript>alert(""恭喜您添加成功"");window.location.href=""news_manage.asp""</script>"
end if
%>
<form method="POST" name="myform" >
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div class="maintop">增加新闻</div></td>
  </tr>
</table>
<table width="98%"  border="0" cellpadding="6" cellspacing="0"  bgcolor="#f9f9f9" align="center">
<tr > 
<td width="700"  >新闻标题：</br></br> <input  name="title" type="text" class="input" size="50" maxlength="200">   
 <input name="btcolor"type="text" id="color"   value="" size="8" /> 
 <input   type="button" id="colorpicker" value="打开取色器" />       </td>
 </tr>
<%
arrClassID=array(cint(request("zmone")),cint(request("zmtwo")),cint(request("zmthree")))
strClassName=""
for arrClassID_i=0 to ubound(arrClassID)
if arrClassID(arrClassID_i)=0 then exit for
set rsc=server.CreateObject("adodb.recordset")
sqlc="select * from newsclass where id="&arrClassID(arrClassID_i)
rsc.open sqlc,conn,1,1
if rsc.eof then exit for
if strClassName="" then
strClassName=rsc("classname")
else
strClassName=strClassName&"<font color=ff0000>·</font>"&rsc("classname")
end if
rsc.close
set rsc=nothing
next
if strClassName="" then strClassName="请选择类别"
%>  
 <tr > 
<td colspan="3">新闻类别：</br></br>
 <div id="strClassName"> <%=strClassName%></div></br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--#include file="xwlb.asp"-->            
<font color="#FF6600">点击图标选择类别</font></td>
<input name="zmone" type="hidden" value="<%=request("zmone")%>" />
<input name="zmtwo" type="hidden" value="<%=request("zmtwo")%>" />
 <input name="zmthree" type="hidden" value="<%=request("zmthree")%>" />
</tr>
 <tr >
<td  valign="top" >新闻关键词:</br></br>
<input name="newkey" type="text" id="newkey" size="100" /></td>
</tr>
<tr >
<td  valign="top" >新闻描述:</br></br>
<input name="newms" type="text" id="newms" size="100" /></td>
</tr>
 <tr >
<td  valign="top" >外链新闻:</br></br>
<input name="wlurl" type="text" id="wlurl" />
（如果不是外链新闻请留空）</td>
</tr>
		   <tr > 
            <td  valign="top" >内容提示：</br></br>
             <textarea name="bfnr" style="width:700px;height:200px;visibility:hidden;"></textarea></td>
          </tr>
          <tr > 
            <td  valign="top" >新闻内容： </br></br>
            <textarea name="content" id="Content"style="width:700px;height:200px;visibility:hidden;"><%=htmlspecialchars(htmlData)%></textarea></td>
          </tr>
		   <tr >
		     <td >手动分页：</br></br><INPUT type=button class="bnt" name="appendHtml" value="插入分页符"></br></br>自动分页：</br></br><input name="zdfy" type="text" id="zdfy"style="background-color: 

#F1F5F8;" onMouseOver="style.backgroundColor='#FFF'" value="0" size="10">
		     （如果采用手动分页请将自动分页设置为0）</td>
	      </tr>
		  
		   <tr >
		     <td  >属性：</br></br>
	         <input name="tj" type="checkbox" id="tj" value="yes">新闻幻灯（获取编辑器第一张图片为首页幻灯图片）
			 <input name="tt" type="checkbox" id="tt" value="1">置顶
			 <input name="sytj" type="checkbox" id="sytj" value="yes">推荐
			 <input name="gg" type="checkbox" id="gg" value="yes"> 公告			 </td>
	      </tr>
          <tr > 
            <td  >发布人：</br></br>
              <input  name="user" type="text" class="input" value="<%=session("AdminName")%>" size="30"></td>
          </tr>
          
          <tr > 
            <td  >来&nbsp;&nbsp;源：</br></br>
            <input name="ly"type="text" id="ly"   value="本站"></td>
          </tr>
          
          <tr > 
            <td height="30"  >发布时间：
                <input  name="adddate" type="text" id="adddate" value="<%=now()%>" onClick="WdatePicker({dateFmt:'yyyy/MM/dd HH:mm:ss'})" maxlength="50">
            </div>提示：【可以定时发布新闻了，点击边框设定时间】</td>
          </tr>
          <tr > 
            <td height="30" align="center" > <input class="bnt"type="submit" name="Submit" value="提交" class="input">
              　             
              <input class="bnt"type="reset" name="Submit2" value="重置" class="input" /></td>
          </tr>       
</table>
</form>
</body>
</html>