<!--#include file="../../Conn.asp" -->
<!--#include file="../../Comm/Site_Class.asp" -->
<%
PagePath = "../../"

Set Qsite = New Site_Class

Qsite.SiteConfig_Master()
%>
<!--#include file="../Check_Login.asp" -->
<%
Qsite.Check_AdminFlag(arrAdminFlag(4 , 1))

Dim Rs,iRs,Sql,i
Dim NewsId,NewsTitle,NewsContent,NewsTypeId

If Request.Form <> "" Then
	NewsTypeId = Qsite.chgStr(Trim(Request.Form("NewsTypeId")))
	NewsTitle = Qsite.chgStr(Trim(Request.Form("NewsTitle")))
	NewsContent = Qsite.chgStrHtml(Trim(Request.Form("NewsContent")))
	
	If NewsTypeId = "" Or IsNull(NewsTypeId) Or Not IsNumeric(NewsTypeId) Then
		Qsite.ShowMsg "请选择资讯分类" , ""
	End If
	If NewsTitle = "" Or IsNull(NewsTitle) Then
		Qsite.ShowMsg "请输入资讯标题" , ""
	End If
	If NewsContent = "" Or IsNull(NewsContent) Then
		Qsite.ShowMsg "请输入资讯内容" , ""
	End If
	
	Conn.Execute("insert into NewsTbl (NewsTitle , NewsContent , NewsTypeId , AddDate) values ('"& NewsTitle &"' , '"& NewsContent &"' , "& NewsTypeId &" , '"& Qsite.FormatDate(Now()) &"')")
	
	Qsite.ShowMsg "资讯添加成功" , "News_Add.asp"
End If
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--文本编辑器部分start-->
<link href="kindeditor/themes/default/default.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="kindeditor/plugins/code/prettify.js"></script>
	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="NewsContent"]', {
				cssPath : 'kindeditor/plugins/code/prettify.css',
				uploadJson : 'kindeditor/upload_json.asp',
				fileManagerJson : 'kindeditor/file_manager_json.asp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=PosForm]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=PosForm]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
      
<!--文本编辑器部分end-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>新闻管理</title>
<link href="../style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE2 {color: #FF0000; font-size: 12px;}
-->
</style>
</head>

<body>
<form name="PosForm" method="post" action="News_Add.asp" style="margin:0">
	<table width="100%" border="0" cellspacing="1" cellpadding="5">
		<tr>
			<td height="25" colspan="2" class="td_title">资讯信息添加<p class="STYLE2">特别说明：如果你上传图片不能正常显示，请检查你网站域名设置正确否。建议传到空间设置好域名使用。如果要在本地测试，请设置本地域名为 http://127.0.0.1/jobjy/ 其中jobjy 为你测试网站所在的文件夹。 设置：后台/常规管理/基本设置 中 。 </p></td>
		</tr>
		<tr>
			<td width="10%" height="23" class="td_content">资讯分类：</td>
			<td width="82%" height="23" class="td_content"><select name="NewsTypeId" class="input_1" id="NewsTypeId">
				<option value="">请选择资讯分类</option>
				<%
				Set Rs = server.createobject("ADODB.Recordset")
				Rs.Open "select * from NewsTypeTbl order by Px asc" , Conn , 1 , 1
				Do While Not Rs.Eof
					Response.Write("<option value="""& Rs("NewsTypeId") &""">"& Rs("NewsTypeName") &"</option>")
					
				Rs.MoveNext
				Loop
				Rs.Close
				set rs  = nothing
				%>
			</select>			</td>
		</tr>
		<tr>
			<td height="23" class="td_content">资讯标题：</td>
			<td height="23" class="td_content"><input name="NewsTitle" type="text" class="input_1" id="NewsTitle" size="60"></td>
		</tr>
		<tr>
			<td height="23" class="td_content">资讯内容：</td>
			<td height="23" class="td_content"><textarea name="NewsContent" class="input_1" id="NewsContent" style="width:750px;height:350px;visibility:hidden;"></textarea>
			</td>
		</tr>
		<tr>
			<td height="23" class="td_content">&nbsp;</td>
			<td height="23" class="td_content"><input name="Submit" type="submit" class="input_1" value=" 添  加 "> &nbsp;
			<input name="Submit" type="reset" class="input_1" value=" 重  置 "></td>
		</tr>
	</table>
    
</form>
</body>
</html>
