
<!-- #include file="conn.asp"-->
<% 
if request("exe")="add" then'加新数据
	set rs=server.createobject("adodb.recordset") 
	sql="select * from FAQ" 
	rs.open sql,conn,3,3
	rs.addnew
	
	classID=request("classID") 
	title=request("title")

	username=request("username")
	content=request("content")
	re_content=request("re_content")
	
	rs("classid")=request("classID") 
	rs("title")=request("title")
	rs("username")=request("username")
	rs("content")=request("content")
	rs("addTime")=now()
	rs("re_content")=request("re_content")
	rs.update
	rs.close
	set rs=nothing
	response.Write("<script>alert('OK！')</script>")
end if

if request("exe")="mod" then'执行
	set rs=server.createobject("adodb.recordset") 
	sql="select * from FAQ where id ="&request("id") 
	rs.open sql,conn,3,3
	rs("classID")=request("classID") 
	rs("title")=request("title")

	rs("username")=request("username")
	rs("content")=request("content")
	rs("re_content")=request("re_content")
	rs.update
	rs.close
	set rs=nothing
	response.Write("<script>alert('修改成功！');window.history.go(-1)</script>")
end if
if request("exe")="del" then'执行
	set rs=server.createobject("adodb.recordset") 
	sql="select * from FAQ where id="&request("id") 
	rs.open sql,conn,3,3
	rs("delete")=1
	rs.update
	rs.close
	set rs=nothing
	response.Write("<script>alert('删除成功！')</script>")
end if
if request("exe")="undel" then'执行
	set rs=server.createobject("adodb.recordset") 
	sql="select * from FAQ where id="&request("id") 
	rs.open sql,conn,3,3
	rs("delete")=0
	rs.update
	rs.close
	set rs=nothing
	response.Write("<script>alert('恢复成功！')</script>")
end if
if request("exe")="deldel" then'彻底删除
	conn.execute "delete from FAQ where id="&request("id")
	response.Write("<script>alert('彻底删除成功！')</script>")
end if

if request("action")="mod" then'要修改
	set rs=server.createobject("adodb.recordset") 
	sql="select * from FAQ where id ="&request("id") 
	rs.open sql,conn,3,3
	classId=rs("classID")

	title=rs("title")
	username=rs("username")
	content=rs("content")
	re_content=rs("re_content")
	rs.close
	set rs=nothing
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加修改文件</title>
<style type="text/css">
<!--
body,td,th {
	font-size: 13px;
}
body {
	background-color: #F4F3EA;
}
-->
</style></head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#006699">
    <tr>
      <td bgcolor="#95CAFF">类别选择</td>
      <td bgcolor="#95CAFF">
<% 
set rs=server.createobject("adodb.recordset") 
sql="select * from FAQ_class" 
rs.open sql,conn,1,1 
response.Write("id:"&classid)
%>
        <select name="classId" id="classId">
		
		<%
		
		 for i=1 to rs.recordcount%>

          <option value="<%=rs("classId")%>"<%if classId-0=rs("classID") then%> selected <%end if%>><%=rs("className")%></option>
		  <%
		  rs.movenext
		  next
		  rs.close
		  set rs=nothing
		  %>
        </select>      </td>
    </tr>
    <tr>
      <td width="14%" bgcolor="#95CAFF">问题名称：</td>
      <td width="86%" bgcolor="#95CAFF"><input name="title" type="text" id="title" value="<%=title%>" size="50" /></td>
    </tr>
    <tr>
      <td bgcolor="#95CAFF">用户名</td>
      <td bgcolor="#95CAFF"><input name="username" type="text" id="username" value="<%=username%>" size="20" /></td>
    </tr>
    <tr>
      <td bgcolor="#95CAFF">问题内容</td>
      <td bgcolor="#95CAFF"><textarea name="content" cols="60" rows="10" style="display:none" id="content"><%=content%></textarea>
	  <IFRAME ID="eWebEditor1" SRC="../../../../crm/htmlEditor/ewebeditor.asp?id=content&style=s_blue" FRAMEBORDER="0" SCROLLING="no" WIDTH="100%" HEIGHT="350"></IFRAME>
	  </td>
    </tr>
    <tr>
      <td bgcolor="#95CAFF">评论情况</td>
      <td bgcolor="#95CAFF"><textarea name="re_content" cols="60" rows="10"  style="display:none"  id="re_content"><%=re_content%></textarea>
	  <IFRAME ID="eWebEditor1" SRC="../../../../crm/htmlEditor/ewebeditor.asp?id=re_content&style=s_blue" FRAMEBORDER="0" SCROLLING="no" WIDTH="100%" HEIGHT="350"></IFRAME>
	  </td>
    </tr>
  </table>
  <p align="center">
    <input type="submit" name="Submit" value="提交" />
    <input type="reset" name="Submit2" value="重置" />
    <input name="exe" type="hidden" id="exe" <%if request("action")="mod" then%>value=mod <%else%>value="add"<%end if%>>
  </p>
</form>
</body>
</html>



