<%@language=vbscript codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="zmwbk.asp"-->
<!--#include file="ys.asp"-->
<!--#include file="Inc/Function.asp"-->
<!--#include file="bfdy.asp"-->
<!-- #include file="Inc/Head.asp" -->
<script language="javascript" type="text/javascript" src="js/getdate/WdatePicker.js"></script>
<style type="text/css">
	form {
				margin: 0;
			}
			textarea {
				display: block;
			}
		.STYLE1 {color: #FF0000}
		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
id=request("id")
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"))
newkey=Trim(request.form("newkey"))
newms=Trim(request.form("newms"))
ly=Trim(request.form("ly"))
adddate=trim(request("adddate"))
Hits=trim(request.form("Hits"))
tj=trim(request("tj"))
tt=trim(request("tt"))
gg=trim(request("gg"))
sytj=trim(request("sytj"))
zdfy=trim(request("zdfy"))
wlurl=trim(request("wlurl"))
 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
Set rs_news = Server.CreateObject("ADODB.Recordset")
sql1="select * from news where id="&id
rs_news.open sql1,conn,1,3
  rs_news("Title")=Title
  rs_news("Content")=Content
  rs_news("bfnr")=bfnr
  rs_news("User")=User
  rs_news("btcolor")=btcolor
  rs_news("zmone")=zmone
  rs_news("zmtwo")=zmtwo
  rs_news("zmthree")=zmthree
  rs_news("adddate")=adddate
  rs_news("ly")=ly
  rs_news("Hits")=Hits
  rs_news("zdfy")=zdfy
  rs_news("wlurl")=wlurl
  rs_news("newkey")=newkey
  rs_news("newms")=newms
 if tj="yes" then
		rs_news("tj")=True
	else
		rs_news("tj")=False
	end if

    if tt="1" then
		rs_news("tt")=1
	else
		rs_news("tt")=0
	end if
	if gg="yes" then
		rs_news("gg")=true
	else
		rs_news("gg")=false
	end if
	 if sytj="yes" then
		rs_news("sytj")=True
	else
		rs_news("sytj")=False
	end if
	rs_news.update
rs_news.close
response.Write "<script language=javascript>alert(""恭喜您修改成功"");window.location.href=""news_manage.asp""</script>"
end if
Set rs_news = server.CreateObject("adodb.recordset")
sql2 = "select * from news where id = "&request.QueryString("id")&""
rs_news.Open sql2, conn, 1, 1
If rs_news.EOF Then
    response.Write "<script language=javascript>alert(""不存在此数据！"");window.history.back();</script>"
    response.End
End If
%>
<form method="POST" name="myform"   target="_self">
<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" align="center" cellpadding="6" cellspacing="0"  bgcolor="#f9f9f9"   >
  
    
    <tr  >
      <td  >新闻标题：</br></br>
        <input  name="title" type="text" size="50" maxlength="200"id="title" value="<%=rs_news("title")%>" />
        <input name="btcolor"type="text" id="color"style="background-color: 

#F1F5F8;" onMouseOver="style.backgroundColor='#FFF'" value="<%=rs_news("btcolor")%>" size="8" /> 
      <input   type="button" id="colorpicker" value="打开取色器" /></td>
    </tr>
	<%
arrClassID=array(rs_news("zmone"),rs_news("zmtwo"),rs_news("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  >新闻类别：</br></br>
        
        <div id="strClassName"><%=strClassName%></div></br>
	  <input name="zmone" type="hidden" value="<%=rs_news("zmone")%>" />
	<input name="zmtwo" type="hidden" value="<%=rs_news("zmtwo")%>" />
	<input name="zmthree" type="hidden" value="<%=rs_news("zmthree")%>" />
	
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--#include file="xwlb.asp"--><font color="#FF6600">点击图标选择类别</font></td>
    </tr>
	 <tr  >
      <td  >新闻关键词:</br></br>
	           <input name="newkey" type="text" id="newkey" value="<%=rs_news("newkey")%>" size="100" />       </td>
    </tr>
	 <tr  >
      <td  >新闻描述:</br></br>
	           <input name="newms" type="text" id="newms" value="<%=rs_news("newms")%>" size="100" />       </td>
    </tr>
    <tr  >
      <td  >外链新闻:</br></br>
	           <input name="wlurl" type="text" id="wlurl" value="<%=rs_news("wlurl")%>" />
	           （如果不是外链新闻请留空）</td>
    </tr>
    <tr  >
      <td  >内容提要：</br></br>
      <textarea name="bfnr" style="width:90%;height:200px;visibility:hidden;"><%=rs_news("bfnr")%></textarea></td>
    </tr>
    <tr  >
      <td  >新闻内容：</br></br>
      <textarea name="content" style="width:90%;height:200px;visibility:hidden;"><%=rs_news("content")%></textarea></td>
    </tr>
    <tr  >
      <td height="25" >手动分页：</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="<%=rs_news("zdfy")%>" size="10" />
        （（如果采用手动分页请将自动分页设置为0））</td>
    </tr>
    <tr  >
      <td  >属性：</br></br>
      <input name="tj" type="checkbox" id="tj" value="yes" <% if rs_news("tj")=true then response.Write("checked") end if%>>
      新闻幻灯
	  <input name="tt" type="checkbox" id="tt" value="1" <% if rs_news("tt")=1 then response.Write("checked") end if%>>
	  置顶
	  <input name="sytj" type="checkbox" id="sytj" value="yes" <% if rs_news("sytj")=true then response.Write("checked") end if%>>
	  推荐	  
	  <input name="gg" type="checkbox" id="gg" value="yes" <% if rs_news("gg")=true then response.Write("checked") end if%>>
	  公告</td>
    </tr>
    <tr  >
      <td  >发布人：</br></br>
        <input  name="user" type="text" class="input" size="30" value="<%=rs_news("user")%>">      </td>
    </tr>
    <tr  >
      <td  >来源：</br></br>
      <input  name="ly" type="text" id="ly" value="<%=rs_news("ly")%>"></td>
    </tr>
    <tr   >
      <td height="35" >录入时间：</br></br>
        <input  name="AddDate" type="text" id="AddDate" value="<%=rs_news("AddDate")%>" onClick="WdatePicker({dateFmt:'yyyy/MM/dd HH:mm:ss'})"maxlength="50">      </td>
    </tr>
    <tr   >
      <input type="hidden" name="Id" value="<%=Id%>">
      <td height="35" ><div align="center">
        <input class="bnt"onMouseOver="style.backgroundColor='#FFF'" type="submit" name="Submit" value="修改" class="input">&nbsp;&nbsp;
        <input class="bnt" onMouseOver="style.backgroundColor='#FFF'" type="reset" name="Submit2" value="重置" class="input">
      </div></td>
    </tr>
</table>
</form>
</body>
</html>

<%

rs_news.close
set rs_news=nothing
conn.close
	set conn=nothing
%>