28,409
社区成员




<%@codepage = 936%>
<!--#include file="conn.asp"-->
<!--#include file="../include/function.asp"-->
<!--#include file="fckeditor/fckeditor.asp"-->
<%
response.charset="GBK"
if session("admin")="" then
call sussLoctionHref("非法操作","admin_login.asp")
end if
dim goodsname,goodscode,goodsweight,goodsnumber,goodsnew,goodshot,goodsfast,goodsunit,goodsprice1,goodsprice2,goodspoint,picdir1,picdir2,goodsinfo,goodscontent
if request.form("send") = "修改" then
goodsname=request.form("goodsname")
goodscode=request.form("goodscode")
goodsweight=request.form("goodsweight")
goodsnumber=request.form("goodsnumber")
goodsnew=request.form("goodsnew")
goodshot=request.form("goodshot")
goodsfast=request.form("goodsfast")
goodsunit=request.form("goodsunit")
goodsprice1=request.form("goodsprice1")
goodsprice2=request.form("goodsprice2")
goodspoint=request.form("goodspoint")
picdir1=request.form("picdir1")
picdir2=request.form("picdir2")
goodsinfo=request.form("goodsinfo")
goodscontent=request.form("goodscontent")
if goodsnew=1 then
goodsnew=true
elseif goodsnew=0 then
goodsnew=false
end if
if goodshot=1 then
goodshot=true
elseif goodshot=0 then
goodshot=false
end if
if goodsfast=1 then
goodsfast=true
elseif goodsfast=0 then
goodsfast=false
end if
if goodsunit="" then
goodsunit="个"
end if
if picdir1="" then
picdir1="images/wusmall.jpg"
end if
if picdir2="" then
picdir2="images/wubig.jpg"
end if
if goodsname="" then
call errorHistoryBack("请输入商品名称")
end if
if goodscode="" then
call errorHistoryBack("请输入商品编号")
end if
if goodsweight="" then
call errorHistoryBack("请输入商品重量")
end if
if goodsnumber="" then
call errorHistoryBack("请输入商品库存量")
end if
if len(goodspoint) < 1 then
call errorHistoryBack("请输入积分")
end if
updatesql="update goods set goods_name='"&goodsname&"' where goods_id="&request.form("id")
conn.execute(updatesql)
call sussLoctionHref("内容修改完成","admin_goods.asp")
end if
dim showid
showid=request.querystring("showid")
if showid="" or not isnumeric(showid) then
call errorHistoryBack("非法操作")
end if
set rs=server.createobject("adodb.recordset")
sql="select * from goods where goods_id=" &showid
rs.open sql,conn,1,1
if rs.eof then
call close_rs
call close_conn
call errorHistoryBack("不存在此数据")
else
goodsname=rs("goods_name")
goodscode=rs("goods_code")
goodsweight=rs("goods_weight")
goodsnumber=rs("goods_number")
goodsnew=rs("goods_new")
goodshot=rs("goods_hot")
goodsfast=rs("goods_fast")
goodsunit=rs("goods_unit")
goodsprice1=rs("goods_price1")
goodsprice2=rs("goods_price2")
goodspoint=rs("goods_point")
picdir1=rs("goods_pic1")
picdir2=rs("goods_pic2")
goodsinfo=rs("goods_info")
goodscontent=rs("goods_content")
end if
call close_rs
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<script type="text/javascript" src="js/yzsj.js"></script>
</head>
<body>
<div id="addnew">
<h3 style="text-align:center;color:red;margin:20px;">添加商品</h3>
<input type="hidden" value="<%=showid%>" name="id" />
<form method="post" name="addgoods" action="admin_goods_mod.asp">
<p>商品名称:<input type="text" name="goodsname" class="text" value=<%=goodsname%> /></p>
<p>商品编号:<input type="text" name="goodscode" class="text" value=<%=goodscode%> /></p>
<p>商品重量:<input type="text" name="goodsweight" class="text1" value=<%=goodsweight%> /> kg</p>
<p>商品库存:<input type="text" name="goodsnumber" class="text1" value=<%=goodsnumber%> /></p>
<p>加入推荐:<input type="checkbox" <%if goodsnew=true then response.write "checked='checked'"%> name="goodsnew" value="1" /> 新品 <input type="checkbox" <%if goodshot=true then response.write "checked='checked'"%> name="goodshot" value="1" /> 热卖 <input type="checkbox" <%if goodsfast=true then response.write "checked='checked'"%> name="goodsfast" value="1" /> 速递</p>
<p>商品单位:<input type="text" name="goodsunit" class="text1" value=<%=goodsunit%>></p>
<p>市场价格:<input type="text" name="goodsprice1" class="text1" value=<%=goodsprice1%> /> 元</p>
<p>本店价格:<input type="text" name="goodsprice2" class="text1" value=<%=goodsprice2%> /> 元</p>
<p>赠送积分:<input type="text" name="goodspoint" class="text1" value=<%=goodspoint%> /> </p>
<p>上传小图:<input type="text" readonly="readonly" name="picdir1" value=<%=picdir1%> /> <a href="###" onclick="javascript:open('upfile.asp?picdir=<%=picdir%>','upfile','width=400,height=200')">上传</a></p>
<p>上传大图:<input type="text" readonly="readonly" name="picdir2" value=<%=picdir2%> /> <a href="###" onclick="javascript:open('upfile2.asp?picdir=<%=picdir%>','upfile','width=400,height=200')">上传</a></p>
<p>商品简介:<textarea name="goodsinfo"><%=goodsinfo%></textarea></p>
<p>详细内容:</p>
<p>
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor '创建一个编辑器的实例
oFCKeditor.BasePath = "fckeditor/" '配置编辑器的路径,我站点根目录下的一个目录
oFCKeditor.ToolbarSet = "Default" '完整和简化.Basic
oFCKeditor.Width = "100%" '编辑器的长度
oFCKeditor.Height = "400" '编辑器的高度
oFCKeditor.Value = goodscontent '这个是给编辑器初始值
oFCKeditor.Create "goodscontent" '以后编辑器里的内容都是由这个content 取得
%>
</p>
<p style="text-align:center;"><input type="submit" value="修改" onclick="return check();" name="send" /></p>
</form>
</div>
</body>
</html>