📄 produit_modi.asp
字号:
<%
if session("username")="" then
%>
<script language="javascript">
top.location.href="../login.asp"
</script>
<%
response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->
<html>
<head>
<title><%=dianming%> - 产品修改</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style2.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY>
<%
if fla1="0" then
%>
<br><center><font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%
response.end
end if
%>
<%if request("hid")="" then%>
<script language="javascript">
function check()
{
if (document.form2.title.value==""||document.form2.huohao.value==""||document.form2.shulian.value=="")
{
alert("有*号的必须填写!");
return false;
}
}
function chg1(a)
{
if (a=="0") {document.all.bian1.innerHTML="%"}
else {document.all.bian1.innerHTML="元"}
}
</script>
<table width="98%" border="0" cellpadding="0" cellspacing="2" align="center">
<tr>
<td height="21"> <img src="../Images/ico/ico35.gif" width="32" height="32" hspace="2" vspace="2" align="absmiddle"><font size="+1"><strong> 产品修改</strong></font></td>
</tr>
</table>
<%
sql="select * from produit where id="&request("id")
set rs=conn.execute(sql)
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="2" align="center" class="TableMenu">
<form name="form3">
<input type="hidden" name="id" value="<%=request("id")%>">
<input type="hidden" name="form" value="<%=request("form")%>">
<input type="hidden" name="field" value="<%=request("field")%>">
<input type="hidden" name="field2" value="<%=request("field2")%>">
<input type="hidden" name="paixu" value="<%=request("paixu")%>">
<input type="hidden" name="paixu2" value="<%=request("paixu2")%>">
<input type="hidden" name="paixu3" value="<%=request("paixu3")%>">
<input type="hidden" name="page" value="<%=request("page")%>">
<input type="hidden" name="ku2" value="<%=request("ku2")%>">
<input type="hidden" name="bigclass2" value="<%=request("bigclass2")%>">
<input type="hidden" name="smallclass2" value="<%=request("smallclass2")%>">
<input type="hidden" name="keyword" value="<%=request("keyword")%>">
<input type="hidden" name="hid3" value="ok">
<tr class="a1" style="color:#ffffff;font-size:12px;">
<th height="30" style="color:#ffffff;font-size:14px" colspan="2"><img src="../images/add.gif" border="0" hspace="2" align="absmiddle">产品资料修改 <font size="-1">(带*号的为必填项)</font></th>
</tr>
<tr class="a3">
<td align="right" height="30"><b>所属大类:</b></td>
<td>
<%
sql="select * from bigclass order by id"
set rs_bigclass=conn.execute(sql)
if rs_bigclass.eof then
%>
<script language="javascript">
alert("请先添加产品大类!")
window.location.href="../system/bigclass_add.asp"
</script>
<%
end if
nowbigclass=request("bigclass")
if nowbigclass="" then
nowbigclass=rs("id_bigclass")&""
end if
%>
<select name="bigclass" onChange="form3.submit()">
<%
do while rs_bigclass.eof=false
%>
<option value="<%=rs_bigclass("id")%>"<%if trim(cstr(rs_bigclass("id")))=nowbigclass then%> selected="selected"<%end if%>><%=rs_bigclass("bigclass")%></option>
<%
rs_bigclass.movenext
loop
%>
</select>
</td>
</tr>
</form>
<form name="form2">
<input type="hidden" name="form" value="<%=request("form")%>">
<input type="hidden" name="field" value="<%=request("field")%>">
<input type="hidden" name="field2" value="<%=request("field2")%>">
<input type="hidden" name="bigclass" value="<%=nowbigclass%>">
<input type="hidden" name="id" value="<%=request("id")%>">
<input type="hidden" name="paixu" value="<%=request("paixu")%>">
<input type="hidden" name="paixu2" value="<%=request("paixu2")%>">
<input type="hidden" name="paixu3" value="<%=request("paixu3")%>">
<input type="hidden" name="page" value="<%=request("page")%>">
<%if request("hid3")="" then%>
<input type="hidden" name="ku2" value="<%=request("ku")%>">
<%else%>
<input type="hidden" name="ku2" value="<%=request("ku2")%>">
<%end if%>
<%if request("hid3")="" then%>
<input type="hidden" name="bigclass2" value="<%=request("bigclass")%>">
<%else%>
<input type="hidden" name="bigclass2" value="<%=request("bigclass2")%>">
<%end if%>
<%if request("hid3")="" then%>
<input type="hidden" name="smallclass2" value="<%=request("smallclass")%>">
<%else%>
<input type="hidden" name="smallclass2" value="<%=request("smallclass2")%>">
<%end if%>
<input type="hidden" name="keyword" value="<%=request("keyword")%>">
<tr bgcolor="#ffffff">
<td align="right" height="30"><b>所属小类:</b></td>
<td>
<%
sql="select * from smallclass where id_bigclass="&nowbigclass&" order by id"
set rs_smallclass=conn.execute(sql)
if rs_smallclass.eof then
%>
<script language="javascript">
alert("请先添加产品小类!")
window.location.href="../system/smallclass_add.asp"
</script>
<%
end if
%>
<select name="smallclass">
<%
do while rs_smallclass.eof=false
%>
<option value="<%=rs_smallclass("id")%>"<%if trim(cstr(rs_smallclass("id")))=rs("id_smallclass")&"" then%> selected="selected"<%end if%>><%=rs_smallclass("smallclass")%></option>
<%
rs_smallclass.movenext
loop
%>
</select>
</td>
</tr>
<tr class="a3">
<td width="28%" height="30" align="right"><b>产品名称:</b> </td>
<td width="72%">
<input type="text" name="title" style="width:200px" value="<%=rs("title")%>">
<font color="#ff0000">*</font></td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" height="30"><b>产品货号:</b> </td>
<td>
<input type="text" name="huohao" style="width:200px" value="<%=rs("huohao")%>">
<input type="hidden" name="oldhuohao" value="<%=rs("huohao")%>">
<font color="#ff0000">*</font></td>
</tr>
<tr class="a3">
<td align="right" height="30"><b>所在仓库:</b> </td>
<td>
<%
sql="select * from ku where id="&rs("id_ku")
set rs_ku=conn.execute(sql)
%>
<%=rs_ku("ku")%>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" height="30"><b>库存数量:</b></td>
<td> <input type="text" name="shulian" style="width:100px" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="<%=rs("shulian")%>">
<font color="#ff0000">* </font><font color="#ff0000">(非必要不要改动,以免造成系统错误!)</font></td>
</tr>
<tr class="a3">
<td align="right" height="30"><b>产品单位:</b></td>
<td>
<%
sql="select * from danwei order by id"
set rs_danwei=conn.execute(sql)
if rs_danwei.eof then
%>
<script language="javascript">
alert("请先添加单位!")
window.location.href="../system/danwei_add.asp"
</script>
<%
end if
%>
<select name="danwei">
<%
do while rs_danwei.eof=false
%>
<option value="<%=rs_danwei("danwei")%>"<%if rs_danwei("danwei")=rs("danwei") then%> selected="selected"<%end if%>><%=rs_danwei("danwei")%></option>
<%
rs_danwei.movenext
loop
%>
</select>
<font color="#666666">(只用于普通识别,不能换算)</font> </td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" height="30"><b>推荐卖价:</b></td>
<td> <input type="text" name="price" style="width:100px" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="<%=rs("price")%>">
<font color="#666666">元</font></td>
</tr>
<tr class="a3">
<td align="right" height="30"><b>规格:</b></td>
<td> <input type="text" name="guige" style="width:200px" value="<%=rs("guige")%>"></td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" height="30"><b>最低库存报警数量:</b></td>
<td> <input type="text" name="baojin" style="width:100px" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="<%=rs("baojin")%>">
<font color="#666666">(设为零将不会报警)</font></td>
</tr>
<tr class="a3">
<td align="right" height="30"><b>产品类型:</b></td>
<td>
<select name="class">
<option value="0"<%if rs("class")=0 then%> selected="selected"<%end if%>>正常产品</option>
<option value="1"<%if rs("class")=1 then%> selected="selected"<%end if%>>公司赠品</option>
</select>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" height="30"><b>兑换所需积分:</b></td>
<td>
<input type="text" name="duihuan" style="width:100px" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="<%=rs("duihuan")%>">
<font color="#666666">(会员兑换此礼品所需积分)</font></td>
</tr>
<tr class="a3">
<td align="right" height="30"><b>提成类型:</b></td>
<td>
<select name="tichen_type" onChange="chg1(this.value)">
<option value="0"<%if rs("tichen_type")=0 then%> selected="selected"<%end if%>>按百分比提成</option>
<option value="1"<%if rs("tichen_type")=1 then%> selected="selected"<%end if%>>固定提成</option>
</select>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" height="30"><b>员工提成:</b></td>
<td>
销售一件提成:<input type="text" name="tichen" style="width:50px" value="<%=rs("tichen")%>" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
<font color="#666666"><span id="bian1"><%if rs("tichen_type")=0 then%>%<%else%>元<%end if%></span></font></td>
</tr>
<tr class="a3">
<td height="30"> </td>
<td> <input type="submit" value=" 确认修改 " onClick="return check()">
<input type="hidden" name="hid" value="ok">
<input type="reset" value=" 重新填写 ">
<input type="button" value=" 放弃修改返回 " onClick="window.history.go(-1)">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<%
else
nowbigclass=request("bigclass")
nowsmallclass=request("smallclass")
nowtitle=request("title")
nowhuohao=request("huohao")
nowoldhuohao=request("oldhuohao")
nowshulian=request("shulian")
nowdanwei=request("danwei")
nowprice=request("price")
nowguige=request("guige")
nowbaojin=request("baojin")
nowclass=request("class")
nowduihuan=request("duihuan")
nowtichen_type=request("tichen_type")
nowtichen=request("tichen")
if nowoldhuohao<>nowhuohao then
sql="select * from produit where huohao='"&nowhuohao&"'"
set rs=conn.execute(sql)
if rs.eof=false then
%>
<script language="javascript">
alert("您输入的产品货号已经存在,请重新输入!")
window.history.go(-1)
</script>
<%
response.end
end if
end if
set rs=server.createobject("ADODB.RecordSet")
sql="select * from produit where id="&request("id")
rs.open sql,conn,1,3
rs("id_bigclass")=nowbigclass
rs("id_smallclass")=nowsmallclass
rs("title")=nowtitle
rs("huohao")=nowhuohao
rs("shulian")=nowshulian
rs("danwei")=nowdanwei
rs("price")=nowprice
rs("guige")=nowguige
rs("baojin")=nowbaojin
rs("class")=nowclass
rs("duihuan")=nowduihuan
rs("tichen_type")=nowtichen_type
rs("tichen")=nowtichen
rs.update
rs.close
sql="select * from produit where huohao='"&nowoldhuohao&"' and id<>"&request("id")
rs.open sql,conn,1,3
do while rs.eof=false
rs("id_bigclass")=nowbigclass
rs("id_smallclass")=nowsmallclass
rs("title")=nowtitle
rs("huohao")=nowhuohao
rs("danwei")=nowdanwei
rs("price")=nowprice
rs("guige")=nowguige
rs("baojin")=nowbaojin
rs("class")=nowclass
rs("duihuan")=nowduihuan
rs("tichen_type")=nowtichen_type
rs("tichen")=nowtichen
rs.movenext
loop
%>
<script language="javascript">
alert("产品修改成功!")
window.location.href="produit.asp?form=<%=request("form")%>&field=<%=request("field")%>&field2=<%=request("field2")%>&paixu=<%=request("paixu")%>&paixu2=<%=request("paixu2")%>&paixu3=<%=request("paixu3")%>&page=<%=request("page")%>&keyword=<%=request("keyword")%>&ku=<%=request("ku2")%>&bigclass=<%=request("bigclass2")%>&smallclass=<%=request("smallclass2")%>"
</script>
<%
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -