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

📄 preview_flag1.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>
<script language=javascript>
function changeSelectDay(x){
        var yy,mm,dd;
        var i,j;  
        if (x == 1)
			{
	        yy=parseInt(document.hamier2.start_year.value);
		    mm=parseInt(document.hamier2.start_month.value);
			i=document.hamier2.start_day.options.length;
			}
        else if (x == 2)
			{
			yy=parseInt(document.hamier2.end_year.value);
		    mm=parseInt(document.hamier2.end_month.value);
			i=document.hamier2.end_day.options.length;
			}
			
        dd=getDay(yy,mm);
        
        if (dd!=0){
            if (dd>i){
                
                if (x == 1){
					for(j=i;j<dd;j++){                    
					    document.hamier2.start_day.options[j]=new Option(j+1,j+1);
									}
							}
				else if (x == 2){
					for(j=i;j<dd;j++){                    
					    document.hamier2.end_day.options[j]=new Option(j+1,j+1);
									}
							}
            
            }
            else if(dd<i){
            
				if (x == 1) {
					for(j=i;j>dd;j--){
						document.hamier2.start_day.options[j-1]=null;
									}
							}
				else if (x ==2){
				     for(j=i;j>dd;j--){
						document.hamier2.end_day.options[j-1]=null;
									}
							}           
                
            
            }
        }
    }
    function getDay(yy,mm){
        //((n mod 4=0) and (n mod 100<>0)) or (n mod 400=0))
        var iyear,imonth;
        iyear=parseInt(yy);
        imonth=parseInt(mm);
        switch (imonth){
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                return 31;
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                return 30;
                break;
            case 2:
                if(((iyear%4==0) && (iyear%100!=0)) || (iyear%400==0))
                    return 29;
                else
                    return 28;
                break;
            default:
                return 0;
                break;
        }
    }

function datacheck()
	{
		if (document.hamier2.biglocation.value == "")
			{
			alert("物品类别必须选择!");
			document.hamier2.smalllocation.focus();
			return false;
			}
		else
			window.open('preview.asp?companyid=<%=newcompanyid%>&flag=' + document.hamier2.biglocation.options[document.hamier2.biglocation.selectedIndex].value,'flag','resizable=yes,scrollbars=yes,width=790,height=520,left=2,top=0,windowstate=max');
			
	} 
</script>
<link rel=stylesheet type=text/css href=../data/forum.css>
<meta http-equiv="Content-Type"content="text/html; charset=gb_2312-80">
</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="preview.asp" name="hamier2" >
           <p align=center><font color=red>请在以下的表格中选择相关的查询条件</font>
<p>     <table align=center border=0>
 <tr> 
                  <td  nowrap>日&nbsp;&nbsp;&nbsp;&nbsp;期:</td>
                  <td> 
                    <select name="start_year" onchange="javascript:changeSelectDay(1)">
            <%for i=2001 to year(date()) %>
				<% 
				if clng(i) = clng(year_now) then 
				 %> 
					<option selected value="<%Response.Write i%>"  ><%Response.Write i%></option>
				<%else%>
					<option value="<%Response.Write i%>"  ><%Response.Write i%></option>
				<%end if%>
            
            <%next%>
	       	  </select>年
	       	                 
               
                    <select name="start_month" onchange="javascript:changeSelectDay(1)">
                    <% for i=1 to 12%>
                    <% 
                    if clng(i) = clng(month_now) then  %>
            <option selected value="<%Response.Write i%>" ><%Response.Write i%></option>
            <%else%>
            <option  value="<%Response.Write i%>" ><%Response.Write i%></option>
			<%end if%>
            <%next%>
	       	  </select>月
	       	  <select name="start_day" onchange="javascript:changeSelectDay(1)">
                    <% for i=1 to 31%>
                    <% 
                    if clng(i) = clng(day_now) then  %>
            <option selected value="<%Response.Write i%>" ><%Response.Write i%></option>
            <%else%>
            <option  value="<%Response.Write i%>" ><%Response.Write i%></option>
			<%end if%>
            <%next%>
	       	  </select>日
	       	                 </td>
	       	  <td> 
           </td>
                </tr>
<tr>
<td  nowrap>物品类别:</td>
<td> 
<select name="biglocation">
<option selected value="">========物品类别========</option>
        <%
       
       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
			call closedatabase
			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>
     
  <td>
   <td><br>
   <input class=buttonface type=hidden name=companyid value=<%=newcompanyid%>> 
   <input class=buttonface type=button onclick="javascript:datacheck()" name=ok value=" 查 询 "> 
   </tr>
              </table> 
          </form> 
<!--#include file=../data/copyright.asp-->
<%
call closedatabase
%>
</body>
</html>

⌨️ 快捷键说明

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