⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 produit_add.asp

📁 web进销存m长审核合格后才能开通帐号。如果不想上载源码
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
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
nowhuohao=request("huohao")
nowshulian=request("shulian")
nowku=request("ku")
nowlogin=request("login")
set rs_produit=conn.execute("select * from produit where huohao='"&nowhuohao&"'")
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
  rs.addnew
  rs("id_bigclass")=rs_produit("id_bigclass")
  rs("id_smallclass")=rs_produit("id_smallclass")
  rs("title")=rs_produit("title")
  rs("huohao")=rs_produit("huohao")
  rs("id_ku")=nowku
  rs("shulian")=nowshulian
  rs("danwei")=rs_produit("danwei")
  rs("price")=rs_produit("price")
  rs("guige")=rs_produit("guige")
  rs("baojin")=rs_produit("baojin")
  rs("class")=rs_produit("class")
  rs("duihuan")=rs_produit("duihuan")
  rs("tichen_type")=rs_produit("tichen_type")
  rs("tichen")=rs_produit("tichen")
else
  rs("shulian")=rs("shulian")+nowshulian 
end if
rs.update
rs.close
sql="select bigclass from bigclass where id="&rs_produit("id_bigclass")
set rs_bigclass=conn.execute(sql)
sql="select smallclass from smallclass where id="&rs_produit("id_smallclass")
set rs_smallclass=conn.execute(sql)
sql="select ku from ku where id="&nowku
set rs_ku=conn.execute(sql)
sql="insert into buy(id_produit,bigclass,smallclass,title,huohao,ku,shulian,guige,login,type,selldate) values("&rs_produit("id")&",'"&rs_bigclass(0)&"','"&rs_smallclass(0)&"','"&rs_produit("title")&"','"&nowhuohao&"','"&rs_ku(0)&"',"&nowshulian&",'"&rs_produit("guige")&"','"&nowlogin&"',0,#"&date()&"#)"
conn.execute(sql)
%>
<script language="javascript">
alert("产品入库成功!")
</script> 
<%
end if
%>

<%
if request("hid2")<>"" then
nowbigclass=request("bigclass")
nowsmallclass=request("smallclass")
nowtitle=request("title")
nowhuohao=request("huohao")
nowku=request("ku")
nowshulian=request("shulian")
nowdanwei=request("danwei")
nowprice=request("price")
if nowprice="" then
  nowprice=0
end if
nowguige=request("guige")
nowbaojin=request("baojin")
nowlogin=request("login")
nowclass=request("class")
nowduihuan=request("duihuan")
nowtichen_type=request("tichen_type")
nowtichen=request("tichen")
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
sql="insert into produit(id_bigclass,id_smallclass,title,huohao,id_ku,shulian,danwei,price,guige,baojin,class,duihuan,tichen_type,tichen) values("&nowbigclass&","&nowsmallclass&",'"&nowtitle&"','"&nowhuohao&"',"&nowku&","&nowshulian&",'"&nowdanwei&"',"&nowprice&",'"&nowguige&"',"&nowbaojin&","&nowclass&","&nowduihuan&","&nowtichen_type&","&nowtichen&")"
conn.execute(sql)
sql="select * from produit order by id desc"
set rs_produit=conn.execute(sql)
sql="select bigclass from bigclass where id="&nowbigclass
set rs_bigclass=conn.execute(sql)
sql="select smallclass from smallclass where id="&nowsmallclass
set rs_smallclass=conn.execute(sql)
sql="select ku from ku where id="&nowku
set rs_ku=conn.execute(sql)
sql="insert into buy(id_produit,bigclass,smallclass,title,huohao,ku,shulian,guige,login,type,selldate) values("&rs_produit("id")&",'"&rs_bigclass(0)&"','"&rs_smallclass(0)&"','"&nowtitle&"','"&nowhuohao&"','"&rs_ku(0)&"',"&nowshulian&",'"&nowguige&"','"&nowlogin&"',0,#"&date()&"#)"
conn.execute(sql)
%>
<script language="javascript">
alert("产品入库成功!")
</script> 
<%
end if
%>
<script language="javascript">
function check()
{
if (document.form2.title.value==""||document.form2.huohao.value==""||document.form2.shulian.value=="")
{
alert("有*号的必须填写!");
return false;
}
}

function check1()
{
if (document.form1.huohao.value=="单击选择产品")
{
alert("还没有选择产品!");
return false;
}
if (document.form1.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">&nbsp;<img src="../Images/ico/ico01.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="8"><img src="../images/add.gif" border="0" hspace="2" align="absmiddle">已有产品入库 <font size="-1">(带*号的为必填项)</font></th>
      </tr>
      <tr class="a3">
        <td width="14%" height="30" align="right"><b>加入仓库:</b> </td>
        <td width="11%">&nbsp;
    <%
	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>	  
        <td width="11%" height="30" align="right"><b>选择产品:</b> </td>
        <td width="20%">&nbsp;
          <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>
        <td width="9%" height="30" align="right"><b>入库数量:</b> </td>
        <td width="10%">&nbsp;
          <input type="text" name="shulian" style="width:50px" onKeyUp="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" value="1">
		 
		  
          <font color="#ff0000">*</font></td>			  
        <td width="7%" height="30" align="right"><b>经办人:</b> </td>
        <td width="18%">&nbsp;
		  <%
		  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="login">
		  <%
		  do while rs_login.eof=false
		  %>
		    <option value="<%=rs_login("username")%>"<%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 class="a3">
        <td height="0" colspan="8" align="center">
		  <span id="showshulian"></span>
		</td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -