📄 admin_product.asp
字号:
<!-- #include file="include/onlogin.asp" -->
<!-- #INCLUDE FILE="include/conn.asp" -->
<!-- #INCLUDE file="include/functions.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<%
dim nsort,sql2,rs2,del_temp,data_name,cid,sid,nid,ncid,nsid,id,left_type,now_id,nummer,sqladd,page,rssum,thepages,viewpage,pageurl
dim name,csid,remark_1,remark_2,price_1,price_2,smallimg,bigimg,serial,brand,stock,isgood,hidden,ispic,pic,down_url,down_remark
tit=vbcrlf & "<a href='?'>产品管理</a> ┋ " & _
vbcrlf & "<a href='?action=add'>发布产品</a> ┋ " & _
vbcrlf & "<a href='admin_nsort.asp?nsort=pro'>产品分类</a>"
response.write header(18,tit)
pageurl="?action="&action&"&":nsort="pro":data_name="product":sqladd="":nummer=15
call admin_cid_sid()
if trim(request("del_ok"))="ok" then
response.write del_select(trim(request.form("del_id")))
end if
function del_select(delid)
dim del_i,del_num,del_dim,del_sql,fobj,picc
if delid<>"" and not isnull(delid) then
delid=replace(delid," ","")
del_dim=split(delid,",")
del_num=UBound(del_dim)
for del_i=0 to del_num
call upload_del(data_name,del_dim(del_i))
del_sql="delete from "&data_name&" where id="&del_dim(del_i)
conn.execute(del_sql)
next
Erase del_dim
del_select=vbcrlf&"<script language=javascript>alert(""共删除了 "&del_num+1&" 条记录!"");</script>"
end if
end function
id=trim(request.querystring("id"))
if (action="hidden" or action="isgood") and isnumeric(id) then
sql="select "&action&" from "&data_name&" where id="&id
set rs=conn.execute(sql)
if not(rs.eof and rs.bof) then
if action="hidden" then
if rs(action)=true then
sql="update "&data_name&" set "&action&"=0 where id="&id
else
sql="update "&data_name&" set "&action&"=1 where id="&id
end if
else
if rs(action)=false then
sql="update "&data_name&" set "&action&"=1 where id="&id
else
sql="update "&data_name&" set "&action&"=0 where id="&id
end if
end if
conn.execute(sql)
end if
rs.close
action=""
end if
select case action
case "add"
call news_add()
case "edit"
if not(isnumeric(id)) then
call news_main()
else
set rs=server.createobject("adodb.recordset")
sql="select * from "&data_name&" where id="&id
rs.open sql,conn,1,3
call news_edit()
end if
case else
call news_main()
end select
close_conn()
response.write ender()
sub news_edit()
dim rs3,sql3
if trim(request.querystring("edit"))="chk" then
name=code_admin(request.form("name"))
csid=trim(request.form("csid"))
remark_1=request.form("remark_1")
remark_2=request.form("remark_2")
price_1=trim(request.form("price_1"))
price_2=trim(request.form("price_2"))
smallimg=trim(request.form("pics"))
bigimg=trim(request.form("picb"))
serial=code_admin(request.form("serial"))
brand=code_admin(request.form("brand"))
stock=code_admin(request.form("stock"))
isgood=trim(request.form("isgood"))
hidden=trim(request.form("hidden"))
down_url=code_admin(request.form("down_url"))
down_remark=code_admin(request.form("down_remark"))
if len(csid)<1 then
response.write "<font class=red_2>请选择产品类型!</font><br><br>"&go_back
elseif len(name)<1 or not(isnumeric(price_1)) or not(isnumeric(price_2)) then
response.write "<font class=red_2>产品名称和产品价格不能为空!</font><br><br>"&go_back
elseif len(remark_1)>250 then
response.write "<font class=red_2>产品简介不能超过250个字!</font><br><br>"&go_back
else
call chk_cid_sid()
rs("c_id")=cid
rs("s_id")=sid
rs("name")=name
rs("remark_1")=remark_1
rs("remark_2")=remark_2
rs("price_1")=price_1
rs("price_2")=price_2
if len(smallimg)<3 then smallimg="no_pic.gif"
rs("smallimg")=smallimg
if len(bigimg)<3 then bigimg="no_pic.gif"
rs("bigimg")=bigimg
rs("serial")=serial
rs("brand")=brand
rs("stock")=stock
rs("down_url")=down_url
rs("down_remark")=down_remark
if isgood="yes" then
rs("isgood")=true
else
rs("isgood")=false
end if
if hidden="yes" then
rs("hidden")=false
else
rs("hidden")=true
end if
rs("tim")=now_time
rs.update
rs.close:set rs=nothing
call upload_note(data_name,id)
response.write "<font class=red>已成功修改了一篇动态!</font><br><br><a href='?c_id="&cid&"&s_id="&sid&"'>点击返回</a><br><br>"
end if
else
%><table border=0 width='100%' cellspacing=0 cellpadding=1>
<form name='add_frm' action='<%response.write pageurl%>c_id=<%response.write cid%>&s_id=<%response.write sid%>&id=<%response.write id%>&edit=chk' method=post>
<input type=hidden name=upid value=''>
<tr><td width='14%' align=center>产品名称:</td><td width='86%'><input type=text size=70 name=name value='<%response.write rs("name")%>' maxlength=50><%=redx%></td></tr>
<tr><td align=center>产品类型:</td><td><%call chk_csid(cid,sid)%> 产品编号:<input type=text size=30 name=serial value='<%response.write rs("serial")%>' maxlength=20></td></tr>
<tr><td align=center>市场价格:</td><td><input type=text size=15 name=price_1 value='<%response.write rs("price_1")%>' maxlength=10> 会员价格:<input type=text size=15 name=price_2 value='<%response.write rs("price_2")%>' maxlength=10> <%response.write redx%>(价格只能为数字)</td></tr>
<tr><td align=center>产品品牌:</td><td><input type=text size=15 name=brand value='<%response.write rs("brand")%>' maxlength=20> 库存:<select name=stock size=1>
<%pic=rs("stock")%><option<%if pic="有货" then response.write " selected"%>>有货</option>
<option<%if pic="紧张" then response.write " selected"%>>紧张</option>
<option<%if pic="暂缺" then response.write " selected"%>>暂缺</option>
</select> 推荐:<input type=checkbox name=isgood<%if rs("isgood")=true then response.write " checked"%> value='yes'> 选为推荐 隐藏:<input type=checkbox name=hidden<%if rs("hidden")=false then response.write " checked"%> value='yes'> 设为隐藏</td></tr>
<tr><td align=center>相关下载:</td><td><input type=text size=70 name=down_url value='<%response.write rs("down_url")%>' maxlength=100></td></tr>
<tr><td align=center>下载说明:</td><td><input type=text size=70 name=down_remark value='<%response.write rs("down_remark")%>' maxlength=50></td></tr>
<tr><td valign=top align=center><br>产品简介:<br><=250B</td><td><textarea name=remark_1 rows=5 cols=70><%response.write rs("remark_1")%></textarea></td></tr>
<tr height=35<%response.write format_table(3,1)%>><td align=center><%call frm_ubb_type()%></td><td><%call frm_ubb("add_frm","remark_2"," ")%></td></tr>
<tr><td valign=top align=center><br>详细说明:</td><td><textarea name=remark_2 rows=8 cols=70><%response.write rs("remark_2")%></textarea></td></tr>
<%
pic=rs("smallimg")
if pic="no_pic.gif" then pic=""
ispic=pic
if Instr(ispic,"/")>0 then ispic=right(ispic,len(ispic)-Instr(ispic,"/"))
if Instr(ispic,".")>0 then ispic=left(ispic,Instr(ispic,".")-1)
if len(ispic)<1 then ispic=upload_time(now_time)
%> <tr><td align=center>小 图 片:</td><td><table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr><td><input type=text name=pics value='<%response.write pic%>' size=40 maxlength=50></td></tr>
<tr><td><iframe frameborder=0 name=upload_frames width='100%' height=30 scrolling=no src='upload.asp?uppath=product&upname=<%response.write "ps"&ispic%>&uptext=pics'></iframe></td></tr>
</table></td></tr>
<%
pic=rs("bigimg")
if pic="no_pic.gif" then pic=""
ispic=pic
if Instr(ispic,"/")>0 then ispic=right(ispic,len(ispic)-Instr(ispic,"/"))
if Instr(ispic,".")>0 then ispic=left(ispic,Instr(ispic,".")-1)
if len(ispic)<1 then ispic=upload_time(now_time)
%> <tr><td align=center>大 图 片:</td><td><table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr><td><input type=text name=picb value='<%response.write pic%>' size=40 maxlength=50> <a href='upload.asp?uppath=product&upname=<%response.write "pb"&ispic%>&uptext=picb' target=upload_frame>上传图片</a> <a href='upload.asp?uppath=product&upname=<%response.write "p"%>&uptext=remark_2' target=upload_frame>上传至详细说明</a></td></tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -