📄 showmana.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="shopconn.asp" -->
<%
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
Response.Write("对不起,您不是社区用户,请先注册!")
Response.End
else
%><HTML><HEAD><title>超级市场 → 修改商品</title><%call shophead()
if master then
dim act,dressid
act=request("act")
if act="del" then
call showdel()
elseif act="edited" then
call edited()
else
call edit()
end if
else
response.write "<script>alert('您没有管理权限!');history.go(-1);</script>"
response.end
end if
sub edit()
dim rs,sql
dressid=request("dressid")
set rs=server.createobject("adodb.recordset")
sql="select dressname,dresssex,showid,dressmoney,dresstext,dresslast from dress where id="&dressid
rs.open sql,connshop,1,1
%>
<TABLE width=700 bgcolor="#B7D3FF" cellpadding="0" cellspacing="0">
<TR>
<TD align="center" height="25" colspan="2"><font color=red><b>修改商品</b></font></td></tr>
<TR><form method=post action=?dressid=<%=dressid%>&act=edited name=nowform>
<td width=30% height="25" align="right">名 称:</td>
<td width=70% ><input type=text name=dressname size=8 value=<%=rs("dressname")%> ></td>
</tr>
<tr>
<td height="25" align="right">式 样:</td>
<td><input type="radio" value="0" <%if rs("dresssex")=0 then%>checked <%end if%>name="Sex">男式
<input type="radio" name="Sex" <%if rs("dresssex")=1 then%>checked <%end if%>value="1">女式</td>
</tr>
<tr>
<td height="25" align="right">说 明:</td>
<td><input type=text name=dresstext value=<%=rs("dresstext")%>></td>
</tr>
<tr>
<td height="25" align="right">价 格:</td>
<td><input type=text name=dressmoney size=5 value=<%=rs("dressmoney")%>></td>
</tr>
<tr>
<td height="25" align="right">类 别:</td>
<td><select name=showid>
<option value="3"<%if rs("showid")=3 then%> selected<%end if%>>上衣</option>
<option value="2"<%if rs("showid")=2 then%> selected<%end if%>>下装</option>
<option value="1"<%if rs("showid")=1 then%> selected<%end if%>>鞋子</option>
<option value="4"<%if rs("showid")=4 then%> selected<%end if%>>饰品</option>
</select></td>
</tr>
<tr>
<td height="25" align="right">保质期:</td>
<td><input type=text name=dresslast size=5 value=<%=rs("dresslast")%>></td>
</tr>
<tr><td align="center" height="25" colspan="2"><input type=submit value=修改> <input type=reset value=重置></td></form></tr></table>
<%
rs.close
set rs=nothing
end sub
sub edited()
if request("dressname")="" then
response.write "<script>alert('请输入商品名称!');history.go(-1);</script>"
elseif request("dressmoney")="" then
response.write "<script>alert('请输入商品价格!');history.go(-1);</script>"
elseif not isnumeric(request("dressmoney")) then
response.write "<script>alert('请确认输入的价格为数值!');history.go(-1);</script>"
elseif cint(request("dressmoney"))<=0 then
response.write "<script>alert('请确认输入的价格大于0!');history.go(-1);</script>"
elseif request("dresslast")="" then
response.write "<script>alert('请输入商品保质期!');history.go(-1);</script>"
elseif not isnumeric(request("dresslast")) then
response.write "<script>alert('请确认输入的保质期为数值!');history.go(-1);</script>"
elseif cint(request("dresslast"))<=0 then
response.write "<script>alert('请确认输入的保质期大于0!');history.go(-1);</script>"
end if
dressid=request("dressid")
set rs=server.createobject("adodb.recordset")
sql="select dressname,dresssex,showid,dressmoney,dresstext,dresslast from dress where id="&dressid
rs.open sql,connshop,1,3
rs("dressname")=request("dressname")
rs("dresssex")=request("sex")
rs("showid")=request("showid")
rs("dressmoney")=request("dressmoney")
rs("dresstext")=request("dresstext")
rs("dresslast")=request("dresslast")
rs.update
rs.close
%>
<table><tr><td align=center>恭喜,操作成功!</td></tr>
<%response.write "<meta http-equiv=refresh content=""3;url=shop.asp"">"%>
<tr><td>系统将自动在3秒后返回商店列表,您现在可以选择下面操作:
<UL><li><a href=shoped.asp><font color=#000000>返回我的购物车</font></a></li>
<li><a href=shop.asp><font color=#000000>返回商店列表</font></a></li></UL>
</td></tr></table>
<%
end sub
connshop.close
set connshop=nothing
%></center></body></html>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -