📄 save_product.asp
字号:
<!--#include file="conn.asp"-->
<%call time_out()%>
<%
if instr(session("proview"),"s1")=0 then
response.Write "<script language=javascript>alert('您无权操作!');window.location.href='index.asp';</script>"
response.end
end if%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%action=trim(request("action"))
pid=trim(request("pid"))
select case action
case "add"
sql="select * from product"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("bigid")=trim(Request("bigid"))
rs("smallid")=trim(Request("smallid"))
rs("pro_name")=trim(Request("pro_name"))
rs("pingpai")=trim(Request("pingpai"))
rs("market_price")=trim(Request("market_price"))
rs("pt_price")=trim(Request("pt_price"))
rs("vip_price")=trim(Request("vip_price"))
rs("kucun")=trim(Request("kucun"))
rs("jifen")=trim(Request("jifen"))
rs("pro_type")=trim(Request("pro_type"))
rs("pro_xinghao")=trim(Request("pro_xinghao"))
rs("big_pic")=trim(Request("big_pic"))
rs("small_pic")=trim(Request("small_pic"))
rs("jieshao")=trim(Request("jieshao"))
if trim(Request("isnew"))<>"" then
rs("isnew")=trim(Request("isnew"))
else
rs("isnew")=0
end if
if trim(Request("istj"))<>"" then
rs("istj")=trim(Request("istj"))
else
rs("istj")=0
end if
if trim(Request("istejia"))<>"" then
rs("istejia")=trim(Request("istejia"))
else
rs("istejia")=0
end if
rs("adddate")=now()
rs("isdel")=0
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('添加成功!');window.location.href='add_product.asp';</script>"
case "edit"
sql="select * from product where pid="&pid
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs("bigid")=trim(Request("bigid"))
rs("smallid")=trim(Request("smallid"))
rs("pro_name")=trim(Request("pro_name"))
rs("pingpai")=trim(Request("pingpai"))
rs("market_price")=trim(Request("market_price"))
rs("pt_price")=trim(Request("pt_price"))
rs("vip_price")=trim(Request("vip_price"))
rs("kucun")=trim(Request("kucun"))
rs("jifen")=trim(Request("jifen"))
rs("pro_type")=trim(Request("pro_type"))
rs("pro_xinghao")=trim(Request("pro_xinghao"))
rs("big_pic")=trim(Request("big_pic"))
rs("small_pic")=trim(Request("small_pic"))
rs("jieshao")=trim(Request("jieshao"))
if trim(Request("isnew"))<>"" then
rs("isnew")=trim(Request("isnew"))
else
rs("isnew")=0
end if
if trim(Request("istj"))<>"" then
rs("istj")=trim(Request("istj"))
else
rs("istj")=0
end if
if trim(Request("istejia"))<>"" then
rs("istejia")=trim(Request("istejia"))
else
rs("istejia")=0
end if
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('修改成功!');window.location.href='edit_product.asp';</script>"
case "del1"
sql="select * from product where pid="&pid
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs("isdel")=1
rs.update
rs.close:set rs=nothing
response.redirect("edit_product.asp")
case "del2"
'判断是否可以删除
'sql1="select pid from [order] where pid="&pid
'set rs=server.createobject("adodb.recordset")
'rs.open sql1,conn,1,1
'if not rs.eof then
'response.Write "<script language=javascript>alert('订单中有该商品信息,不可删除!');window.location.href='edit_product.asp';</script>"
'response.end
'end if
'rs.close
'set rs=nothing
conn.execute("delete from product where pid="&pid)
response.redirect("edit_product.asp")
end select%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -