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

📄 special_prod1.asp

📁 1.多种查询方式
💻 ASP
字号:
<%@language=vbscript%>
<%
response.buffer=true
Response.Expires = 0
Response.CacheControl = "Private" 
%>
<%'On Error Resume Next%>
<%const title="库存汇总查询"%>
<!-- #include file=../data/username.inc-->
<!-- #include file=../data/connect.asp-->
<!--#include file=../data/myPrg.asp-->
<!-- #include file=../data/flag.inc-->
<html>
<head>
<title><%=title%></title>
<link rel=stylesheet type=text/css href=../data/forum.css>
<meta http-equiv="Content-Type"content="text/html; charset=gb_2312-80">
<%
if flag = 4 or flag = 5 then
	sql = "select prod_id,prod_no,prod_type,prod_danwei,prod_flag,prod_pinming from product where prod_companyid = "&newcompanyid&" and prod_flag in  ("&prodservice&") and prod_disabled = 0 and prod_dir_flag = 0"
elseif flag < 4 then 
	sql = "select prod_id,prod_no,prod_type,prod_danwei,prod_flag,prod_pinming from product where prod_companyid = "&newcompanyid&" and prod_disabled = 0 and prod_dir_flag = 0"
end if
sql = sql + " order by prod_no asc "
set rs10 = conn.execute(sql)

%>
<script language="JavaScript">
<!--
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs10.eof 
        %>
subcat[<%=count%>] = new Array("<%response.write trim(rs10("prod_no"))&"   " & rs10("prod_pinming") & "   " & rs10("prod_type") & "   "&rs10("prod_danwei")%>","<%= trim(rs10("prod_flag"))%>","<%= trim(rs10("prod_id"))%>");
        <%
        count = count + 1
        rs10.movenext
        loop
        rs10.close
        set rs10=nothing
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.hamier2.smalllocation.length = 0; 

    var locationid=locationid;
    var i;
    document.hamier2.smalllocation.options[0] = new Option('========物品编号========','');
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.hamier2.smalllocation.options[document.hamier2.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }
function datacheck()
	{
	if (document.hamier2.biglocation.value == "")
		{alert("物品类别必须选择!");
		 document.hamier2.biglocation.focus();
		 return false;
		 }	
		
	if (document.hamier2.smalllocation.value == "")
			{
			alert("物品编号必须选择!");
			document.hamier2.smalllocation.focus();
			return false;
			}
	
			
	}    
// -->
</script>
</head>
<body topmargin="0">
<%
showtitle(title)
year_now =year(date())
month_now = month(date())
day_now = day(date()) 

%>
<font color=blue>
     
         <form method="POST" action="special_prod_searchaction1.asp" name="hamier2" LANGUAGE="javascript" onsubmit="return datacheck()">
           <p align=center><font color=red>请在以下的表格中选择相关的查询条件</font>
<p>     <table align=center border=0>
  
<tr>
<td  nowrap>物品类别:</td>
<td> 
<select name="biglocation" onChange="javascript:changelocation(document.hamier2.biglocation.options[document.hamier2.biglocation.selectedIndex].value)">
        <%
       
       if flag = 4 or flag = 5 then
			
			sql = "select id,type_name from prod_type where type_companyid =  "&newcompanyid&"  and id in ("&prodservice&") order by id asc"
	   elseif flag < 4 then 
			sql = "select id,type_name from prod_type where type_companyid = "&newcompanyid&" order by id asc"
	   else
			Response.Write "操作无效!"
			Response.End 
	   end if
	   'Response.Write sql
	   'Response.End 
       set rs10 = conn.Execute (sql)
       
        do while not rs10.eof
        %>
        <option value="<%=trim(rs10("id"))%>"><%=trim(rs10("type_name"))%></option>
        <%
        rs10.movenext
        loop
        rs10.close
        set rs10 = nothing        
        %>
    </select>
</td>
</tr>
<tr>
<td  nowrap>物品编号:</td>
<td> 
<select name="smalllocation">
<option selected value="">========物品编号========</option>
</select>
</td>
</tr>    
  <tr>
<td  nowrap>物品序列号:</td>
<td> 
<input type=text name="prod_sn" size="15">
</td>
</tr>              
  <td>
   <td><br>
   <input class=buttonface type=hidden name=companyid value=<%=newcompanyid%>> 
   <input class=buttonface type=submit name=ok value=查询> 
 </tr>
              </table> 
          </form> 
<script LANGUAGE="javascript"> 
    changelocation(document.hamier2.biglocation.options[document.hamier2.biglocation.selectedIndex].value); 
</script>  
<!--#include file=../data/copyright.asp-->
<%call closedatabase%>
</body>
</html>

⌨️ 快捷键说明

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