<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<!--#include file="inc/function.asp" -->
<HTML>
<HEAD>
<TITLE>添加新闻</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
</style>

</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p22")
'''''''''''''''''''''''''''''''''''''''''''''''
'获得大类
dim first,id,classid,labelArr
dim i
'获得参数
%>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<%
dim act,Title,Content
act=request.QueryString("act")
if(act="modi") then
	id=Cint(request("id"))	
	Title=trim(request.Form("Title"))
	Content =Request.Form("Content")
	call Modilabel()
	response.Write("成功修改~!")
	response.Write("<br><input type=button value='继续修改' onclick='history.go(-2)'> &nbsp;")
else
	id=cint(request("id"))	
	set rs=server.CreateObject("adodb.recordset")
	sql="select Title,Content from t_wenda where id="&id
	rs.open sql,conn,3,1
	if not rs.eof then
		labelArr=rs.GetRows()
		rs.close
		set rs=nothing
	else
		response.Write("没有记录")
		rs.close
		set rs=nothing
		response.End()
	end if	
%>
<FORM method="POST" name="form1" action="?act=modi" style="margin:0 0 0 0; ">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#F5F5F5">
  <TD><div align="center">标题：</div></TD>
  <TD><input name="Title" type="text" size="60" value="<%=labelArr(0,0)%>"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD><div align="center">内容：</div></TD>
  <TD><textarea name="Content" cols="50" rows="6" id="Content"><%=labelArr(1,0)%></textarea></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD align=right>&nbsp;	  </TD>
  <TD align=right><div align="left">
    <input type="hidden" name="id" value="<%=id%>">
    <input type=submit name=b1 value="提交">
    <input type=reset name=b2 value="重填">
    </div></TD>
</TR>
</TABLE>
</FORM>
<%
end if
sub Modilabel
	sql="select * from t_wenda where id="&id
	set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,3,3	
	rs("Title")=Title
	rs("Content")=Content
	rs.update
	rs.close
	set rs=nothing
end sub
%>
<script language="JavaScript">
function addParentOption()
{
	var arr = showModalDialog("tree_container.asp", "", "dialogWidth:410px; dialogHeight:420px; status:0");
  	if (arr != null){  
   		document.form1.newsclass.options[0]=new Option(arr[1],arr[0]);
  	}
	
}
</script>
</BODY>
</HTML>
<%
call connclose()
%>