📄 produit_tui.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 fla0="0" then
%>
<br><center><font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%
response.end
end if
%>
<%
if request("hid1")="ok" then
nowku=request("ku")
nowhuohao=request("huohao")
nowshulian=request("shulian")
nowid_login=request("id_login")
set rs_login=conn.execute("select * from login where id="&nowid_login)
set rs_ku=conn.execute("select ku from ku where id="&nowku)
set rs_produit=conn.execute("select * from produit where huohao='"&nowhuohao&"'")
set rs_bigclass=conn.execute("select bigclass from bigclass where id="&rs_produit("id_bigclass"))
set rs_smallclass=conn.execute("select smallclass from smallclass where id="&rs_produit("id_smallclass"))
set rs=server.createobject("ADODB.RecordSet")
sql="select * from produit where huohao='"&nowhuohao&"' and id_ku="&nowku
rs.open sql,conn,1,3
if rs.eof then
%>
<script language="javascript">
alert("<%=rs_ku("ku")%> 中没有此产品!")
window.history.go(-1)
</script>
<%
response.end
elseif rs("shulian")-nowshulian<0 then
%>
<script language="javascript">
alert("<%=rs_ku("ku")%> 库存不足!")
window.history.go(-1)
</script>
<%
response.end
else
rs("shulian")=rs("shulian")-nowshulian
end if
rs.update
rs.close
sql="insert into sell(id_produit,bigclass,smallclass,title,huohao,ku,shulian,guige,id_login,type,selldate,login) values("&rs_produit("id")&",'"&rs_bigclass(0)&"','"&rs_smallclass(0)&"','"&rs_produit("title")&"','"&nowhuohao&"','"&rs_ku(0)&"',"&nowshulian&",'"&rs_produit("guige")&"',"&nowid_login&",2,#"&date()&"#,'"&rs_login("username")&"')"
conn.execute(sql)
%>
<script language="javascript">
alert("操作成功!")
</script>
<%
end if
%>
<script language="javascript">
function check()
{
if (document.form1.huohao.value=="单击选择产品"||document.form1.shulian.value=="")
{
alert("有*号的必须填写!");
return false;
}
}
</script>
<table width="98%" border="0" cellpadding="0" cellspacing="2" align="center">
<tr>
<td height="21"> <img src="../Images/ico/ico32.gif" width="32" height="32" hspace="2" vspace="2" align="absmiddle"><font size="+1"><strong> 产品退给公司</strong></font></td>
</tr>
</table>
<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="form1">
<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 bgcolor="#ffffff">
<td width="30%" height="30" align="right"><b>出货仓库:</b> </td>
<td width="70%">
<%
sql="select * from ku order by id"
set rs_ku=conn.execute(sql)
if rs_ku.eof then
%>
<script language="javascript">
alert("请先添加仓库!")
window.location.href="../system/ku_add.asp"
</script>
<%
end if
%>
<select name="ku">
<%
do while rs_ku.eof=false
%>
<option value="<%=rs_ku("id")%>"<%if rs_ku("moren") then%> selected="selected"<%end if%>><%=rs_ku("ku")%></option>
<%
rs_ku.movenext
loop
%>
</select>
</td>
</tr>
<tr class="a3">
<td width="30%" height="30" align="right"><b>选择产品:</b> </td>
<td width="70%">
<input name="huohao" readonly onClick="JavaScript:window.open('produit1.asp?form=form1&field=huohao','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=895,height=503,top=142,left=115');" style="width:150px" value="单击选择产品">
<font color="#ff0000">*</font></td>
</tr>
<tr class="a3">
<td height="0" colspan="2" align="center">
<span id="showshulian"></span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td width="30%" height="30" align="right"><b>退回数量:</b> </td>
<td width="70%">
<input type="text" name="shulian" style="width:50px" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="1">
<font color="#ff0000">*</font></td>
</tr>
<tr class="a3">
<td width="30%" height="30" align="right"><b>经办人:</b> </td>
<td width="70%">
<%
sql="select * from login order by id"
set rs_login=conn.execute(sql)
if rs_login.eof then
%>
<script language="javascript">
alert("请先添加员工!")
window.location.href="../system/user_add.asp"
</script>
<%
else
%>
<select name="id_login">
<%
do while rs_login.eof=false
%>
<option value="<%=rs_login("id")%>"<%if rs_login("username")=session("username") then%> selected="selected"<%end if%>><%=rs_login("username")%></option>
<%
rs_login.movenext
loop
%>
</select>
<%
end if
%>
</td>
</tr>
<tr bgcolor="#ffffff">
<td height="30" colspan="2" align="center"><input type="submit" value=" 确认退回 " onClick="return check()">
<input type="hidden" name="hid1" value="ok">
<input type="reset" value=" 重新填写 ">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -