<!--#include file="admin_conn.asp"-->
<%
chkLogin
response.charset="utf-8"
response.Expires = 0
response.expiresabsolute = Now() - 1
response.addHeader "pragma", "no-cache"
response.addHeader "cache-control", "private"
response.CacheControl = "no-cache"
response.Buffer = True
response.Clear

dim action : action = be("all","action")
dim show,id,ajaxcontent,name,flag,tid,ttype,thit,ttopic,thide,tlevel
dim rs,str,tjText

show = be("all","show")
id = be("all","id") 
name = be("all","name") 
ajaxcontent = be("all","ajaxcontent") : ajaxcontent=trim(ajaxcontent)
flag = be("all","flag")
if flag="vod" then
    tid ="d_id" : ttype="d_type" :thit="d_hits":ttopic="d_topic" : thide="d_hide" : tlevel="d_level"
elseif flag="art" then
	tid ="a_id" : ttype="a_type" :thit="a_hits":ttopic="a_topic" : thide="a_hide" : tlevel="a_level"
end if

select case action
	case "getinfo" : getinfo
	case "getinfoxml" : getinfoxml
	case "save" : save
	case "savexml" : savexml
	case "del" : del
	case "delxml" : delxml
	case "tj" : mtuijian
	case "lz" : mstatus
	case "zt" : mtopic
	case "pltj" : mpltuijian
	case "plfl" : mplfenlei
	case "plzt" : mplzhuanti
	case "plrq" : mplrenqi
	case "plyc" : mplyincang
	case "ckname" : mname
	case else: redirect getReferer()
end select
dispseObj()

sub getinfoxml
	dim tab : tab = be("all","tab")
	dim val : val = be("all","val")
	dim i,j,objxml,xmlnode,dict
	set objxml = new AppXmlDom
	set dict = CreateObject("Scripting.Dictionary")
	dim status,sort,des,tip,show,path,file,paramets,weeks,hours
	
	select case tab
		case "vodplay","voddown","vodserver":
			if tab="vodplay" then
				path="players/player"
			elseif tab="voddown" then
				path="downs/down"
			elseif tab="vodserver" then
				path="servers/server"
			end if
			objxml.OpenXml("../inc/"&tab&".xml")
			set xmlnode = objxml.FindNodes(path)
			for i=0 to xmlnode.length-1
				if val = xmlnode(i).getAttributeNode("from").nodevalue then
					show = xmlnode(i).getAttributeNode("show").nodevalue
					status = xmlnode(i).getAttributeNode("status").nodevalue
					sort = xmlnode(i).getAttributeNode("sort").nodevalue
					des = xmlnode(i).getAttributeNode("des").nodevalue
					tip = xmlnode(i).selectNodes("tip")(0).text
					exit for
				end if
			next
			dict.add "from",val
			dict.add "status",status
			dict.add "sort",sort
			dict.add "des",des
			dict.add "tip",tip
			dict.add "show",show
		case "timming":
			objxml.OpenXml("../inc/timmingset.xml")
			set xmlnode = objxml.FindNodes("timmings/timming")
			for i=0 to xmlnode.length-1
				if val = xmlnode(i).selectNodes("name")(0).text then
					des = xmlnode(i).selectNodes("des")(0).text
					status = xmlnode(i).selectNodes("status")(0).text
					file = xmlnode(i).selectNodes("file")(0).text
					paramets = xmlnode(i).selectNodes("paramets")(0).text
					weeks = xmlnode(i).selectNodes("weeks")(0).text
					hours = xmlnode(i).selectNodes("hours")(0).text
					exit for
				end if
			next
			dict.add "name",val
			dict.add "des",des
			dict.add "status",status
			dict.add "file",file
			dict.add "paramets",paramets
			dict.add "weeks",weeks
			dict.add "hours",hours
		case else
	end select
	
	set xmlnode = nothing
	set objxml= nothing
	writeA ((new AppJSON).toJSON(empty, dict, true))
	dict.RemoveAll
	set dict = nothing
end sub

sub delxml
	dim tab : tab = be("all","tab")
	dim val : val = be("all","val")
	dim i,objxml,xmlnode,path
	set objxml = new AppXmlDom
	select case tab
		case "vodplay","voddown","vodserver":
			if tab="vodplay" then
				path="players/player"
			elseif tab="voddown" then
				path="downs/down"
			elseif tab="vodserver" then
				path="servers/server"
			end if
			objxml.OpenXml("../inc/"&tab&".xml")
			set xmlnode = objxml.FindNodes(path)
			for i=0 to xmlnode.length-1
				if val = xmlnode(i).getAttributeNode("from").nodevalue then
					objxml.DelNode xmlnode(i)
					objxml.SaveXML()
					exit for
				end if
			next
		case "timming":
			objxml.OpenXml("../inc/timmingset.xml")
			set xmlnode = objxml.FindNodes("timmings/timming")
			for i=0 to xmlnode.length-1
				if val = xmlnode(i).selectNodes("name")(0).text then
				objxml.DelNode(xmlnode(i))
				objxml.SaveXML()
				exit for
			end if
			next
		case else
	end select
	set xmlnode = nothing
	set objxml = nothing
	redirect getReferer()
end sub

sub savexml
	dim tab : tab = be("all","tab")
	dim i,objxml,xmlnode,path,path1,tempNode,tipnode,newNode
	set objxml = new AppXmlDom
	dim flag,from,status,show,des,tip,sort,name,file,paramets,weeks,hours
	flag = be("all","flag")
	
	select case tab
		case "vodplay","voddown","vodserver":
			from = be("post","from") : status = be("post","status") : des = be("post","des") 
			tip = be("post","tip") : sort = be("post","sort") : show = be("post","show")
			if tab="vodplay" then
				path="players/player" : path1="player"
			elseif tab="voddown" then
				path="downs/down": path1="down"
			elseif tab="vodserver" then
				path="servers/server": path1="server"
			end if
			objxml.OpenXml("../inc/"&tab&".xml")
			set xmlnode = objxml.FindNodes(path)
			if flag="edit" then
				for i=0 to xmlnode.length-1
					if from = xmlnode(i).getAttributeNode("from").nodevalue then
						set tipnode = xmlnode(i).getElementsByTagName("tip")
						objxml.AddAttribute "status",status,xmlnode(i)
						objxml.AddAttribute "sort",sort,xmlnode(i)
					    objxml.AddAttribute "show",show,xmlnode(i)
					    objxml.AddAttribute "des",des,xmlnode(i)
					    tipnode(0).text = tip
						exit for
					end if
				next
				set tipnode=nothing
			else
				set tempNode = objxml.AddNode(path1,xmlnode(0).parentNode)
				set tipnode = objxml.AddNode("tip",tempNode)
				objxml.AddAttribute "status",status,tempNode
				objxml.AddAttribute "sort",sort,tempNode
				objxml.AddAttribute "from",from,tempNode
				objxml.AddAttribute "show",show,tempNode
				objxml.AddAttribute "des",des,tempNode
				objxml.AddText tip,true,tipnode
				set tempNode=nothing
				set tipnode=nothing
			end if
			objxml.SaveXML()
		case "timming":
			name =  be("post","name") : des =  be("post","des") : status =  be("post","status")
			file =  be("post","file") : paramets =  be("post","paramets") : weeks =  be("post","weeks")
			hours =  be("post","hours")
			
			weeks = replaceStr(weeks," ","")
			hours = replaceStr(hours," ","")
			
			
			objxml.OpenXml("../inc/timmingset.xml")
			if flag="edit" then
				set xmlnode = objxml.FindNodes("timmings/timming")
				for i=0 to xmlnode.length-1
					if name = xmlnode(i).selectNodes("name")(0).text then
						xmlnode(i).selectNodes("des")(0).text = des
						xmlnode(i).selectNodes("status")(0).text = status
						xmlnode(i).selectNodes("file")(0).text = file
						xmlnode(i).selectNodes("paramets")(0).text = paramets
						xmlnode(i).selectNodes("weeks")(0).text = weeks
						xmlnode(i).selectNodes("hours")(0).text = hours
					end if
				next
			else
				set xmlnode = objxml.FindNodes("timmings")
				set tempNode = objxml.AddNode("timming",xmlnode(0))
				set newNode = objxml.AddNode ("name",tempNode)
				newNode.Text = name
				set newNode = objxml.AddNode ("des",tempNode)
				newNode.Text = des
				set newNode = objxml.AddNode ("status",tempNode)
				newNode.Text = status
				set newNode = objxml.AddNode ("file",tempNode)
				newNode.Text = file
				set newNode = objxml.AddNode ("paramets",tempNode)
				newNode.Text = paramets
				set newNode = objxml.AddNode ("weeks",tempNode)
				newNode.Text = weeks
				set newNode = objxml.AddNode ("hours",tempNode)
				newNode.Text = hours
				set newNode = objxml.AddNode ("runtime",tempNode)
				newNode.Text = ""
			end if
			objxml.SaveXML()
			set newNode=nothing
		case else
	end select
	set xmlnode = nothing
	set objxml = nothing
	writeA "保存完毕"
end sub

sub getinfo
	dim tab : tab = be("all","tab")
	dim col : col = be("all","col")
	dim val : val = be("all","val")
	dim rs : set rs = objdb.DB("SELECT * from "&tab&" WHERE "&col&"="&val,"rs1")
	writeA ((new AppJSON).toJSON(empty, rs, true))
	objdb.c(rs)
end sub

sub save
	dim tab,flag,where,str,arr,i,rc,upcache
	dim l_id,l_name,l_type,l_url,l_sort,l_logo,l_remarks,l_code
	dim t_id,t_name,t_enname,t_sort,t_pid,t_template,t_vodtemplate,t_playtemplate,t_downtemplate,t_arttemplate,t_key,t_pic,t_des
	dim a_id,a_name,a_sort
	dim s_id,s_url,s_name,s_sort,s_des
	dim g_id,g_reply,g_replytime
	dim m_id,m_name,m_password,m_levels,m_status
	dim ug_id,ug_name,ug_type,ug_popedom,ug_upgrade,ug_popvalue
	dim u_id,u_name,u_group,u_password,u_email,u_phone,u_question,u_answer,u_qq,u_status,u_points,u_start,u_end,u_flag
	dim colarr,valarr
	
	rc=false
	upcache=false
	tab = be("all","tab") :  flag = be("all","flag")
	select case tab
		case "{pre}link" :
			l_id = be("all","l_id") : l_name = be("post","l_name") : l_type = be("post","l_type")
			l_url = be("post","l_url") : l_sort = be("post","l_sort") : l_logo = be("post","l_logo")
			if not isNum(l_sort) then  l_sort= objdb.db("SELECT MAX(l_sort) FROM {pre}link","rs1")(0)+1
			colarr = Array("l_name","l_type","l_url","l_sort","l_logo")
			valarr = Array(l_name,l_type,l_url,l_sort,l_logo)
			where = "l_id="&l_id
		case "{pre}vod_type" :
			t_id = be("all","t_id") : t_name = be("post","t_name") : t_enname = be("post","t_enname")
			t_pid = be("post","t_pid") : t_sort = be("post","t_sort") : t_key = be("post","t_key") : t_des = be("post","t_des")
			t_template = be("post","t_template") : t_vodtemplate= be("post","t_vodtemplate") : t_playtemplate = be("post","t_playtemplate") :  t_downtemplate = be("post","t_downtemplate") 
			if not isNum(t_sort) then t_sort= objdb.db("SELECT MAX(t_sort) FROM {pre}vod_type","rs1")(0)+1
			colarr = Array("t_name","t_enname","t_sort","t_pid","t_template","t_vodtemplate","t_playtemplate","t_downtemplate","t_key","t_des")
			valarr = Array(t_name,t_enname,t_sort,t_pid,t_template,t_vodtemplate,t_playtemplate,t_downtemplate,t_key,t_des)
			where = "t_id="&t_id
			upcache=true
		case "{pre}vod_topic" :
			t_id = be("all","t_id") : t_name = be("post","t_name") : t_enname = be("post","t_enname")
			t_sort = be("post","t_sort") : t_pic = be("post","t_pic") : t_template = be("post","t_template")
			t_des = be("post","t_des")
			if not isNum(t_sort) then  t_sort= objdb.DB("select max(t_sort) from {pre}vod_topic","rs1")(0)+1
			colarr = Array("t_name","t_enname","t_sort","t_pic","t_template","t_des")
			valarr = Array(t_name,t_enname,t_sort,t_pic,t_template,t_des)
			where = "t_id="&t_id
			upcache=true
		case "{pre}art_type" :
			t_id = be("all","t_id") : t_name = be("post","t_name") : t_enname = be("post","t_enname")
			t_pid = be("post","t_pid") : t_sort = be("post","t_sort") : t_key = be("post","t_key") : t_des = be("post","t_des")
			t_template = be("post","t_template") : t_arttemplate= be("post","t_arttemplate")
			if not isNum(t_sort) then t_sort= objdb.db("SELECT MAX(t_sort) FROM {pre}art_type","rs1")(0)+1
			colarr = Array("t_name","t_enname","t_sort","t_pid","t_template","t_arttemplate","t_key","t_des")
			valarr = Array(t_name,t_enname,t_sort,t_pid,t_template,t_arttemplate,t_key,t_des)
			where = "t_id="&t_id
			upcache=true
		case "{pre}art_topic" :
			t_id = be("all","t_id") : t_name = be("post","t_name") : t_enname = be("post","t_enname")
			t_sort = be("post","t_sort") : t_pic = be("post","t_pic") : t_template = be("post","t_template")
			t_des = be("post","t_des")
			if not isNum(t_sort) then  t_sort= objdb.DB("select max(t_sort) from {pre}art_topic","rs1")(0)+1
			colarr = Array("t_name","t_enname","t_sort","t_pic","t_template","t_des")
			valarr = Array(t_name,t_enname,t_sort,t_pic,t_template,t_des)
			where = "t_id="&t_id
			upcache=true
		case "{pre}gbook":
			g_id = be("all","g_id") : g_reply = be("all","g_reply") : g_replytime=now()
			colarr = Array("g_reply","g_replytime")
			valarr = Array(g_reply,g_replytime)
			where = "g_id="&g_id
		case "{pre}manager":
			m_id = be("all","m_id") : m_name = be("all","m_name") : m_password = be("all","m_password")
			m_levels = be("all","m_levels") : m_status = be("all","m_status")
			if m_password <>"" then
				colarr = Array("m_name","m_password","m_levels","m_status")
				valarr = Array(m_name,md5(m_password,2),m_levels,m_status)
			else
				colarr = Array("m_name","m_levels","m_status")
				valarr = Array(m_name,m_levels,m_status)
			end if
			where = "m_id="&m_id
		case "{pre}user_group":
			ug_id = be("all","ugid") : ug_name = be("all","ug_name") : ug_type = be("all","ug_type")
			ug_popedom = be("all","ug_popedom") : ug_upgrade = be("all","ug_upgrade") : ug_popvalue = be("all","ug_popvalue")
			str=ug_type : arr = split(str,",") : ug_type=","
			
			for i =0 to ubound(arr)
				if rc then ug_type = ug_type & ","
				ug_type = ug_type & trim(arr(i))
				rc = true
			next
			ug_type = ug_type & ","
			ug_type = replace(ug_type,",,",",")
			
			rc=false
			str=ug_popedom : arr = split(str,",") : ug_popedom=","
			for i =0 to ubound(arr)
				if rc then ug_popedom = ug_popedom & ","
				ug_popedom = ug_popedom & trim(arr(i)) 
				rc = true
			next
			ug_popedom = ug_popedom & ","
			ug_popedom = replace(ug_popedom,",,",",")
			
			colarr = Array("ug_name","ug_type","ug_popedom","ug_upgrade","ug_popvalue")
			valarr = Array(ug_name,ug_type,ug_popedom,ug_upgrade,ug_popvalue)
			where = "ug_id="&ug_id
			upcache=true
		case "{pre}user":
			u_id = be("all","uid") : u_name = be("all","u_name") : u_group = be("all","u_group")
			u_password = be("all","u_password") 
			u_qq = be("all","u_qq") : u_email = be("all","u_email") : u_status = be("all","u_status")
			u_points = be("all","u_points") : u_flag=be("all","u_flag") : u_phone = be("all","u_phone")
			u_question = be("all","u_question") : u_answer = be("all","u_answer")
			if u_flag = 1 then
				u_start=be("all","u_starttime") : u_end = be("all","u_endtime")
			elseif u_flag=2then
				u_start=be("all","u_startip") : u_end = be("all","u_endip")
			end if
			if flag="add" or u_password <>"" then
				u_password=md5(u_password,2)
				colarr = Array("u_name","u_group","u_password","u_email","u_qq","u_phone","u_question","u_answer","u_status","u_points","u_start","u_end","u_flag")
				valarr = Array(u_name,u_group,u_password,u_email,u_qq,u_phone,u_question,u_answer,u_status,u_points,u_start,u_end,u_flag)
			else
				colarr = Array("u_name","u_group","u_email","u_qq","u_phone","u_question","u_answer","u_status","u_points","u_start","u_end","u_flag")
				valarr = Array(u_name,u_group,u_email,u_qq,u_phone,u_question,u_answer,u_status,u_points,u_start,u_end,u_flag)
			end if
			where = "u_id="&u_id
	end select
	if flag="add" then
		objdb.Add tab,colarr,valarr
	elseif flag="edit" then
		objdb.Update tab,colarr,valarr,where
	end if
	if upcache then updateCacheFile
    writeE "保存完毕"
end sub

sub del
	dim tab,flag,ids,col,where,upcache:upcache=false
	tab = be("all","tab")
	flag = be("all","flag")
	select case tab
		case "{pre}link" :
			col="l_id" : ids = be("all","l_id")
		case "{pre}vod_type":
			col="t_id" : ids = be("all","t_id"):upcache=true
		case "{pre}vod_topic" :
			col="t_id" : ids = be("all","t_id"):upcache=true
		case "{pre}art":
			col="a_id" : ids = be("all","a_id")
		case "{pre}art_type" :
			col="t_id" : ids = be("all","t_id"):upcache=true
		case "{pre}art_topic" :
			col="t_id" : ids = be("all","t_id"):upcache=true
		case "{pre}gbook":
			col="g_id" : ids = be("all","g_id")
		case "{pre}manager":
			col="m_id" : ids = be("all","m_id")
		case "{pre}user_group":
			col="ug_id" : ids = be("all","ug_id"):upcache=true
		case "{pre}user":
			col="u_id" : ids = be("all","u_id")
		case "{pre}user_card":
			col="c_id" : ids = be("all","c_id")
		case "{pre}comment"
			col="c_id" : ids = be("all","c_id")
	end select
	
	if not isN(ids) then objdb.Delete tab, col&" in ("&ids&")"
	if upcache then updateCacheFile
	if isN(flag) then
		redirect getReferer()
	else
		writeA "删除完毕"
	end if
end sub

sub mname
	set rs = objdb.DB("SELECT * FROM {pre}vod WHERE d_name='"& name &"'","rs1")
	if not rs.eof then
		str="d_name_ok$<img src=""../images/icons/html_no.gif"" border=""0"">" 
	else
		str="d_name_ok$<img src=""../images/icons/html_ok.gif"" border=""0"">" 
	end if
	objdb.C(rs)
	writee str
end sub

sub mtuijian
	if show = 1 then
		str="<select id=""ajaxcontent"" name=""ajaxcontent""><option value="""">请选择推荐</option><option value=""1"">推荐1</option><option value=""2"">推荐2</option><option value=""3"">推荐3</option><option value=""4"">推荐4</option><option value=""5"">推荐5</option><option value=""0"">取消推荐</option></select><input type=""button"" value=""确定"" onclick=""ajaxsubmit('"&id&"','"&action&"','"&flag&"');"" class=inputbut><input type=""button"" value=""取消"" onclick=""closew();"" class=inputbut>"
		writee str
	else
		select case ajaxcontent
			case "1" : tjText ="1"
			case "2" : tjText ="2"
			case "3" : tjText ="3"
			case "4" : tjText ="4"
			case "5" : tjText ="5"
			case "0" : tjText ="0"
		end select
		objdb.Update "{pre}"&flag ,Array(tlevel),Array(ajaxcontent) , tid&"="&ID
		writee "tj"&id&"$<img src=""../images/icons/ico"&tjText&".gif"" border=""0"" style=""cursor: pointer;"" onClick=""setday('tj','"&id&"')""/> "
	end if
end sub

sub mpltuijian
	if show = 1 then
		str="<select id=""ajaxcontent"" name=""ajaxcontent""><option value="""">请选择推荐</option><option value=""1"">推荐1</option><option value=""2"">推荐2</option><option value=""3"">推荐3</option><option value=""4"">推荐4</option><option value=""5"">推荐5</option><option value=""0"">取消推荐</option></select><input type=""button"" value=""确定"" onclick=""ajaxsubmit('"&id&"','"&action&"','"&flag&"');"" class=inputbut> <input type=""button"" value=""取消"" onclick=""closew();"" class=inputbut>"
		writee str
	elseif show = 2 then
		select case ajaxcontent
			case "1" : tjText ="1"
			case "2" : tjText ="2"
			case "3" : tjText ="3"
			case "4" : tjText ="4"
			case "5" : tjText ="5"
		end select
		objdb.db "UPDATE {pre}"&flag&" set "&tlevel&"="&ajaxcontent&" WHERE "&tid&" IN("&ID&")","exe"
		dim idarr : idarr = Split(id,",")
		dim i
		if ajaxcontent = "0" then
			for i =0 to ubound(idarr)
				writeA "tj"&idarr(i)&"$<img src=""../images/icons/ico0.gif"" border=""0"" style=""cursor: pointer;"" onClick=""setday('tj','"&idarr(i)&"')""/>|||"
			next 
		else
			for i =0 to ubound(idarr)
				writeA "tj"&idarr(i)&"$<img src=""../images/icons/ico"&tjText&".gif"" border=""0"" style=""cursor: pointer;"" onClick=""ajaxdivdel('"&idarr(i)&"','"&action&"')""/> |||"
			next 
		end if
	end if
end sub

sub mplfenlei
	if show = 1 then
		str="<select id=""ajaxcontent"" name=""ajaxcontent""><option value=""0"">请选择栏目</option>" & makeSelectAll("{pre}"&flag&"_type","t_id","t_name","t_pid","t_sort",0,"","&nbsp;|&nbsp;&nbsp;","") &"</select><input type=""button"" value=""确定"" onclick=""ajaxsubmit('"&id&"','"&action&"','"&flag&"');"" class=inputbut> <input type=""button"" value=""取消"" onclick=""closew();"" class=inputbut>"
		writee str
	elseif show = 2 then
		objdb.DB "UPDATE {pre}"&flag & " set "& ttype &"="&ajaxcontent& " WHERE " & tid &" IN("&ID&")","exe"
		writeA "reload"
	end if
end sub

sub mplzhuanti
	if show = 1 then
		str="<select id=""ajaxcontent"" name=""ajaxcontent""><option value=""0"">请选择专题</option>" & makeSelect("{pre}"&flag&"_topic","t_id","t_name","t_sort","","&nbsp;|&nbsp;&nbsp;","") &"</select><input type=""button"" value=""确定"" onclick=""ajaxsubmit('"&id&"','"&action&"','"&flag&"');"" class=inputbut> <input type=""button"" value=""取消"" onclick=""closew();"" class=inputbut>"
		writee str
	elseif show = 2 then
		objdb.DB "UPDATE {pre}"&flag & " set "& ttopic &"="&ajaxcontent& " WHERE " & tid &" IN("&ID&")","exe"
		writeA "reload"
	end if
end sub

sub mplrenqi
	if show = 1 then
		str="<input id=""num1"" name=""num1"" type=""text""  size=""5"">到<input id=""num2"" name=""num2"" type=""text""  size=""5"">之间<input type=""button"" value=""确定"" onclick=""ajaxsubmit('"&id&"','"&action&"','"&flag&"');"" class=inputbut> <input type=""button"" value=""取消"" onclick=""closew();"" class=inputbut>"
		writee str
	elseif show = 2 then
		dim num1,num2,num3
		num1 = be("all","num1") : num2 = be("all","num2")
		if isN(num1) or not isNum(num1) then num1=1
		if isN(num2) or not isNum(num2) then num1=1000
		dim rs
		set rs = objdb.db("select "&tid&" from {pre}"&flag&" where "&tid&" in (" & id & ")","rs1")
		do while not rs.eof 
			num3 = rndNum(num1,num2)
			objdb.Update "{pre}"&flag ,Array(thit),Array(num3) ,tid&"="&rs(tid)
		rs.movenext
		loop
		objdb.c(rs)
		writeA "reload"
	end if
end sub

sub mplyincang
	if show = 1 then
		str="<select id=""ajaxcontent"" name=""ajaxcontent""><option value="""">请选择...</option><option value=""0"">显示</option><option value=""1"">隐藏</option></select><input type=""button"" value=""确定"" onclick=""ajaxsubmit('"&id&"','"&action&"','"&flag&"');"" class=inputbut> <input type=""button"" value=""取消"" onclick=""closew();"" class=inputbut>"
		writee str
	elseif show = 2 then
		objdb.DB "UPDATE {pre}"&flag & " set "& thide &"="&ajaxcontent& " WHERE " & tid &" IN("&ID&")","exe"
		writeA "reload"
	end if
end sub


sub mtopic
	if show = 1 then
		str="<select id=""ajaxcontent"" name=""ajaxcontent""><option value=""0"">请选择专题</option>" & makeSelect("{pre}"&flag&"_topic","t_id","t_name","t_sort","","&nbsp;|&nbsp;&nbsp;","") &"</select><input type=""button"" value=""确定"" onclick=""ajaxsubmit('"&id&"','"&action&"','"&flag&"');"" class=inputbut> <input type=""button"" value=""取消"" onclick=""closew();"" class=inputbut>"
		writee str
	elseif show = 2 then
		objdb.Update "{pre}"&flag ,Array(ttopic),Array(ajaxcontent),tid&"="& ID
		writeA "zt"&id&"$<img src=""../images/icons/icon_01.gif"" border=""0"" style=""cursor: pointer;"" onClick=""ajaxdivdel('"&id&"','"&action&"','"&flag&"')""/>"
	elseif show = 3 then
		objdb.Update "{pre}"&flag ,Array(ttopic),Array(0),tid&"="& ID
		writeA "zt"&id&"$<img src=""../images/icons/icon_02.gif"" border=""0"" style=""cursor: pointer;"" onClick=""setday('zt','"&id&"','"&flag&"')""/>" 
	end if
end sub
%>