📄 product_edit.asp
字号:
<!--#include file="Conn.asp"-->
<!--#include file="Check.asp"-->
<!--#include file="Inc/Date.asp"-->
<%
Dim pr,id
Dim ty,pr_id
id=Request("id")
Dim isdataman
isdataman = Manage_Level(adl)
If isdataman <> "财务员" Then
Response.write "<script language='javascript'>alert('对不起,你没有权限进行此项操作!');" & chr(13)
Response.write "window.document.location.href='javascript:history.go(-1)';</script>"
End if
Set pr = Conn.execute("Select * From [Product] Where ID="&id)
pr_id = pr("Type")
%>
<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="Image/style.css" type=text/css rel=stylesheet>
<script language="JavaScript" src="Image/js.js"></SCRIPT>
</head>
<script language="JavaScript">
<!--
function change(obj,i) {
he=parseInt(obj.style.height);
if (he>=80&&he<=400)
obj.style.height=he+i+'px';
else
obj.style.height='80px';
}
function chk(theForm){
if (theForm.product_id.value == ""){
alert("请输入商品代码!");
theForm.product_id.focus();
return (false);
}
if (theForm.adddate.value == ""){
alert("请输入入库时间!");
theForm.adddate.focus();
return (false);
}
if (theForm.pname.value == ""){
alert("请输入商品名称!");
theForm.pname.focus();
return (false);
}
if (theForm.guige.value == ""){
alert("请输入规格!");
theForm.guige.focus();
return (false);
}
if (theForm.money.value == ""){
alert("请输入零售价!");
theForm.money.focus();
return (false);
}
if (theForm.shuliang.value == ""||theForm.shuliang.value<=0){
alert("请输入数量且数量不能少于0!");
theForm.shuliang.focus();
return (false);
}
if (theForm.from.value == ""){
alert("请输入产地!");
theForm.from.focus();
return (false);
}
if (theForm.type.value == ""){
alert("请输入所属类别!");
theForm.type.focus();
return (false);
}
if (theForm.message.value == ""){
alert("请输入备注!");
theForm.message.focus();
return (false);
}
}
function CheckNum(){
if((event.keyCode<48||event.keyCode>57)&&event.keyCode!=46) event.returnValue=false;
}
//-->
</script>
<body text="#000000">
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
<form action="Product_Edit2.asp?id=<%=pr("ID")%>" method=post id=form1 name=form1 onSubmit="return chk(this)">
<tr bgcolor=ffffff>
<th height=25 colspan=4 align="center">修改商品</th>
</tr>
<tr bgcolor=ffffff>
<td width="27%" class=forumrow><div align="right">商品代码:</div></td>
<td width="18%" class=forumrow> <input name="product_id" type="text" id="product_id" value="<%=pr("Product_ID")%>" size="15" maxlength="20" readonly>
</td>
<td width="16%" class=forumrow><div align="right">入库时间:</div></td>
<td width="39%" class=forumrow><input name="adddate" type="text" id="adddate" value="<%=pr("InTime")%>" size="12" maxlength="12" readonly>
<input name="button" type="button" onClick="popUpCalendar(this, form1.adddate, 'yyyy-mm-dd')" value="请选择日期"></td>
</tr>
<tr bgcolor=ffffff>
<td width="27%" class=forumrow><div align="right">商品名称:</div></td>
<td colspan="3" class=forumrow><input name="pname" type="text" id="pname" value="<%=pr("Name")%>" size="25" maxlength="30"></td>
</tr>
<tr bgcolor=ffffff>
<td class=forumrow><div align="right">规格:</div></td>
<td colspan="3" class=forumrow> <input name="guige" type="text" id="guige" value="<%=pr("GuiGe")%>" size="20" maxlength="20"></td>
</tr>
<tr bgcolor=ffffff>
<td class=forumrow><div align="right">零售价:</div></td>
<td colspan="3" class=forumrow>
<input name="money" type="text" id="money" onKeyPress="javascript:CheckNum();" value="<%=pr("Money")%>" size="15" maxlength="10" readonly></td>
</tr>
<tr bgcolor=ffffff>
<td class=forumrow><div align="right">数量:</div></td>
<td colspan="3" class=forumrow>
<input name="shuliang" onKeyPress="javascript:CheckNum();" type="text" id="shuliang" value="<%=pr("ShuLiang")%>" size="15" maxlength="10" readonly>
<font color="#FF0000"><strong>(数量一旦添加了就不可以再修改,只有管理员才有权力修改) </strong></font>
<div align="right"></div></td>
</tr>
<tr bgcolor=ffffff>
<td align="center" class=forumrow><div align="right">数量提示:</div></td>
<td colspan="3" class=forumrow> <input name="min" type="text" id="min" onKeyPress="javascript:CheckNum();" value="<%=pr("Min")%>" size="15" maxlength="10">
<font color="#FF0000"><strong>(产品剩多少的时要提示库存不足,留空为不提示)</strong></font></td>
</tr>
<tr bgcolor=ffffff>
<td class=forumrow><div align="right">产地:</div></td>
<td colspan="3" class=forumrow><input name="from" type="text" id="from" value="<%=pr("Froms")%>" maxlength="30"></td>
</tr>
<tr bgcolor=ffffff>
<td class=forumrow><div align="right">所属类别:</div></td>
<td colspan="3" class=forumrow><select name="type" id="type">
<%
Set ty=Conn.Execute("Select ID,Class From [Product_Class]")
Do While Not ty.Eof
If ty(0)=pr_id Then
Response.Write "<option value='"& ty(0) &"' selected>" & ty(1) & "</option>"
Else
Response.Write "<option value='"& ty(0) &"'>" & ty(1) & "</option>"
End if
ty.MoveNext
Loop
ty.Close
Set ty=Nothing
%>
</select></td>
</tr>
<tr bgcolor=ffffff>
<td rowspan="2" class=forumrow><div align="right">备注:</div></td>
<td colspan="3" class=forumrow><textarea name="message" cols="50" rows="10" id="message"><%=pr("Mone")%></textarea></td>
</tr>
<tr bgcolor=ffffff>
<td colspan="2" class=forumrow> </td>
<td class=forumrow><a href="javascript:change(document.all.message,-50)"><img src="Image/minus.gif" alt="缩小文本框" width="20" height="20" border="0"></a>
<a href="javascript:change(document.all.message,50)"><img src="Image/plus.gif" alt="放大文本框" width="20" height="20" border="0"></a></td>
</tr>
<tr bgcolor=ffffff>
<td colspan="4" align="center" class=forumrow> <input type="submit" name="Submit" value="修 改">
<input type="reset" name="Submit2" value="还 原"></td>
</tr>
</form>
</table>
</html>
<%
pr.Close
Set pr=Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -