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

📄 admin_product.asp

📁 正版创力4.1SQL商业版!!!ASP版。
💻 ASP
📖 第 1 页 / 共 5 页
字号:
	Trademark		= Trim(request.form("Trademark"))
	ProductModel	= Trim(request.form("ProductModel"))
	ProductUnit		= Trim(request.form("ProductUnit"))
	Intro			= Trim(request.form("Intro"))
	Explain			= Trim(request.form("Explain"))
	MarketPrice		= Trim(request.form("MarketPrice"))
	MemberPrice		= Trim(request.form("MemberPrice"))
	TruePrice		= Trim(request.form("TruePrice"))
	Discount		= Trim(request.form("Discount"))
	BeginDate		= Trim(request.form("BeginDate"))
	EndDate			= Trim(request.form("EndDate"))
	NoOver			= Trim(request.form("NoOver"))
	'IncludeTax		= Trim(request.form("IncludeTax"))
	'TaxRate		= Cl.GetClng(request.form("TaxRate"))
	InfoPoint		= Cl.GetClng(request.form("InfoPoint"))
	BackPoint		= Cl.GetClng(request.form("BackPoint"))
	BackPointRate	= Cl.GetClng(request.form("BackPointRate"))
	BackMoney		= Cl.GetClng(request.form("BackMoney"))
	BackMoneyRate	= Cl.GetClng(request.form("BackMoneyRate"))
	StockNum		= Cl.GetClng(request.form("StockNum"))
	InfoGroup		= Trim(request.form("InfoGroup"))
	PresentExp		= Cl.GetClng(request.form("PresentExp"))
	PicUrl			= Trim(request.form("PicUrl"))
	ProductType		= Cl.GetClng(request.form("ProductType"))
	DownloadUrl		= Trim(request.form("DownloadUrl"))
	CardPoint		= Cl.GetClng(request.form("CardPoint"))
	OnTop			= Trim(request.form("OnTop"))
	Hot				= Trim(request.form("Hot"))
	Elite			= Trim(request.form("Elite"))
	Stars			= Cl.GetClng(request.form("Stars"))
	Hits			= Cl.GetClng(request.form("Hits"))
	BuyTimes		= Cl.GetClng(request.form("BuyTimes"))
	UpdateTime		= Trim(request.form("UpdateTime"))
	Passed			= Trim(request.form("Passed"))
	NowCreate		= Trim(request.form("NowCreate"))
	UploadFiles		= Trim(request.form("UploadFiles"))
	ProjectID		= Cl.GetClng(request.form("ProjectID"))
	TemplateID		= Cl.GetClng(request.form("TemplateID"))
	CssID			= Cl.GetClng(request.form("CssID"))
	Editor			= Cl.MemberName
	if ClassID=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>指定了非法的栏目(外部栏目或不存在的栏目)</li>"
	end if
	if ProductName="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>商品名称不能为空</li>"
	end if
	if Keyword="" then
		founderr=true
		errmsg=errmsg & "<br /><li>请输入商品关键字</li>"
	end if
	if MemberPrice="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>原始零售价不能为空</li>"
	end if
	if TruePrice="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>当前零售价不能为空</li>"
	end if
	if StockNum=0 then
		founderr=true
		errmsg=ErrMsg & "<br /><li>商品库存不能为空</li>"
	end if
	if MarketPrice="" then MarketPrice=0
	if FoundErr=True then Cl.ShowErr(ErrMsg)
	set tClass=Cl.Execute("select ClassName,Depth,ParentID,ParentPath,Child,ClassMaster,BrowsePurview,DisabledAdd,AddPoint,AddIsChk,MaxLimit,IsOuter From Cl_Class where ClassID=" & ClassID)
	if tClass.bof and tClass.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>找不到指定的栏目</li>"
	else
		if tClass(11)=1 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>不能指定外部栏目</li>"
		elseif tClass(7)<>0 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>对不起,此栏目禁止添加资料</li>"
		else
			ClassName	= tClass(0) : Depth		= tClass(1)
			ParentID	= tClass(2) : ParentPath= tClass(3)
			Child		= tClass(4) : ClassMaster= tClass(5)
			sAddPoint	= tClass(8) : sAddIsChk	= tClass(9)
			sMaxLimit	= tClass(10)
		end if
		if sAddIsChk=False then
			Passed=True
		elseif Passed = "yes" then
			if ParentID>0 then
				dim sqlPath,rsPath
				sqlPath="select ClassMaster From Cl_Class where ChannelID="&ChannelID&" and ClassID in (" & ParentPath & ") order by Depth"
				set rsPath=Cl.Execute(sqlPath)
				if Not rsPath.eof then
					sqlPath=rsPath.GetRows(-1)
					for i=0 to Ubound(sqlPath,2)
						ClassMaster = ClassMaster & "|" & sqlPath(0,i)
					Next
					sqlPath=Empty
				End if
				rsPath.Close:Set rsPath=Nothing
			end if
			IsClassMaster=Cl.TrueClassMaster(ClassMaster,Cl.Admin_Info(1))
			if IsClassMaster then
				Passed = True
			elseif Cl.TrueChannelPurview(2,ChannelID) then
				Passed = True
			else
				Passed = Cl.TrueArrClassPurview(2,ChannelID,ParentPath & "," & ClassID)
			end if
		else
			Passed=False
		end if
	end if
	tClass.Close :Set tClass=Nothing
	if Intro="" then
		Intro="暂无简介"
	else
		Intro=Left(Intro,250)
	end if
	if Explain="" then
		Explain="暂无说明"
	else
		if Cl.strLength(Explain)>sMaxLimit and sMaxLimit<>0 then
			founderr=true
			errmsg=errmsg & "<br /><li>简介内容大小超过了最大限制("&sMaxLimit&" 字节!)</li>"
		end if
		if Trim(Cl.Web_Setting(9))="Yes" then
			Explain=Cl.DeCode(Explain,Trim(Cl.Web_Setting(10)))
		end if
	end if
	if FoundErr=True then Cl.ShowErr(ErrMsg)
	if SpecialID="" Or SpecialID="0" then
		SpecialID="0"
	else
		SpecialID=Replace(SpecialID," ","")
		if Len(SpecialID)>250 then
			Dim TempStr,SpecialStr
			TempStr=Split(SpecialID,",")

			For i=0 to Ubound(TempStr)
				if TempStr(i)<>"" then SpecialStr=SpecialStr & "," & TempStr(i)
				if Len(SpecialStr)>=230 then Exit For
			Next
			SpecialID=SpecialStr & ","
		else
		SpecialID=","&SpecialID&","
		End if
	end if
	Keyword=Cl.ReplaceBadChar(Keyword)
	Keyword=Replace(Keyword,"||","|")
	if Left(Keyword,1)="|" then Keyword=Right(Keyword,Len(Keyword)-1)
	if Right(Keyword,1)="|" then Keyword=Left(Keyword,Len(Keyword)-1)
	if UpdateTime<>"" and IsDate(UpdateTime) then
		UpdateTime=CDate(UpdateTime)
	else
		UpdateTime=now()
	end if
	if BeginDate<>"" and IsDate(BeginDate) then
		BeginDate=CDate(BeginDate)
	else
		BeginDate=now()
	end if
	if EndDate<>"" and IsDate(EndDate) then
		EndDate=CDate(EndDate)
	else
		EndDate=now()+365
	end if
	if NoOver="yes" then NoOver=True else NoOver=False end if
	if OnTop="yes" then OnTop=True else OnTop=False end if
	if Hot="yes" then Hot=True else Hot=False end if
	if Elite="yes" then Elite=True else Elite=False end If
	'if IncludeTax="yes" then IncludeTax=True else IncludeTax=False End if
	if ProductType<>0 and ProductType<>1 and ProductType<>2 Then ProductType = 0
	set rs=server.createobject("adodb.recordset")
	if Action="SaveAdd" then
		Dim MaxTID
		MaxTID=Cl.Execute("select max(InfoID) from Cl_Product")(0)
		if isnull(MaxTID) or Not IsNumeric(MaxTID) then MaxTID=0
		InfoID=MaxTID+1
		sql="select Top 1 * from Cl_Product" 
		OpenConn : rs.open sql,Conn,1,3
		rs.addnew
		rs("InfoID")=InfoID
		rs("ChannelID")=ChannelID
		call SaveData()
	    rs("Editor")=Editor
		rs.update
	elseif Action="SaveModify" then
  		if InfoID=0 then
			Cl.ShowErr("<br /><li>不能确定InfoID的值</li>")
		else
			sql="select * from Cl_Product where InfoID=" & InfoID
			OpenConn : rs.open sql,Conn,1,3
			if rs.bof and rs.eof then
				rs.Close : set rs=nothing
				Cl.ShowErr("<br /><li>找不到此商品,可能已经被其他人删除。</li>")
 			else
				Editor	= Rs("Editor")
				if rs("Status")=1 then
					Cl.Execute_U("update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "-"&sAddPoint&"," & Db.DataCount & "=" & Db.DataCount & "-1 where " & Db.UserName & "='" & Editor & "'")
				end if
				call SaveData()
				rs.update
			end if
		end if
	else
		Cl.ShowErr("<br /><li>参数错误!</li>")
	end if
	rs.Close : set rs=nothing
	Cl.ChkUploadFile InfoID,PicUrl & DownloadUrl & Intro,UploadFiles
	Cl.SaveAdminLog
	SaveSuccess
end sub

sub SaveData()
	rs("ChannelDir")	= Cl.Channel.selectSingleNode("@channeldir").text
	rs("ClassID")		= ClassID
	rs("SpecialID")		= SpecialID
	rs("Prefixion")		= Prefixion
	rs("ProductName")	= ProductName
	rs("FontColor")		= FontColor
	rs("FontType")		= FontType
	rs("ProductSn")		= ProductSn
	rs("Producer")		= Producer
	rs("Trademark")		= Trademark
	rs("ProductModel")	= ProductModel
	rs("ProductUnit")	= ProductUnit
	rs("Intro")			= Intro
	rs("Explain")		= Explain
	rs("MarketPrice")	= MarketPrice
	rs("MemberPrice")	= MemberPrice
	rs("TruePrice")		= TruePrice
	rs("Discount")		= Discount
	rs("BeginDate")		= BeginDate
	rs("EndDate")		= EndDate
	rs("NoOver")		= NoOver
	'rs("IncludeTax")	= IncludeTax
	'rs("TaxRate")		= TaxRate
	rs("InfoPoint")		= InfoPoint
	rs("StockNum")		= StockNum
	rs("InfoGroup")		= InfoGroup
	rs("PresentExp")	= PresentExp
	rs("PicUrl")		= PicUrl
	rs("ProductType")	= ProductType
	rs("DownloadUrl")	= DownloadUrl
	rs("CardPoint")		= CardPoint
	rs("OnTop")			= OnTop
	rs("Hot")			= Hot
	rs("Elite")			= Elite
	rs("Stars")			= Stars
	rs("Hits")			= Hits
	rs("BuyTimes")		= BuyTimes
	rs("Keyword")		= Keyword
	rs("UpdateTime")	= UpdateTime
	rs("UploadFiles")	= UploadFiles
	rs("BackPoint")		= BackPoint
	rs("BackPointRate")	= BackPointRate
	rs("BackMoney")		= BackMoney
	rs("BackMoneyRate")	= BackMoneyRate
	if Passed=True then
		rs("Status")	= 1
		rs("Censor")	= Cl.MemberName
		rs("CensorTime")= Date()
		Cl.Execute_U("update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+"&sAddPoint&"," & Db.DataCount & "=" & Db.DataCount & "+1 where " & Db.UserName & "='" & Editor & "'")
	else
		rs("Status")	= 0
	end If
	rs("Deleted")		= False
	rs("ProjectID")		= ProjectID
	rs("TemplateID")	= TemplateID
	rs("CssID")			= CssID
	Rem 自定义字段By GDW
	Call SaveField(ChannelID,5)
end sub
	
Sub SaveSuccess()
%>
<br /><br />
<!--<meta http-equiv="refresh" content="3;url=javascript:history.go(-2);" />-->
<table class="border" align="center" border="0" cellpadding="0" cellspacing="1" style="width:600px;">
	<tr class="title"> 
		<td height="22" align="left" colspan="3">&nbsp;&nbsp;<b>恭喜您,操作成功,请选择快速连接返回!</b></td>
	</tr>

⌨️ 快捷键说明

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