<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加新闻</title>
<link type="text/css" rel="stylesheet" href="../Css/style.css" />
<script language="javascript" type="text/javascript" src="../jQuery/lib/jquery.js"></script>
<script language="javascript" type="text/javascript" src="../js/WebSite.js"></script>
<script language="javascript" type="text/javascript" src="../js/ChkForm.js"></script>
<script language="JavaScript" type="text/javascript" src="../js/Calendar.js"></script>
</head>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Function.asp"-->
<!--#include file="../FCKeditor/fckeditor.asp" -->
<body>
<%
Call ChkLogin(session("WebAdminsUserName"))
Call ConnectionDataBase(2)
 
id=0
SortID=1
Act = Request.QueryString("Act")
IF Act = "Edit" Then
	id = Request.QueryString("id")
	Call ChkIsNumber(id,"参数类型错误!")
	Sql = "SELECT TOP 1 * FROM T_Baike WHERE ID=" & id
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then
		CID = Rs("ClassID")
		NewsTitle = Rs("NewsTitle")		
		SortID = Rs("SortID")
		Content = Rs("Content")		
		Position=Rs("Position")
		FilePath=Rs("FilePath")	
	End IF
End IF
%>
<form action="Submit.asp" method="post" name="frm" style="margin:0" onsubmit="return ChkSubmitNews();">
<input type="hidden" name="action" value="AddNews" />
<input type="hidden" name="ID" value="<%=id%>" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">  
  <tr>
    <td width="15%" align="right">百科分类：</td>
    <td width="85%" align="left">
    <select name="NewsCategory" id="NewsCategory">
    <option value="0" selected>请选择类别</option>
    <%
	Sql="SELECT * FROM T_Class WHERE CateID=333 AND ParentID=0 ORDER BY SortID DESC,ID ASC"
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then
	Do While Not Rs.EOF
	iCount = iCount + 1
	ClassName = Rs("ClassName")
	ClassID = Rs("ID")
    %>
    <option value="<%=ClassID%>" <%IF Cstr(ClassID)=Cstr(CID) Then Response.Write "Selected"%>><%=ClassName%></option>
	<%
	  Call SubCategory(Rs("ID"),"&nbsp;&nbsp;&nbsp;&nbsp;")
	  Rs.movenext
	Loop
	End IF
	DisRs Rs
    %>
    </select>
    </td>
  </tr>
  <tr>
    <td width="15%" align="right">标题：</td>
    <td width="85%" align="left"><input type="text" name="NewsTitle" id="NewsTitle" class="txt" value="<%=NewsTitle%>" /></td>
  </tr>
  <tr>
    <td width="15%" align="right">图片：</td>
    <td width="85%" align="left">
	<input type="text" name="FilePath" id="FilePath" class="txt" value="<%=FilePath%>" />
    <input type="button" value="添加图片" class="btn2" onClick="window.open('../Public/UpLoad.asp?formname=frm&EditName=FilePath&filepath=Baike&fileType=gif,jpg,png','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"> 支持格式:gif,jpg,png,建议上传大小不大于:480px * 344px
	</td>
  </tr>  
   <tr>
    <td align="right">排序：</td>
    <td align="left"><input type="text" name="SortID" id="SortID" class="txt" value="<%=SortID%>" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"> 数字越大,排位越靠前</td>
  </tr>
  <tr>
    <td align="right">详细内容：</td>
    <td align="left">
    	<% 
		Dim oFCKeditor
		Set oFCKeditor = New FCKeditor
		oFCKeditor.BasePath = "../FCKeditor/" '设置编辑器的路径，我站点根目录下的一个目录
		oFCKeditor.ToolbarSet = "Define"
		oFCKeditor.Width = "98%"
		oFCKeditor.Height = "300"
		
		oFCKeditor.Value = Content '这个是给编辑器初始值
		oFCKeditor.Create "Content" '以后编辑器里的内容都是由这个logbody取得，命名由你定		
		%>
    </td>
  </tr>
  <tr>
    <td width="15%" align="right">显示位置:</td>
    <td width="85%" align="left">
	<input type="radio" name="position" id="position" value="1" <%IF Position=1 Then Response.Write("checked")%> />图片显示 
	<input type="radio" name="position" id="position" value="2" <%IF Position=2 Then Response.Write("checked")%> />头条 
	<input type="radio" name="position" id="position" value="3" <%IF Position=3 Then Response.Write("checked")%> />推荐
	</td>
  </tr> 
  <tr>
    <td align="right">&nbsp;</td>
    <td align="left"><input type="submit" class="btn" value="提交" /><input type="reset" class="btn" value="重置"></td>
  </tr>  
</table>
</form>
</body>
</html>
