<!--#include file="Access.asp"  -->
<!-- #include file="inc/functions.asp" -->
<!-- #include file="x_to_html/index_to_html.asp" -->
<!-- #include file="x_to_html/category_article_to_html.asp" -->

<% '添加数据到数据表
page=request.querystring("page")
act=request.querystring("act")
keywords=request.querystring("keywords")
article_id=cint(request.querystring("id"))


act1=Request("act1")
If act1="save" Then 
a_id=trim(request.form("l_id"))
l_author=request.form("l_author")
l_name=trim(request.form("name"))
l_type=trim(request.form("type"))
l_content=trim(request.form("content"))
l_view_yes=trim(request.form("view_yes"))
l_index_push=trim(request.form("index_push"))
l_time=now()

set rs=server.createobject("adodb.recordset")
sql="select * from web_info where id="&a_id&""
rs.open(sql),cn,1,3
rs("author")=l_author
rs("name")=l_name
rs("type")=l_type
rs("content")=l_content
rs("index_push")=cint(l_index_push)
rs("view_yes")=cint(l_view_yes)
rs.update

filepath=rs("file_path")
rs.close
set rs=nothing
%>


<% '生成html
call category_article_to_html(a_id,filepath)
call index_to_html()

%>

<%
response.Write "<script language='javascript'>alert('修改成功！');location.href='info_list.asp?page="&page&"&act="&act&"&keywords="&keywords&"';</script>"
end if 
 %>
 

	<%
Call header()

%>
<% set rs=server.createobject("adodb.recordset")
sql="select * from web_info where id="&article_id&""
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then%>
  <form id="form1" name="form1" method="post" action="?act1=save&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>">
          <script language='javascript'>
function checksignup1() {
if ( document.form1.l_author.value == '' ) {
window.alert('请选择作者^_^');
document.form1.l_author.focus();
return false;}

if ( document.form1.name.value == '' ) {
window.alert('请输入标题^_^');
document.form1.name.focus();
return false;}

if ( document.form1.type.value == '' ) {
window.alert('请选择分类^_^');
document.form1.type.focus();
return false;}

return true;}
</script>       
	<table cellpadding='3' cellspacing='1' border='0' class='tableBorder' align=center>
	<tr>
	  <th class='tableHeaderText' colspan=2 height=25>修改分类信息</th>
	<tr>
	<td width="15%" height=23 class='forumRowHighLight'>发布者</td>
	<td width="85%" class='forumRowHighLight'><select name="l_author" id="l_author">
<option value="">请选择</option>
<% set rsp=server.createobject("adodb.recordset")
		   sql="select id,username from web_register"
		   rsp.open(sql),cn,1,1
		   if not rsp.eof and not rsp.bof then
		   do while not rsp.eof 
		   %> <option value="<%=rsp("id")%>" <% if rsp("id")=rs("author") then
		   response.write " selected"
		   end if%>>[<%=rsp("id")%>] <%=rsp("username")%></option>
            <%
			rsp.movenext
			loop
			end if
			rsp.close
			set rsp=nothing%></select></td>
	</tr>
	  <tr>
	    <td class='forumRow' height=30>信息标题</td>
	    <td class='forumRow'><input name='name' type='text' id='name' value="<%=rs("name")%>" size='70'>
	      <span class="forumRowHighLight">
          <input name='l_id' type='hidden' id='l_id' value="<%=rs("id")%>" size='70'>
        </span></td>
      </tr>
	 <tr>
	    <td class='forumRowHighLight' height=30>信息分类</td>
	    <td class='forumRowHighLight'><label>
	      <select name="type" id="type">
	       <% set rsp=server.createobject("adodb.recordset")
		   sql="select id,name from web_info_type "
		   rsp.open(sql),cn,1,1
		   if not rsp.eof and not rsp.bof then
		   do while not rsp.eof 
		   %> <option value="<%=rsp("id")%>" <%if rsp("id")=cint(rs("type")) then
		response.write "selected"
		end if%>><%=rsp("name")%></option>
            <%
			rsp.movenext
			loop
			end if
			rsp.close
			set rsp=nothing%></select>
	    </label></td>
      </tr>	<tr>
	  <td class='forumRow' height=23>信息内容 </td>
	  <td class='forumRow'> <textarea name='content' style='display:none' dataType='Require'  ><%=rs("content")%></textarea>
 <iframe ID='eWebEditor1' src='editor/ewebeditor.htm?id=content&style=coolblue&originalfilename=d_originalfilename&savefilename=d_savefilename&savepathfilename=d_savepathfilename' frameborder='0' scrolling='no' width='100%' HEIGHT='350'></iframe></td>
	</tr>
	  
	  <tr>
	    <td class='forumRowHighLight' height=23><span class="forumRow">是否显示</span></td>
	    <td class='forumRowHighLight'><input type="radio" name="view_yes" value="1"<%
		if rs("view_yes")=1 then
		response.write "checked"
		end if%>>
是
      &nbsp;
      <input name="view_yes" type="radio" value="0" <%if rs("view_yes")=0 then
		response.write "checked"
		end if%>>
否</td>
      </tr>
	  <tr>
	  <td class='forumRow' height=23>是否推荐</td>
	  <td class='forumRow'><label>
	       <input type="radio" name="index_push" value="1"<%
		if rs("index_push")=1 then
		response.write "checked"
		end if%>>
      是
      &nbsp;
      <input name="index_push" type="radio" value="0" <%if rs("index_push")=0 then
		response.write "checked"
		end if%>>
      否</label></td>
	</tr>
	<tr><td height="50" colspan=2  class='forumRow'><div align="center">
	  <INPUT type=submit value='提交' onClick='javascript:return checksignup1()' name=Submit>
	  </div></td></tr>
	</table>
</form>
<%
else
response.write"未找到数据"
end if%>
<%
Call DbconnEnd()
 %>