?? produit_add.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
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"> <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%">
<%
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%">
<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%">
<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>
<td width="7%" height="30" align="right"><b>經辦人:</b> </td>
<td width="18%">
<%
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>
</tr>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -