⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addeditdebate.asp

📁 后台目录:qwbAdmin/Login.asp 登陆用户名:admin 登陆密码:admin
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<% Option Explicit %>
<!--#include file="../../FS_Inc/Const.asp" -->
<!--#include file="../../FS_InterFace/MF_Function.asp" -->
<!--#include file="../../FS_Inc/Function.asp" -->
<%
'on error resume next
Dim Conn,User_Conn,OperateDebateRs,DebateID,title,content,ParentID,parentIDRs,Classid,AppointUserNumber,AppointUserGroup,isLock,AccessFile,TopicRs,TopicRs1,TopicRs2,ClassRs,UserGroupRs,CorpGroupRs,ArrayCount,selectedTF,currentTopicRs,i,ChildDebateArray
Admin_Login_State
MF_Default_Conn
MF_User_Conn
MF_Session_TF
AppointUserGroup=null
function getChildID(ID,self)
	Dim F_Rs,F_ChildID
	Set F_Rs=User_Conn.Execute("select DebateID,ParentID from FS_ME_GroupDebate where parentID="&ID)
	while not F_Rs.eof
		F_ChildID=F_Rs("DebateID")&","&getChildID(F_Rs("DebateID"),false)
		F_Rs.movenext
	wend
	F_Rs.close
	Set F_Rs=nothing
	if self then
		getChildID=ID&","&F_ChildID
	else
		getChildID=F_ChildID
	end if
end function
function getParentNum(parentID)
	Dim F_Parent_Count,F_Rs
	F_Parent_Count=1
	if not isnumeric(parentID) then exit function
	Set F_Rs=User_Conn.execute("Select DebateID,ParentID from FS_ME_GroupDebate where DebateID="&parentID)
	if not F_Rs.eof then
		F_Parent_Count=F_Parent_Count+getParentNum(F_Rs("ParentID"))
	end if
	F_Rs.close
	Set F_Rs=nothing
	getParentNum=F_Parent_Count
end function
'************************************Update
if Request.QueryString("Act")="edit" then'修改界面
	DebateID=Request.QueryString("DebateID")
	Set OperateDebateRs=server.CreateObject(G_FS_RS)
	OperateDebateRs.open "select DebateID,title,content,addtime,ParentID,classid,AppointUserNumber,AppointUserGroup,AddTime,isLock,AccessFile from FS_ME_GroupDebate where DebateID="&DebateID,User_Conn,1,3
	if not OperateDebateRs.eof then
		title=OperateDebateRs("title")
		content=OperateDebateRs("content")
		ParentID=OperateDebateRs("ParentID")
		classid=OperateDebateRs("classid")
		AppointUserNumber=OperateDebateRs("AppointUserNumber")
		if OperateDebateRs("AppointUserGroup")<>"" then
			AppointUserGroup=split(OperateDebateRs("AppointUserGroup"),",")
		end if
		isLock=OperateDebateRs("isLock")
		AccessFile=OperateDebateRs("AccessFile")
	end if
elseif Request.QueryString("Act")="EditDebate" then'修改动作
	if Request.Form("currentValue")<>"" then
		parentID=Request.Form("currentValue")
	elseif Request.Form("topic2")<>"" then
		parentID=Request.Form("topic2")
	elseif Request.Form("topic1")<>"" then
		parentID=Request.Form("topic1")
	elseif Request.Form("topic")<>"" then
		parentID=Request.Form("topic")
	end if 
	if request.Form("userGroup")="" and Request.Form("corpGroup")<>"" then
		AppointUserGroup=Request.Form("corpGroup")
	elseif request.Form("userGroup") <> "" and Request.Form("corpGroup")="" then
		AppointUserGroup=Request.Form("userGroup")
	elseif request.Form("userGroup") <> "" and Request.Form("corpGroup")<>"" then
		AppointUserGroup=trim(request.Form("userGroup"))&","&trim(Request.Form("corpGroup"))
	end if
	
	'****************验证修改数据的合理性
	ChildDebateArray=split(DelHeadAndEndDot(getChildID(NoSqlHack(Request("DebateID")),true)),",")
	for i=0 to Ubound(ChildDebateArray)
		if parentID=ChildDebateArray(i) then
		Response.Redirect("../error.asp?ErrCodes=<li>1.自己不能是自己的父类</li><li>2.自己的子类不能作为父类</li>")
		Response.End()
		end if
	next
	 if getParentNum(parentID)+Ubound(ChildDebateArray)>4 then
		Response.Redirect("../error.asp?ErrCodes=<li>总层级数不能大于4</li>")
		Response.End()
	 end if
	'****************************************
	
	User_Conn.Execute("Update FS_ME_GroupDebate set title='"&Request.Form("title")&"',content='"&Request.Form("Content")&"',parentid="&parentid&",classid="&Request.Form("DebateClass")&",AppointUserNumber='"&Request.Form("AppointUserNumber")&"',AppointUserGroup='"&AppointUserGroup&"',addtime='"&Now()&"',isLock="&Request.Form("isLock")&",AccessFile='"&Request.Form("AccessFile")&"' where DebateID="&NoSqlHack(Request("DebateID")))
	if err.number>0 then
		Response.Redirect("../error.asp?ErrCodes="&err.description&"&ErrorUrl=./user/GroupDebate_manage.asp")
		Response.End()
	else
		Response.Redirect("../success.asp?ErrCodes=<li>操作成功</li>&ErrorUrl=./user/GroupDebate_manage.asp")
		Response.End()
	end if
elseif Request("Act")="AddDebate" then'添加动作
	Set OperateDebateRs=server.CreateObject(G_FS_RS)
	if Request("currentValue")<>"" then
		parentID=Request("currentValue")
	elseif Request("topic2")<>"" then
		parentID=Request("topic2")
	elseif Request("topic1")<>"" then
		parentID=Request("topic1")
	elseif Request("topic")<>"" then
		parentID=Request("topic")
	end if 
	if request.Form("userGroup")="" and Request.Form("corpGroup")<>"" then
		AppointUserGroup=Request.Form("corpGroup")
	elseif request.Form("userGroup") <> "" and Request.Form("corpGroup")="" then
		AppointUserGroup=Request.Form("userGroup")
	elseif request.Form("userGroup") <> "" and Request.Form("corpGroup")<>"" then
		AppointUserGroup=trim(request.Form("userGroup"))&","&trim(Request.Form("corpGroup"))
	end if
	OperateDebateRs.open "select title,content,ParentID,ClassID,addtime,AppointUserNumber,AppointUserGroup,isLock,AccessFile from FS_ME_GroupDebate",User_Conn,1,3
	OperateDebateRs.addNew
	OperateDebateRs("title")=Request.Form("title")
	OperateDebateRs("content")=Request.Form("Content")
	OperateDebateRs("ParentID")=parentID
	OperateDebateRs("ClassID")=Request.Form("DebateClass")
	OperateDebateRs("addtime")=Now()
	if Request.Form("AppointUserNumber")<>"" then
		OperateDebateRs("AppointUserNumber")=Request.Form("AppointUserNumber")
	end if
	if AppointUserGroup<>"" then
	OperateDebateRs("AppointUserGroup")=AppointUserGroup
	end if
	OperateDebateRs("islock")=Request.Form("islock")
	OperateDebateRs("AccessFile")=Request.Form("AccessFile")
	OperateDebateRs.update
	OperateDebateRs.close
	if err.number>0 then
		Response.Redirect("../error.asp?ErrCodes="&err.description&"&ErrorUrl=./user/GroupDebate_manage.asp")
		Response.End()
	else
		Response.Redirect("../success.asp?ErrCodes=<li>操作成功</li>&ErrorUrl=./user/GroupDebate_manage.asp")
		Response.End()
	end if
end if
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>FoosunCMS</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
</HEAD>
<script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
<script language="JavaScript" src="lib/UserJS.js" type="text/JavaScript"></script>
<link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes  oncontextmenu="return false;"> 
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> 
	<%
	if Request.QueryString("Act")="edit" then
	Response.Write("<form action='?Act=EditDebate&DebateID="&DebateID&"' method='post' name='operateDebate' id='operateDebate'>")
	elseif Request.QueryString("Act")="add" or Request.QueryString("Act")="AddChild" then
	Response.Write("<form action='?Act=AddDebate' method='post' name='operateDebate' id='operateDebate'>")
	end if
	%>
  <tr class="hback"> 
    <td align="right" class="xingmu" ><div align="left">社群管理</div></td>
	<td align="right" class="xingmu"><div align="right"><a href="GroupDebate_manage.asp">返回</a></div></td>
	</tr> 
        <tr class="hback"> 
          <td align="right">社群主题:</td> 
          <td width="631"> <input name="Title" type="text" id="Title" value="<%=title%>" size="50" />
          <font color="#FF0000">*</font><span id="Title_Alert"></span> </td> 
        </tr>      
<tr class="hback">
    <td align="right">讨论内容: </td>
    <td>    <textarea name="Content" cols="80" rows="10" id="Content"><%=content%></textarea>
    <font color="#FF0000">*</font><span id="Content_Alert"></span></td>
  </tr>
<tr class="hback">
  <td align="right">所属主题:</td>
  <td>	
  <%
	if Request.QueryString("act")<>"AddChild" then
		Set TopicRs=User_Conn.Execute("Select DebateID,Title,ParentID from FS_ME_GroupDebate where ParentID=0 order by addtime desc")
		Response.Write("<select name='Topic' id='topic' onchange=""getDebate(this,'Topic1')"">"&Chr(10)&Chr(13))
		Response.Write("<option value=''>请选择一级主题</option>")
		Response.Write("<option value='0'>一级主题</option>")
		while not TopicRs.eof
			Response.Write("<option value='"&TopicRs("DebateID")&"'>"&TopicRs("title")&"</option>")
			TopicRs.movenext
		wend
		Response.Write("</select>")
	end if
  %>
  <span id="Topic1_Container">
  </span>&nbsp;
  <span id="Topic2_Container">
  </span>
  <span id="current">
	<%
	Response.Write("<select name='currentValue' id='currentValue' size='1' multiple>")
	if Request.QueryString("act")="AddChild" then
		Set currentTopicRs=User_Conn.Execute("Select DebateID,title from FS_ME_Groupdebate where  DebateID="&Request.QueryString("DebateID"))
		if not currentTopicRs.eof then
			ParentID=currentTopicRs("DebateID")
			if ParentID=0 then
				Response.Write("<option value='0' selected>一级主题</option>")
			else
				Response.Write("<option value='"&ParentID&"' selected>"&currentTopicRs("title")&"</option>")
			end if
		end if
	else
		if ParentID=0 then
			Response.Write("<option value='0' selected>一级主题</option>")
		else
			Response.Write("<option value='"&ParentID&"' selected>"&User_Conn.execute("select title from FS_ME_Groupdebate where DebateID="&ParentID)(0)&"</option>")
		end if
	end if
	Response.Write("</select>")
	%>
  </span>
  </td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -