gusucode.com > 爱美尔女性商城源码 1.0源码程序 > admintouch/saveaddgood.asp

    <!--#include file="conn.asp"-->
<%
if request("bookname")="" or request("shichangjia")="" or request("huiyuanjia")=""  then
response.Write "对不起,添加失败,请用正确的方式添加商品!"
response.End
end if
function HTMLEncode2(fString)
	fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
	fString = Replace(fString, CHR(10), "<BR>")
	HTMLEncode2 = fString
end function
dim bookdate,dazhe
dazhe=round(request("huiyuanjia")/request("shichangjia"),2)

dim action,bookid
typeid=request.QueryString("typeid")
bookid=request.QueryString("id")
action=request.QueryString("action")
shjianame=request.cookies("bjx")("shjianame")
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from BJX_goods",conn,1,3
rs.AddNew
rs("shjianame")="网上商城"
rs("shjiaid")=1

rs("typeid")=request("typeid")

rs("gg")=trim(request("gg")) '

rs("anclassid")=int(request("anclassid")) '大类
if request("nclassid")<>"" then
rs("nclassid")=int(request("nclassid")) '小类
else
rs("nclassid")=0
end if
rs("gjanclassid")=int(request("gjanclassid")) '大类
if request("gjnclassid")<>"" then
rs("gjnclassid")=int(request("gjnclassid")) '小类
else
rs("gjnclassid")=0
end if
rs("bookname")=trim(request("bookname")) '商品名称
rs("booknum")=trim(request("booknum"))
rs("enbookname")=trim(request("enbookname")) '商品名称
rs("pingpai")=trim(request("pingpai")) '商品品牌
rs("shichangjia")=trim(request("shichangjia"))  '市场价
rs("huiyuanjia")=trim(request("huiyuanjia"))  '会员价
if request("vipjia")<>"" then 
rs("vipjia")=trim(request("vipjia"))  'VIP价
else
rs("vipjia")=0
end if
rs("dazhe")=dazhe  '打折
rs("kucun")=trim(request("kucun"))  '商品库存
rs("bookpic")=trim(request("bookpic"))  '小图片地址
rs("zhuang")=trim(request("zhuang")) '大图片地址
rs("bookcontent")=trim(request("content"))  '简介
rs("banci")=request("fudongjia")  '浮动价
rs("yeshu")=trim(request("yeshu"))  '商品积分
if request("bestbook")=1 then  '推荐
rs("bestbook")=1
else
rs("bestbook")=0
end if
if request("newsbook")=1 then  '新品
rs("newsbook")=1
else
rs("newsbook")=0
end if
if request("tejiabook")=1 then  '特价
rs("tejiabook")=1
else
rs("tejiabook")=0
end if
if request("pjbook")=1 then  '特价
rs("pjbook")=1
else
rs("pjbook")=0
end if

if request("jjbook")=1 then  '特价
rs("jjbook")=1
else
rs("jjbook")=0
end if
if request("checkcard")=1 then  
rs("checkcard")=1
else
rs("checkcard")=0
end if
rs("chengjiaocount")=0  '成交计数
rs("liulancount")=0  '浏览计数
rs("adddate")=now()  '加入日期
rs("pingji")=0  '评级人数
rs("pingjizong")=0 '总评级
'rs("bookmulu")=htmlencode2(trim(request("bookmulu")))  '目录
rs.Update
bookid=rs("bookid")
rs.Close
set rs=nothing

response.Write "<script language=javascript>alert('添加成功!');window.location.href='managebook.asp?typeid="&typeid&"';</script>"
response.End

case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from BJX_goods where bookid="&bookid,conn,1,3

rs("typeid")=request("typeid")
rs("gg")=trim(request("gg")) '
rs("anclassid")=int(request("anclassid")) '大类
if request("nclassid")<>"" then
rs("nclassid")=int(request("nclassid")) '小类
else
rs("nclassid")=0
end if
rs("gjanclassid")=int(request("gjanclassid")) '大类
if request("gjnclassid")<>"" then
rs("gjnclassid")=int(request("gjnclassid")) '小类
else
rs("gjnclassid")=0
end if
rs("bookname")=trim(request("bookname")) '商品名称
rs("booknum")=trim(request("booknum"))
rs("enbookname")=trim(request("enbookname")) '商品名称
rs("pingpai")=trim(request("pingpai")) '商品品牌
rs("shichangjia")=trim(request("shichangjia"))  '市场价
rs("huiyuanjia")=trim(request("huiyuanjia"))  '会员价
if request("vipjia")<>"" then 
rs("vipjia")=trim(request("vipjia"))  'VIP价
else
rs("vipjia")=0
end if
rs("dazhe")=dazhe  '打折
rs("kucun")=trim(request("kucun"))  '商品库存
rs("bookpic")=trim(request("bookpic"))  '小图片地址
rs("zhuang")=trim(request("zhuang")) '大图片地址
rs("bookcontent")=trim(request("content"))  '简介
rs("banci")=request("fudongjia")  '浮动价
rs("yeshu")=trim(request("yeshu"))  '商品积分
if request("bestbook")=1 then  '推荐
rs("bestbook")=1
else
rs("bestbook")=0
end if
if request("newsbook")=1 then  '新品
rs("newsbook")=1
else
rs("newsbook")=0
end if
if request("tejiabook")=1 then  '特价
rs("tejiabook")=1
else
rs("tejiabook")=0
end if
if request("pjbook")=1 then  '特价
rs("pjbook")=1
else
rs("pjbook")=0
end if

if request("jjbook")=1 then  '特价
rs("jjbook")=1
else
rs("jjbook")=0
end if
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('修改成功!');window.location.href='managebook.asp?typeid="&typeid&"';</script>"
response.End
end select
%>