📄 productmod.asp
字号:
<!--#include file="../include/bkconn.asp"-->
<!--#include file="checkUser.asp"-->
<%
function selectTreeList(i,deep)
dim sql
dim rs
dim tempi
dim rsID
set rs=server.createObject("adodb.recordset")
sql="select * from productSort where fatherID="&i
rs.open sql,conn,1,1
if rs.eof then
exit function
else
do while not rs.eof
rsID=rs("id")
rsName=rs("name")
if deep=0 then
response.write "<option value='"&rsID&"'"
else
response.write "<option value='"&rsID&"'"
end if
if rsID=productSort then response.write " selected"
response.write ">"
for tempi=1 to deep
response.write " "
next
response.write rsName&"</option>"
call selectTreeList(rsID,deep+1)
rs.movenext
loop
end if
end function
dim rs,sql
dim productSort
dim pinpaiid
sql="select * from product where id="&Request("id")
set rs=conn.execute (sql)
pinpaiid=rs("pinpai")
%>
<html>
<head>
<title>商品修改</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../main.css" type="text/css">
<script language=Javascript>
<!--
function checkForm(){
//if (form1.productSort.value=='0'){
// alert("请选择商品具体小类");
// return false;
// }
return true;
}
//-->
</script>
</head>
<body bgcolor="#9CC7EF" text="#000000">
<%if rs.eof or err then%>
<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="35"> </td>
</tr>
<tr>
<td><div align="center">该商品已被删除,<a href=Javascript:window.history.go(-1)>返回</a></div></td>
</tr>
</table>
<%
else
productSort=rs("productSort")
%>
<br>
<form method="post" action="saveProductMod.asp" name="form1" onSubmit="return checkForm()">
<table width="70%" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
<tr>
<td colspan="2" bgcolor="#4296E7"> <div align="center"><font color="#FFFFFF">修改商品</font></div></td>
</tr>
<tr>
<td nowrap> <div align="right">商品编号</div></td>
<td> <input name="itemno" type="text" value="<%=rs("itemno")%>" size="18">
<input name="recommendDate" type="hidden" value="<%=now()%>"> </td>
</tr>
<tr>
<td width="20%" nowrap> <div align="right">商品类别</div></td>
<td width="80%"> <select name="productSort">
<%call selectTreeList(0,0)%>
</select> <input type="hidden" name="id" value="<%=Request("id")%>"> </td>
</tr>
<tr>
<td width="20%" nowrap> <div align="right">产品名称(中)</div></td>
<td width="80%"> <input type="text" name="name" size="60" value="<%=rs("name")%>">
</td>
</tr>
<tr>
<td width="20%" nowrap> <div align="right">价 格</div></td>
<td width="80%"> <input type="text" name="memberPrice" size="12" value="<%=rs("memberPrice")%>">
¥</td>
</tr>
<tr>
<td nowrap><div align="right">会员价格</div></td>
<td><input type="text" name="costprice" size="12" value="<%=rs("costPrice")%>" >
¥</td>
</tr>
<tr>
<td nowrap><div align="right">VIP会员价格</div></td>
<td><input type="text" name="vip" size="12" value="<%=rs("vip")%>" >
¥</td>
</tr>
<tr>
<td nowrap><div align="right">特价</div></td>
<td> <% dim tejia
dim recommend
tejia=rs("tejia")
recommend=rs("recommend")%>
<%if tejia=1 then%>
<select name="tejia">
<option value="1" selected>是</option>
<option value="0">否</option>
</select>
<%else%>
<select name="tejia">
<option value="1">是</option>
<option value="0" selected>否</option>
</select>
<%end if%>
<input type="text" name="tejia1" size="12" value="<%=rs("tejia1")%>" >
</td>
</tr>
<tr>
<td nowrap><div align="right">推荐</div></td>
<td> <%if recommend=1 then%>
<select name="recommend">
<option value="1" selected>是</option>
<option value="0">否</option>
</select>
<%else%>
<select name="recommend">
<option value="1">是</option>
<option value="0" selected>否</option>
</select> <%end if%>
</td>
</tr>
<tr>
<td nowrap> <div align="right">产 地</div></td>
<td> <input name="outer" type="text" value="<%=rs("outer")%>"> </td>
</tr>
<tr>
<td nowrap> <div align="right">规 格</div></td>
<td><input name="spec" type="text" value="<%=rs("spec")%>"> </td>
</tr>
<tr>
<td nowrap> <div align="right">品 牌</div></td>
<td>
<select name="pinpai" id="pinpai">
<%sql="select * from pinpai order by id "
set rs=conn.execute (sql)
while not rs.eof %>
<option value="<%=rs("id")%>" <%dim pin
pin=rs("id")
if pin=pinpaiid then %>
selected
<%end if%>><%=rs("name")%></option>
<%rs.movenext
wend %>
</select></td>
</tr>
<%sql="select * from product where id="&Request("id")
set rs=conn.execute (sql)
pinpai=rs("pinpai")
%>
<tr>
<td nowrap><div align="right">大图宽</div></td>
<td><input name="width" type="text" value="<%=rs("width")%>"size="10"></td>
</tr>
<tr>
<td nowrap><div align="right">大图高</div></td>
<td><input name="height" type="text" value="<%=rs("height")%>"size="10"></td>
</tr>
<tr>
<td width="20%" nowrap> <div align="right">产品说明</div></td>
<td width="80%"> <textarea name="explain" cols="60" rows="15"><%=rs("explain")%></textarea>
</td>
</tr>
<tr>
<td colspan="2" nowrap> <div align="center">
<input type="button" name="Submit3" value="删除" onClick="deleteMe()">
<input type="submit" name="Submit" value="修改">
<input type="button" name="Submit2" value="返回" onClick="window.location='<%=session("adminOldUrl")%>';">
</div></td>
</tr>
</table>
</form>
<script language=Javascript>
<!--
function deleteMe(){
if(confirm("确定删除?(不提供后悔药)")==1){
window.location="saveProductDel.asp?id=<%=rs("id")%>"
}
}
//-->
</script>
<%end if %>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -