<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
	useflag=4
%>
<!--#include file="flag.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	id=Trim(Request.QueryString("id"))
	action1=Trim(Request.QueryString("action1"))
	action=Trim(Request.Form("action"))
	
	if action="add" then
		
		cate=Trim(Request.Form("cate"))
		newsid=Trim(Request.Form("newsid"))
		IncludePic=Trim(Request.Form("IncludePic"))   			'图片推荐选项
		TitleFontColor=Trim(Request.Form("TitleFontColor"))     '标题颜色
		title=Trim(Request.Form("title"))						'标题题目
		
		zuo=Trim(Request.Form("zuo"))
		text=trim(request("content"))
		chu=Trim(Request.Form("chu"))
		
		if title ="" or text="" then
			response.write"<SCRIPT language=JavaScript>alert('请填写完整新闻的标题和新闻内容！');"
			response.write"javascript:history.go(-1)</SCRIPT>"
			response.end
		end if
		
		set rs=server.createobject("adodb.recordset")
		sql="select * from companynews where id="&newsid
		rs.open sql,conn,2,3
		rs("cate")=cate
		rs("title")=IncludePic&title
		rs("text")=text
		rs("zuo")=zuo
		rs("chu")=chu
		rs("tcolor")=TitleFontColor
		rs("tj")=Trim(Request.Form("tj"))
		rs("thot")=Trim(Request.Form("thot"))
		rs.update
		rs.close
		set rs=nothing
		
		response.write"<script language=JavaScript>alert('新闻修改成功,现在为您返回');"    
		response.write"this.location.href='managenews.asp';</script>"
		response.End
	end if
	if action1="edit" then
	set rs=server.createobject("adodb.recordset")
	sql="select * from companynews where id="&id
	rs.open sql,conn,1,1 
	cate1=rs("cate")
%>
<HTML>
<HEAD>
<TITLE>修改新闻内容</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<link href='Include/Admin_Style.CSS' rel='stylesheet' type='text/css'>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
</HEAD>
<body topmargin="0">
<table width="95%" border="3" cellpadding="1" align="center" bordercolor="#FFFFFF" cellspacing="0">
  <tr>
    <td>
      <FORM name="searchForm" action="" method=post>
	  <input name="newsid" type="hidden" value="<%= id %>">
	  <input name="action" type="hidden" value="add">
        <TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1"  class="sortbutton">
          <tr>
            <td height=25 colspan="2" align="center"><b>新闻信息修改</b></td>
          </tr>
          <TR ALIGN="center">
            <TD>
	<TABLE width="100%" border="0" cellpadding="5" cellspacing="2" bordercolorlight="#CEE7FF" bordercolordark="#CEE7FF" style="border-collapse: collapse">
                <TR>
                  <TD width="131" align="right"><b>信息标题：</b></TD>
                  <TD width="739"><font color="#F4FAFF">
                    <select name='IncludePic'>
                      <option selected value=''> </option>
                      <option value='[图文]'>[图文]</option>
                      <option value='[组图]'>[组图]</option>
                      <option value='[推荐]'>[推荐]</option>
                      <option value='[注意]'>[注意]</option>
                    </select>
                    <input type="text" name="title" size="55" value="<%=rs("title")%>">
                    </font> <font color='#FF0000'>*</font>
                    <select id='TitleFontColor' name="TitleFontColor">
                      <option value='' selected>颜色</option>
                      <option value=''>默认</option>
                      <option value='#000000' style='background-color:#000000'></option>
                      <option value='#FFFFFF' style='background-color:#FFFFFF'></option>
                      <option value='#008000' style='background-color:#008000'></option>
                      <option value='#800000' style='background-color:#800000'></option>
                      <option value='#808000' style='background-color:#808000'></option>
                      <option value='#000080' style='background-color:#000080'></option>
                      <option value='#800080' style='background-color:#800080'></option>
                      <option value='#808080' style='background-color:#808080'></option>
                      <option value='#FFFF00' style='background-color:#FFFF00'></option>
                      <option value='#00FF00' style='background-color:#00FF00'></option>
                      <option value='#00FFFF' style='background-color:#00FFFF'></option>
                      <option value='#FF00FF' style='background-color:#FF00FF'></option>
                      <option value='#FF0000' style='background-color:#FF0000'></option>
                      <option value='#0000FF' style='background-color:#0000FF'></option>
                      <option value='#008080' style='background-color:#008080'></option>
                  </select></TD>
                </TR>
                <TR>
                  <TD align="right" valign="middle"><b>信息分类：</b></td>
                  <TD><font color="#F4FAFF">
		<select name="cate" size=1>
<%
	set rs_area=server.createobject("adodb.recordset")
	sql="select * from newstype order by id asc"
	rs_area.open sql,conn,1,1
	for i_area=1 to rs_area.recordcount
	if rs_area("id")=rs("cate") then
		response.write "<OPTION VALUE="&rs_area("id")&" selected>"&rs_area("type")&"</OPTION>"
	else
		response.write "<OPTION VALUE="&rs_area("id")&">"&rs_area("type")&"</OPTION>"
	end if
	rs_area.movenext
	if rs_area.eof then exit for
	next
	rs_area.close
	set rs_area=nothing
%>
        </select>
                  </font></TD>
                </TR>
                <TR>
                  <TD align="right"><b>信息作者：</b></td>
                  <TD valign="middle"><input type="text" name="zuo" class="smallInput" size="15" value="<%=rs("zuo")%>">
                      <font color='blue'><=【<font color='green' onclick="document.searchForm.zuo.value='未知'" style="cursor:hand;">未知</font>】</font></TD>
                </TR>
                <TR>
                  <TD align="right"><b>信息来源：</b></td>
                  <TD valign="middle"><input type="text" name="chu" class="smallInput" size="50" value="<%=rs("chu")%>">
                      <font color='blue'><=【<font color='green' onclick="document.searchForm.chu.value='信息中心'" style="cursor:hand;">信息中心</font>】</font> </TD>
                </TR>
                <TR>
                  <TD align="right"><b>是否推荐：</b></td>
                  <TD valign="middle"><input type="radio" name="tj" id="tj" value="1" <% If rs("tj")=1 Then Response.Write("checked")%>>
                    推荐 
                      <input type="radio" name="tj" id="tj" value="0" <% If rs("tj")=0 Then Response.Write("checked")%>>
                    不推荐</TD>
                </TR>
                <TR>
                  <TD align="right"><b>热点状态：</b></td>
                  <TD valign="middle"><input type="radio" name="thot" id="thot" value="1" <% If rs("thot")=1 Then Response.Write("checked")%>>
                    热点新闻 
                      <input type="radio" name="thot" id="thot" value="0" <% If rs("thot")=0 Then Response.Write("checked")%>>
                    非热点新闻 (显示在热点新闻框内，仅显示最新的一条)</TD>
                </TR>
                <TR>
                  <TD align="right"><b>详细信息：</b></TD>
                  <TD><textarea name="content" style="display:none"><%=Server.HTMLEncode(rs("text"))%></textarea>
                     <iframe ID="eWebEditor1" src="editor/ewebeditor.asp?id=content&style=standard" frameborder="0" scrolling="no" width="617" HEIGHT="450"></iframe></TD>
                </TR>
				<TR height="40">
                  <TD colspan="2" align="center" height="40"><input type="submit" name="Submit" value=" 提　交 保 存" class="smallInput">
                  &nbsp;&nbsp;&nbsp;<input type="reset" name="Submit2" value=" 重　新 添 写" class="smallInput"></TD>                  </TR>
            </TABLE></TD>
          </TR>
        </TABLE>
      </form>
    </td>
  </tr>
</table>
<%
	End If
	rs.close
	set rs=nothing
%>
</BODY>
</HTML>
