28,390
社区成员
发帖
与我相关
我的任务
分享
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<% dim count
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from mtl_onhand_quantities ",conn,1,1
%>
<SCRIPT language="javascript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%=rs("subinventory_code")%>","<%=rs("inventory_item_id")%>","<%=rs("onhand_id")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
set rs=nothing
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.id.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
if (subcat[i][1] == locationid)
document.myform.id.options[document.myform.id.length] = new Option(subcat[i][0], subcat[i][2]);
}
</SCRIPT>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
set rs=server.CreateObject("adodb.recordset")
'rs.open"select eq_id,eq_number,eq_name from equipment_detail where company_code='"&session("company")&"'and workstation_code in (select user_station_code from tbl_user_level where user_id='"&session("user_id")&"'and status=1)",conn,1,1
rs.open"select distinct subinventory_code from mtl_onhand_quantities ",conn,1,1
if not rs.eof then
%>
<select name="system_id" class="txtBoxStyle2" id="system" onChange="changelocation(document.myform.system_id.options[document.myform.system_id.selectedIndex].value)">
<option selected value="<%=rs("subinventory_code")%>"><%=rs("subinventory_code")%></option>
<% dim seleq
seleq=rs("subinventory_code")
rs.movenext
do while not rs.eof
%>
<option value="<%=rs("subinventory_code")%>"><%=rs("subinventory_code")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select>
<select name="id" id="id">
<%
set rs2=server.CreateObject("adodb.recordset")
sql="select * from mtl_onhand_quantities where subinventory_code="&seleq
response.Write sql
rs2.open sql,conn,1,3
if not(rs2.eof and rs2.bof) then
%>
<option selected value="<%=trim(rs2("onhand_id"))%>"><%=trim(rs2("inventory_item_id"))%></option>
<%rs2.movenext
do while not rs2.eof%>
<option value="<%=trim(rs2("onhand_id"))%>"><%=trim(rs2("inventory_item_id"))%></option>
<% rs2.movenext
loop
end if
rs2.close
set rs2=nothing
%>
</select> <%end if%>
</body>
</html>