📄 product_info_add.asp
字号:
<!--#include file="admin_check.asp"-->
<%dim dbpath
dbpath="../"
%>
<!--#include file="../Conn.asp"-->
<!--#include file="../include/MyRequest.asp"-->
<%
action=my_request("action",0)
if action="save" then
call save()
end if
sub save()
cid = my_request("cid",1)
product_info_name = my_request("product_info_name",0)
product_info_AdWord = my_request("product_info_AdWord",0)
product_info_flag = my_request("product_info_flag",0)
product_info_PriceM = my_request("product_info_PriceM",0)
product_info_PriceS = my_request("product_info_PriceS",0)
product_info_PicS = my_request("product_info_PicS",0)
product_info_PicB = my_request("product_info_PicB",0)
product_info_Detail = my_request("content",0)
product_info_OnOff = my_request("product_info_OnOff",0)
ErrMsg=""
if product_info_name="" then
FoundErr=True
ErrMsg=ErrMsg & "<li>商品名称不能为空!</li>"
end if
if cid="" then
FoundErr=True
ErrMsg=ErrMsg & "<li>商品类别必须选择!</li>"
end if
if product_info_PriceS="" then
FoundErr=True
ErrMsg=ErrMsg & "<li>本站价格不能为空!</li>"
end if
if product_info_PicS="" then
FoundErr=True
ErrMsg=ErrMsg & "<li>商品小图片不能为空!</li>"
end if
if product_info_PicB="" then
FoundErr=True
ErrMsg=ErrMsg & "<li>商品大图片不能为空!</li>"
end if
if product_info_Detail="" then
FoundErr=True
ErrMsg=ErrMsg & "<li>商品详细描述不能为空!</li>"
end if
if FoundErr<>True then
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from product_info Where product_info_name='"&product_info_name&"'"
rs.open sql,conn,1,1
if not rs.eof and rs.bof then
response.write "<script language='javascript'>"
response.write "alert('出错了,商品标题重复,请重新录入!');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
rs.close
set rs=nothing
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from product_info"
rs.open sql,conn,1,3
rs.addnew
rs("cid")=cid
rs("product_info_name") = product_info_name
rs("product_info_AdWord") = product_info_AdWord
rs("product_info_flag") = product_info_flag
rs("product_info_PriceM") = product_info_PriceM
rs("product_info_PriceS") = product_info_PriceS
rs("product_info_PicB") = product_info_PicB
rs("product_info_PicS") = product_info_PicS
rs("product_info_Detail") = product_info_Detail
rs("product_info_OnOff") = product_info_OnOff
rs("addtime") = now()
rs.update
rs.close
set rs=nothing
call ok("您已成功添加了一条商品信息!","product_info_add.asp?cid="&cid&"")
else
call WriteErrMsg(ErrMsg)
end if
end sub
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品信息添加</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="Editor/edit.js" type="text/javascript"></script>
</head>
<body>
<table cellspacing="1" cellpadding="4" width="100%" class="tableborder">
<tbody class="altbg2">
<form action="Product_Info_Add.asp" method="post" name="form1">
<input type="hidden" name="action" value="save">
<tr>
<td colspan="2" class="title">商品信息添加</td>
</tr>
<tr>
<td>商品名称及规格:</td>
<td><input type="text" name="product_info_name" size="30"></td>
</tr>
<tr>
<td>加促销语:</td>
<td><select size="1" name="product_info_AdWord">
<option value="" selected>不加任何促销语(默认)</option>
<option value="赞">赞</option>
<option value="热门">热门</option>
<option value="店长赞">店长赞</option>
<option value="抢购中">抢购中</option>
<option value="价格新底">价格新底</option>
<option value="店长严重推荐">店长严重推荐</option>
<option value="新品上市,棒!">新品上市,棒!</option>
<option value="超特价,当到谷底">超特价,当到谷底</option>
<option value="人气绝项,销售佳!">人气绝项,销售佳!</option>
</select></td>
</tr>
<tr>
<td>所属商品类别:</td>
<td><select name="cid">
<%
sql="select cid,product_class_name from product_class order by cid desc"
set rs=conn.execute (sql)
set cid=rs(0)
set product_class_name=rs(1)
do while not rs.eof
%>
<option value="<%=cid%>" <%if cid=cint(request("cid")) then response.write "selected" %>><%=product_class_name%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select></td>
</tr>
<tr>
<td>市场价:</td>
<td><input type="text" name="product_info_PriceM" size="20"></td>
</tr>
<tr>
<td>本站价:</td>
<td><input type="text" name="product_info_PriceS" size="20"></td>
</tr>
<tr>
<td>小图片:</td>
<td>
<input type="text" name="product_info_PicS" size="30">
<input type="button" value=">>点此上传商品小图片" name="action0" onclick="javascript:openWin('Njj_Pic_Upload.asp?Fname=product_info_PicS','upload','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=yes,width=400,height=100')">
</td>
</tr>
<tr>
<td>大图片:</td>
<td>
<input type="text" name="product_info_PicB" size="30">
<input type="button" value=">>点此上传商品大图片" name="action1" onclick="javascript:openWin('Njj_Pic_Upload.asp?Fname=product_info_PicB','upload','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=yes,width=400,height=100')">
</td>
</tr>
<tr>
<td>详细描述:</td>
<td>
<!--//商品介绍//-->
<!--#include file="editor/editor.asp"-->
<script language="javascript">
document.write ('<iframe src="Product_Txtbox.asp" id="message" width="90%" height="300"></iframe>')
frames.message.document.designMode = "On";
</script>
</td>
</tr>
<tr>
<td>商品特性:</td>
<td><input type="checkbox" name="product_info_flag" value="1">新品
<input type="checkbox" name="product_info_flag" value="2">推荐
<input type="checkbox" name="product_info_flag" value="3">特价</td>
</tr>
<tr>
<td>是否上架:</td>
<td><input type="radio" value="0" name="product_info_OnOff" checked>上架(显示)
<input type="radio" value="1" name="product_info_OnOff">下架(隐藏) </td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" value="提交(按enter键也可以快速提交)" name="Submit1" onclick="document.form1.Content.value = frames.message.document.body.innerHTML;">
<input type="reset" value="重置" name="B2">
<input type="hidden" name="Content" value>
</td>
</tr>
</form>
</tbody>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -