<!--#include file="../../../inc/cms_admin.asp" -->
<%
dim SID, LabelID,Label_SID,Label_Order, Label_pic,   Label_AddTime, Label_name,  Label_OnOff, Label_editTime,Label_Desc,Label_Content
dim sql,Label_EnName,usertype,table,col,colval,idval,id,sorLabelID,title,entitle,Label_title,Label_entitle

dim act : act=getForm("act","get")
dim stype : stype=getForm("stype","get")
dim postion : postion=getForm("postion","get")
Label_Order=getForm("Order","both")
table=getForm("table","both")
col=getForm("col","both")
colval=getForm("colval","both")
idval=getForm("idval","both")
LabelID=getForm("LabelID","both")
id=isnum(getForm("id","both"))
title=getForm("title","both")
entitle=getForm("entitle","both")
Select case act	
	case "setlabels"	:	dbconn("update [dbpre]labels set Label_OnOff="&colval&"  where  LabelID="&ID&"")
	case "del"			:	dbconn("delete from [dbpre]labels  where LabelID in ("&id&")")	
	case "edit" 		:	editlabels
	case "add"			:	addlabels
	case "del"			: 	dellabels
	case "saveid" 	: 	saveid
End Select

sub saveid
	dim colid		:	colid=getForm("colid","both")
	dim colname		:	colname=getForm("colname","both")
	dim colval		:	colval=getForm("colval","both")
	dim sql1		:	sql1="update [dbpre]labels Set "&colname&"='"&colval&"' Where LabelID="&colid
	dim sql2		:	sql2="update [dbpre]labels Set "&colname&"="&colval&" Where LabelID="&colid	
	dbconn(sql1)	:	if err then  dbconn(sql2)	
end sub

Sub getlabels
dim rs,id	
	if not isnul(LabelID) then	
		sql ="select * from [dbpre]labels where LabelID="&LabelID
		set rs = conn.exec(sql,"r1")		
	else
		back "没有这条记录"
	end if 
	if rs.eof then 
			back "没有这条记录"
		else
			LabelID=rs("LabelID")
			
			Label_Order=rs("Label_Order")
			Label_Name=rs("Label_name")
			Label_title=rs("Label_title")
			Label_entitle=rs("Label_entitle")
			Label_pic=rs("Label_pic")
			Label_AddTime=rs("Label_AddTime")	
			Label_editTime=rs("Label_editTime")	
			Label_OnOff=rs("Label_OnOff")			
			Label_entitle=rs("Label_entitle")
			Label_Desc=rs("Label_Desc")
			Label_Content=decode(rs("Label_Content"))
		end if
	rs.close : set rs=nothing
End Sub



Sub getMobel(this)
	dim rs,sel,sql,OnOff
	sql="select Model_type,Model_Name from [dbpre]model where Model_OnOff=1 and Model_table='content'"
	set rs=conn.Exec(sql,"r1")
		Do While Not rs.Eof	
			IF CSTR(this)=CSTR(rs(0)) Then sel = "selected=""selected""" else sel="" end if
			dim rscount:rscount=0		
				echo "<option  value="""& rs(0) &""" "&sel&">"&rs(1)&"</option>" & vbcr				
			rs.MoveNext
		Loop
		Closers rs
end Sub
%>