<!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">
<!--#include file="../inc/Conn.asp"-->
<!--#include file="../inc/Config.asp"-->
<!--#include file="../inc/Function.asp"-->
<!--#include file="Adminqx.asp"--><%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
dim action,id,pagenum,classid,keyword
action = request.querystring("action")
keyword = request.form("keyword")
if keyword = "" then keyword = UTF2GB(request.querystring("keyword"))
id = request.querystring("id")

classid = request.form("classid")
if classid = "" then classid = request.querystring("classid")
if classid = "0" or classid = "" then classid = 1
If request.querystring("pagenum") = 0 Or request.querystring("pagenum") = "" Then
pagenum = 1 
Else
pagenum = request.querystring("pagenum")
End If
%>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新闻管理</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="Js/Msgbox.js" type="text/javascript"></script>
<script language="javascript" src="Js/Windowsopen.js" type="text/javascript"></script>
<script language="javascript" src="../Editor/scripts/language/schi/editor_lang.js" type="text/javascript"></script>
<%
if InStr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then
	Response.Write "<script language=JavaScript src='../Editor/scripts/editor.js'></script>"
else
	Response.Write "<script language=JavaScript src='../Editor/scripts/moz/editor.js'></script>"
end if
%>
</head>

<body>
<div class="warning">
	<strong>提示： </strong>创建或编辑新闻之后要及时发布网页！您还可以为每个新闻分配不同的模板！</div>
<div class="pagetitle">
	<%
	select case classid
	case "" , 1
	%>
	<div class="ypagetit">
		<span class="toright"><img src="Images/pagetit_1_r.gif" alt="" /></span>
		<span class="toleft"><img src="Images/pagetit_1_l.gif" alt="" /></span>
		<a href="?action=&classid=1">公司新闻</a></div>
	<%
	case else
	%>
	<div class="npagetit">
		<span class="toright"><img src="Images/pagetit_2_r.gif" alt="" /></span>
		<span class="toleft"><img src="Images/pagetit_2_l.gif" alt="" /></span>
		<a href="?action=&classid=1">公司新闻</a></div>
	<%
	end select
	select case classid
	case 2
	%>
	<div class="ypagetit">
		<span class="toright"><img src="Images/pagetit_1_r.gif" alt="" /></span>
		<span class="toleft"><img src="Images/pagetit_1_l.gif" alt="" /></span>
		<a href="?classid=2">业内资讯</a></div>
	<%
	case else
	%>
	<div class="npagetit">
		<span class="toright"><img src="Images/pagetit_2_r.gif" alt="" /></span>
		<span class="toleft"><img src="Images/pagetit_2_l.gif" alt="" /></span>
		<a href="?classid=2">业内资讯</a></div>
	<%
	end select
	select case classid
	case 3
	%>
	<div class="ypagetit">
		<span class="toright"><img src="Images/pagetit_1_r.gif" alt="" /></span>
		<span class="toleft"><img src="Images/pagetit_1_l.gif" alt="" /></span>
		<a href="?classid=3">产品动态</a></div>
	<%
	case else
	%>
	<div class="npagetit">
		<span class="toright"><img src="Images/pagetit_2_r.gif" alt="" /></span>
		<span class="toleft"><img src="Images/pagetit_2_l.gif" alt="" /></span>
		<a href="?classid=3">产品动态</a></div>
	<%
	end select
	%> </div>
<div class="pagetitle-b">
</div>
<%
select case action
'新闻列表
case ""
set rs=server.CreateObject("adodb.recordset")
if keyword <> "" then
rs.open "select * from [Hu_news] where newstitle like '%"&keyword&"%' and cid="&classid&" and recycle=0 order by id desc",conn,1,1
else
rs.open "select * from [Hu_news] where cid="&classid&" and recycle=0 order by id desc",conn,1,1
end if
if not(rs.bof and rs.eof) then
rs.pagesize = 15 '每页显示的标签数量
pagecount1 = rs.pagecount
rs.absolutepage = pagenum
end if
%>
<form method="post" name="form1" id="form1" action="" target="msgokmain">
	<ul class="label-1">
		<li class="label-2-2"><a href="?action=&classid=<%=classid%>">
		<%
		if classid = 1 then
		response.write "公司新闻"
		elseif classid = 2 then
		response.write "业内资讯"
		elseif classid = 3 then
		response.write "产品动态"
		else
		response.write "ERR"
		end if
		%>
		</a></li>
		<li class="label-2-1"><a href="?action=recycle&classid=<%=classid%>">回收站</a></li>
		<li class="label-2-1"><a href="?action=search&classid=<%=classid%>">搜索</a></li>
		<li class="label-2-1"><a href="?action=addnews&classid=<%=classid%>">发布新闻</a></li>
		<li style="float: right;"><%=kehupage(pagenum,pagecount1,"news.asp?classid="&classid&"&keyword="&toUTF8(keyword)&"")%></li>
	</ul>
	<div class="list-1">
		<ul class="list-2">
			<li style="width: 10%;">序号</li>
			<li style="width: 10%;">选择</li>
			<li style="width: 40%;">新闻标题</li>
			<li style="width: 20%;">修改时间</li>
			<li style="max-width: 20%; min-width: 19%;">操作</li>
		</ul>
		<%
		if not(rs.bof and rs.eof) then
		dim i
		i=0
		%>
		<table style="width: 100%;" cellspacing="1">
			<%
		do while not rs.eof and i < rs.pagesize
		i = i+1
		%>
			<tr style="background: #fafafa;">
				<td style="width: 10%; height: 25px; text-align: center;"><%=rs("id")%></td>
				<td style="text-align: center; width: 10%; height: 25px;">
				<input id="id" name="id" type="checkbox" value='<%=rs("id")%>' /></td>
				<td style="width: 40%; text-align: left; height: 25px;"><%=rs("newstitle")%></td>
				<td style="width: 20%; text-align: center; height: 25px;"><%=rs("addtime")%></td>
				<td style="width: 20%; text-align: center; height: 25px;">
				<a href='?action=edit&amp;id=<%=rs("id")%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&amp;keyword=<%=toUTF8(keyword)%>'>
				<img alt="编辑" src="Images/nav/edit.gif" /></a>&nbsp;
				<a href="#" onclick='showmsgok(&#039;确定要将这条记录放进回收站吗？&#039;,&#039;news.asp?action=huishou&amp;id=<%=rs("id")%>&amp;keyword=<%=toUTF8(keyword)%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&#039;)'>
				<img alt="放进回收站" src="Images/nav/recycle.gif" /></a>&nbsp;
				<a href="#" onclick='showmsgok(&#039;确定要将这条记录彻底删除吗？&#039;,&#039;news.asp?action=del&amp;id=<%=rs("id")%>&amp;keyword=<%=toUTF8(keyword)%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&#039;)'>
				<img alt="彻底删除" src="Images/nav/dele.gif" /></a></td>
			</tr>
			<%
			rs.movenext
			if not rs.eof and i < rs.pagesize then
			i = i+1
			%>
			<tr style="background: #f6f4f4;">
				<td style="width: 10%; height: 25px; text-align: center;"><%=rs("id")%></td>
				<td style="text-align: center; width: 10%; height: 25px;">
				<input id="id" name="id" type="checkbox" value='<%=rs("id")%>' /></td>
				<td style="width: 40%; text-align: left; height: 25px;"><%=rs("newstitle")%></td>
				<td style="width: 20%; text-align: center; height: 25px;"><%=rs("addtime")%></td>
				<td style="width: 20%; text-align: center; height: 25px;">
				<a href='?action=edit&amp;id=<%=rs("id")%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&amp;keyword=<%=toUTF8(keyword)%>'>
				<img alt="编辑" src="Images/nav/edit.gif" /></a>&nbsp;
				<a href="#" onclick='showmsgok(&#039;确定要将这条记录放进回收站吗？&#039;,&#039;news.asp?action=huishou&amp;id=<%=rs("id")%>&amp;keyword=<%=toUTF8(keyword)%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&#039;)'>
				<img alt="放进回收站" src="Images/nav/recycle.gif" /></a>&nbsp;
				<a href="#" onclick='showmsgok(&#039;确定要将这条记录彻底删除吗？&#039;,&#039;news.asp?action=del&amp;id=<%=rs("id")%>&amp;keyword=<%=toUTF8(keyword)%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&#039;)'>
				<img alt="彻底删除" src="Images/nav/dele.gif" /></a></td>
			</tr>
			<%
			rs.movenext
			end if
			loop
			%>
		</table>
		<%
		end if
		rs.close
		set rs=nothing
		%> </div>
	<div style="margin-left: 6px; margin-right: 6px;">
		<table style="width: 100%; height: 30px;" cellspacing="1">
			<tr>
				<td style="width: 10%; text-align: center;">全部选中</td>
				<td style="width: 10%; text-align: center;">
				<input name="chkall" id="chkall" type="checkbox" onclick="CheckAll(this.form)" /></td>
				<td style="width: 20%;">
				<input name="Button1" class="sub-del" type="submit" value="回收站" onclick="document.form1.action='?action=huishouall&amp;classid=<%=classid%>&amp;keyword=<%=toUTF8(keyword)%>';" />
				<input name="Button2" class="sub-del" type="submit" value="删除" onclick="document.form1.action='?action=delall&amp;classid=<%=classid%>&amp;keyword=<%=toUTF8(keyword)%>';" /></td>
				<td style="text-align: right; padding-right: 10px;"><%=kehupage(pagenum,pagecount1,"news.asp?classid="&classid&"&keyword="&toUTF8(keyword)&"")%></td>
			</tr>
		</table>
	</div>
</form>
<%
case "recycle"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [Hu_news] where cid="&classid&" and recycle=1 order by id",conn,1,1
if not(rs.bof and rs.eof) then
rs.pagesize = 15 '每页显示的标签数量
pagecount1 = rs.pagecount
rs.absolutepage = pagenum
end if
%>
<form method="post" name="form1" id="form1" action="" target="msgokmain">
	<ul class="label-1">
		<li class="label-2-1"><a href="?action=&classid=<%=classid%>">
		<%
		if classid = 1 then
		response.write "公司新闻"
		elseif classid = 2 then
		response.write "业内资讯"
		elseif classid = 3 then
		response.write "产品动态"
		else
		response.write "ERR"
		end if
		%>
		</a></li>
		<li class="label-2-2"><a href="?action=recycle&classid=<%=classid%>">回收站</a></li>
		<li class="label-2-1"><a href="?action=search&classid=<%=classid%>">搜索</a></li>
		<li class="label-2-1"><a href="?action=addnews&classid=<%=classid%>">发布新闻</a></li>
		<li style="float: right;"><%=kehupage(pagenum,pagecount1,"news.asp?action=recycle&classid="&classid&"&keyword="&toUTF8(keyword)&"")%></li>
	</ul>
	<div class="list-1">
		<ul class="list-2">
			<li style="width: 10%;">序号</li>
			<li style="width: 10%;">选择</li>
			<li style="width: 40%;">新闻标题</li>
			<li style="width: 20%;">修改时间</li>
			<li style="max-width: 20%; min-width: 19%;">操作</li>
		</ul>
		<%
		if not(rs.bof and rs.eof) then
		i=0
		%>
		<table style="width: 100%;" cellspacing="1">
			<%
		do while not rs.eof and i < rs.pagesize
		i = i+1
		%>
			<tr style="background: #fafafa;">
				<td style="width: 10%; height: 25px; text-align: center;"><%=rs("id")%></td>
				<td style="text-align: center; width: 10%; height: 25px;">
				<input id="id" name="id" type="checkbox" value='<%=rs("id")%>' /></td>
				<td style="width: 40%; text-align: left; height: 25px;"><%=rs("newstitle")%></td>
				<td style="width: 20%; text-align: center; height: 25px;"><%=rs("addtime")%></td>
				<td style="width: 20%; text-align: center; height: 25px;">
				<a href="#" onclick='showmsgok(&#039;确定要将这条记录还原吗？&#039;,&#039;news.asp?action=huangyuan&amp;id=<%=rs("id")%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&#039;)'>
				<img alt="还原到列表" src="Images/nav/reset.gif" /></a>&nbsp;
				<a href="#" onclick='showmsgok(&#039;确定要将这条记录彻底删除吗？&#039;,&#039;news.asp?action=del&amp;id=<%=rs("id")%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&#039;)'>
				<img alt="彻底删除" src="Images/nav/dele.gif" /></a></td>
			</tr>
			<%
			rs.movenext
			if not rs.eof and i < rs.pagesize then
			i = i+1
			%>
			<tr style="background: #f6f4f4;">
				<td style="width: 10%; height: 25px; text-align: center;"><%=rs("id")%></td>
				<td style="text-align: center; width: 10%; height: 25px;">
				<input id="id" name="id" type="checkbox" value='<%=rs("id")%>' /></td>
				<td style="width: 40%; text-align: left; height: 25px;"><%=rs("newstitle")%></td>
				<td style="width: 20%; text-align: center; height: 25px;"><%=rs("addtime")%></td>
				<td style="width: 20%; text-align: center; height: 25px;">
				<a href="#" onclick='showmsgok(&#039;确定要将这条记录还原吗？&#039;,&#039;news.asp?action=huangyuan&amp;id=<%=rs("id")%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&#039;)'>
				<img alt="还原到列表" src="Images/nav/reset.gif" /></a>&nbsp;
				<a href="#" onclick='showmsgok(&#039;确定要将这条记录彻底删除吗？&#039;,&#039;news.asp?action=del&amp;id=<%=rs("id")%>&amp;classid=<%=classid%>&amp;pagenum=<%=pagenum%>&#039;)'>
				<img alt="彻底删除" src="Images/nav/dele.gif" /></a></td>
			</tr>
			<%
			rs.movenext
			end if
			loop
			%>
		</table>
		<%
		end if
		rs.close
		set rs=nothing
		%> </div>
	<div style="margin-left: 6px; margin-right: 6px;">
		<table style="width: 100%; height: 30px;" cellspacing="1">
			<tr>
				<td style="width: 10%; text-align: center;">全部选中</td>
				<td style="width: 10%; text-align: center;">
				<input name="chkall" id="chkall" type="checkbox" onclick="CheckAll(this.form)" /></td>
				<td style="width: 20%;">
				<input name="Button1" class="sub-del" type="submit" value="还原" onclick="document.form1.action='?action=huangyuanall&amp;classid=<%=classid%>';" />
				<input name="Button2" class="sub-del" type="submit" value="删除" onclick="document.form1.action='?action=delall&amp;classid=<%=classid%>&amp;keyword=<%=toUTF8(keyword)%>';" /></td>
				<td style="text-align: right; padding-right: 10px;"><%=kehupage(pagenum,pagecount1,"news.asp?action=recycle&classid="&classid&"&keyword="&toUTF8(keyword)&"")%></td>
			</tr>
		</table>
	</div>
</form>
<%
case "search"
%>
	<ul class="label-1">
		<li class="label-2-1"><a href="?action=&classid=<%=classid%>">
		<%
		if classid = 1 then
		response.write "公司新闻"
		elseif classid = 2 then
		response.write "业内资讯"
		elseif classid = 3 then
		response.write "产品动态"
		else
		response.write "ERR"
		end if
		%>
		</a></li>
		<li class="label-2-1"><a href="?action=recycle&classid=<%=classid%>">回收站</a></li>
		<li class="label-2-2"><a href="?action=search&classid=<%=classid%>">搜索</a></li>
		<li class="label-2-1"><a href="?action=addnews&classid=<%=classid%>">发布新闻</a></li>
		<li style="float: right;"><%=kehupage(pagenum,pagecount1,"news.asp?classid="&classid&"&keyword="&toUTF8(keyword)&"")%></li>
	</ul>
<div class="list-1">
	<ul class="list-2">
		<li style="width: 100%;">新闻资讯搜索</li>
	</ul>
	<form method="post" action="?action=" style="height: 100px; line-height: 50px; background: #fafafa; text-align: center;">
		<span>关键词： </span><input name="keyword" type="text" size="30" />
		<select name="classid">
		<option value="1" <%if classid = 1 then response.write "selected=""selected"""%>>公司新闻</option>
		<option value="2" <%if classid = 2 then response.write "selected=""selected"""%>>业内资讯</option>
		<option value="3" <%if classid = 3 then response.write "selected=""selected"""%>>产品动态</option>
		</select>
		<input name="Button3" type="submit" value="   搜 索" class="sub-search" /><br />
		<span style="color: red;">关键词可以为空！</span>
	</form>
</div>


<%
case "addnews"
%>
<div class="list-1">
	<ul class="list-2">
		<li style="width: 100%;">创建新闻资讯</li>
	</ul>
	<form method="post" name="ClassForm" id="ClassForm" action="?action=saveaddnews" target="msgmain">
		<table style="width: 100%;" cellspacing="1">
			<tr style="background: #f6f4f4; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">新闻标题：<input name="newstitle" type="text" size="40" /> 
				*</td>
			</tr>
			<tr style="background: #fafafa; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">所属栏目：<select name="cid">
		<option value="1" <%if classid = 1 then response.write "selected=""selected"""%>>
		公司新闻</option>
		<option value="2" <%if classid = 2 then response.write "selected=""selected"""%>>
		业内资讯</option>
		<option value="3" <%if classid = 3 then response.write "selected=""selected"""%>>
		产品动态</option>
		</select></td>
			</tr>
			<tr style="background: #f6f4f4; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">作者名称：<input name="author" type="text" size="40" value="<%=session("adminname")%>" /> 
				*</td>
			</tr>
			<tr style="background: #fafafa; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">发表时间：<input name="addtime" type="text" size="40" value="<%=now()%>" />
				<span lang="zh-cn">如要修改，请注意格式。</span></td>
			</tr>
			<tr style="background: #fafafa; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">点击次数：<input name="loads" type="text" value="0" /></td>
			</tr>
			<tr style="background: #f6f4f4; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">
				<span style="float:left; text-align:left; width:790px; margin-top: 10px; margin-bottom: 10px;">新闻内容：<pre id="idTemporary" name="idTemporary" style="display: none">
				</pre>
				<script language="javascript" type="text/javascript">
					var oEdit1 = new InnovaEditor("oEdit1");
					oEdit1.cmdAssetManager="modalDialogShow('/Editor/assetmanager/assetmanager.asp?lang=schi',640,465)";
					oEdit1.btnFlash=true;
					oEdit1.btnMedia=true;
					oEdit1.RENDER(document.getElementById("idTemporary").innerHTML);
				</script>
				<input type="hidden" name="Content" id="Content" /></span></td>
			</tr>
			<tr style="background: #f6f4f4; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">全站推荐：<input name="alltop" type="checkbox" value="1" /></td>
			</tr>
			<tr style="background: #fafafa; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">
				<input name="Button1" type="submit" value="   提 交" class="sub-enter" onclick="document.forms.ClassForm.elements.Content.value = oEdit1.getHTMLBody();" />
				<input name="Button2" type="reset" value="重填" class="sub-in" /></td>
			</tr>
		</table>
	</form>
</div>
<%
case "edit"
set hu = server.CreateObject("adodb.recordset")
hu.open "select * from [Hu_news] where id = "&id&"",conn,1,1
%>
<div class="list-1">
	<ul class="list-2">
		<li style="width: 100%;">编辑新闻资讯</li>
	</ul>
	<form method="post" name="ClassForm" id="ClassForm" action="?action=saveeditnews&id=<%=id%>" target="msgmain">
		<table style="width: 100%;" cellspacing="1">
			<tr style="background: #f6f4f4; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">新闻标题：<input name="newstitle" type="text" size="40" value='<%=hu("newstitle")%>' /> 
				*</td>
			</tr>
			<tr style="background: #fafafa; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">所属栏目：<select name="cid">
		<option value="1" <%if hu("cid") = 1 then response.write "selected=""selected"""%>>
		公司新闻</option>
		<option value="2" <%if hu("cid") = 2 then response.write "selected=""selected"""%>>
		业内资讯</option>
		<option value="3" <%if hu("cid") = 3 then response.write "selected=""selected"""%>>
		产品动态</option>
		</select></td>
			</tr>
			<tr style="background: #f6f4f4; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">作者名称：<input name="author" type="text" size="40" value='<%=hu("author")%>' /> 
				*</td>
			</tr>
			<tr style="background: #fafafa; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">发表时间：<input name="addtime" type="text" size="40" value='<%=hu("addtime")%>' />
				<span lang="zh-cn">如要修改，请注意格式。</span></td>
			</tr>
			
			<tr style="background: #fafafa; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">点击次数：<input name="loads" type="text" value='<%=hu("loads")%>' /></td>
			</tr>
			<tr style="background: #f6f4f4; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">
				<span style="float:left; text-align:left; width:790px; margin-top: 10px; margin-bottom: 10px;">新闻内容：<pre id="idTemporary" name="idTemporary" style="display: none">
				<%=Server.HTMLEncode(hu("Content"))%>
				</pre>
				<script language="javascript" type="text/javascript">
					var oEdit1 = new InnovaEditor("oEdit1");
					oEdit1.cmdAssetManager="modalDialogShow('/Editor/assetmanager/assetmanager.asp?lang=schi',640,465)";
					oEdit1.btnFlash=true;
					oEdit1.btnMedia=true;
					oEdit1.RENDER(document.getElementById("idTemporary").innerHTML);
				</script>
				<input type="hidden" name="Content" id="Content" /></span></td>
			</tr>
			<tr style="background: #f6f4f4; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">全站推荐：<input name="alltop" type="checkbox" value="1" <%if rs("alltop")=1 then%> checked="checked" <%end if%> /></td>
			</tr>
			<tr style="background: #fafafa; height: 30px;">
				<td style="padding-left: 50px; padding-right: 10px;">
				<input name="Button1" type="submit" value="   提 交" class="sub-enter" onclick="document.forms.ClassForm.elements.Content.value = oEdit1.getHTMLBody();" />
				<input name="Button2" type="reset" value="重填" class="sub-in" /></td>
			</tr>
		</table>
	</form>
</div>

<%
case "saveaddnews"
call adminqx2
if trim(request.form("newstitle")) = "" then
response.write("<script>showmsgbox('新闻资讯标题必须填写！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
response.end
end if
if trim(request.form("cid")) = "0" then
response.write("<script>showmsgbox('请选择新闻资讯所属栏目！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
response.end
end if

if trim(request.form("content")) = "" then
response.write("<script>showmsgbox('新闻资讯内容必须填写！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [Hu_news] where newstitle = '"&trim(request.form("newstitle"))&"'",conn,1,3
if rs.bof and rs.eof then
rs.addnew
rs("cid") = trim(request.form("cid"))
rs("newstitle") = trim(request.form("newstitle"))
rs("author") = trim(request.form("author"))
rs("addtime") = trim(request.form("addtime"))
rs("loads") = trim(request.form("loads"))
rs("Content") = trim(request.form("Content"))
rs("recycle") = 0
if trim(request.form("alltop")) = "1" then
rs("alltop") = 1
else
rs("alltop") = 0
end if
rs.update
response.write("<script>showmsgbox('新闻资讯"&trim(request.form("newstitle"))&"创建成功！')</script>")
response.write("<script>gotourl('news.asp?classid="&trim(request.form("cid"))&"')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
else
response.write("<script>showmsgbox('不要重复创建产品,请检查是否已存在！')</script>")
response.write("<meta http-equiv=""refresh"" content=""2;URL=index.asp?action=close"" />")
response.end
end if
rs.close
set rs=nothing

case "saveeditnews"
call adminqx2
if trim(request.form("newstitle")) = "" then
response.write("<script>showmsgbox('新闻资讯标题必须填写！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
response.end
end if
if trim(request.form("cid")) = "0" then
response.write("<script>showmsgbox('请选择新闻资讯所属栏目！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
response.end
end if

if trim(request.form("content")) = "" then
response.write("<script>showmsgbox('新闻资讯内容必须填写！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [Hu_news] where id="&id&"",conn,1,3
if not(rs.bof and rs.eof) then
rs("cid") = trim(request.form("cid"))
rs("newstitle") = trim(request.form("newstitle"))
rs("author") = trim(request.form("author"))
rs("addtime") = trim(request.form("addtime"))
rs("loads") = trim(request.form("loads"))
rs("Content") = trim(request.form("Content"))
rs("recycle") = 0
if trim(request.form("alltop")) = "1" then
rs("alltop") = 1
else
rs("alltop") = 0
end if
rs.update
response.write("<script>showmsgbox('新闻资讯"&trim(request.form("newstitle"))&"创建成功！')</script>")
response.write("<script>gotourl('news.asp?classid="&trim(request.form("cid"))&"')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
else
response.write("<script>showmsgbox('请检查数据是否还存在！')</script>")
response.write("<meta http-equiv=""refresh"" content=""2;URL=index.asp?action=close"" />")
response.end
end if
rs.close
set rs=nothing


case "huishou"
call adminqx2
conn.execute("update [Hu_news] set recycle=1 where id = ("&id&")")
response.write("<script>showmsgbox('成功将id为"&id&"的记录放进回收站！')</script>")
response.write("<script>gotourl('news.asp?classid="&classid&"&pagenum="&pagenum&"&keyword="&toUTF8(keyword)&"')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")

case "huishouall"
call adminqx2
id = request.form("id")
if id = "" then
response.write("<script>showmsgbox('最少要选择一条记录！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
else
response.write("<script>showmsgok('确定将您选择的记录放进回收站？','news.asp?action=huishouallyes&classid="&classid&"&id="&id&"&keyword="&toUTF8(keyword)&"')</script>")
end if

case "huishouallyes"
call adminqx2
conn.execute("update [Hu_news] set recycle=1 where id in ("&id&")")
response.write("<script>showmsgbox('成功将您选择的记录放入了回收站！')</script>")
response.write("<script>gotourl('news.asp?classid="&classid&"&keyword="&toUTF8(keyword)&"')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")

case "huangyuan"
call adminqx2
conn.execute("update [Hu_news] set recycle=0 where id = ("&id&")")
response.write("<script>showmsgbox('成功将id为"&id&"的记录还原到列表！')</script>")
response.write("<script>gotourl('News.asp?action=recycle&pagenum="&pagenum&"&classid="&classid&"')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")

case "huangyuanall"
call adminqx2
id = request.form("id")
if id = "" then
response.write("<script>showmsgbox('最少要选择一条记录！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
else
response.write("<script>showmsgok('确定将您选择的记录还原到列表吗？','News.asp?action=huangyuanallyes&id="&id&"&classid="&classid&"')</script>")
end if

case "huangyuanallyes"
call adminqx2
conn.execute("update [Hu_news] set recycle=0 where id in ("&id&")")
response.write("<script>showmsgbox('成功将您选择的记录还原到列表！')</script>")
response.write("<script>gotourl('News.asp?action=recycle&classid="&classid&"')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")

case "del"
call adminqx1
conn.execute("Delete from [Hu_news] where id = ("&id&")")
response.write("<script>showmsgbox('成功将id为"&id&"的记录彻底删除！')</script>")
response.write("<script>gotourl('News.asp?classid="&classid&"&pagenum="&pagenum&"&keyword="&toUTF8(keyword)&"')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")

case "delall"
id = request.form("id")
if id = "" then
response.write("<script>showmsgbox('最少要选择一条记录！')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")
else
response.write("<script>showmsgok('确定将您选择的记录彻底删除？','News.asp?action=delallyes&classid="&classid&"&id="&id&"&keyword="&toUTF8(keyword)&"')</script>")
end if

case "delallyes"
call adminqx1
conn.execute("Delete from [Hu_news] where id in ("&id&")")
response.write("<script>showmsgbox('成功将您选择的记录彻底删除！')</script>")
response.write("<script>gotourl('News.asp?classid="&classid&"&keyword="&toUTF8(keyword)&"')</script>")
response.write("<meta http-equiv=""refresh"" content=""1;URL=index.asp?action=close"" />")

end select
%>
<div class="copyright">
	Powered by <a href="http://www.9959.net.cn/">9959企业网站管理系统</a> Release 2007,<a href="http://www.tongwang.cn/">通王科技</a> 
	Inc.</div>

</body>

</html>
