<%@codepage = 936%>
<!--#include file="../include/function.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="fckeditor/fckeditor.asp"-->
<%
response.charset = "GBK"
if session("admin") = "" then
call sussLoctionHref("非法登录","admin_login.asp")
end if
'目录地址
dim picdir
picdir = "product"
'添加数据
if request.form("send") = "添加商品" then
dim sql,proname,procode,pronav,probrand,proref,pronew,prohot,proweight,prorep,prounit,proprice1,proprice2,propoint,picdir1,picdir2,proinfo,procontent
proname = request.form("proname")
procode = request.form("procode")
pronav = request.form("pronav")
probrand = request.form("probrand")
proref = request.form("proref")
pronew = request.form("pronew")
prohot = request.form("prohot")
proweight = request.form("proweight")
prorep = request.form("prorep")
prounit = request.form("prounit")
proprice1 = request.form("proprice1")
proprice2 = request.form("proprice2")
propoint = request.form("propoint")
picdir1 = request.form("picdir1")
picdir2 = request.form("picdir2")
proinfo = request.form("proinfo")
procontent = request.form("procontent") if proref = 1 then
proref = true
elseif proref = "" then
proref = false
end if
if pronew = 1 then
pronew = true
elseif pronew = "" then
pronew = false
end if
if prohot = 1 then
prohot = true
elseif prohot = "" then
prohot = false
end if if prounit = "" then
prounit = "件"
end if
sql = "insert into Mall_Detail (Mall_ProName,Mall_ProCode,Mall_ProNav,Mall_ProBrand,Mall_ProRef,Mall_ProNew,Mall_ProHot,Mall_ProWeight,Mall_ProRep,Mall_ProUnit,Mall_ProPrice1,Mall_ProPrice2,Mall_ProPoint,Mall_PicDir1,Mall_PicDir2,Mall_ProInfo,Mall_ProContent,Mall_Date) values ('"&proname&"','"&procode&"',"&pronav&","&probrand&","&proref&","&pronew&","&prohot&","&proweight&","&prorep&",'"&prounit&"',"&proprice1&","&proprice2&","&propoint&",'"&picdir1&"','"&picdir2&"','"&proinfo&"','"&procontent&"',GetDate())"
conn.execute(sql)
response.redirect "admin_add_pro.asp"
end if
%>
<!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>e家乐--后台管理</title>
<link rel="stylesheet" type="text/css" href="style/admin.css" />
</head>
<body>
<form method="post" name="form1" action="admin_add_pro.asp">
<div id="pro">
<h3>添加商品</h3>
<p>商品名称:<input type="text" name="proname" class="text" /> (*)</p>
<p>商品编号:<input type="text" name="procode" class="text" /> (* 货物的货号,唯一的)</p>
<p>商品分类:
<select name="pronav">
<option value="0" selected="selected">请选择你要的商品分类</option>
<%
dim navrs,navsql,navrs2,navsql2
set navrs = server.createobject("adodb.recordset")
navsql = "select * from Mall_Nav where Mall_Sid=0 order by Mall_Sort asc"
navrs.open navsql,conn,1,1
do while not navrs.eof
%>
<optgroup label="<%=navrs("Mall_NavName")%>">
<%
set navrs2 = server.createobject("adodb.recordset")
navsql2 = "select * from Mall_Nav where Mall_Sid="&navrs("Mall_ID")
navrs2.open navsql2,conn,1,1
do while not navrs2.eof
response.write "<option value='"&navrs2("Mall_ID")&"'>└—"&navrs2("Mall_NavName")&"</option>"
navrs2.movenext
loop
navrs2.close
set navrs2 = nothing
%>
</optgroup>
<%
navrs.movenext
loop
navrs.close
set navrs = nothing
%>
</select> (*)
</p>
<p>品牌分类:
<select name="probrand">
<option value="0" selected="selected">请选择你要的商品分类</option>
<%
set navrs = server.createobject("adodb.recordset")
navsql = "select * from Mall_Brand where Mall_Sid=0 order by Mall_Sort asc"
navrs.open navsql,conn,1,1
do while not navrs.eof
%>
<optgroup label="<%=navrs("Mall_BrandName")%>">
<%
set navrs2 = server.createobject("adodb.recordset")
navsql2 = "select * from Mall_Brand where Mall_Sid="&navrs("Mall_ID")
navrs2.open navsql2,conn,1,1
do while not navrs2.eof
response.write "<option value='"&navrs2("Mall_ID")&"'>└—"&navrs2("Mall_BrandName")&"</option>"
navrs2.movenext
loop
navrs2.close
set navrs2 = nothing
%>
</optgroup>
<%
navrs.movenext
loop
navrs.close
set navrs = nothing
%>
</select> (*)
</p>
<p>加入推荐:<input type="checkbox" name="proref" value="1" /> 精品 <input type="checkbox" name="pronew" value="1" /> 新品 <input type="checkbox" name="prohot" value="1" /> 热销</p>
<p>商品重量:<input type="text" name="proweight" class="text2" /> g (*)</p>
<p>库存数量:<input type="text" name="prorep" class="text2" /> (*)</p>
<p>商品单位:<input type="text" name="prounit" class="text2" /> (如果补填,就是“件”)</p>
<p>市场价格:<input type="text" name="proprice1" class="text2" value="0" /> (*)</p>
<p>本店价格:<input type="text" name="proprice2" class="text2" value="0" /> (*)</p>
<p>赠送积分:<input type="text" name="propoint" class="text2" value="0" /> (购买此商品所获得的分数)</p>
<p>上传小图:<input type="text" readonly="readonly" id="picdir1" name="picdir1" /> <a href="###" onclick="javascript:open('upfile.asp?picdir=<%=picdir%>','upfile','width=400,height=100')">上传</a></p>
<p>上传大图:<input type="text" readonly="readonly" id="picdir2" name="picdir2" /> <a href="###" onclick="javascript:open('upfile2.asp?picdir=<%=picdir%>','upfile','width=400,height=100')">上传</a></p>
<p>商品简介:<textarea name="proinfo"></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 = "" '这个是给编辑器初始值
oFCKeditor.Create "procontent" '以后编辑器里的内容都是由这个content 取得,
%>
</p>
<p><input type="submit" name="send" value="添加商品" /></p>
</div>
</form>
</body>
</html>
<!--#include file="../include/function.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="fckeditor/fckeditor.asp"-->
<%
response.charset = "GBK"
if session("admin") = "" then
call sussLoctionHref("非法登录","admin_login.asp")
end if
'目录地址
dim picdir
picdir = "product"
'添加数据
if request.form("send") = "添加商品" then
dim sql,proname,procode,pronav,probrand,proref,pronew,prohot,proweight,prorep,prounit,proprice1,proprice2,propoint,picdir1,picdir2,proinfo,procontent
proname = request.form("proname")
procode = request.form("procode")
pronav = request.form("pronav")
probrand = request.form("probrand")
proref = request.form("proref")
pronew = request.form("pronew")
prohot = request.form("prohot")
proweight = request.form("proweight")
prorep = request.form("prorep")
prounit = request.form("prounit")
proprice1 = request.form("proprice1")
proprice2 = request.form("proprice2")
propoint = request.form("propoint")
picdir1 = request.form("picdir1")
picdir2 = request.form("picdir2")
proinfo = request.form("proinfo")
procontent = request.form("procontent") if proref = 1 then
proref = true
elseif proref = "" then
proref = false
end if
if pronew = 1 then
pronew = true
elseif pronew = "" then
pronew = false
end if
if prohot = 1 then
prohot = true
elseif prohot = "" then
prohot = false
end if if prounit = "" then
prounit = "件"
end if
sql = "insert into Mall_Detail (Mall_ProName,Mall_ProCode,Mall_ProNav,Mall_ProBrand,Mall_ProRef,Mall_ProNew,Mall_ProHot,Mall_ProWeight,Mall_ProRep,Mall_ProUnit,Mall_ProPrice1,Mall_ProPrice2,Mall_ProPoint,Mall_PicDir1,Mall_PicDir2,Mall_ProInfo,Mall_ProContent,Mall_Date) values ('"&proname&"','"&procode&"',"&pronav&","&probrand&","&proref&","&pronew&","&prohot&","&proweight&","&prorep&",'"&prounit&"',"&proprice1&","&proprice2&","&propoint&",'"&picdir1&"','"&picdir2&"','"&proinfo&"','"&procontent&"',GetDate())"
conn.execute(sql)
response.redirect "admin_add_pro.asp"
end if
%>
<!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>e家乐--后台管理</title>
<link rel="stylesheet" type="text/css" href="style/admin.css" />
</head>
<body>
<form method="post" name="form1" action="admin_add_pro.asp">
<div id="pro">
<h3>添加商品</h3>
<p>商品名称:<input type="text" name="proname" class="text" /> (*)</p>
<p>商品编号:<input type="text" name="procode" class="text" /> (* 货物的货号,唯一的)</p>
<p>商品分类:
<select name="pronav">
<option value="0" selected="selected">请选择你要的商品分类</option>
<%
dim navrs,navsql,navrs2,navsql2
set navrs = server.createobject("adodb.recordset")
navsql = "select * from Mall_Nav where Mall_Sid=0 order by Mall_Sort asc"
navrs.open navsql,conn,1,1
do while not navrs.eof
%>
<optgroup label="<%=navrs("Mall_NavName")%>">
<%
set navrs2 = server.createobject("adodb.recordset")
navsql2 = "select * from Mall_Nav where Mall_Sid="&navrs("Mall_ID")
navrs2.open navsql2,conn,1,1
do while not navrs2.eof
response.write "<option value='"&navrs2("Mall_ID")&"'>└—"&navrs2("Mall_NavName")&"</option>"
navrs2.movenext
loop
navrs2.close
set navrs2 = nothing
%>
</optgroup>
<%
navrs.movenext
loop
navrs.close
set navrs = nothing
%>
</select> (*)
</p>
<p>品牌分类:
<select name="probrand">
<option value="0" selected="selected">请选择你要的商品分类</option>
<%
set navrs = server.createobject("adodb.recordset")
navsql = "select * from Mall_Brand where Mall_Sid=0 order by Mall_Sort asc"
navrs.open navsql,conn,1,1
do while not navrs.eof
%>
<optgroup label="<%=navrs("Mall_BrandName")%>">
<%
set navrs2 = server.createobject("adodb.recordset")
navsql2 = "select * from Mall_Brand where Mall_Sid="&navrs("Mall_ID")
navrs2.open navsql2,conn,1,1
do while not navrs2.eof
response.write "<option value='"&navrs2("Mall_ID")&"'>└—"&navrs2("Mall_BrandName")&"</option>"
navrs2.movenext
loop
navrs2.close
set navrs2 = nothing
%>
</optgroup>
<%
navrs.movenext
loop
navrs.close
set navrs = nothing
%>
</select> (*)
</p>
<p>加入推荐:<input type="checkbox" name="proref" value="1" /> 精品 <input type="checkbox" name="pronew" value="1" /> 新品 <input type="checkbox" name="prohot" value="1" /> 热销</p>
<p>商品重量:<input type="text" name="proweight" class="text2" /> g (*)</p>
<p>库存数量:<input type="text" name="prorep" class="text2" /> (*)</p>
<p>商品单位:<input type="text" name="prounit" class="text2" /> (如果补填,就是“件”)</p>
<p>市场价格:<input type="text" name="proprice1" class="text2" value="0" /> (*)</p>
<p>本店价格:<input type="text" name="proprice2" class="text2" value="0" /> (*)</p>
<p>赠送积分:<input type="text" name="propoint" class="text2" value="0" /> (购买此商品所获得的分数)</p>
<p>上传小图:<input type="text" readonly="readonly" id="picdir1" name="picdir1" /> <a href="###" onclick="javascript:open('upfile.asp?picdir=<%=picdir%>','upfile','width=400,height=100')">上传</a></p>
<p>上传大图:<input type="text" readonly="readonly" id="picdir2" name="picdir2" /> <a href="###" onclick="javascript:open('upfile2.asp?picdir=<%=picdir%>','upfile','width=400,height=100')">上传</a></p>
<p>商品简介:<textarea name="proinfo"></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 = "" '这个是给编辑器初始值
oFCKeditor.Create "procontent" '以后编辑器里的内容都是由这个content 取得,
%>
</p>
<p><input type="submit" name="send" value="添加商品" /></p>
</div>
</form>
</body>
</html>