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

📄 saveaddbook.asp

📁 很好的网上书店源码 适合企业个人使用 很好的网络书城
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.reload('login.asp')</script>"
response.End
end if
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
bookid=request.QueryString("id")
action=request.QueryString("action")
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from shop_books",conn,1,3
rs.AddNew
rs("anclassid")=int(request("anclassid")) '大类
rs("nclassid")=int(request("nclassid")) '小类
rs("xclassid")=int(request("xclassid")) '子类
rs("bh")=trim(request("bh")) '书本编号
rs("bookname")=trim(request("bookname")) '书名
rs("k")=trim(request("k")) '关键字
rs("bookzz")=trim(request("bookzz")) '作者
rs("bookchuban")=trim(request("bookchuban")) '出版社
rs("bookdateyear")=trim(request("bookdateyear")) '出版日期
rs("bookdatemonth")=trim(request("bookdatemonth")) '出版日期
rs("shichangjia")=trim(request("shichangjia"))  '市场价
rs("huiyuanjia")=trim(request("huiyuanjia"))  '会员价
rs("vip")=trim(request("vip"))  'vip会员价
rs("dazhe")=dazhe '打折
rs("kaiben")=trim(request("kaiben"))  '开本
rs("banci")=request("banci")  '版次
rs("yeshu")=trim(request("yeshu"))  '页数
rs("zhuang")=trim(request("zhuang")) '装帧
rs("cs")=trim(request("cs")) '成色
rs("kucun")=trim(request("kucun"))  '库存
rs("isbn")=trim(request("isbn")) 'isbn
if request("bestbook")=1 then  '推荐
rs("bestbook")=1
else
rs("bestbook")=0
end if
rs("chengjiaocount")=0  '成交计数
rs("liulancount")=0  '浏览计数
rs("bookpic")=trim(request("bookpic"))  '图片地址
rs("bookdir")=trim(request("bookdir"))  '目录下载
rs("adddate")=now()  '加入日期
rs("pingji")=0  '评级人数
rs("pingjizong")=0 '总评级
rs("bookcontent")=htmlencode2(trim(request("bookcontent")))  '简介
rs("bookmulu")=htmlencode2(trim(request("bookmulu")))  '目录
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('图书添加成功!');window.location.reload('add_book.asp')</script>"
response.End
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from shop_books where bookid="&bookid,conn,1,3
rs("anclassid")=int(request("anclassid")) '大类
rs("nclassid")=int(request("nclassid")) '小类
rs("xclassid")=int(request("xclassid")) '子类
rs("bh")=trim(request("bh")) '书本编号
rs("bookname")=trim(request("bookname")) '书名
rs("k")=trim(request("k")) '关键字
rs("bookzz")=trim(request("bookzz")) '作者
rs("bookchuban")=trim(request("bookchuban")) '出版社
rs("bookdateyear")=trim(request("bookdateyear")) '出版日期
rs("bookdatemonth")=trim(request("bookdatemonth")) '出版日期
rs("shichangjia")=trim(request("shichangjia"))  '市场价
rs("huiyuanjia")=trim(request("huiyuanjia"))  '会员价
rs("vip")=trim(request("vip"))  'vip会员价
rs("dazhe")=dazhe '打折
rs("kaiben")=trim(request("kaiben"))  '开本
rs("banci")=request("banci")  '版次
rs("yeshu")=trim(request("yeshu"))  '页数
rs("zhuang")=trim(request("zhuang")) '装帧
rs("cs")=trim(request("cs")) '成色
rs("kucun")=trim(request("kucun"))  '库存
rs("isbn")=trim(request("isbn")) 'isbn
if request("bestbook")=1 then  '推荐
rs("bestbook")=1
else
rs("bestbook")=0
end if
rs("bookpic")=trim(request("bookpic"))  '图片地址
rs("bookdir")=trim(request("bookdir"))  '目录下载
rs("bookcontent")=htmlencode2(trim(request("bookcontent")))  '简介
rs("bookmulu")=htmlencode2(trim(request("bookmulu")))  '目录
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('图书修改成功!');window.location.reload('list_book.asp')</script>"
response.End
end select
%>

⌨️ 快捷键说明

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