?? saveaddbook.asp
字號:
<!--#include file="conn.asp"-->
<%
if request("bookname")="" or request("shichangjia")="" or request("huiyuanjia")="" or request("vipjia")="" then
response.Write "對不起,添加失敗,請用正確的方式添加商品!"
response.End
end if
dim action,bookid
bookid=request.QueryString("id")
action=request.QueryString("action")
select case action
case "add"
'set rs_news=server.CreateObject("adodb.recordset")
'rs_news.open "select * from [shjia] where username='"&shjianame&"'",conn,1,1
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from sh_chanpin",conn,1,3
rs.AddNew
rs("anclassid")=int(request("anclassid")) '大類
rs("nclassid")=int(request("nclassid")) '小類
rs("bookname")=trim(request("bookname")) '商品名稱
rs("pingpai")=trim(request("pingpai")) '商品品牌
rs("isbn")=trim(request("isbn")) '商品規格
rs("bookchuban")=trim(request("bookchuban")) '商品單位
rs("shichangjia")=trim(request("shichangjia")) '市場價
rs("huiyuanjia")=trim(request("huiyuanjia")) '會員價
rs("vipjia")=trim(request("vipjia")) 'VIP價
rs("kucun")=trim(request("kucun")) '商品庫存
rs("bookpic")=trim(request("bookpic")) '小圖片地址
rs("zhuang")=trim(request("zhuang")) '大圖片地址
rs("bookcontent")=trim(request("bookcontent")) '簡介
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
rs("chengjiaocount")=0 '成交計數
rs("liulancount")=0 '瀏覽計數
rs("adddate")=now() '加入日期
rs("pingji")=0 '評級人數
rs("pingjizong")=0 '總評級
'rs("bookmulu")=htmlencode2(trim(request("bookmulu"))) '目錄
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('添加成功!');history.go(-1);</script>"
response.End
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from sh_chanpin where bookid="&bookid,conn,1,3
rs("anclassid")=int(request("anclassid")) '大類
rs("nclassid")=int(request("nclassid")) '小類
rs("bookname")=trim(request("bookname")) '商品名稱
rs("pingpai")=trim(request("pingpai")) '商品品牌
rs("isbn")=trim(request("isbn")) '商品規格
rs("bookchuban")=trim(request("bookchuban")) '商品單位
rs("shichangjia")=trim(request("shichangjia")) '市場價
rs("huiyuanjia")=trim(request("huiyuanjia")) '會員價
rs("vipjia")=trim(request("vipjia")) 'VIP價
rs("kucun")=trim(request("kucun")) '商品庫存
rs("bookpic")=trim(request("bookpic")) '小圖片地址
rs("zhuang")=trim(request("zhuang")) '大圖片地址
rs("bookcontent")=trim(request("bookcontent")) '簡介
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
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('修改成功!');history.go(-1);</script>"
response.End
end select
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -