edit_product.asp
来自「购物系统时尚版.强大的后台文章编辑器的功能」· ASP 代码 · 共 202 行
ASP
202 行
<!--#include file="chk.asp"-->
<!--#include file="db_conn.asp"-->
<!--#include file="../my_lib/my_request.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="style.css" rel=stylesheet type=text/css>
<title>商品修改</title>
<%
dim count
yqj=cint(my_request("id",1))
set rs=server.createobject("adodb.recordset")
sql = "select * from small_class order by addtime desc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("txt_small_class"))%>","<%= trim(rs("iid"))%>","<%= trim(rs("id"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.sid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.sid.options[document.form1.sid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<script language="javascript">
<!--
function checkdata()
{
if (document.form1.viewhtml.checked == true)
{
alert("对不起,请取消“查看HTML源代码”后再添加!")
document.form1.viewhtml.focus()
return false
}
}
//-->
</script>
<script src="edit.js" type="text/javascript"></script>
<SCRIPT>
function view1(url){
var url; window.open(url,'_blank','status=no,scrollbars=yes,top=20,left=50,width=600,height=400');
}
</SCRIPT>
</head>
<%
yqjsql="select * from yqj_product where id="&yqj
set yqjrs=conn.execute (yqjsql)
%>
<body>
<!--#include file="TopManu.asp"-->
<form action="save_edit_product.asp" method="post" name="form1" onsubmit="return checkdata();">
<div align="center">
<table border="0" width="100%" id="table1" cellspacing="0" style="border-collapse: collapse" cellpadding="0">
<tr>
<td background="image/admintoptdbg.gif">
<p align="left">
<img border="0" src="image/title_arrow.bmp" width="17" height="27" align="absmiddle"><font color="#808080"><b>商品编辑</b></font></td>
</tr>
</table>
<table border="1" width="100%" id="table1" cellspacing="0" style="border:1px solid #CCCCCC; border-collapse: collapse; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" bordercolor="#EFEFEF" cellpadding="4">
<tr>
<td width="204" align="right">商品类别:</td>
<td width="546"><select size="1" name="bid" onChange="changelocation(document.form1.bid.options[document.form1.bid.selectedIndex].value)">
<option>≡≡请选择大类≡≡</option>
<%sql="select id,txt_big_class from big_class order by addtime"
set rs=conn.execute (sql)
set id=rs("id")
set big_class=rs("txt_big_class")
do while not rs.eof
%>
<option value="<%=id%>" <%if id=yqjrs("bid") then response.write "Selected" end if%>><%=big_class%></option>
<%rs.movenext
loop
rs.close
set rs=nothing
%>
</select><select name="sid" onChange="change(document.form1.sid.options[document.form1.sid.selectedIndex].value)" style='width:147;background-color:white;font-size:12;color:black; height:18' size="1">
<option>≡≡请选择小类≡≡</option>
<%
Set rs = conn.execute("Select id,txt_small_class from small_class where iid = " & yqjrs("bid"))
do while not rs.eof
%><option value="<%=rs("id")%>" <%if rs("id") =yqjrs("sid") then response.write "Selected"%>><%=rs("txt_small_class")%></option>
<%
rs.movenext
loop
rs.close
set rs=noting
%>
</select></td>
</tr>
<tr>
<td width="204" align="right">商品名称:</td>
<td width="546">
<input type="text" name="p_name" size="32" maxlength="50" value="<%=yqjrs("p_name")%>">
<input type="hidden" name="id" value="<%=yqj%>"></td>
</tr>
<tr>
<td width="204" align="right">商品规格:</td>
<td width="546">
<input type="text" name="p_spec" size="32" maxlength="50" value="<%=yqjrs("p_spec")%>"></td>
</tr>
<tr>
<td width="204" align="right">商品单位:</td>
<td width="546"><select size="1" name="p_unit">
<%set rss=server.createobject("adodb.recordset")
sqls="select * from yqj_sort"
rss.open sqls,conn,1,1
do while not rss.eof%>
<option value="<%=rss("yqj_class")%>"<%if yqjrs("p_unit")=rss("yqj_class") then response.write "selected"%>> <%=rss("yqj_class")%></option>
<%rss.movenext
loop
rss.close
set rss=nothing%>
</select></td>
</tr>
<tr>
<td width="204" align="right">库存数量(销售数量):</td>
<td width="546">
<input type="text" name="nums" size="8" maxlength="6" value="<%=yqjrs("p_nums")%>">(请输入数字)</td>
</tr>
<tr>
<td width="204" align="right" rowspan="2">商品价格:</td>
<td width="546">市场价格:<input type="text" name="p_cmoney" size="8" maxlength="4" value="<%=yqjrs("p_cmoney")%>">元(RMB)</td>
</tr>
<tr>
<td width="546">会员价格:<input type="text" name="p_mmoney" size="8" maxlength="10" value="<%=yqjrs("p_mmoney")%>">元(RMB)</td>
</tr>
<tr>
<td width="204" align="right" rowspan="2">商品图片:</td>
<td width="546">商品的大图片:<input type="text" name="big_pic" size="25" readonly value="<%=yqjrs("big_pic")%>"><font color="#330000" size="2"><a href="javascript:openWin('upload1.asp?action=1','upload','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=410,height=230')"><img src="image/upload.gif" alt="上传图片" width="60" height="18" border="0" align="middle" style="cursor: hand;" onMouseOver="window.status='使用系统自带的上传程序上传图片';return true;" onMouseOut="window.status='';return true;"></a></font></td>
</tr>
<tr>
<td width="546">商品的小图片:<input type="text" name="small_pic" size="25" readonly value="<%=yqjrs("small_pic")%>"><font color="#330000" size="2"><a href="javascript:openWin('upload1.asp?action=2','upload','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=410,height=230')"><img src="image/upload.gif" alt="上传图片" width="60" height="18" border="0" align="middle" style="cursor: hand;" onMouseOver="window.status='使用系统自带的上传程序上传图片';return true;" onMouseOut="window.status='';return true;"></a></font></td>
</tr>
<tr>
<td width="204" align="right">商品简要说明:</td>
<td width="546"><!--#include file="eokedit.asp"-->
<script language="javascript">
document.write ('<iframe src="product_textbox.asp?id=<%=yqj%>&action=modify" id="message" width="450" height="250"></iframe>')
frames.message.document.designMode = "On";
</script></td>
</tr>
<tr>
<td width="204" align="right" rowspan="2">
<p>商品设置:</td>
<td width="546" align="right">
<p align="left">推荐<input type="checkbox" name="flag" value="1" <%if InStr(1,yqjrs("flag"),"1") then%> checked <%end if%>>
特价<input type="checkbox" name="flag" value="2" <%if InStr(1,yqjrs("flag"),"2") then%> checked <%end if%>> 新品<input type="checkbox" name="flag" value="3" <%if InStr(1,yqjrs("flag"),"3") then%> checked <%end if%>></td>
</tr>
<tr>
<td width="546" align="right">
<p align="left"><input type="radio" value="1" name="issale" <%if cint(yqjrs("issale"))=1 then%> checked <%end if%>>上架
<input type="radio" name="issale" value="2" <%if cint(yqjrs("issale"))=2 then%> checked <%end if%>>不上架(暂存)</td>
</tr>
<tr>
<td width="744" align="right" colspan="2">
<p align="center"><input type="submit" value="提交" name="B1" onclick="document.form1.Content.value = frames.message.document.body.innerHTML;"><input type="reset" value="重置" name="B2"><input type="hidden" name="Content" value></td>
</tr>
</table>
</div>
</form>
<div align="center">
<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
<tr>
<td align=right><input TYPE="button" VALUE="刷新本页" ONCLICK="location.reload()"> </td>
</tr>
</table>
</div>
</body>
</html>
<%
yqjrs.close
set yqjrs=nothing
conn.close
set conn=nothing%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?