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

📄 groupdebate_manage.asp

📁 后台目录:qwbAdmin/Login.asp 登陆用户名:admin 登陆密码:admin
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<% Option Explicit %>
<!--#include file="../../FS_Inc/Const.asp" -->
<!--#include file="../../FS_InterFace/MF_Function.asp" -->
<!--#include file="../../FS_Inc/Function.asp" -->
<!--#include file="../../FS_Inc/Func_page.asp" -->
<% 'Copyright (c) 2006 Foosun Inc. Code by awen
'on error resume next
Dim Conn,User_Conn,VClass_Rs,VClass_Sql
MF_Default_Conn
MF_User_Conn
MF_Session_TF
if not MF_Check_Pop_TF("ME_Form") then Err_Show 

Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
int_RPP=15 '设置每页显示数目
int_showNumberLink_=10 '数字导航显示数目
showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
str_nonLinkColor_="#999999" '非热链接颜色
toF_="<font face=webdings>9</font>"   			'首页 
toP10_=" <font face=webdings>7</font>"			'上十
toP1_=" <font face=webdings>3</font>"			'上一
toN1_=" <font face=webdings>4</font>"			'下一
toN10_=" <font face=webdings>8</font>"			'下十
toL_="<font face=webdings>:</font>"				'尾页

set VClass_Rs=User_Conn.execute("select count(*) from FS_ME_GroupDebateClass")
if VClass_Rs(0) = 0 then response.Redirect("GroupDebate_Class.asp") : response.End()
VClass_Rs.close

Function set_Def(old,Def)
	if old<>"" then 
		set_Def = old
	else
		set_Def = Def
	end if
End Function

Function Get_FValue_Html(Add_Sql,orderby)
	Dim Get_Html,This_Fun_Sql,ii,Str_Tmp,Arr_Tmp,New_Search_Str,Req_Str,regxp
	Dim fun_ii,fun_ClassID,fun_ClassType
	Str_Tmp = "gdID,ClassID,Title,InfoType,ClassType,hits,AddTime,isLock"
	This_Fun_Sql = "select "&Str_Tmp&" from FS_ME_GroupDebateManage"
	if Add_Sql<>"" then 
		if Add_Sql = "islock" Then
			This_Fun_Sql = and_where(This_Fun_Sql) &" "&"isLock = '1'"
		ElseIf Add_Sql = "notislock" Then
			This_Fun_Sql = and_where(This_Fun_Sql) &" "&"isLock = '0'"
		End If
	End If	
	if orderby<>"" then This_Fun_Sql = This_Fun_Sql &"  Order By "& replace(orderby,"csed"," Desc")
	if request.QueryString("Act")="SearchGo" then 
		Str_Tmp = "gdID,Title,Content,AppointUserNumber,AppointUserGroup,InfoType,AddTime,isLock,AccessFile,UserNumber,AdminName,ClassMember,PerPageNum,isSys,hits"
		Arr_Tmp = split(Str_Tmp,",")
		for each Str_Tmp in Arr_Tmp
			if Trim(request("frm_"&Str_Tmp))<>"" then 
				Req_Str = NoSqlHack(Trim(request("frm_"&Str_Tmp)))
				select case Str_Tmp
					case "gdID","InfoType","hits","AddTime","isLock","PerPageNum","isSys"
					''数字,日期
						regxp = "|<|>|=|<=|>=|<>|"
						if instr(regxp,"|"&left(Req_Str,1)&"|")>0 or instr(regxp,"|"&left(Req_Str,2)&"|")>0 then 
							New_Search_Str = and_where( New_Search_Str ) & Str_Tmp &" "& Req_Str
						elseif instr(Req_Str,"*")>0 then 
							if left(Req_Str,1)="*" then Req_Str = "%"&mid(Req_Str,2)
							if right(Req_Str,1)="*" then Req_Str = mid(Req_Str,1,len(Req_Str) - 1) & "%"							
							New_Search_Str = and_where( New_Search_Str ) & Str_Tmp &" like '"& Req_Str &"'"							
						else	
							New_Search_Str = and_where( New_Search_Str ) & Str_Tmp &" = "& Req_Str
						end if		
					case else
					''字符
						New_Search_Str = and_where(New_Search_Str) & Search_TextArr(Req_Str,Str_Tmp,"")
				end select 		
			end if
		next
		''=========================================
		'''vclass表示ClassID,Hy_vclass表示ClassType
		for fun_ii = 4 to 1 step -1			
			if request.Form("vclass"&fun_ii)<>"" then fun_ClassID = request.Form("vclass"&fun_ii) : exit for
		next
		for fun_ii = 4 to 1 step -1			
			if request.Form("Hy_vclass"&fun_ii)<>"" then fun_ClassType = request.Form("Hy_vclass"&fun_ii) : exit for
		next
		if fun_ClassID = "[ChangeToTop]" then fun_ClassID = 0
		if fun_ClassType = "[ChangeToTop]" then fun_ClassType = 0
		if fun_ClassID<>"" then New_Search_Str = and_where( New_Search_Str ) & "ClassID" &" = "& fun_ClassID
		if fun_ClassType<>"" then New_Search_Str = and_where( New_Search_Str ) & "ClassType" &" = "& fun_ClassType

		if New_Search_Str<>"" then This_Fun_Sql = and_where(This_Fun_Sql) & replace(New_Search_Str," where ","")
	end if
	
	Str_Tmp = ""
	'On Error Resume Next
	'response.Write(This_Fun_Sql)
	'response.End()
	Set VClass_Rs = CreateObject(G_FS_RS)
	VClass_Rs.Open This_Fun_Sql,User_Conn,1,1	
	if Err<>0 then 
		Err.Clear
		response.Redirect("../error.asp?ErrCodes=<li>查询出错:"&Err.Description&"</li><li>请检查字段类型是否匹配.</li>")
		response.End()
	end if
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	IF VClass_Rs.eof THEN
	 	response.Write("<tr class=""hback""><td colspan=15>暂无数据.</td></tr>") 
	else	
	VClass_Rs.PageSize=int_RPP
	cPageNo=NoSqlHack(Request.QueryString("Page"))
	If cPageNo="" Then cPageNo = 1
	If not isnumeric(cPageNo) Then cPageNo = 1
	cPageNo = Clng(cPageNo)
	If cPageNo<=0 Then cPageNo=1
	If cPageNo>VClass_Rs.PageCount Then cPageNo=VClass_Rs.PageCount 
	VClass_Rs.AbsolutePage=cPageNo
	
	  FOR int_Start=1 TO int_RPP 
		Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf
		Get_Html = Get_Html & "<td align=""center""><a href=""GroupDebate_manage.asp?Act=Edit&gdID="&VClass_Rs("gdID")&""" class=""otherset"" title='点击修改'>"&VClass_Rs("gdID")&"</a></td>" & vbcrlf
		Get_Html = Get_Html & "<td align=""center""><a href=""GroupDebate_manage.asp?Act=Edit&gdID="&VClass_Rs("gdID")&""" class=""otherset"" title='点击修改'>"& VClass_Rs("Title") & "</a></td>" & vbcrlf
		Str_Tmp = Get_FildValue("select vClassName from FS_ME_GroupDebateClass where VCID="&set_Def(VClass_Rs("ClassID"),0),"无") ''社群分类
		Get_Html = Get_Html & "<td align=""center"">"& Str_Tmp & "</td>" & vbcrlf
		select case VClass_Rs("InfoType")
			case 0
				Str_Tmp = "新闻"  
			case 1
				Str_Tmp = "下载"
			case 2
				Str_Tmp = "商品"
			case 3
				Str_Tmp = "房产"
			case 4
				Str_Tmp = "供求"
			case 5
				Str_Tmp = "求职"
			case 6
				Str_Tmp = "招聘"
			case 7
				Str_Tmp = "其它"
			case else
				Str_Tmp = "无"
		end select 
		Get_Html = Get_Html & "<td align=""center"">"& Str_Tmp & "</td>" & vbcrlf
		Str_Tmp = Get_FildValue("select vClassName from FS_ME_VocationClass where VCID="&set_Def(VClass_Rs("ClassID"),0),"无") ''行业分类
		Get_Html = Get_Html & "<td align=""center"">"& Str_Tmp & "</td>" & vbcrlf
		Get_Html = Get_Html & "<td align=""center"">"& set_Def(VClass_Rs("hits"),0) & "</td>" & vbcrlf
		Get_Html = Get_Html & "<td align=""center"">"& VClass_Rs("AddTime") & "</td>" & vbcrlf
		if cbool(VClass_Rs("isLock")) then 
			''锁定,需要解锁
			Get_Html = Get_Html & "<td align=""center""><input type=button value=""锁 定"" onclick=""javascript:location='GroupDebate_manage.asp?Act=OtherEdit&EditSql="&server.URLEncode(Encrypt( "Update FS_ME_GroupDebateManage set isLock=0 where gdID="&VClass_Rs("gdID")) )&"&Red_Url='"" title=""点击解锁"" style=""color:red""></td>" & vbcrlf
		else
			Get_Html = Get_Html & "<td align=""center""><input type=button value=""正 常"" onclick=""javascript:location='GroupDebate_manage.asp?Act=OtherEdit&EditSql="&server.URLEncode(Encrypt( "Update FS_ME_GroupDebateManage set isLock=1 where gdID="&VClass_Rs("gdID")) )&"&Red_Url='"" title=""点击锁定""></td>" & vbcrlf
		end if
		Get_Html = Get_Html & "<td align=""center"" class=""ischeck""><input type=""checkbox"" name=""gdID"" id=""gdID"" value="""&VClass_Rs("gdID")&""" /></td>" & vbcrlf
		Get_Html = Get_Html & "</tr>" & vbcrlf
		VClass_Rs.MoveNext
 		if VClass_Rs.eof or VClass_Rs.bof then exit for
      NEXT
	END IF
	Get_Html = Get_Html & "<tr class=""hback""><td colspan=20 align=""center"" class=""ischeck"">"& vbcrlf &"<table width=""100%"" border=0><tr><td height=30>" & vbcrlf
	Get_Html = Get_Html & fPageCount(VClass_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)  & vbcrlf
	Get_Html = Get_Html & "</td><td align=right><input type=""submit"" name=""submit"" value="" 删除 "" onclick=""javascript:return confirm('确定要删除所选项目吗?');""></td>"
	Get_Html = Get_Html &"</tr></table>"&vbNewLine&"</td></tr>"
	VClass_Rs.close
	Get_FValue_Html = Get_Html
End Function

Function Get_FildValue(This_Fun_Sql,Default)
	Dim This_Fun_Rs
	set This_Fun_Rs = User_Conn.execute(This_Fun_Sql)
	if not This_Fun_Rs.eof then 
		Get_FildValue = This_Fun_Rs(0)
	else
		Get_FildValue = Default
	end if
	This_Fun_Rs.close
End Function

Function Get_FildValue_List(This_Fun_Sql,EquValue,Get_Type)
'''This_Fun_Sql 传入sql语句,EquValue与数据库相同的值如果是<option>则加上selected,Get_Type=1为<option>
Dim Get_Html,This_Fun_Rs,Text
On Error Resume Next
set This_Fun_Rs = User_Conn.execute(This_Fun_Sql)
If Err.Number <> 0 then Err.clear : response.Redirect("../error.asp?ErrCodes=<li>抱歉,Get_FildValue_List函数传入的Sql语句有问题.或表和字段不存在.</li>")
do while not This_Fun_Rs.eof 
	select case Get_Type
	  case 1
		''<option>		
		if instr(This_Fun_Sql,",") >0 then 
			Text = This_Fun_Rs(1)
		else
			Text = This_Fun_Rs(0)
		end if	
		if EquValue = This_Fun_Rs(0) then 
			Get_Html = Get_Html & "<option value="""&This_Fun_Rs(0)&"""  style=""color:#0000FF"" selected>"&Text&"</option>"&vbNewLine
		else
			Get_Html = Get_Html & "<option value="""&This_Fun_Rs(0)&""">"&Text&"</option>"&vbNewLine
		end if		
	  case else
		exit do : Get_FildValue_List = "Get_Type值传入错误" : exit Function
    end select
	This_Fun_Rs.movenext
loop
This_Fun_Rs.close
Get_FildValue_List = Get_Html
End Function ''================================================================


Sub OtherEdit()
	if not MF_Check_Pop_TF("ME025") then Err_Show '权限判断
	Dim Red_Url
	Red_Url = request.QueryString("Red_Url")
	if Red_Url = "" then Red_Url = "GroupDebate_manage.asp"
	On Error Resume Next
	if request.QueryString("EditSql")<>"" then 
		User_Conn.execute( Decrypt(request.QueryString("EditSql")) )
		If Err.Number <> 0 then response.Redirect("../error.asp?ErrCodes=<li>抱歉,OtherEdit过程传入的Sql语句有问题.或表和字段不存在.</li>")
	end if
	response.Redirect(Red_Url)
End Sub

Sub Del()
	if not MF_Check_Pop_TF("ME024") then Err_Show '权限判断
	Dim Str_Tmp
	if request.QueryString("gdID")<>"" then 
		User_Conn.execute("Delete from FS_ME_GroupDebateManage where gdID = "&request.QueryString("gdID"))
	else
		Str_Tmp = request.form("gdID")
		if Str_Tmp="" then response.Redirect("../error.asp?ErrCodes=<li>你必须至少选择一个进行删除。</li>")
		Str_Tmp = replace(Str_Tmp," ","")
		User_Conn.execute("Delete from FS_ME_GroupDebateManage where gdID in ("&Str_Tmp&")")
	end if
	response.Redirect("../Success.asp?ErrorUrl="&server.URLEncode( "User/GroupDebate_manage.asp?Act=View" )&"&ErrCodes=<li>恭喜,删除成功。</li>")
End Sub

Sub Save()
	'''vclass表示ClassID,Hy_vclass表示ClassType
	Dim Str_Tmp,Arr_Tmp,gdID,ii,New_ClassID,New_ClassType,kkk
	for ii = 4 to 1 step -1			
		if request.Form("vclass"&ii)<>"" then New_ClassID = request.Form("vclass"&ii) : exit for
	next
	for ii = 4 to 1 step -1			
		if request.Form("Hy_vclass"&ii)<>"" then New_ClassType = request.Form("Hy_vclass"&ii) : exit for
	next
	if New_ClassID = "[ChangeToTop]" then New_ClassID = 0
	if New_ClassType = "[ChangeToTop]" then New_ClassType = 0
	Str_Tmp = "ClassID,Title,Content,AppointUserNumber,AppointUserGroup,InfoType,ClassType,AddTime,isLock,AccessFile,UserNumber,AdminName,ClassMember,PerPageNum,isSys,hits"

⌨️ 快捷键说明

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